InvokeAI/invokeai/frontend/web/dist/assets/App-2fa7e2d4.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

170 lines
820 KiB
JavaScript
Raw Normal View History

2023-07-19 16:36:39 +00:00
import{t as qg,r as iE,i as lE,a as mu,b as d4,S as f4,c as p4,d as h4,e as Kg,f as m4,g as Qg,h as cE,j as uE,k as dE,l as fE,m as pE,n as hE,o as mE,p as gE,q as vE,s as f,u as nt,v as a,I as mo,w as ur,x as Wn,y as He,z as Mt,A as gu,B as mt,C as vu,D as Ko,E as Xr,F as io,G as xr,H as yE,J as bE,K as Ga,L as Uc,M as Ni,N as sn,O as Ca,P as Up,Q as ov,R as kl,T as sv,U as yu,_ as Qn,V as xE,W as N,X as g4,Y as v4,Z as qb,$ as y4,a0 as Gp,a1 as av,a2 as Xl,a3 as wE,a4 as SE,a5 as CE,a6 as _E,a7 as b4,a8 as x4,a9 as qp,aa as Sf,ab as kE,ac as PE,ad as Um,ae as Kb,af as jE,ag as w4,ah as S4,ai as Jl,aj as Qb,ak as Yb,al as IE,am as EE,an as OE,ao as ME,ap as RE,aq as Gm,ar as rl,as as qm,at as DE,au as TE,av as AE,aw as iv,ax as Kp,ay as Cf,az as NE,aA as C4,aB as _4,aC as $E,aD as bu,aE as lv,aF as zE,aG as LE,aH as BE,aI as FE,aJ as HE,aK as WE,aL as VE,aM as Xb,aN as ve,aO as UE,aP as Gt,aQ as $e,aR as F,aS as zs,aT as rt,aU as $,aV as Mr,aW as Zl,aX as fe,aY as k4,aZ as xo,a_ as P4,a$ as j4,b0 as ec,b1 as Qo,b2 as _n,b3 as _f,b4 as GE,b5 as We,b6 as qa,b7 as cv,b8 as kf,b9 as $i,ba as xu,bb as Qp,bc as qE,bd as uv,be as wu,bf as KE,bg as Ot,bh as te,bi as Ka,bj as Jb,bk as dv,bl as QE,bm as YE,bn as XE,bo as ol,bp as Uo,bq as JE,br as Su,bs as Nc,bt as ZE,bu as e8,bv as t8,bw as n8,bx as fv,by as Oe,bz as I4,bA as St,bB as Pf,bC as r8,bD as o8,bE as s8,bF as a8,bG as jd,bH as Id,bI as Gc,bJ as qc,bK as Zb,bL as jf,bM as ex,bN as If,bO as tx,bP as Yg,bQ as nx,bR as Xg,bS as rx,bT as Ef,bU as ox,bV as $l,bW as sx,bX as zl,bY as ax,bZ as Of,b_ as pv,b$ as hv,c0 as E4,c1 as mv,c2 as gv,c3 as i8,c4 as l8,c5 as Yp,c6 as bl,c7 as c8,c8 as mf,c9 as u8,ca as d8,cb as f8,cc as Mf,cd as O4,ce as M4,cf as R4,cg as Ws,ch as p8,ci as Jg,cj as Vs,ck as ws,cl as vs,cm as h8,cn as D4,co as ix,cp as m8,cq as g8,cr as v8,cs as y8,ct as vr,cu as T4,cv as b8,cw as x8,cx as w8,cy as S8,cz as C8,cA as vv,cB as Go,cC as A4,cD as N4,cE as _8,cF as k8,cG as yv,cH as Yn,cI as lx,cJ as P8,cK as j8,cL as I8,cM as E8,cN as O8,cO as M8,cP as R8,cQ as D8,cR as $4,cS as T8,cT as A8,cU as N8,cV as $8,cW as z8,cX as L8,cY as z4,cZ as B8,c_ as F8,c$ as H8,d0 as W8,d1 as V8,d2 as U8,d3 as G8,d4 as q8,d5 as K8,d6 as Q8,d7 as Y8,d8 as L4,d9 as Yo,da as X8,db as J8,dc as Z8,dd as Xp,de as e7,df as bv,dg as B4,dh as t7,di as n7,dj as r7,dk as Xo,dl as o7,dm as cx,dn as ux,dp as Pl,dq as s7,dr as a7,ds as i7,dt as l7,du as c7,dv as u7,dw as d7,dx as f7,dy as p7,dz as h7,dA as m7,dB as xv,dC as wv,dD as g7,dE as dx,dF as v7,dG as fx,dH as y7,dI as b7,dJ as px,dK as hx,dL as x7,dM as mx,dN as w7,dO as S7,dP as C7,dQ as _7,dR as k7,dS as P7,dT as F4,dU as H4,dV as W4,dW as V4,dX as U4,dY as Cu,dZ as gx,d_ as j7,d$ as ji,e0 as I7,e1 as G4,e2 as vx,e3 as E7,e4 as us,e5 as O7,e6 as M7,e7 as q4,e8 as K4,e9 as R7,ea as Q4,eb as Y4,ec as or,ed as _u,ee as X4,ef as J4,eg as yx,eh as D7,ei as bx,ej as T7,ek as Z4,el as A7,em as Jp,en as xx,eo as e6,ep as N7,eq as wx,er as t6,es as qo,et as $7,eu as z7,ev as n6,ew as Sx,ex as L7,ey as B7,ez as F7,eA as H7,eB as W7,eC as V7,eD as U7,eE as G7,eF as q7,eG as K7,eH as Q7,eI as Y7,eJ as X7,eK as J7,eL as Z7,eM as eO,eN as tO,eO as nO,eP as rO,eQ as oO,eR as Cx,eS as gf,eT as sO,eU as Rf,eV as r6,eW as tu,eX as aO,eY as iO,eZ as Hs,e_ as o6,e$ as Sv,f0 as ku,f1 as lO,f2 as cO,f3 as uO,f4 as ha,f5 as s6,f6 as dO,f7 as fO,f8 as a6,f9 as pO,fa as hO,fb as mO,fc as gO,fd as vO,fe as yO,ff as bO,fg as xO,fh as wO,fi as SO,fj as _x,fk as CO,fl as _O,fm as kO,fn as PO,fo as jO,fp as IO,fq as Km,fr as Bs,fs as Ed,ft as Qm,fu as Ym,fv as Od,fw as kx,fx as Zg,fy as EO,fz as OO,fA as MO,fB as RO,fC as Df,fD as i6,fE as l6,fF as DO,fG as TO,fH as c6,fI as u6,fJ as d6,fK as f6,fL as p6,fM as h6,fN as m6,fO as g6,fP as jl,fQ as Il,fR as v6,fS as y6,fT as AO,fU as b6,fV as x6,fW as w6,fX as S6,fY as C6,fZ as _6,f_ as Cv,f$ as NO,g0 as $O,g1 as Px,g2 as zO,g3 as LO,g4 as Tf,g5 as jx,g6 as Ix,g7 as Ex,g8 as Ox,g9 as BO,ga as FO,gb as HO,gc as WO,gd as VO,ge as UO,gf as GO,gg as qO,gh as KO}from"./index-0ec007dd.js";import{m as _v,u as k6,a a
`})}function B9(e){vu({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function zc(e){const{isOpen:t,isDisabled:n}=jv(),{reduceMotion:r}=Iv(),o=Mt("chakra-accordion__icon",e.className),s=Zp(),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(mo,{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"})})}zc.displayName="AccordionIcon";var Lc=nt(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=N9(t),d={...Zp().container,overflowAnchor:"none"},p=f.useMemo(()=>i,[i]);return a.jsx(O9,{value:p,children:a.jsx(He.div,{ref:n,...s,className:Mt("chakra-accordion__item",o),__css:d,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});Lc.displayName="AccordionItem";var bi={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},jc={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function t0(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return jc.slideRight;case"left":return jc.slideLeft;case"bottom":return jc.slideDown;case"top":return jc.slideUp;default:return jc.slideRight}}var wi={enter:{duration:.2,ease:bi.easeOut},exit:{duration:.1,ease:bi.easeIn}},ds={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})},F9=e=>e!=null&&parseInt(e.toString(),10)>0,$x={exit:{height:{duration:.2,ease:bi.ease},opacity:{duration:.3,ease:bi.ease}},enter:{height:{duration:.3,ease:bi.ease},opacity:{duration:.4,ease:bi.ease}}},H9={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:F9(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:ds.exit($x.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:ds.enter($x.enter,o)}}},eh=f.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:u,className:d,transition:p,transitionEnd:h,...g}=e,[v,b]=f.useState(!1);f.useEffect(()=>{const k=setTimeout(()=>{b(!0)});return()=>clearTimeout(k)},[]),vu({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const S=parseFloat(s.toString())>0,w={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:S?"block":"none"}}},C=r?n:!0,_=n||r?"enter":"exit";return a.jsx(Ko,{initial:!1,custom:w,children:C&&a.jsx(Xr.div,{ref:t,...g,className:Mt("chakra-collapse",d),style:{overflow:"hidden",display:"block",...u},custom:w,variants:H9,initial:r?"exit":!1,animate:_,exit:"exit"})})});eh.displayName="Collapse";var W9={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:ds.enter(wi.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:ds.exit(wi.exit,n),transitionEnd:t==null?void 0:t.exi
.`.concat(FD,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(u,"px ").concat(r,`;
}
body {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(s,`px;
padding-right: `).concat(i,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(vf,` {
right: `).concat(u,"px ").concat(r,`;
}
.`).concat(yf,` {
margin-right: `).concat(u,"px ").concat(r,`;
}
.`).concat(vf," .").concat(vf,` {
right: 0 `).concat(r,`;
}
.`).concat(yf," .").concat(yf,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat(HD,": ").concat(u,`px;
}
`)},eT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=f.useMemo(function(){return XD(o)},[o]);return f.createElement(JD,{styles:ZD(s,!t,o,n?"":"!important")})},f0=!1;if(typeof window<"u")try{var Dd=Object.defineProperty({},"passive",{get:function(){return f0=!0,!0}});window.addEventListener("test",Dd,Dd),window.removeEventListener("test",Dd,Dd)}catch{f0=!1}var ll=f0?{passive:!1}:!1,tT=function(e){return e.tagName==="TEXTAREA"},V5=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tT(e)&&n[t]==="visible")},nT=function(e){return V5(e,"overflowY")},rT=function(e){return V5(e,"overflowX")},e2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=U5(e,r);if(o){var s=G5(e,r),i=s[1],u=s[2];if(i>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},oT=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},sT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},U5=function(e,t){return e==="v"?nT(t):rT(t)},G5=function(e,t){return e==="v"?oT(t):sT(t)},aT=function(e,t){return e==="h"&&t==="rtl"?-1:1},iT=function(e,t,n,r,o){var s=aT(e,window.getComputedStyle(t).direction),i=s*r,u=n.target,d=t.contains(u),p=!1,h=i>0,g=0,v=0;do{var b=G5(e,u),S=b[0],w=b[1],C=b[2],_=w-C-s*S;(S||_)&&U5(e,u)&&(g+=_,v+=S),u=u.parentNode}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&(o&&g===0||!o&&i>g)||!h&&(o&&v===0||!o&&-i>v))&&(p=!0),p},Td=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},t2=function(e){return[e.deltaX,e.deltaY]},n2=function(e){return e&&"current"in e?e.current:e},lT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cT=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},uT=0,cl=[];function dT(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(uT++)[0],s=f.useState(W5)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=a0([e.lockRef.current],(e.shards||[]).map(n2),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=f.useCallback(function(w,C){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var _=Td(w),k=n.current,j="deltaX"in w?w.deltaX:k[0]-_[0],I="deltaY"in w?w.deltaY:k[1]-_[1],E,O=w.target,M=Math.abs(j)>Math.abs(I)?"h":"v";if("touches"in w&&M==="h"&&O.type==="range")return!1;var T=e2(M,O);if(!T)return!0;if(T?E=M:(E=M==="v"?"h":"v",T=e2(M,O)),!T)return!1;if(!r.current&&"changedTouches"in w&&(j||I)&&(r.current=E),!E)return!0;var A=r.current||E;return iT(A,C,w,A==="h"?j:I,!0)},[]),d=f.useCallback(function(w){var C=w;if(!(!cl.length||cl[cl.length-1]!==s)){var _="deltaY"in C?t2(C):Td(C),k=t.current.filter(function(E){return E.name===C.type&&E.target===C.target&&lT(E.delta,_)})[0];if(k&&k.should){C.cancelable&&C.preventDefault();return}if(!k){var j=(i.current.shards||[]).map(n2).filter(Boolean).filter(function(E){return E.contains(C.target)}),I=j.length>0?u(C,j[0]):!i.current.noIsolation;I&&C.cancelable&&C.preventDefault()}}},[]),p=f.useCallback(function(w,C,_,k){var j={name:w,delta:C,target:_,should:k};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(I){return I!==j})},1)},[]),h=f.useCallback(function(w){n.current=Td(w),r.current=void 0},[]),g=f.useCallback(function(w){p(w.type,t2(w),w.target,u(w,e.lockRef.current))},[]),v=f.useCallback(function(w){p(w.type,Td(w),w.target,u(w,e.lockRef.current))},[]);f.useEffect(function(){return cl.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",d,ll),document.addEventListener("touchmove",d,ll),document.addEventListener("touchstart",h,ll),function(){cl=cl.filter(function(w){return w!==s}),document.removeEventListener("wheel",d,ll),document.removeEventListener("touchmove",d,ll),document.removeEventListener("touchstart",h,ll)}},[]);var b=e.removeScrollBar,S=e.inert;return f.createElement(f.Fragment,null,S?f.createElement(s,{styles:cT(o)}):null,b?f.createElement(eT,{gapMode:e.gapMode}):null)}const fT=$M(H5,dT);var q5=f.forwardRef(function(e,t){return f.createElement(rh,Ls({},e,{ref:t,sideCar:fT}))});q5.classNames=rh.classNames;const pT=q5;function hT(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:u,returnFocusOnClose:d,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:g}=Oi(),[v,b]=kE();f.useEffect(()=>{!v&&b&&setTimeout(b)},[v,b]);const S=B5(r,g);return a.jsx(k5,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:d,contentRef:r,lockFocusAcrossFrames:h,children:a.jsx(pT,{removeScrollBar:!p,allowPinchZoom:i,enabled:S===1&&s,forwardProps:!0,children:e.children})})}var au=nt((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:u,getDialogContainerProps:d}=Oi(),p=u(i,t),h=d(o),g=Mt("chakra-modal__content",n),v=oc(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},S={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{motionPreset:w}=Oi();return a.jsx(hT,{children:a.jsx(He.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:S,children:a.jsx(L5,{preset:w,motionProps:s,className:g,...p,__css:b,children:r})})})});au.displayName="ModalContent";function Du(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(su,{...n,initialFocusRef:t})}var Tu=nt((e,t)=>a.jsx(au,{ref:t,role:"alertdialog",...e})),ma=nt((e,t)=>{const{className:
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fill:d,fillRule:"evenodd",stroke:p,strokeWidth:h,pointerEvents:"none"})]})})}c3.displayName="MiniMap";var yA=f.memo(c3),fs;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(fs||(fs={}));function bA({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 xA({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const wA={[fs.Dots]:"#91919a",[fs.Lines]:"#eee",[fs.Cross]:"#e2e2e2"},SA={[fs.Dots]:1,[fs.Lines]:1,[fs.Cross]:6},CA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function u3({id:e,variant:t=fs.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:u,className:d}){const p=f.useRef(null),{transform:h,patternId:g}=Cf(CA,lv),v=i||wA[t],b=r||SA[t],S=t===fs.Dots,w=t===fs.Cross,C=Array.isArray(n)?n:[n,n],_=[C[0]*h[2]||1,C[1]*h[2]||1],k=b*h[2],j=w?[k,k]:_,I=S?[k/s,k/s]:[j[0]/s,j[1]/s];return a.jsxs("svg",{className:Kp(["react-flow__background",d]),style:{...u,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background",children:[a.jsx("pattern",{id:g+e,x:h[0]%_[0],y:h[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${I[0]},-${I[1]})`,children:S?a.jsx(xA,{color:v,radius:k/s}):a.jsx(bA,{dimensions:j,color:v,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${g+e})`})]})}u3.displayName="Background";var _A=f.memo(u3),Kc;(function(e){e.Line="line",e.Handle="handle"})(Kc||(Kc={}));function kA({width:e,prevWidth:t,height:n,prevHeight:r,invertX:o,invertY:s}){const i=e-t,u=n-r,d=[i>0?1:i<0?-1:0,u>0?1:u<0?-1:0];return i&&o&&(d[0]=d[0]*-1),u&&s&&(d[1]=d[1]*-1),d}const d3={width:0,height:0,x:0,y:0},PA={...d3,pointerX:0,pointerY:0,aspectRatio:1};function jA({nodeId:e,position:t,variant:n=Kc.Handle,className:r,style:o={},children:s,color:i,minWidth:u=10,minHeight:d=10,maxWidth:p=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:g=!1,shouldResize:v,onResizeStart:b,onResize:S,onResizeEnd:w}){const C=HE(),_=typeof e=="string"?e:C,k=C4(),j=f.useRef(null),I=f.useRef(PA),E=f.useRef(d3),O=WE(),M=n===Kc.Line?"right":"bottom-right",T=t??M;f.useEffect(()=>{if(!j.current||!_)return;const J=_4(j.current),L=T.includes("right")||T.includes("left"),H=T.includes("bottom")||T.includes("top"),B=T.includes("left"),K=T.includes("top"),R=VE().on("start",G=>{const U=k.getState().nodeInternals.get(_),{xSnapped:Z,ySnapped:ie}=O(G);E.current={width:(U==null?void 0:U.width)??0,height:(U==null?void 0:U.height)??0,x:(U==null?void 0:U.position.x)??0,y:(U==null?void 0:U.position.y)??0},I.current={...E.current,pointerX:Z,pointerY:ie,aspectRatio:E.current.width/E.current.height},b==null||b(G,{...E.current})}).on("drag",G=>{const{nodeInternals:U,triggerNodeChanges:Z}=k.getState(),{xSnapped:ie,ySnapped:xe}=O(G),he=U.get(_);if(he){const ae=[],{pointerX:ee,pointerY:W,width:re,height:pe,x:ne,y:ge,aspectRatio:ue}=I.current,{x:Ce,y:Re,width:me,height:_e}=E.current,Ve=Math.floor(L?ie-ee:0),Le=Math.floor(H?xe-W:0);let Ue=Xb(re+(B?-Ve:Ve),u,p),kt=Xb(pe+(K?-Le:Le),d,h);if(g){const Te=Ue/kt,It=L&&H,Ft=L&&!H,Wt=H&&!L;Ue=Te<=ue&&It||Wt?kt*ue:Ue,kt=Te>ue&&It||Ft?Ue/ue:kt,Ue>=p?(Ue=p,kt=p/ue):Ue<=u&&(Ue=u,kt=u/ue),kt>=h?(kt=h,Ue=h*ue):kt<=d&&(kt=d,Ue=d*ue)}const gt=Ue!==me,jn=kt!==_e;if(B||K){const Te=B?ne-(Ue-re):ne,It=K?ge-(kt-pe):ge,Ft=Te!==Ce&&gt,Wt=It!==Re&&jn;if(Ft||Wt){const Cn={id:he.id,type:"position",position:{x:Ft?Te:Ce,y:Wt?It:Re}};ae.push(Cn),E.current.x=Cn.position.x,E.current.y=Cn.position.y}}if(gt||jn){const Te={id:_,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:Ue,height:kt}};ae.push(Te),E.current.width=Ue,E.current.height=kt}if(ae.length===0)return;const Pt=kA({width:E.current.width,prevWidth:me,height:E.current.height,prevHeight:_e,invertX:B,invertY:K}),yt={...E.current,direction:Pt};if((v==null?void 0:v(G,yt))===!1)return;S==null||S(G,yt),Z(ae)}}).on("end",G=>{const U={id:_,type:"dimensions",resizing:!1};w==null||w(G,{...E.current}),k.getState().tr
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VA(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UA(e){if(Array.isArray(e))return v0(e)}function i2(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 l2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i2(Object(n),!0).forEach(function(r){h3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function h3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iu(e,t){return KA(e)||qA(e,t)||m3(e,t)||GA()}function GA(){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 m3(e,t){if(e){if(typeof e=="string")return v0(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 v0(e,t)}}function v0(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 qA(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,u;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,u=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function KA(e){if(Array.isArray(e))return e}var QA="file-invalid-type",YA="file-too-large",XA="file-too-small",JA="too-many-files",ZA=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:QA,message:"File type must be ".concat(n)}},c2=function(t){return{code:YA,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},u2=function(t){return{code:XA,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},eN={code:JA,message:"Too many files"};function g3(e,t){var n=e.type==="application/x-moz-file"||HA(e,t);return[n,n?null:ZA(t)]}function v3(e,t,n){if(vi(e.size))if(vi(t)&&vi(n)){if(e.size>n)return[!1,c2(n)];if(e.size<t)return[!1,u2(t)]}else{if(vi(t)&&e.size<t)return[!1,u2(t)];if(vi(n)&&e.size>n)return[!1,c2(n)]}return[!0,null]}function vi(e){return e!=null}function tN(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(d){var p=g3(d,n),h=iu(p,1),g=h[0],v=v3(d,r,o),b=iu(v,1),S=b[0],w=u?u(d):null;return g&&S&&!w})}function Ff(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ad(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 d2(e){e.preventDefault()}function nN(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function rN(e){return e.indexOf("Edge/")!==-1}function oN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return nN(e)||rN(e)}function Ts(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(u){return!Ff(r)&&u&&u.apply(void 0,[r].concat(s)),Ff(r)})}}function sN(){return"showOpenFilePicker"in window}function aN(e){if(vi(e)){var t=Object.entries(e).filter(function(n){var r=iu(n,2),o=r[0],s=r[1],i=!0;return y3(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(b3))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=iu(r,2),s=o[0],i=o[1];return l2(l2({},n),{},h3({},s,i))},{});return[{description:"Files",accept:t}]}return e}function iN(e){if(vi(e))return Object.entries(e).reduce(function(t,n){var r=iu(n,2),o=r[0],s=r[1];return[].concat(a2(t),[o],a2(s))},[]).filter(function(t){return y3(t)||b3(t)}).join(",")}function lN(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function cN(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function y3(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function b3(e){return/^.*\.[\w]+$/.test(e)}var uN=["children"],dN=["open"],fN=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDr
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vN(e){if(Array.isArray(e))return y0(e)}function fg(e,t){return xN(e)||bN(e,t)||x3(e,t)||yN()}function yN(){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 x3(e,t){if(e){if(typeof e=="string")return y0(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 y0(e,t)}}function y0(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 bN(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,u;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,u=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function xN(e){if(Array.isArray(e))return e}function f2(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 er(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f2(Object(n),!0).forEach(function(r){b0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function b0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hf(e,t){if(e==null)return{};var n=wN(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 wN(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 Jv=f.forwardRef(function(e,t){var n=e.children,r=Hf(e,uN),o=Zv(r),s=o.open,i=Hf(o,dN);return f.useImperativeHandle(t,function(){return{open:s}},[s]),N.createElement(f.Fragment,null,n(er(er({},i),{},{open:s})))});Jv.displayName="Dropzone";var w3={disabled:!1,getFilesFromEvent:DA,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};Jv.defaultProps=w3;Jv.propTypes={children:Tn.func,accept:Tn.objectOf(Tn.arrayOf(Tn.string)),multiple:Tn.bool,preventDropOnDocument:Tn.bool,noClick:Tn.bool,noKeyboard:Tn.bool,noDrag:Tn.bool,noDragEventsBubbling:Tn.bool,minSize:Tn.number,maxSize:Tn.number,maxFiles:Tn.number,disabled:Tn.bool,getFilesFromEvent:Tn.func,onFileDialogCancel:Tn.func,onFileDialogOpen:Tn.func,useFsAccessApi:Tn.bool,autoFocus:Tn.bool,onDragEnter:Tn.func,onDragLeave:Tn.func,onDragOver:Tn.func,onDrop:Tn.func,onDropAccepted:Tn.func,onDropRejected:Tn.func,onError:Tn.func,validator:Tn.func};var x0={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Zv(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=er(er({},w3),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,u=t.multiple,d=t.maxFiles,p=t.onDragEnter,h=t.onDragLeave,g=t.onDragOver,v=t.onDrop,b=t.onDropAccepted,S=t.onDropRejected,w=t.onFileDialogCancel,C=t.onFileDialogOpen,_=t.useFsAccessApi,k=t.autoFocus,j=t.preventDropOnDocument,I=t.noClick,E=t.noKeyboard,O=t.noDrag,M=t.noDragEventsBubbling,T=t.onError,A=t.validator,z=f.useMemo(function(){return iN(n)},[n]),V=f.useMemo(function(){return aN(n)},[n]),J=f.useMemo(function(){return typeof C=="function"?C:p2},[C]),L=f.useMemo(function(){return typeof w=="function"?w:p2},[w]),H=f.useRef(null),B=f.useRef(null),K=f.useReducer(SN,x0),R=fg(K,2),G=R[0],U=R[1],Z=G.isFocused,ie=G.isFileDialogActive,xe=f.useRef(typeof window<"u"&&window.isSecureContext&&_&&sN()),he=function(){!xe.current&&ie&&setTimeout(function(){if(B.current){var Te=B.current.files;Te.length||(U({type:"closeDialog"}),L())}},300)};f.useEffect(functi
`),status:"error"})},[s,o]),h=f.useCallback(async k=>{d({file:k,image_category:"user",is_intermediate:!1,postUploadAction:n})},[n,d]),g=f.useCallback((k,j)=>{if(j.length>1){o({title:s("toast.uploadFailed"),description:s("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}j.forEach(I=>{p(I)}),k.forEach(I=>{h(I)})},[s,o,h,p]),{getRootProps:v,getInputProps:b,isDragAccept:S,isDragReject:w,isDragActive:C,inputRef:_}=Zv({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:g,onDragOver:()=>u(!0),disabled:r,multiple:!1});return f.useEffect(()=>{const k=async j=>{var I,E;_.current&&(I=j.clipboardData)!=null&&I.files&&(_.current.files=j.clipboardData.files,(E=_.current)==null||E.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",k),()=>{document.removeEventListener("paste",k)}},[_]),a.jsxs($e,{...v({style:{}}),onKeyDown:k=>{k.key},children:[a.jsx("input",{...b()}),t,a.jsx(Ko,{children:C&&i&&a.jsx(Xr.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(NN,{isDragAccept:S,isDragReject:w,setIsHandlingUpload:u})},"image-upload-overlay")})]})},LN=f.memo(zN),en=e=>e.canvas,Xn=ve([en,sr,xo],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),BN=e=>e.canvas.layerState.objects.find(P4),FN=r9(e=>{e(j4(!0))},300),vo=()=>(e,t)=>{sr(t())==="unifiedCanvas"&&FN(e)};var HN=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yr=globalThis&&globalThis.__assign||function(){return yr=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},yr.apply(this,arguments)},m2={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},g2={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Nd={width:"20px",height:"20px",position:"absolute"},WN={top:yr(yr({},m2),{top:"-5px"}),right:yr(yr({},g2),{left:void 0,right:"-5px"}),bottom:yr(yr({},m2),{top:void 0,bottom:"-5px"}),left:yr(yr({},g2),{left:"-5px"}),topRight:yr(yr({},Nd),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:yr(yr({},Nd),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:yr(yr({},Nd),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:yr(yr({},Nd),{left:"-10px",top:"-10px",cursor:"nw-resize"})},VN=function(e){HN(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onMouseDown=function(r){n.props.onResizeStart(r,n.props.direction)},n.onTouchStart=function(r){n.props.onResizeStart(r,n.props.direction)},n}return t.prototype.render=function(){return f.createElement("div",{className:this.props.className||"",style:yr(yr({position:"absolute",userSelect:"none"},WN[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(f.PureComponent),UN=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),As=globalThis&&globalThis.__assign||function(){return As=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},As.apply(this,arguments)},GN={width:"auto",height:"auto"},$d=function(e,t,n){return Math.max(Math.min(e,n),t)},v2=function(e,t){return Math.round(e/t)*t},dl=function(e,t){return new RegExp(e,"i")
* OverlayScrollbars
* Version: 2.2.1
*
* Copyright (c) Rene Haas | KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
*/function gn(e,t){if(mh(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&gn(Object.keys(e),n=>t(e[n],n,e));return e}function Yr(e,t){const n=ri(t);if(bs(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?C2(e,s,t):t.reduce((i,u)=>(i[u]=C2(e,s,u),i),o)}return o}e&&gn(Oo(t),o=>v$(e,o,t[o]))}const ls=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const u=(h,g)=>{const v=s,b=h,S=g||(r?!r(v,b):v!==b);return(S||o)&&(s=b,i=v),[s,S,i]};return[t?h=>u(t(s,i),h):u,h=>[s,!!h,i]]},$u=()=>typeof window<"u",E3=$u()&&Node.ELEMENT_NODE,{toString:n$,hasOwnProperty:gg}=Object.prototype,ka=e=>e===void 0,hh=e=>e===null,r$=e=>ka(e)||hh(e)?`${e}`:n$.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Ya=e=>typeof e=="number",ri=e=>typeof e=="string",e1=e=>typeof e=="boolean",ys=e=>typeof e=="function",bs=e=>Array.isArray(e),lu=e=>typeof e=="object"&&!bs(e)&&!hh(e),mh=e=>{const t=!!e&&e.length,n=Ya(t)&&t>-1&&t%1==0;return bs(e)||!ys(e)&&n?t>0&&lu(e)?t-1 in e:!0:!1},S0=e=>{if(!e||!lu(e)||r$(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=gg.call(e,n),i=o&&gg.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return ka(t)||gg.call(e,t)},Wf=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===E3:!1},gh=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===E3:!1},t1=(e,t,n)=>e.indexOf(t,n),In=(e,t,n)=>(!n&&!ri(t)&&mh(t)?Array.prototype.push.apply(e,t):e.push(t),e),Mi=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{In(n,r)}):gn(e,r=>{In(n,r)}),n)},n1=e=>!!e&&e.length===0,Qs=(e,t,n)=>{gn(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},vh=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Oo=e=>e?Object.keys(e):[],nr=(e,t,n,r,o,s,i)=>{const u=[t,n,r,o,s,i];return(typeof e!="object"||hh(e))&&!ys(e)&&(e={}),gn(u,d=>{gn(Oo(d),p=>{const h=d[p];if(e===h)return!0;const g=bs(h);if(h&&(S0(h)||g)){const v=e[p];let b=v;g&&!bs(v)?b=[]:!g&&!S0(v)&&(b={}),e[p]=nr(b,h)}else e[p]=h})}),e},r1=e=>{for(const t in e)return!1;return!0},O3=(e,t,n,r)=>{if(ka(r))return n?n[e]:t;n&&(ri(r)||Ya(r))&&(n[e]=r)},Qr=(e,t,n)=>{if(ka(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},ho=(e,t)=>{e&&e.removeAttribute(t)},Si=(e,t,n,r)=>{if(n){const o=Qr(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=Mi(s).join(" ").trim();Qr(e,t,i)}},o$=(e,t,n)=>{const r=Qr(e,t)||"";return new Set(r.split(" ")).has(n)},ps=(e,t)=>O3("scrollLeft",0,e,t),ca=(e,t)=>O3("scrollTop",0,e,t),C0=$u()&&Element.prototype,M3=(e,t)=>{const n=[],r=t?gh(t)?t:null:document;return r?In(n,r.querySelectorAll(e)):n},s$=(e,t)=>{const n=t?gh(t)?t:null:document;return n?n.querySelector(e):null},Vf=(e,t)=>gh(e)?(C0.matches||C0.msMatchesSelector).call(e,t):!1,o1=e=>e?Mi(e.childNodes):[],ba=e=>e?e.parentElement:null,wl=(e,t)=>{if(gh(e)){const n=C0.closest;if(n)return n.call(e,t);do{if(Vf(e,t))return e;e=ba(e)}while(e)}return null},a$=(e,t,n)=>{const r=e&&wl(e,t),o=e&&s$(n,r),s=wl(o,t)===r;return r&&o?r===e||o===e||s&&wl(wl(e,n),t)!==r:!1},s1=(e,t,n)=>{if(n&&e){let r=t,o;mh(n)?(o=document.createDocumentFragment(),gn(n,s=>{s===r&&(r=s.previousSibling),o.appendChild(s)})):o=n,t&&(r?r!==t&&(r=r.nextSibling):r=e.firstChild),e.insertBefore(o,r||null)}},Vo=(e,t)=>{s1(e,null,t)},i$=(e,t)=>{s1(ba(e),e,t)},x2=(e,t)=>{s1(ba(e),e&&e.nextSibling,t)},Us=e=>{if(mh(e))gn(Mi(e),t=>Us(t));else if(e){const t=ba(e);t&&t.removeChild(e)}},Ci=e=>{const t=document.createElement("div");return e&&Qr(t,"class",e),t},R3=e=>{const t=Ci();return t.innerHTML=e.trim(),gn(o1(t),n=>Us(n))},_0=e=>e.charAt(0).toUpperCase()+e.slice(1),l$=()=>Ci().style,c$=["-webkit-","-moz-","-o-","-ms-"],u$=["WebKit","Moz","O","MS","webkit","moz","o","ms"],vg={},yg={},d$=e=>{let t=yg[e];if(vh(yg,e))return t;const n=_0(e),r=l$();return gn(c$,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,_0(s)+n].find(u=>r[u]!==void 0))}),yg[e]=t||""},zu=e=>{if($u()){let t=vg[e]||window[e];return vh(vg,e)||(gn(u$,n=>(t=t||window[n+_0(e)],!t)),vg[e]=t),t}},f$=zu("MutationObserver"),w2=zu("IntersectionObserver"),Sl=zu("ResizeObserver"),D3=zu("cancelAnimationFrame"),T
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:Fe,mutationThunk:ht,api:q,serializeQueryArgs:tt,context:le}),Sr=Xt.buildInitiateQuery,Vn=Xt.buildInitiateMutation;return Dr(q.util,{getRunningOperationPromises:Xt.getRunningOperationPromises,getRunningOperationPromise:Xt.removalWarning,getRunningMutationThunk:Xt.getRunningMutationThunk,getRunningMutationsThunk:Xt.getRunningMutationsThunk,getRunningQueryThunk:Xt.getRunningQueryThunk,getRunningQueriesThunk:Xt.getRunningQueriesThunk}),{name:ns,injectEndpoint:function(vt,wn){var kn,Un=q;(kn=Un.endpoints)[vt]!=null||(kn[vt]={}),ne(wn)?Dr(Un.endpoints[vt],{name:vt,select:zt(vt,wn),initiate:Sr(vt,wn)},qt(Fe,vt)):wn.type===W.mutation&&Dr(Un.endpoints[vt],{name:vt,select:tn(),initiate:Vn(vt)},qt(ht,vt))}}}}},Ps=Qe(Xs())})(v_);g_.exports=v_;var yo=g_.exports,Qc=globalThis&&globalThis.__assign||function(){return Qc=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},Qc.apply(this,arguments)};function y_(e){var t,n=f.useState(!1),r=n[0],o=n[1],s=f.useState(!1),i=s[0],u=s[1],d=f.useState(!1),p=d[0],h=d[1],g=f.useState([0,0]),v=g[0],b=g[1],S=f.useRef(null);f.useEffect(function(){if(r)setTimeout(function(){u(!0),setTimeout(function(){h(!0)})});else{h(!1);var C=setTimeout(function(){u(r)},1e3);return function(){return clearTimeout(C)}}},[r]),HR("contextmenu",function(C){var _;!((_=S.current)===null||_===void 0)&&_.contains(C.target)||C.target===S.current?(C.preventDefault(),o(!0),b([C.pageX,C.pageY])):o(!1)});var w=f.useCallback(function(){var C,_;(_=(C=e.menuProps)===null||C===void 0?void 0:C.onClose)===null||_===void 0||_.call(C),o(!1)},[(t=e.menuProps)===null||t===void 0?void 0:t.onClose,o]);return f.createElement(f.Fragment,null,e.children(S),i&&f.createElement(Sf,Qc({},e.portalProps),f.createElement(Mu,Qc({isOpen:p,gutter:0},e.menuProps,{onClose:w}),f.createElement(Ru,Qc({"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:v[0],top:v[1],cursor:"default"}},e.menuButtonProps)),e.renderMenu())))}const b_=f.memo(({board:e,isSelected:t,setBoardToDelete:n})=>{const r=te(),{currentData:o}=Uo(e.cover_image_name??yo.skipToken),{colorMode:s}=Qo(),{board_name:i,board_id:u}=e,d=f.useCallback(()=>{r(wu(u))},[u,r]),[p,{isLoading:h}]=JE(),g=S=>{p({board_id:u,changes:{board_name:S}})},v=f.useCallback(()=>{n(e)},[e,n]),b=f.useMemo(()=>({id:u,actionType:"MOVE_BOARD",context:{boardId:u}}),[u]);return a.jsx($e,{sx:{touchAction:"none",height:"full"},children:a.jsx(y_,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>a.jsxs(rc,{sx:{visibility:"visible !important"},motionProps:_v,children:[e.image_count>0&&a.jsx(a.Fragment,{}),a.jsx(po,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Jo,{}),onClickCapture:v,children:"Delete Board"})]}),children:S=>a.jsxs(F,{userSelect:"none",ref:S,sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full"},children:[a.jsxs(F,{onClick:d,sx:{position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",w:"full",aspectRatio:"1/1",overflow:"hidden",shadow:t?"selected.light":void 0,_dark:{shadow:t?"selected.dark":void 0},flexShrink:0},children:[e.cover_image_name&&(o==null?void 0:o.thumbnail_url)&&a.jsx(Su,{src:o==null?void 0:o.thumbnail_url,draggable:!1}),!(e.cover_image_name&&(o!=null&&o.thumbnail_url))&&a.jsx(xa,{boxSize:8,icon:uL,sx:{borderWidth:"2px",borderStyle:"solid",borderColor:"base.200",_dark:{borderColor:"base.800"}}}),a.jsx(F,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(Ja,{variant:"solid",children:e.image_count})}),a.jsx(S1,{data:b,dropLabel:a.jsx(Ze,{fontSize:"md",children:"Move"})})]}),a.jsx(F,{sx:{width:"full",height:"full",justifyContent:"center",alignItems:"center"},children:a.jsxs(H6,{defaultValue:i,submitOnBlur:!1,onSubmit:w=>{g(w)},sx:{maxW:"full"},children:[a.jsx(L6,{sx:{color:t?Pe("base.900","base.50")(s):Pe
* @license React
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var kte=function(t){var n={},r=f,o=gf,s=Object.assign;function i(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;m<arguments.length;m++)c+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,d=Symbol.for("react.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),S=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),E=Symbol.iterator;function O(l){return l===null||typeof l!="object"?null:(l=E&&l[E]||l["@@iterator"],typeof l=="function"?l:null)}function M(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case p:return"Portal";case v:return"Profiler";case g:return"StrictMode";case C:return"Suspense";case _:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case S:return(l.displayName||"Context")+".Consumer";case b:return(l._context.displayName||"Context")+".Provider";case w:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case k:return c=l.displayName||null,c!==null?c:M(l.type)||"Memo";case j:c=l._payload,l=l._init;try{return M(l(c))}catch{}}return null}function T(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return M(c);case 8:return c===g?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function A(l){var c=l,m=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,c.flags&4098&&(m=c.return),l=c.return;while(l)}return c.tag===3?m:null}function z(l){if(A(l)!==l)throw Error(i(188))}function V(l){var c=l.alternate;if(!c){if(c=A(l),c===null)throw Error(i(188));return c!==l?null:l}for(var m=l,y=c;;){var x=m.return;if(x===null)break;var P=x.alternate;if(P===null){if(y=x.return,y!==null){m=y;continue}break}if(x.child===P.child){for(P=x.child;P;){if(P===m)return z(x),l;if(P===y)return z(x),c;P=P.sibling}throw Error(i(188))}if(m.return!==y.return)m=x,y=P;else{for(var D=!1,Q=x.child;Q;){if(Q===m){D=!0,m=x,y=P;break}if(Q===y){D=!0,y=x,m=P;break}Q=Q.sibling}if(!D){for(Q=P.child;Q;){if(Q===m){D=!0,m=P,y=x;break}if(Q===y){D=!0,y=P,m=x;break}Q=Q.sibling}if(!D)throw Error(i(189))}}if(m.alternate!==y)throw Error(i(190))}if(m.tag!==3)throw Error(i(188));return m.stateNode.current===m?l:c}function J(l){return l=V(l),l!==null?L(l):null}function L(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=L(l);if(c!==null)return c;l=l.sibling}return null}function H(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var c=H(l);if(c!==null)return c}l=l.sibling}return null}var B=Array.isArray,K=t.getPublicInstance,R=t.getRootHostContext,G=t.getChildHostContext,U=t.prepareForCommit,Z=t.resetAfterCommit,ie=t.createInstance,xe=t.appendInitialChild,he=t.finalizeInitialChildren,ae=t.prepareUpdate,ee=t.shouldSetTextContent,W=t.createTextInstance,re=t.scheduleTimeout,pe=t.cancelTimeout,ne=t.noTimeout,ge=t.isPrimaryRenderer,ue=t.supportsMutation,Ce=t.supportsPersistence,Re=t.supportsHydration,me=t.
`+bt+l}var Lt=!1;function Kt(l,c){if(!l||Lt)return"";Lt=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Ee){var y=Ee}Reflect.construct(l,[],c)}else{try{c.call()}catch(Ee){y=Ee}l.call(c.prototype)}else{try{throw Error()}catch(Ee){y=Ee}l()}}catch(Ee){if(Ee&&y&&typeof Ee.stack=="string"){for(var x=Ee.stack.split(`
`),P=y.stack.split(`
`),D=x.length-1,Q=P.length-1;1<=D&&0<=Q&&x[D]!==P[Q];)Q--;for(;1<=D&&0<=Q;D--,Q--)if(x[D]!==P[Q]){if(D!==1||Q!==1)do if(D--,Q--,0>Q||x[D]!==P[Q]){var se=`
`+x[D].replace(" at new "," at ");return l.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",l.displayName)),se}while(1<=D&&0<=Q);break}}}finally{Lt=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?Et(l):""}var qt=Object.prototype.hasOwnProperty,$t=[],Me=-1;function ut(l){return{current:l}}function Ct(l){0>Me||(l.current=$t[Me],$t[Me]=null,Me--)}function Tt(l,c){Me++,$t[Me]=l.current,l.current=c}var xn={},zt=ut(xn),tn=ut(!1),Xt=xn;function Sr(l,c){var m=l.type.contextTypes;if(!m)return xn;var y=l.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var x={},P;for(P in m)x[P]=c[P];return y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=x),x}function Vn(l){return l=l.childContextTypes,l!=null}function vt(){Ct(tn),Ct(zt)}function wn(l,c,m){if(zt.current!==xn)throw Error(i(168));Tt(zt,c),Tt(tn,m)}function kn(l,c,m){var y=l.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return m;y=y.getChildContext();for(var x in y)if(!(x in c))throw Error(i(108,T(l)||"Unknown",x));return s({},m,y)}function Un(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||xn,Xt=zt.current,Tt(zt,l),Tt(tn,tn.current),!0}function ir(l,c,m){var y=l.stateNode;if(!y)throw Error(i(169));m?(l=kn(l,c,Xt),y.__reactInternalMemoizedMergedChildContext=l,Ct(tn),Ct(zt),Tt(zt,l)):Ct(tn),Tt(tn,m)}var On=Math.clz32?Math.clz32:pn,Mn=Math.log,nn=Math.LN2;function pn(l){return l>>>=0,l===0?32:31-(Mn(l)/nn|0)|0}var Sn=64,cn=4194304;function un(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Be(l,c){var m=l.pendingLanes;if(m===0)return 0;var y=0,x=l.suspendedLanes,P=l.pingedLanes,D=m&268435455;if(D!==0){var Q=D&~x;Q!==0?y=un(Q):(P&=D,P!==0&&(y=un(P)))}else D=m&~x,D!==0?y=un(D):P!==0&&(y=un(P));if(y===0)return 0;if(c!==0&&c!==y&&!(c&x)&&(x=y&-y,P=c&-c,x>=P||x===16&&(P&4194240)!==0))return c;if(y&4&&(y|=m&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=y;0<c;)m=31-On(c),x=1<<m,y|=l[m],c&=~x;return y}function xt(l,c){switch(l){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pt(l,c){for(var m=l.suspendedLanes,y=l.pingedLanes,x=l.expirationTimes,P=l.pendingLanes;0<P;){var D=31-On(P),Q=1<<D,se=x[D];se===-1?(!(Q&m)||Q&y)&&(x[D]=xt(Q,c)):se<=c&&(l.expiredLanes|=Q),P&=~Q}}function Xe(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function ft(){var l=Sn;return Sn<<=1,!(Sn&4194240)&&(Sn=64),l}function Rt(l){for(var c=[],m=0;31>m;m++)c.push(l);return c}function lt(l,c,m){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-On(c),l[c]=m}function qe(l,c){var m=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var y=l.eventTimes;for(l=l.expirationTimes;0<m;){var x=31-On(m),P=1<<x;c[x]=0,y[x]=-1,l[x]=-1,m&=~P}}function ke(l,c){var m=l.entangledLanes|=c;for(l=l.entanglements;m;){var y=31-On(m),x=1<<y;x&c|l[y]&c&&(l[y]|=c),m&=~x}}var Se=0;function je(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var Ae=o.unstable_scheduleCallback,Ge=o.unstable_cancelCallback,_t=o.unsta
Error generating stack: `+P.message+`
`+P.stack}return{value:l,source:c,stack:x,digest:null}}function mm(l,c,m){return{value:l,source:null,stack:m??null,digest:c??null}}function gm(l,c){try{console.error(c.value)}catch(m){setTimeout(function(){throw m})}}var zI=typeof WeakMap=="function"?WeakMap:Map;function rb(l,c,m){m=ea(-1,m),m.tag=3,m.payload={element:null};var y=c.value;return m.callback=function(){yd||(yd=!0,Nm=y),gm(l,c)},m}function ob(l,c,m){m=ea(-1,m),m.tag=3;var y=l.type.getDerivedStateFromError;if(typeof y=="function"){var x=c.value;m.payload=function(){return y(x)},m.callback=function(){gm(l,c)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(m.callback=function(){gm(l,c),typeof y!="function"&&(Oa===null?Oa=new Set([this]):Oa.add(this));var D=c.stack;this.componentDidCatch(c.value,{componentStack:D!==null?D:""})}),m}function sb(l,c,m){var y=l.pingCache;if(y===null){y=l.pingCache=new zI;var x=new Set;y.set(c,x)}else x=y.get(c),x===void 0&&(x=new Set,y.set(c,x));x.has(m)||(x.add(m),l=JI.bind(null,l,c,m),c.then(l,l))}function ab(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function ib(l,c,m,y,x){return l.mode&1?(l.flags|=65536,l.lanes=x,l):(l===c?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(c=ea(-1,1),c.tag=2,Ea(m,c,1))),m.lanes|=1),l)}var LI=u.ReactCurrentOwner,lo=!1;function oo(l,c,m,y){c.child=l===null?Ty(c,null,m,y):Yi(c,l.child,m,y)}function lb(l,c,m,y,x){m=m.render;var P=c.ref;return Qi(c,x),y=cm(l,c,m,y,P,x),m=um(),l!==null&&!lo?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~x,ta(l,c,x)):(Gn&&m&&Vh(c),c.flags|=1,oo(l,c,y,x),c.child)}function cb(l,c,m,y,x){if(l===null){var P=m.type;return typeof P=="function"&&!Hm(P)&&P.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(c.tag=15,c.type=P,ub(l,c,P,y,x)):(l=_d(m.type,null,y,c,c.mode,x),l.ref=c.ref,l.return=c,c.child=l)}if(P=l.child,!(l.lanes&x)){var D=P.memoizedProps;if(m=m.compare,m=m!==null?m:Gu,m(D,y)&&l.ref===c.ref)return ta(l,c,x)}return c.flags|=1,l=Ta(P,y),l.ref=c.ref,l.return=c,c.child=l}function ub(l,c,m,y,x){if(l!==null){var P=l.memoizedProps;if(Gu(P,y)&&l.ref===c.ref)if(lo=!1,c.pendingProps=y=P,(l.lanes&x)!==0)l.flags&131072&&(lo=!0);else return c.lanes=l.lanes,ta(l,c,x)}return vm(l,c,m,y,x)}function db(l,c,m){var y=c.pendingProps,x=y.children,P=l!==null?l.memoizedState:null;if(y.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(tl,jo),jo|=m;else{if(!(m&1073741824))return l=P!==null?P.baseLanes|m:m,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,Tt(tl,jo),jo|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=P!==null?P.baseLanes:m,Tt(tl,jo),jo|=y}else P!==null?(y=P.baseLanes|m,c.memoizedState=null):y=m,Tt(tl,jo),jo|=y;return oo(l,c,x,m),c.child}function fb(l,c){var m=c.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(c.flags|=512,c.flags|=2097152)}function vm(l,c,m,y,x){var P=Vn(m)?Xt:zt.current;return P=Sr(c,P),Qi(c,x),m=cm(l,c,m,y,P,x),y=um(),l!==null&&!lo?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~x,ta(l,c,x)):(Gn&&y&&Vh(c),c.flags|=1,oo(l,c,m,x),c.child)}function pb(l,c,m,y,x){if(Vn(m)){var P=!0;Un(c)}else P=!1;if(Qi(c,x),c.stateNode===null)ad(l,c),Oy(c,m,y),nm(c,m,y,x),y=!0;else if(l===null){var D=c.stateNode,Q=c.memoizedProps;D.props=Q;var se=D.context,Ee=m.contextType;typeof Ee=="object"&&Ee!==null?Ee=Ao(Ee):(Ee=Vn(m)?Xt:zt.current,Ee=Sr(c,Ee));var ct=m.getDerivedStateFromProps,Vt=typeof ct=="function"||typeof D.getSnapshotBeforeUpdate=="function";Vt||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(Q!==y||se!==Ee)&&My(c,D,y,Ee),Ia=!1;var Je=c.memoizedState;D.state=Je,Yu(c,y,D,x),se=c.memoizedState,Q!==y||Je!==se||tn.current||Ia?(typeof ct=="function"&&(tm(c,m,ct,y),se=c.memoizedState),(Q=Ia||Ey(c,m,Q,y,Je,se,Ee))?(Vt||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMo
`+(y.join(" > ")+`
No matching component was found for:
`)+l.join(" > ")}return null},n.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return K(l.child.stateNode);default:return l.child.stateNode}},n.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:oE,findFiberByHostInstance:l.findFiberByHostInstance||sE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)l=!0;else{try{Fn=c.inject(l),an=c}catch{}l=!!c.checkDCE}}return l},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(l,c,m,y){if(!gt)throw Error(i(363));l=Mm(l,c);var x=Ft(l,m,y).disconnect;return{disconnect:function(){x()}}},n.registerMutableSourceForHydration=function(l,c){var m=c._getVersion;m=m(c._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[c,m]:l.mutableSourceEagerHydrationData.push(c,m)},n.runWithPriority=function(l,c){var m=Se;try{return Se=l,c()}finally{Se=m}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(l,c,m,y){var x=c.current,P=Kr(),D=Ra(x);return m=Vb(m),c.context===null?c.context=m:c.pendingContext=m,c=ea(P,D),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=Ea(x,c,D),l!==null&&(zo(l,x,D,P),Qu(l,x,D)),D},n};dI.exports=kte;var Pte=dI.exports;const jte=yu(Pte);var fI={exports:{}},Gi={};/**
* @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.
*/Gi.ConcurrentRoot=1;Gi.ContinuousEventPriority=4;Gi.DefaultEventPriority=16;Gi.DiscreteEventPriority=1;Gi.IdleEventPriority=536870912;Gi.LegacyRoot=0;fI.exports=Gi;var pI=fI.exports;const ZC={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let e4=!1,t4=!1;const my=".react-konva-event",Ite=`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
`,Ete=`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
`,Ote={};function Wh(e,t,n=Ote){if(!e4&&"zIndex"in t&&(console.warn(Ete),e4=!0),!t4&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(Ite),t4=!0)}for(var s in n)if(!ZC[s]){var i=s.slice(0,2)==="on",u=n[s]!==t[s];if(i&&u){var d=s.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),e.off(d,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var h=t._useStrictMode,g={},v=!1;const b={};for(var s in t)if(!ZC[s]){var i=s.slice(0,2)==="on",S=n[s]!==t[s];if(i&&S){var d=s.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),t[s]&&(b[d]=t[s])}!i&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(v=!0,g[s]=t[s])}v&&(e.setAttrs(g),ai(e));for(var d in b)e.on(d+my,b[d])}function ai(e){if(!sO.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const hI={},Mte={};hu.Node.prototype._applyProps=Wh;function Rte(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),ai(e)}function Dte(e,t,n){let r=hu[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=hu.Group);const o={},s={};for(var i in t){var u=i.slice(0,2)==="on";u?s[i]=t[i]:o[i]=t[i]}const d=new r(o);return Wh(d,s),d}function Tte(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Ate(e,t,n){return!1}function Nte(e){return e}function $te(){return null}function zte(){return null}function Lte(e,t,n,r){return Mte}function Bte(){}function Fte(e){}function Hte(e,t){return!1}function Wte(){return hI}function Vte(){return hI}const Ute=setTimeout,Gte=clearTimeout,qte=-1;function Kte(e,t){return!1}const Qte=!1,Yte=!0,Xte=!0;function Jte(e,t){t.parent===e?t.moveToTop():e.add(t),ai(e)}function Zte(e,t){t.parent===e?t.moveToTop():e.add(t),ai(e)}function mI(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),ai(e)}function ene(e,t,n){mI(e,t,n)}function tne(e,t){t.destroy(),t.off(my),ai(e)}function nne(e,t){t.destroy(),t.off(my),ai(e)}function rne(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function one(e,t,n){}function sne(e,t,n,r,o){Wh(e,o,r)}function ane(e){e.hide(),ai(e)}function ine(e){}function lne(e,t){(t.visible==null||t.visible)&&e.show()}function cne(e,t){}function une(e){}function dne(){}const fne=()=>pI.DefaultEventPriority,pne=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Jte,appendChildToContainer:Zte,appendInitialChild:Rte,cancelTimeout:Gte,clearContainer:une,commitMount:one,commitTextUpdate:rne,commitUpdate:sne,createInstance:Dte,createTextInstance:Tte,detachDeletedInstance:dne,finalizeInitialChildren:Ate,getChildHostContext:Vte,getCurrentEventPriority:fne,getPublicInstance:Nte,getRootHostContext:Wte,hideInstance:ane,hideTextInstance:ine,idlePriority:gf.unstable_IdlePriority,insertBefore:mI,insertInContainerBefore:ene,isPrimaryRenderer:Qte,noTimeout:qte,now:gf.unstable_now,prepareForCommit:$te,preparePortalMount:zte,prepareUpdate:Lte,removeChild:tne,removeChildFromContainer:nne,resetAfterCommit:Bte,resetTextContent:Fte,run:gf.unstable_runWithPriority,scheduleTimeout:Ute,shouldDeprioritizeSubtree:Hte,shouldSetTextContent:Kte,supportsMutation:Xte,unhideInstance:lne,unhideTextInstance:cne,warnsIfNotActing:Yte},Symbol.toStringTag,{value:"Module"}));var hne=Object.defineProperty,mne=Object.defineProperties,gne=Object.getOwnPropertyDescriptors,n4=Object.getOwnPropertySymbols,vne=Object.prototype.hasOwnProperty,yne=Object.prototype.propertyIsEnumerable,r4=(e,t,n)=>t in e?hne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o4=(e,t)=>{for(var n in t||(t={}))vne.call(t,n)&&r4(e,n,t[n]);if(n4)for(var n of n4(t))yne.cal
<!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),qne=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=$(Gne),[i,u]=f.useState(null),[d,p]=f.useState(0),h=f.useRef(null),g=f.useCallback(()=>{p(d+1),setTimeout(g,500)},[d]);return f.useEffect(()=>{if(i)return;const v=new Image;v.onload=()=>{u(v)},v.src=i4(n)},[i,n]),f.useEffect(()=>{i&&(i.src=i4(n))},[i,n]),f.useEffect(()=>{const v=setInterval(()=>p(b=>(b+1)%5),50);return()=>clearInterval(v)},[]),!i||!sl(r.x)||!sl(r.y)||!sl(s)||!sl(o.width)||!sl(o.height)?null:a.jsx(qs,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:sl(d)?d:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Kne=ve([en],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Gt}}),Qne=e=>{const{...t}=e,{objects:n}=$(Kne);return a.jsx(Sa,{listening:!1,...t,children:n.filter(yO).map((r,o)=>a.jsx(Wp,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},o))})};var gi=f,Yne=function(t,n,r){const o=gi.useRef("loading"),s=gi.useRef(),[i,u]=gi.useState(0),d=gi.useRef(),p=gi.useRef(),h=gi.useRef();return(d.current!==t||p.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,d.current=t,p.current=n,h.current=r),gi.useLayoutEffect(function(){if(!t)return;var g=document.createElement("img");function v(){o.current="loaded",s.current=g,u(Math.random())}function b(){o.current="failed",s.current=void 0,u(Math.random())}return g.addEventListener("load",v),g.addEventListener("error",b),n&&(g.crossOrigin=n),r&&(g.referrerPolicy=r),g.src=t,function(){g.removeEventListener("load",v),g.removeEventListener("error",b)}},[t,n,r]),[s.current,o.current]};const Xne=yu(Yne),wI=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:i,isError:u}=Uo(s??yo.skipToken),[d]=Xne((i==null?void 0:i.image_url)??"",bO.get()?"use-credentials":"anonymous");return u?a.jsx(qs,{x:r,y:o,width:t,height:n,fill:"red"}):a.jsx(bI,{x:r,y:o,image:d,listening:!1})},Jne=ve([en],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Gt}}),Zne=()=>{const{objects:e}=$(Jne);return e?a.jsx(Sa,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(P4(t))return a.jsx(wI,{canvasImage:t},n);if(xO(t)){const r=a.jsx(Wp,{points:t.points,stroke:t.color?Pi(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(wO(t))return a.jsx(qs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Pi(t.color)},n);if(SO(t))return a.jsx(qs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},ere=ve([en],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:i,height:u}}=e,{selectedImageIndex:d,images:p}=t.stagingArea;return{currentStagingAreaImage:p.length>0&&d!==void 0?p[d]:void 0,isOnFirstImage:d===0,isOnLastImage:d===p.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:o,y:s,width:i,height:u}},{memoizeOptions:{resultEqualityCheck:Gt}}),tre=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:u,height:d}=$(ere);return a.jsxs(Sa,{...t,children:[r&&n&&a.jsx(wI,{canvasImage:n}),o&&a.jsxs(Sa,{children:[a.jsx(qs,{x:s,y:i,width:u,height:d,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(qs,{x:s,y:i,width:u,height:d,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},nre=ve([en],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n,sessionId:r}},shouldShowSta