mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
189 lines
592 KiB
JavaScript
189 lines
592 KiB
JavaScript
|
import{r as x,f as he,j as l,u as RS,c as re,a as Ae,b as Pe,w as is,d as fn,o as At,S as Qf,e as pi,g as Ye,h as Dr,k as Zi,i as yc,_ as Ql,l as NS,m as FS,R as ke,n as zv,p as LS,q as Kd,s as Ji,t as j1,v as E1,x as BS,y as HS,z as te,A as P1,B as I1,C as bc,D as os,F as B,E as Z,T as Ce,G as WS,H as Hl,I as Zl,J as Qd,K as Zd,L as Jd,U as VS,M as M1,N as T1,O as US,P as _1,Q as D1,V as $S,W as O1,X as A1,Y as Bi,Z as jn,$ as z1,a0 as as,a1 as GS,a2 as qS,a3 as R1,a4 as on,a5 as YS,a6 as vl,a7 as Sc,a8 as XS,a9 as Rv,aa as Fi,ab as KS,ac as QS,ad as Da,ae as gl,af as ZS,ag as JS,ah as eC,ai as tC,aj as nC,ak as N1,al as F1,am as ef,an as tf,ao as L1,ap as nf,aq as rf,ar as Nv,as as B1,at as H1,au as W1,av as Wl,aw as Vl,ax as rC,ay as of,az as V1,aA as iC,aB as dd,aC as Fv,aD as U1,aE as $1,aF as af,aG as Hi,aH as oC,aI as aC,aJ as Lv,aK as Bv,aL as sC,aM as lC,aN as cC,aO as G1,aP as q1,aQ as uC,aR as dC,aS as Hv,aT as fC,aU as Wv,aV as hC,aW as pC,aX as mC,aY as vC,aZ as gC,a_ as xC,a$ as yC,b0 as bC,b1 as Vv,b2 as Ul,b3 as SC,b4 as CC,b5 as qa,b6 as Jl,b7 as Y1,b8 as ec,b9 as wC,ba as kC,bb as xr,bc as X1,bd as Zf,be as ss,bf as jC,bg as EC,bh as PC,bi as Sr,bj as K1,bk as IC,bl as MC,bm as Q1,bn as TC,bo as _C,bp as DC,bq as OC,br as AC,bs as zC,bt as RC,bu as NC,bv as FC,bw as Uv,bx as LC,by as BC,bz as HC,bA as WC,bB as VC,bC as UC,bD as fd,bE as Na,bF as xl,bG as $v,bH as hd,bI as pd,bJ as yl,bK as Gv,bL as sf,bM as $C,bN as GC,bO as qC,bP as YC,bQ as XC,bR as KC,bS as QC,bT as bl,bU as md,bV as Sl,bW as nr,bX as ZC,bY as JC,bZ as Z1,b_ as tc,b$ as Jf,c0 as J1,c1 as e2,c2 as t2,c3 as e3,c4 as n2,c5 as r2,c6 as i2,c7 as o2,c8 as a2,c9 as Wo,ca as Vo,cb as s2,cc as l2,cd as c2,ce as u2,cf as d2,cg as t3,ch as n3,ci as qv,cj as Cl,ck as r3,cl as Yv,cm as Xv,cn as Kv,co as Qv,cp as vd,cq as f2,cr as i3,cs as ls,ct as Zv,cu as o3,cv as a3,cw as s3,cx as Wi,cy as h2,cz as Jv,cA as l3,cB as c3,cC as u3,cD as d3,cE as f3,cF as h3,cG as p3,cH as m3,cI as v3,cJ as g3,cK as x3,cL as y3}from"./index-61f10aa8.js";import{I as Jt,u as b3,c as S3,a as Et,b as Ut,A as ia,m as Wr,d as Uo,e as eo,P as eh,f as C3,C as w3,g as O,h as Y,n as p2}from"./scrollbar-7e342734.js";function th(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var nc="NOT_FOUND";function k3(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:nc},put:function(r,i){t={key:r,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function j3(e,t){var n=[];function r(u){var f=n.findIndex(function(p){return t(u,p.key)});if(f>-1){var h=n[f];return f>0&&(n.splice(f,1),n.unshift(h)),h.value}return nc}function i(u,f){r(u)===nc&&(n.unshift({key:u,value:f}),n.length>e&&n.pop())}function s(){return n}function c(){n=[]}return{get:r,put:i,getEntries:s,clear:c}}var E3=function(t,n){return t===n};function P3(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,s=0;s<i;s++)if(!e(n[s],r[s]))return!1;return!0}}function I3(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?E3:r,s=n.maxSize,c=s===void 0?1:s,u=n.resultEqualityCheck,f=P3(i),h=c===1?k3(f):j3(c,f);function p(){var g=h.get(arguments);if(g===nc){if(g=e.apply(null,arguments),u){var y=h.getEntries(),S=y.find(function(C){return u(C.value,g)});S&&(g=S.value)}h.put(arguments,g)}return g}return p.clearCache=function(){return h.clear()},p}function M3(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function T3(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];var h=0,p,g={memoizeOptions:void 0},y=u.pop();if(typeof y=="object"&&(g=y,y=u.pop()),typeof y
|
||
|
`})}function aw(e){is({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Ro(e){const{isOpen:t,isDisabled:n}=ih(),{reduceMotion:r}=ah(),i=Ae("chakra-accordion__icon",e.className),s=wc(),c={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return l.jsx(Jt,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:c,...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Ro.displayName="AccordionIcon";var No=he(function(t,n){const{children:r,className:i}=t,{htmlProps:s,...c}=nw(t),f={...wc().container,overflowAnchor:"none"},h=x.useMemo(()=>c,[c]);return l.jsx(K3,{value:h,children:l.jsx(re.div,{ref:n,...s,className:Ae("chakra-accordion__item",i),__css:f,children:typeof r=="function"?r({isExpanded:!!c.isOpen,isDisabled:!!c.isDisabled}):r})})});No.displayName="AccordionItem";var Fo={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Vi={enter:{duration:.2,ease:Fo.easeOut},exit:{duration:.1,ease:Fo.easeIn}},Or={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})},sw=e=>e!=null&&parseInt(e.toString(),10)>0,ig={exit:{height:{duration:.2,ease:Fo.ease},opacity:{duration:.3,ease:Fo.ease}},enter:{height:{duration:.3,ease:Fo.ease},opacity:{duration:.4,ease:Fo.ease}}},lw={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var s;return{...e&&{opacity:sw(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Or.exit(ig.exit,i)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>{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:Or.enter(ig.enter,i)}}},y2=x.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:s=0,endingHeight:c="auto",style:u,className:f,transition:h,transitionEnd:p,...g}=e,[y,S]=x.useState(!1);x.useEffect(()=>{const M=setTimeout(()=>{S(!0)});return()=>clearTimeout(M)},[]),is({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const C=parseFloat(s.toString())>0,w={startingHeight:s,endingHeight:c,animateOpacity:i,transition:y?h:{enter:{duration:0}},transitionEnd:{enter:p==null?void 0:p.enter,exit:r?p==null?void 0:p.exit:{...p==null?void 0:p.exit,display:C?"block":"none"}}},k=r?n:!0,j=n||r?"enter":"exit";return l.jsx(ia,{initial:!1,custom:w,children:k&&l.jsx(Wr.div,{ref:t,...g,className:Ae("chakra-collapse",f),style:{overflow:"hidden",display:"block",...u},custom:w,variants:lw,initial:r?"exit":!1,animate:j,exit:"exit"})})});y2.displayName="Collapse";var cw={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Or.enter(Vi.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:Or.exit(Vi.exit,n),transitionEnd:t==null?void 0:t.exit}}},b2={initial:"exit",animate:"enter",exit:"exit",variants:cw},uw=x.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:s,transition:c,transitionEnd:u,delay:f,...h}=t,p=i||r?"enter":"exit",g=r?i&&r:!0,y={transition:c,transitionEnd:u,delay:f};return l.jsx(ia,{custom:y,children:g&&l.jsx(Wr.div,{ref:n,className:Ae("chakra-fade",s),custom:y,...b2,animate:p,...h})})});uw.displayName="Fade";var dw={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>{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:Or.exit(Vi.exit,i)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Or.enter(Vi.enter,n),transitionEnd:e==null?void 0:e.enter}}},S2={initial:"exit",animate:
|
||
|
.`.concat(Bj,` {
|
||
|
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(i,`px;
|
||
|
padding-top: `).concat(s,`px;
|
||
|
padding-right: `).concat(c,`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(ql,` {
|
||
|
right: `).concat(u,"px ").concat(r,`;
|
||
|
}
|
||
|
|
||
|
.`).concat(Yl,` {
|
||
|
margin-right: `).concat(u,"px ").concat(r,`;
|
||
|
}
|
||
|
|
||
|
.`).concat(ql," .").concat(ql,` {
|
||
|
right: 0 `).concat(r,`;
|
||
|
}
|
||
|
|
||
|
.`).concat(Yl," .").concat(Yl,` {
|
||
|
margin-right: 0 `).concat(r,`;
|
||
|
}
|
||
|
|
||
|
body {
|
||
|
`).concat(Hj,": ").concat(u,`px;
|
||
|
}
|
||
|
`)},Jj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,s=x.useMemo(function(){return Kj(i)},[i]);return x.createElement(Qj,{styles:Zj(s,!t,i,n?"":"!important")})},Pf=!1;if(typeof window<"u")try{var El=Object.defineProperty({},"passive",{get:function(){return Pf=!0,!0}});window.addEventListener("test",El,El),window.removeEventListener("test",El,El)}catch{Pf=!1}var Io=Pf?{passive:!1}:!1,eE=function(e){return e.tagName==="TEXTAREA"},$x=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!eE(e)&&n[t]==="visible")},tE=function(e){return $x(e,"overflowY")},nE=function(e){return $x(e,"overflowX")},Ag=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Gx(e,n);if(r){var i=qx(e,n),s=i[1],c=i[2];if(s>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},rE=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},iE=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Gx=function(e,t){return e==="v"?tE(t):nE(t)},qx=function(e,t){return e==="v"?rE(t):iE(t)},oE=function(e,t){return e==="h"&&t==="rtl"?-1:1},aE=function(e,t,n,r,i){var s=oE(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),h=!1,p=c>0,g=0,y=0;do{var S=qx(e,u),C=S[0],w=S[1],k=S[2],j=w-k-s*C;(C||j)&&Gx(e,u)&&(g+=j,y+=C),u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&(i&&g===0||!i&&c>g)||!p&&(i&&y===0||!i&&-c>y))&&(h=!0),h},Pl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zg=function(e){return[e.deltaX,e.deltaY]},Rg=function(e){return e&&"current"in e?e.current:e},sE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lE=function(e){return`
|
||
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
|
`)},cE=0,Mo=[];function uE(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(cE++)[0],s=x.useState(function(){return Ux()})[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=xf([e.lockRef.current],(e.shards||[]).map(Rg),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(w,k){if("touches"in w&&w.touches.length===2)return!c.current.allowPinchZoom;var j=Pl(w),M=n.current,P="deltaX"in w?w.deltaX:M[0]-j[0],I="deltaY"in w?w.deltaY:M[1]-j[1],T,D=w.target,_=Math.abs(P)>Math.abs(I)?"h":"v";if("touches"in w&&_==="h"&&D.type==="range")return!1;var z=Ag(_,D);if(!z)return!0;if(z?T=_:(T=_==="v"?"h":"v",z=Ag(_,D)),!z)return!1;if(!r.current&&"changedTouches"in w&&(P||I)&&(r.current=T),!T)return!0;var V=r.current||T;return aE(V,k,w,V==="h"?P:I,!0)},[]),f=x.useCallback(function(w){var k=w;if(!(!Mo.length||Mo[Mo.length-1]!==s)){var j="deltaY"in k?zg(k):Pl(k),M=t.current.filter(function(T){return T.name===k.type&&T.target===k.target&&sE(T.delta,j)})[0];if(M&&M.should){k.cancelable&&k.preventDefault();return}if(!M){var P=(c.current.shards||[]).map(Rg).filter(Boolean).filter(function(T){return T.contains(k.target)}),I=P.length>0?u(k,P[0]):!c.current.noIsolation;I&&k.cancelable&&k.preventDefault()}}},[]),h=x.useCallback(function(w,k,j,M){var P={name:w,delta:k,target:j,should:M};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(I){return I!==P})},1)},[]),p=x.useCallback(function(w){n.current=Pl(w),r.current=void 0},[]),g=x.useCallback(function(w){h(w.type,zg(w),w.target,u(w,e.lockRef.current))},[]),y=x.useCallback(function(w){h(w.type,Pl(w),w.target,u(w,e.lockRef.current))},[]);x.useEffect(function(){return Mo.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Io),document.addEventListener("touchmove",f,Io),document.addEventListener("touchstart",p,Io),function(){Mo=Mo.filter(function(w){return w!==s}),document.removeEventListener("wheel",f,Io),document.removeEventListener("touchmove",f,Io),document.removeEventListener("touchstart",p,Io)}},[]);var S=e.removeScrollBar,C=e.inert;return x.createElement(x.Fragment,null,C?x.createElement(s,{styles:lE(i)}):null,S?x.createElement(Jj,{gapMode:"margin"}):null)}const dE=h5(Vx,uE);var Yx=x.forwardRef(function(e,t){return x.createElement(Ic,vr({},e,{ref:t,sideCar:dE}))});Yx.classNames=Ic.classNames;const fE=Yx;function hE(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:s,allowPinchZoom:c,finalFocusRef:u,returnFocusOnClose:f,preserveScrollBarGap:h,lockFocusAcrossFrames:p,isOpen:g}=Ki(),[y,S]=C3();x.useEffect(()=>{!y&&S&&setTimeout(S)},[y,S]);const C=Hx(r,g);return l.jsx(mx,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:u,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:p,children:l.jsx(fE,{removeScrollBar:!h,allowPinchZoom:c,enabled:C===1&&s,forwardProps:!0,children:e.children})})}var fi=he((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:s,...c}=e,{getDialogProps:u,getDialogContainerProps:f}=Ki(),h=u(c,t),p=f(i),g=Ae("chakra-modal__content",n),y=la(),S={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...y.dialog},C={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...y.dialogContainer},{motionPreset:w}=Ki();return l.jsx(hE,{children:l.jsx(re.div,{...p,className:"chakra-modal__content-container",tabIndex:-1,__css:C,children:l.jsx(Bx,{preset:w,motionProps:s,className:g,...h,__css:S,children:r})})})});fi.displayName="ModalContent";function Xx(e){const{leastDestructiveRef:t,...n}=e;return l.jsx(di,{...n,initialFocusRef:t})}var Kx=he((e,t)=>l.jsx(fi,{ref:t,role:"alertdialog",...e})),zr=he((e,t
|
||
|
position: relative;
|
||
|
width: -moz-fit-content;
|
||
|
width: fit-content;
|
||
|
height: -moz-fit-content;
|
||
|
height: fit-content;
|
||
|
overflow: hidden;
|
||
|
-webkit-touch-callout: none; /* iOS Safari */
|
||
|
-webkit-user-select: none; /* Safari */
|
||
|
-khtml-user-select: none; /* Konqueror HTML */
|
||
|
-moz-user-select: none; /* Firefox */
|
||
|
-ms-user-select: none; /* Internet Explorer/Edge */
|
||
|
user-select: none;
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
}
|
||
|
.transform-component-module_content__uCDPE {
|
||
|
display: flex;
|
||
|
flex-wrap: wrap;
|
||
|
width: -moz-fit-content;
|
||
|
width: fit-content;
|
||
|
height: -moz-fit-content;
|
||
|
height: fit-content;
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
transform-origin: 0% 0%;
|
||
|
}
|
||
|
.transform-component-module_content__uCDPE img {
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
`,p0={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};eI(tI);var nI=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,s=i===void 0?"":i,c=e.wrapperStyle,u=e.contentStyle,f=e.wrapperProps,h=f===void 0?{}:f,p=e.contentProps,g=p===void 0?{}:p,y=x.useContext(Bc).init,S=x.useRef(null),C=x.useRef(null);return x.useEffect(function(){var w=S.current,k=C.current;w!==null&&k!==null&&y&&y(w,k)},[]),ke.createElement("div",li({},h,{ref:S,className:"react-transform-wrapper ".concat(p0.wrapper," ").concat(r),style:c}),ke.createElement("div",li({},g,{ref:C,className:"react-transform-component ".concat(p0.content," ").concat(s),style:u}),t))},l4=function(){var e=x.useContext(Bc),t=x.useState(dt(e||{})),n=t[0],r=t[1];if(!e)throw new Error("Transform context mus be placed inside TransformWrapper");return x.useEffect(function(){e.onChange(function(i){r(i)})},[e]),n};ke.forwardRef(function(e,t){var n=x.useRef(null),r=x.useContext(Bc);return x.useEffect(function(){return r.onChange(function(i){if(n.current){var s=0,c=0;n.current.style.transform=r.handleTransformStyles(s,c,1/i.state.scale)}})},[r]),ke.createElement("div",li({},e,{ref:TP([n,t])}))});const rI=()=>{const[e,t]=x.useState(0),[n,r]=x.useState(1),[i,s]=x.useState(1);return{rotation:e,scaleX:n,scaleY:i,flipHorizontally:()=>{r(n*-1)},flipVertically:()=>{s(i*-1)},rotateCounterClockwise:()=>{t(e===-270?0:e-90)},rotateClockwise:()=>{t(e===270?0:e+90)},reset:()=>{t(0),r(1),s(1)}}},iI=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:i})=>{const{zoomIn:s,zoomOut:c,resetTransform:u}=l4();return l.jsxs(en,{isAttached:!0,orientation:"vertical",children:[l.jsx(le,{icon:l.jsx(t8,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>s(),fontSize:20}),l.jsx(le,{icon:l.jsx(n8,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>c(),fontSize:20}),l.jsx(le,{icon:l.jsx(J7,{}),"aria-label":"Rotate Counter-Clockwise",tooltip:"Rotate Counter-Clockwise",onClick:n,fontSize:20}),l.jsx(le,{icon:l.jsx(e8,{}),"aria-label":"Rotate Clockwise",tooltip:"Rotate Clockwise",onClick:r,fontSize:20}),l.jsx(le,{icon:l.jsx(Jg,{}),"aria-label":"Flip Horizontally",tooltip:"Flip Horizontally",onClick:e,fontSize:20}),l.jsx(le,{icon:l.jsx(Jg,{style:{transform:"rotate(90deg)"}}),"aria-label":"Flip Vertically",tooltip:"Flip Vertically",onClick:t,fontSize:20}),l.jsx(le,{icon:l.jsx(ep,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{u(),i()},fontSize:20})]})};function oI({image:e,alt:t,ref:n,styleClass:r,rotation:i,scaleX:s,scaleY:c}){const{centerView:u}=l4();return l.jsx(nI,{wrapperStyle:{width:"100%",height:"100%"},children:l.jsx("img",{style:{transform:`rotate(${i}deg) scaleX(${s}) scaleY(${c})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>u(1,0,"easeOut")})})}const aI=be([Vr,ro],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function sI(){const e=Y(),t=O(y=>y.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:i,flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:h}=rI(),{viewerImageToDisplay:p,shouldShowImageDetails:g}=O(aI);return fe("Esc",()=>{t&&e(Bi(!1))},[t]),l.jsx(JP,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:l.jsxs(We,{sx:{width:"100%",height:"100%",overflow:"hidden",position:"absolute",insetInlineStart:0,top:0,zIndex:30,animation:"popIn 0.3s ease-in",bg:"base.800"},children:[l.jsxs(B,{sx:{flexDir:"column",position:"absolute",top:4,insetInlineStart:4,gap:4,zIndex:3},children:[l.jsx(le,{icon:l.jsx(Z7,{}),"aria-label":"Exit Viewer",onClick:()=>{e(Bi(!1))},fontSize:20}),l.jsx(iI,{flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:h})]}),l.jsxs(B,{children:[l.jsxs($n,{sx:{overflow:"hidden",gridTemplateColumns:"auto max-content",placeItems:"center",width:"100vw",height:"100vh",bg:"base.850"},children:[p&&l.jsxs(l.Fragment,{children:[l.jsx(oI,{rotation
|
||
|
* @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 ZI=function(t){var n={},r=x,i=Ul,s=Object.assign;function c(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+a+" 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,f=Symbol.for("react.element"),h=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),T=Symbol.iterator;function D(o){return o===null||typeof o!="object"?null:(o=T&&o[T]||o["@@iterator"],typeof o=="function"?o:null)}function _(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case p:return"Fragment";case h:return"Portal";case y:return"Profiler";case g:return"StrictMode";case k:return"Suspense";case j:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case C:return(o.displayName||"Context")+".Consumer";case S:return(o._context.displayName||"Context")+".Provider";case w:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case M:return a=o.displayName||null,a!==null?a:_(o.type)||"Memo";case P:a=o._payload,o=o._init;try{return _(o(a))}catch{}}return null}function z(o){var a=o.type;switch(o.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=a.render,o=o.displayName||o.name||"",a.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _(a);case 8:return a===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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function V(o){var a=o,d=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,a.flags&4098&&(d=a.return),o=a.return;while(o)}return a.tag===3?d:null}function F(o){if(V(o)!==o)throw Error(c(188))}function L(o){var a=o.alternate;if(!a){if(a=V(o),a===null)throw Error(c(188));return a!==o?null:o}for(var d=o,m=a;;){var v=d.return;if(v===null)break;var b=v.alternate;if(b===null){if(m=v.return,m!==null){d=m;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===d)return F(v),o;if(b===m)return F(v),a;b=b.sibling}throw Error(c(188))}if(d.return!==m.return)d=v,m=b;else{for(var E=!1,A=v.child;A;){if(A===d){E=!0,d=v,m=b;break}if(A===m){E=!0,m=v,d=b;break}A=A.sibling}if(!E){for(A=b.child;A;){if(A===d){E=!0,d=b,m=v;break}if(A===m){E=!0,m=b,d=v;break}A=A.sibling}if(!E)throw Error(c(189))}}if(d.alternate!==m)throw Error(c(190))}if(d.tag!==3)throw Error(c(188));return d.stateNode.current===d?o:a}function X(o){return o=L(o),o!==null?$(o):null}function $(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var a=$(o);if(a!==null)return a;o=o.sibling}return null}function Q(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){if(o.tag!==4){var a=Q(o);if(a!==null)return a}o=o.sibling}return null}var ie=Array.isArray,oe=t.getPublicInstance,U=t.getRootHostContext,K=t.getChildHostContext,ne=t.prepareForCommit,ce=t.resetAfterCommit,Re=t.createInstance,ze=t.appendInitialChild,Me=t.finalizeInitialChildren,J=t.prepareUpdate,ue=t.shouldSetTextContent,Ie=t.createTextInstance,Be=t.scheduleTimeout,Ne=t.cancelTimeout,Ge=t.noTimeout,Qe=t.isPrimaryRenderer,ve=t.supportsMutation,_e=t.supportsPersistence,qe=t.supportsHydration,ge
|
||
|
`+Jc+o}var eu=!1;function tu(o,a){if(!o||eu)return"";eu=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(ae){var m=ae}Reflect.construct(o,[],a)}else{try{a.call()}catch(ae){m=ae}o.call(a.prototype)}else{try{throw Error()}catch(ae){m=ae}o()}}catch(ae){if(ae&&m&&typeof ae.stack=="string"){for(var v=ae.stack.split(`
|
||
|
`),b=m.stack.split(`
|
||
|
`),E=v.length-1,A=b.length-1;1<=E&&0<=A&&v[E]!==b[A];)A--;for(;1<=E&&0<=A;E--,A--)if(v[E]!==b[A]){if(E!==1||A!==1)do if(E--,A--,0>A||v[E]!==b[A]){var W=`
|
||
|
`+v[E].replace(" at new "," at ");return o.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",o.displayName)),W}while(1<=E&&0<=A);break}}}finally{eu=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?ha(o):""}var Ub=Object.prototype.hasOwnProperty,nu=[],uo=-1;function Gr(o){return{current:o}}function bt(o){0>uo||(o.current=nu[uo],nu[uo]=null,uo--)}function gt(o,a){uo++,nu[uo]=o.current,o.current=a}var qr={},an=Gr(qr),xn=Gr(!1),Si=qr;function fo(o,a){var d=o.type.contextTypes;if(!d)return qr;var m=o.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var v={},b;for(b in d)v[b]=a[b];return m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=v),v}function yn(o){return o=o.childContextTypes,o!=null}function js(){bt(xn),bt(an)}function Jp(o,a,d){if(an.current!==qr)throw Error(c(168));gt(an,a),gt(xn,d)}function em(o,a,d){var m=o.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var v in m)if(!(v in a))throw Error(c(108,z(o)||"Unknown",v));return s({},d,m)}function Es(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||qr,Si=an.current,gt(an,o),gt(xn,xn.current),!0}function tm(o,a,d){var m=o.stateNode;if(!m)throw Error(c(169));d?(o=em(o,a,Si),m.__reactInternalMemoizedMergedChildContext=o,bt(xn),bt(an),gt(an,o)):bt(xn),gt(xn,d)}var Xn=Math.clz32?Math.clz32:qb,$b=Math.log,Gb=Math.LN2;function qb(o){return o>>>=0,o===0?32:31-($b(o)/Gb|0)|0}var Ps=64,Is=4194304;function pa(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Ms(o,a){var d=o.pendingLanes;if(d===0)return 0;var m=0,v=o.suspendedLanes,b=o.pingedLanes,E=d&268435455;if(E!==0){var A=E&~v;A!==0?m=pa(A):(b&=E,b!==0&&(m=pa(b)))}else E=d&~v,E!==0?m=pa(E):b!==0&&(m=pa(b));if(m===0)return 0;if(a!==0&&a!==m&&!(a&v)&&(v=m&-m,b=a&-a,v>=b||v===16&&(b&4194240)!==0))return a;if(m&4&&(m|=d&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=m;0<a;)d=31-Xn(a),v=1<<d,m|=o[d],a&=~v;return m}function Yb(o,a){switch(o){case 1:case 2:case 4:return a+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 a+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 Xb(o,a){for(var d=o.suspendedLanes,m=o.pingedLanes,v=o.expirationTimes,b=o.pendingLanes;0<b;){var E=31-Xn(b),A=1<<E,W=v[E];W===-1?(!(A&d)||A&m)&&(v[E]=Yb(A,a)):W<=a&&(o.expiredLanes|=A),b&=~A}}function ru(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function nm(){var o=Ps;return Ps<<=1,!(Ps&4194240)&&(Ps=64),o}function iu(o){for(var a=[],d=0;31>d;d++)a.push(o);return a}function ma(o,a,d){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-Xn(a),o[a]=d}function Kb(o,a){var d=o.pendingLanes&~a;o.pendingLanes=a,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=a,o.mutableReadLanes&=a,o.entangledLanes&=a,a=o.entanglements;var m=o.eventTimes;for(o=o.expirationTimes;0<d;){var v=31-Xn(d),b=1<<v;a[v]=0,m[v]=-1,o[v]=-1,d&=~b}}function ou(o,a){var d=o.entangledLanes|=a;for(o=o.entanglements;d;){var m=31-Xn(d),v=1<<m;v&a|o[m]&a&&(o[m]|=a),d&=~v}}var it=0;function rm(o){return o&=-o,1<o?4<o?o&268435455?16:536870912:4:1}var au=i.unstable_scheduleCallback,im=i.unstable_cancelCallback,Qb=i.unstable_sho
|
||
|
Error generating stack: `+b.message+`
|
||
|
`+b.stack}return{value:o,source:a,stack:v,digest:null}}function zu(o,a,d){return{value:o,source:null,stack:d??null,digest:a??null}}function Ru(o,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var hS=typeof WeakMap=="function"?WeakMap:Map;function $m(o,a,d){d=Ir(-1,d),d.tag=3,d.payload={element:null};var m=a.value;return d.callback=function(){sl||(sl=!0,nd=m),Ru(o,a)},d}function Gm(o,a,d){d=Ir(-1,d),d.tag=3;var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var v=a.value;d.payload=function(){return m(v)},d.callback=function(){Ru(o,a)}}var b=o.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(d.callback=function(){Ru(o,a),typeof m!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var E=a.stack;this.componentDidCatch(a.value,{componentStack:E!==null?E:""})}),d}function qm(o,a,d){var m=o.pingCache;if(m===null){m=o.pingCache=new hS;var v=new Set;m.set(a,v)}else v=m.get(a),v===void 0&&(v=new Set,m.set(a,v));v.has(d)||(v.add(d),o=PS.bind(null,o,a,d),a.then(o,o))}function Ym(o){do{var a;if((a=o.tag===13)&&(a=o.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return o;o=o.return}while(o!==null);return null}function Xm(o,a,d,m,v){return o.mode&1?(o.flags|=65536,o.lanes=v,o):(o===a?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=Ir(-1,1),a.tag=2,Xr(d,a,1))),d.lanes|=1),o)}var pS=u.ReactCurrentOwner,bn=!1;function mn(o,a,d,m){a.child=o===null?Cm(a,null,d,m):xo(a,o.child,d,m)}function Km(o,a,d,m,v){d=d.render;var b=a.ref;return go(a,v),m=Mu(o,a,d,m,b,v),d=Tu(),o!==null&&!bn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~v,Mr(o,a,v)):(It&&d&&uu(a),a.flags|=1,mn(o,a,m,v),a.child)}function Qm(o,a,d,m,v){if(o===null){var b=d.type;return typeof b=="function"&&!ld(b)&&b.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=b,Zm(o,a,b,m,v)):(o=hl(d.type,null,m,a,a.mode,v),o.ref=a.ref,o.return=a,a.child=o)}if(b=o.child,!(o.lanes&v)){var E=b.memoizedProps;if(d=d.compare,d=d!==null?d:zs,d(E,m)&&o.ref===a.ref)return Mr(o,a,v)}return a.flags|=1,o=ei(b,m),o.ref=a.ref,o.return=a,a.child=o}function Zm(o,a,d,m,v){if(o!==null){var b=o.memoizedProps;if(zs(b,m)&&o.ref===a.ref)if(bn=!1,a.pendingProps=m=b,(o.lanes&v)!==0)o.flags&131072&&(bn=!0);else return a.lanes=o.lanes,Mr(o,a,v)}return Nu(o,a,d,m,v)}function Jm(o,a,d){var m=a.pendingProps,v=m.children,b=o!==null?o.memoizedState:null;if(m.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(wo,_n),_n|=d;else{if(!(d&1073741824))return o=b!==null?b.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:o,cachePool:null,transitions:null},a.updateQueue=null,gt(wo,_n),_n|=o,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=b!==null?b.baseLanes:d,gt(wo,_n),_n|=m}else b!==null?(m=b.baseLanes|d,a.memoizedState=null):m=d,gt(wo,_n),_n|=m;return mn(o,a,v,d),a.child}function ev(o,a){var d=a.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function Nu(o,a,d,m,v){var b=yn(d)?Si:an.current;return b=fo(a,b),go(a,v),d=Mu(o,a,d,m,b,v),m=Tu(),o!==null&&!bn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~v,Mr(o,a,v)):(It&&m&&uu(a),a.flags|=1,mn(o,a,d,v),a.child)}function tv(o,a,d,m,v){if(yn(d)){var b=!0;Es(a)}else b=!1;if(go(a,v),a.stateNode===null)Xs(o,a),xm(a,d,m),Cu(a,d,m,v),m=!0;else if(o===null){var E=a.stateNode,A=a.memoizedProps;E.props=A;var W=E.context,ae=d.contextType;typeof ae=="object"&&ae!==null?ae=Rn(ae):(ae=yn(d)?Si:an.current,ae=fo(a,ae));var Ee=d.getDerivedStateFromProps,Ue=typeof Ee=="function"||typeof E.getSnapshotBeforeUpdate=="function";Ue||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(A!==m||W!==ae)&&ym(a,E,m,ae),Yr=!1;var ye=a.memoizedState;E.state=ye,Ls(a,m,E,v),W=a.memoizedState,A!==m||ye!==W||xn.current||Yr?(typeof Ee=="function"&&(Su(a,d,Ee,m),W=a.memoizedState),(A=Yr||gm(a,d,A,m,ye,W,ae))?(Ue||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="
|
||
|
`+(m.join(" > ")+`
|
||
|
|
||
|
No matching component was found for:
|
||
|
`)+o.join(" > ")}return null},n.getPublicRootInstance=function(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return oe(o.child.stateNode);default:return o.child.stateNode}},n.injectIntoDevTools=function(o){if(o={bundleType:o.bundleType,version:o.version,rendererPackageName:o.rendererPackageName,rendererConfig:o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:OS,findFiberByHostInstance:o.findFiberByHostInstance||AS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")o=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)o=!0;else{try{Ts=a.inject(o),or=a}catch{}o=!!a.checkDCE}}return o},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(o,a,d,m){if(!N)throw Error(c(363));o=Qu(o,a);var v=Ze(o,d,m).disconnect;return{disconnect:function(){v()}}},n.registerMutableSourceForHydration=function(o,a){var d=a._getVersion;d=d(a._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[a,d]:o.mutableSourceEagerHydrationData.push(a,d)},n.runWithPriority=function(o,a){var d=it;try{return it=o,a()}finally{it=d}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(o,a,d,m){var v=a.current,b=un(),E=Zr(v);return d=Dv(d),a.context===null?a.context=d:a.pendingContext=d,a=Ir(b,E),a.payload={element:o},m=m===void 0?null:m,m!==null&&(a.callback=m),o=Xr(v,a,E),o!==null&&(Ln(o,v,E,b),Fs(o,v,E)),E},n};(function(e){e.exports=ZI})(QI);const JI=SC(Af);var fc={},eM={get exports(){return fc},set exports(e){fc=e}},oo={};/**
|
||
|
* @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.
|
||
|
*/oo.ConcurrentRoot=1;oo.ContinuousEventPriority=4;oo.DefaultEventPriority=16;oo.DiscreteEventPriority=1;oo.IdleEventPriority=536870912;oo.LegacyRoot=0;(function(e){e.exports=oo})(eM);const w0={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let k0=!1,j0=!1;const Dp=".react-konva-event",tM=`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
|
||
|
`,nM=`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
|
||
|
`,rM={};function Hc(e,t,n=rM){if(!k0&&"zIndex"in t&&(console.warn(nM),k0=!0),!j0&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(tM),j0=!0)}for(var s in n)if(!w0[s]){var c=s.slice(0,2)==="on",u=n[s]!==t[s];if(c&&u){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[s])}var h=!t.hasOwnProperty(s);h&&e.setAttr(s,void 0)}var p=t._useStrictMode,g={},y=!1;const S={};for(var s in t)if(!w0[s]){var c=s.slice(0,2)==="on",C=n[s]!==t[s];if(c&&C){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(S[f]=t[s])}!c&&(t[s]!==n[s]||p&&t[s]!==e.getAttr(s))&&(y=!0,g[s]=t[s])}y&&(e.setAttrs(g),gi(e));for(var f in S)e.on(f+Dp,S[f])}function gi(e){if(!CC.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const v4={},iM={};qa.Node.prototype._applyProps=Hc;function oM(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),gi(e)}function aM(e,t,n){let r=qa[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=qa.Group);const i={},s={};for(var c in t){var u=c.slice(0,2)==="on";u?s[c]=t[c]:i[c]=t[c]}const f=new r(i);return Hc(f,s),f}function sM(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function lM(e,t,n){return!1}function cM(e){return e}function uM(){return null}function dM(){return null}function fM(e,t,n,r){return iM}function hM(){}function pM(e){}function mM(e,t){return!1}function vM(){return v4}function gM(){return v4}const xM=setTimeout,yM=clearTimeout,bM=-1;function SM(e,t){return!1}const CM=!1,wM=!0,kM=!0;function jM(e,t){t.parent===e?t.moveToTop():e.add(t),gi(e)}function EM(e,t){t.parent===e?t.moveToTop():e.add(t),gi(e)}function g4(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),gi(e)}function PM(e,t,n){g4(e,t,n)}function IM(e,t){t.destroy(),t.off(Dp),gi(e)}function MM(e,t){t.destroy(),t.off(Dp),gi(e)}function TM(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function _M(e,t,n){}function DM(e,t,n,r,i){Hc(e,i,r)}function OM(e){e.hide(),gi(e)}function AM(e){}function zM(e,t){(t.visible==null||t.visible)&&e.show()}function RM(e,t){}function NM(e){}function FM(){}const LM=()=>fc.DefaultEventPriority,BM=Object.freeze(Object.defineProperty({__proto__:null,appendChild:jM,appendChildToContainer:EM,appendInitialChild:oM,cancelTimeout:yM,clearContainer:NM,commitMount:_M,commitTextUpdate:TM,commitUpdate:DM,createInstance:aM,createTextInstance:sM,detachDeletedInstance:FM,finalizeInitialChildren:lM,getChildHostContext:gM,getCurrentEventPriority:LM,getPublicInstance:cM,getRootHostContext:vM,hideInstance:OM,hideTextInstance:AM,idlePriority:Ul.unstable_IdlePriority,insertBefore:g4,insertInContainerBefore:PM,isPrimaryRenderer:CM,noTimeout:bM,now:Ul.unstable_now,prepareForCommit:uM,preparePortalMount:dM,prepareUpdate:fM,removeChild:IM,removeChildFromContainer:MM,resetAfterCommit:hM,resetTextContent:pM,run:Ul.unstable_runWithPriority,scheduleTimeout:xM,shouldDeprioritizeSubtree:mM,shouldSetTextContent:SM,supportsMutation:kM,unhideInstance:zM,unhideTextInstance:RM,warnsIfNotActing:wM},Symbol.toStringTag,{value:"Module"}));var HM=Object.defineProperty,WM=Object.defineProperties,VM=Object.getOwnPropertyDescriptors,E0=Object.getOwnPropertySymbols,UM=Object.prototype.hasOwnProperty,$M=Object.prototype.propertyIsEnumerable,P0=(e,t,n)=>t in e?HM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I0=(e,t)=>{for(var n in t||(t={}))UM.call(t,n)&&P0(e,n,t[n]);if(E0)for(var n of E0(t))$M.call(t,n)&&P0(e,n,t[n]);return e},GM=(e,t)=>WM(e,VM(t));function x4(e,t,n){if(!e)return;if(n(e
|
||
|
<!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),CT=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:s}=O(ST),[c,u]=x.useState(null),[f,h]=x.useState(0),p=x.useRef(null),g=x.useCallback(()=>{h(f+1),setTimeout(g,500)},[f]);return x.useEffect(()=>{if(c)return;const y=new Image;y.onload=()=>{u(y)},y.src=M0(n)},[c,n]),x.useEffect(()=>{c&&(c.src=M0(n))},[c,n]),x.useEffect(()=>{const y=setInterval(()=>h(S=>(S+1)%5),50);return()=>clearInterval(y)},[]),!c||!te.isNumber(r.x)||!te.isNumber(r.y)||!te.isNumber(s)||!te.isNumber(i.width)||!te.isNumber(i.height)?null:l.jsx(Hr,{ref:p,offsetX:r.x/s,offsetY:r.y/s,height:i.height/s,width:i.width/s,fillPatternImage:c,fillPatternOffsetY:te.isNumber(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},wT=be([tt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),kT=e=>{const{...t}=e,{objects:n}=O(wT);return l.jsx(Br,{listening:!1,...t,children:n.filter(zC).map((r,i)=>l.jsx(hc,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var Di=x,jT=function(t,n,r){const i=Di.useRef("loading"),s=Di.useRef(),[c,u]=Di.useState(0),f=Di.useRef(),h=Di.useRef(),p=Di.useRef();return(f.current!==t||h.current!==n||p.current!==r)&&(i.current="loading",s.current=void 0,f.current=t,h.current=n,p.current=r),Di.useLayoutEffect(function(){if(!t)return;var g=document.createElement("img");function y(){i.current="loaded",s.current=g,u(Math.random())}function S(){i.current="failed",s.current=void 0,u(Math.random())}return g.addEventListener("load",y),g.addEventListener("error",S),n&&(g.crossOrigin=n),r&&(g.referrerpolicy=r),g.src=t,function(){g.removeEventListener("load",y),g.removeEventListener("error",S)}},[t,n,r]),[s.current,i.current]};const w4=e=>{const{url:t,x:n,y:r}=e,[i]=jT(t);return l.jsx(S4,{x:n,y:r,image:i,listening:!1})},ET=be([tt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),PT=()=>{const{objects:e}=O(ET);return e?l.jsx(Br,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(T1(t))return l.jsx(w4,{x:t.x,y:t.y,url:t.image.url},n);if(RC(t)){const r=l.jsx(hc,{points:t.points,stroke:t.color?qi(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?l.jsx(Br,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(NC(t))return l.jsx(Hr,{x:t.x,y:t.y,width:t.width,height:t.height,fill:qi(t.color)},n);if(FC(t))return l.jsx(Hr,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},IT=be([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:s,y:c},boundingBoxDimensions:{width:u,height:f}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:s,y:c,width:u,height:f}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),MT=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:s,y:c,width:u,height:f}=O(IT);return l.jsxs(Br,{...t,children:[r&&n&&l.jsx(w4,{url:n.image.url,x:s,y:c}),i&&l.jsxs(Br,{children:[l.jsx(Hr,{x:s,y:c,width:u,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),l.jsx(Hr,{x:s,y:c,width:u,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},TT=be([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shoul
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jD(e){if(Array.isArray(e))return Bf(e)}function R0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function N0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R0(Object(n),!0).forEach(function(r){N4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function es(e,t){return ID(e)||PD(e,t)||F4(e,t)||ED()}function ED(){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 F4(e,t){if(e){if(typeof e=="string")return Bf(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 Bf(e,t)}}function Bf(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 PD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,c,u;try{for(n=n.call(e);!(i=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));i=!0);}catch(f){s=!0,u=f}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function ID(e){if(Array.isArray(e))return e}var MD="file-invalid-type",TD="file-too-large",_D="file-too-small",DD="too-many-files",OD=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:MD,message:"File type must be ".concat(n)}},F0=function(t){return{code:TD,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},L0=function(t){return{code:_D,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},AD={code:DD,message:"Too many files"};function L4(e,t){var n=e.type==="application/x-moz-file"||CD(e,t);return[n,n?null:OD(t)]}function B4(e,t,n){if(Ni(e.size))if(Ni(t)&&Ni(n)){if(e.size>n)return[!1,F0(n)];if(e.size<t)return[!1,L0(t)]}else{if(Ni(t)&&e.size<t)return[!1,L0(t)];if(Ni(n)&&e.size>n)return[!1,F0(n)]}return[!0,null]}function Ni(e){return e!=null}function zD(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=L4(f,n),p=es(h,1),g=p[0],y=B4(f,r,i),S=es(y,1),C=S[0],w=u?u(f):null;return g&&C&&!w})}function vc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Nl(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 B0(e){e.preventDefault()}function RD(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function ND(e){return e.indexOf("Edge/")!==-1}function FD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return RD(e)||ND(e)}function hr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];return t.some(function(u){return!vc(r)&&u&&u.apply(void 0,[r].concat(s)),vc(r)})}}function LD(){return"showOpenFilePicker"in window}function BD(e){if(Ni(e)){var t=Object.entries(e).filter(function(n){var r=es(n,2),i=r[0],s=r[1],c=!0;return H4(i)||(console.warn('Skipped "'.concat(i,'" 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.')),c=!1),(!Array.isArray(s)||!s.every(W4))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var i=es(r,2),s=i[0],c=i[1];return N0(N0({},n),{},N4({},s,c))},{});return[{description:"Files",accept:t}]}return e}function HD(e){if(Ni(e))return Object.entries(e).reduce(function(t,n){var r=es(n,2),i=r[0],s=r[1];return[].concat(z0(t),[i],z0(s))},[]).filter(function(t){return H4(t)||W4(t)}).join(",")}function WD(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function VD(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function H4(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function W4(e){return/^.*\.[\w]+$/.test(e)}var UD=["children"],$D=["open"],GD=["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 KD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function QD(e){if(Array.isArray(e))return Hf(e)}function Wd(e,t){return eO(e)||JD(e,t)||V4(e,t)||ZD()}function ZD(){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 V4(e,t){if(e){if(typeof e=="string")return Hf(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 Hf(e,t)}}function Hf(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 JD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,c,u;try{for(n=n.call(e);!(i=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));i=!0);}catch(f){s=!0,u=f}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function eO(e){if(Array.isArray(e))return e}function H0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ot(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H0(Object(n),!0).forEach(function(r){Wf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gc(e,t){if(e==null)return{};var n=tO(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tO(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Np=x.forwardRef(function(e,t){var n=e.children,r=gc(e,UD),i=$4(r),s=i.open,c=gc(i,$D);return x.useImperativeHandle(t,function(){return{open:s}},[s]),ke.createElement(x.Fragment,null,n(Ot(Ot({},c),{},{open:s})))});Np.displayName="Dropzone";var U4={disabled:!1,getFilesFromEvent:hD,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};Np.defaultProps=U4;Np.propTypes={children:lt.func,accept:lt.objectOf(lt.arrayOf(lt.string)),multiple:lt.bool,preventDropOnDocument:lt.bool,noClick:lt.bool,noKeyboard:lt.bool,noDrag:lt.bool,noDragEventsBubbling:lt.bool,minSize:lt.number,maxSize:lt.number,maxFiles:lt.number,disabled:lt.bool,getFilesFromEvent:lt.func,onFileDialogCancel:lt.func,onFileDialogOpen:lt.func,useFsAccessApi:lt.bool,autoFocus:lt.bool,onDragEnter:lt.func,onDragLeave:lt.func,onDragOver:lt.func,onDrop:lt.func,onDropAccepted:lt.func,onDropRejected:lt.func,onError:lt.func,validator:lt.func};var Vf={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function $4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ot(Ot({},U4),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,p=t.onDragLeave,g=t.onDragOver,y=t.onDrop,S=t.onDropAccepted,C=t.onDropRejected,w=t.onFileDialogCancel,k=t.onFileDialogOpen,j=t.useFsAccessApi,M=t.autoFocus,P=t.preventDropOnDocument,I=t.noClick,T=t.noKeyboard,D=t.noDrag,_=t.noDragEventsBubbling,z=t.onError,V=t.validator,F=x.useMemo(function(){return HD(n)},[n]),L=x.useMemo(function(){return BD(n)},[n]),X=x.useMemo(function(){return typeof k=="function"?k:W0},[k]),$=x.useMemo(function(){return typeof w=="function"?w:W0},[w]),Q=x.useRef(null),ie=x.useRef(null),oe=x.useReducer(nO,Vf),U=Wd(oe,2),K=U[0],ne=U[1],ce=K.isFocused,Re=K.isFileDialogActive,ze=x.useRef(typeof window<"u"&&window.isSecureContext&&j&&LD()),Me=function(){!ze.current&&Re&&setTimeout(function(){if(ie.current){var se=ie.current.files;se.length||(ne({type:"closeDialog"}),$())}},300)};x.useEffe
|
||
|
${D.message}`,"");i({title:s("toast.uploadFailed"),description:I,status:"error",isClosable:!0})},[s,i]),p=x.useCallback(async P=>{n(Ug({imageFile:P}))},[n]),g=x.useCallback((P,I)=>{I.forEach(T=>{h(T)}),P.forEach(T=>{p(T)})},[p,h]),{getRootProps:y,getInputProps:S,isDragAccept:C,isDragReject:w,isDragActive:k,open:j}=$4({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:g,onDragOver:()=>u(!0),maxFiles:1});f(j),x.useEffect(()=>{const P=I=>{var z;const T=(z=I.clipboardData)==null?void 0:z.items;if(!T)return;const D=[];for(const V of T)V.kind==="file"&&["image/png","image/jpg"].includes(V.type)&&D.push(V);if(!D.length)return;if(I.stopImmediatePropagation(),D.length>1){i({description:s("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const _=D[0].getAsFile();if(!_){i({description:s("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(Ug({imageFile:_}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[s,n,i,r]);const M=["img2img","unifiedCanvas"].includes(r)?` to ${Dn[r].tooltip}`:"";return l.jsx(Qh.Provider,{value:j,children:l.jsxs(We,{...y({style:{}}),onKeyDown:P=>{P.key},children:[l.jsx("input",{...S()}),t,k&&c&&l.jsx(rO,{isDragAccept:C,isDragReject:w,overlaySecondaryText:M,setIsHandlingUpload:u})]})})},oO=be(Pt,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),aO=be(Pt,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),sO=()=>{const e=Y(),t=O(oO),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=O(aO),[s,c]=x.useState(!0),u=x.useRef(null);x.useLayoutEffect(()=>{u.current!==null&&s&&(u.current.scrollTop=u.current.scrollHeight)},[s,t,n]);const f=()=>{e(f2()),e(vd(!n))};fe("`",()=>{e(vd(!n))},[n]),fe("esc",()=>{e(vd(!1))});const h=()=>{u.current&&s&&u.current.scrollTop<u.current.scrollHeight-u.current.clientHeight&&c(!1)};return l.jsxs(l.Fragment,{children:[n&&l.jsx(Ly,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",insetInlineStart:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:l.jsx(B,{sx:{flexDirection:"column",width:"100vw",overflow:"auto",direction:"column",fontFamily:"monospace",pt:0,pr:4,pb:4,pl:12,borderTopWidth:5,bg:"base.850",borderColor:"base.700"},ref:u,onScroll:h,children:t.map((p,g)=>{const{timestamp:y,message:S,level:C}=p,w=C==="info"?"base":C;return l.jsxs(B,{sx:{gap:2,color:`${w}.300`},children:[l.jsxs(Ce,{fontWeight:"600",children:[y,":"]}),l.jsx(Ce,{wordBreak:"break-all",children:S})]},g)})})}),n&&l.jsx(Yt,{hasArrow:!0,label:s?"Autoscroll On":"Autoscroll Off",children:l.jsx(le,{size:"sm","aria-label":"Toggle autoscroll",icon:l.jsx(E8,{}),onClick:()=>c(!s),isChecked:s,sx:{position:"fixed",insetInlineStart:2,bottom:12,zIndex:"10000"}})}),l.jsx(Yt,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:l.jsx(le,{size:"sm","aria-label":"Toggle Log Viewer",icon:n?l.jsx(V8,{}):l.jsx(Ty,{}),onClick:f,sx:{position:"fixed",insetInlineStart:2,bottom:2,zIndex:"10000"},colorScheme:r||!i?"error":"base"})})]})},lO=be(Pt,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),cO=()=>{const{t:e}=Z(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:i}=O(lO),s=n?Math.round(n*100/r):0;return l.jsx(ey,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!i,height:fp,zIndex:99})};function uO(e){const{title:t,hotkey:n,description:r}=e;return l.jsxs($n,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs($n,{children:[l.jsx(Ce,{fontWeight:600,children:t}),r&&l.jsx(Ce,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),l.jsx(We,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function dO({children:e}){const{isOpen:t,onOpen:n,onClose:r}=ui(),{t:i}=Z(),s=[{title:i("hotkeys.invoke.title"),desc:i("hotkeys.invoke
|