IT_Server/modules/migan/iopaint/web_app/assets/index-OeSab6Ny.js

167 lines
752 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var Wv=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var F=(e,t,n)=>(Wv(e,t,"read from private field"),n?n.call(e):t.get(e)),Te=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},we=(e,t,n,r)=>(Wv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var qf=(e,t,n,r)=>({set _(o){we(e,t,o,n)},get _(){return F(e,t,r)}}),tt=(e,t,n)=>(Wv(e,t,"access private method"),n);function T9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Jc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R$={exports:{}},ym={},k$={exports:{}},it={};/**
* @license React
* react.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 Pd=Symbol.for("react.element"),A9=Symbol.for("react.portal"),M9=Symbol.for("react.fragment"),O9=Symbol.for("react.strict_mode"),N9=Symbol.for("react.profiler"),D9=Symbol.for("react.provider"),I9=Symbol.for("react.context"),L9=Symbol.for("react.forward_ref"),j9=Symbol.for("react.suspense"),F9=Symbol.for("react.memo"),B9=Symbol.for("react.lazy"),Y_=Symbol.iterator;function z9(e){return e===null||typeof e!="object"?null:(e=Y_&&e[Y_]||e["@@iterator"],typeof e=="function"?e:null)}var P$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T$=Object.assign,A$={};function xc(e,t,n){this.props=e,this.context=t,this.refs=A$,this.updater=n||P$}xc.prototype.isReactComponent={};xc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};xc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function M$(){}M$.prototype=xc.prototype;function cw(e,t,n){this.props=e,this.context=t,this.refs=A$,this.updater=n||P$}var uw=cw.prototype=new M$;uw.constructor=cw;T$(uw,xc.prototype);uw.isPureReactComponent=!0;var X_=Array.isArray,O$=Object.prototype.hasOwnProperty,dw={current:null},N$={key:!0,ref:!0,__self:!0,__source:!0};function D$(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)O$.call(t,r)&&!N$.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var u=Array(l),f=0;f<l;f++)u[f]=arguments[f+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Pd,type:e,key:i,ref:s,props:o,_owner:dw.current}}function U9(e,t){return{$$typeof:Pd,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function fw(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pd}function V9(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Z_=/\/+/g;function Hv(e,t){return typeof e=="object"&&e!==null&&e.key!=null?V9(""+e.key):t.toString(36)}function Ih(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Pd:case A9:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Hv(s,0):r,X_(o)?(n="",e!=null&&(n=e.replace(Z_,"$&/")+"/"),Ih(o,t,n,"",function(f){return f})):o!=null&&(fw(o)&&(o=U9(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Z_,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",X_(e))for(var l=0;l<e.length;l++){i=e[l];var u=r+Hv(i,l);s+=Ih(i,t,n,u,o)}else if(u=z9(e),typeof u=="function")for(e=u.call(e),l=0;!(i=e.next()).done;)i=i.value,u=r+Hv(i,l++),s+=Ih(i,t,n,u,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Qf(e,t,n){if(e==null)return e;var r=[],o=0;return Ih(e,r,"","",function(i){return t.call(n,i,o++)}),r}function W9(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Un={current:null},Lh={transition:null},H9={ReactCurrentDispatcher:Un,ReactCurrentBatchConfig:Lh,ReactCurrentOwner:dw};it.Children={map:Qf,forEach:function(e,t,n){Qf(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Qf(e,function(){t++}),t},toArray:function(e){return Qf(e,function(t){return t})||[]},only:function(e){if(!fw(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};it.Component=xc;it.Fragment=M9;it.Profiler=N9;it.PureComponent=cw;it.StrictMode=O9;it.Suspense=j9;it.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H9;it.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=T$({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=dw.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)O$.call(t,u)&&!N$.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var f=0;f<u;f++)l[f]=arguments[f+2];r.children=l}return{$$typeof:Pd,type:e.type,key:o,ref:i,props:r,_owner:s}};it.createContext=function(e){return e={$$typeof:I9,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:D9,_context:e},e.Consumer=e};it.createElement=D$;it.createFactory=function(e){var t=D$.bind(null,e);return t.type=e,t};it.createRef=function(){return{current:null}};it.forwardRef=function(e){return{$$typeof:L9,render:e}};it.isValidElement=fw;it.lazy=function(e){return{$$typeof:B9,_payload:{_status:-1,_result:e},_init:W9}};it.memo=function(e,t){return{$$typeof:F9,type:e,compare:t===void 0?null:t}};it.startTransition=function(e){var t=Lh.transition;Lh.transition={};try{e()}finally{Lh.transition=t}};it.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};it.useCallback=function(e,t){return Un.current.useCallback(e,t)};it.useContext=function(e){return Un.current.useContext(e)};it.useDebugValue=function(){};it.useDeferredValue=function(e){return Un.current.useDeferredValue(e)};it.useEffect=function(e,t){return Un.current.useEffect(e,t)};it.useId=function(){return Un.current.useId()};it.useImperativeHandle=function(e,t,n){return Un.current.useImperativeHandle(e,t,n)};it.useInsertionEffect=function(e,t){return Un.current.useInsertionEffect(e,t)};it.useLayoutEffect=function(e,t){return Un.current.useLayoutEffect(e,t)};it.useMemo=function(e,t){return Un.current.useMemo(e,t)};it.useReducer=function(e,t,n){return Un.current.useReducer(e,t,n)};it.useRef=function(e){return Un.current.useRef(e)};it.useState=function(e){return Un.current.useState(e)};it.useSyncExternalStore=function(e,t,n){return Un.current.useSyncExternalStore(e,t,n)};it.useTransition=function(){return Un.current.useTransition()};it.version="18.2.0";k$.exports=it;var d=k$.exports;const Be=vm(d),K9=T9({__proto__:null,default:Be},[d]);/**
* @license React
* react-jsx-runtime.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 G9=d,Y9=Symbol.for("react.element"),X9=Symbol.for("react.fragment"),Z9=Object.prototype.hasOwnProperty,q9=G9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Q9={key:!0,ref:!0,__self:!0,__source:!0};function I$(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Z9.call(t,r)&&!Q9.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Y9,type:e,key:i,ref:s,props:o,_owner:q9.current}}ym.Fragment=X9;ym.jsx=I$;ym.jsxs=I$;R$.exports=ym;var v=R$.exports,q0={},L$={exports:{}},Sr={},j$={exports:{}},F$={};/**
* @license React
* scheduler.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.
*/(function(e){function t(G,Z){var Q=G.length;G.push(Z);e:for(;0<Q;){var le=Q-1>>>1,L=G[le];if(0<o(L,Z))G[le]=Z,G[Q]=L,Q=le;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var Z=G[0],Q=G.pop();if(Q!==Z){G[0]=Q;e:for(var le=0,L=G.length,ue=L>>>1;le<ue;){var Ne=2*(le+1)-1,Ke=G[Ne],Me=Ne+1,me=G[Me];if(0>o(Ke,Q))Me<L&&0>o(me,Ke)?(G[le]=me,G[Me]=Q,le=Me):(G[le]=Ke,G[Ne]=Q,le=Ne);else if(Me<L&&0>o(me,Q))G[le]=me,G[Me]=Q,le=Me;else break e}}return Z}function o(G,Z){var Q=G.sortIndex-Z.sortIndex;return Q!==0?Q:G.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],f=[],m=1,p=null,g=3,y=!1,x=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(G){for(var Z=n(f);Z!==null;){if(Z.callback===null)r(f);else if(Z.startTime<=G)r(f),Z.sortIndex=Z.expirationTime,t(u,Z);else break;Z=n(f)}}function R(G){if(S=!1,C(G),!x)if(n(u)!==null)x=!0,H(T);else{var Z=n(f);Z!==null&&J(R,Z.startTime-G)}}function T(G,Z){x=!1,S&&(S=!1,_(O),O=-1),y=!0;var Q=g;try{for(C(Z),p=n(u);p!==null&&(!(p.expirationTime>Z)||G&&!ie());){var le=p.callback;if(typeof le=="function"){p.callback=null,g=p.priorityLevel;var L=le(p.expirationTime<=Z);Z=e.unstable_now(),typeof L=="function"?p.callback=L:p===n(u)&&r(u),C(Z)}else r(u);p=n(u)}if(p!==null)var ue=!0;else{var Ne=n(f);Ne!==null&&J(R,Ne.startTime-Z),ue=!1}return ue}finally{p=null,g=Q,y=!1}}var N=!1,A=null,O=-1,U=5,z=-1;function ie(){return!(e.unstable_now()-z<U)}function K(){if(A!==null){var G=e.unstable_now();z=G;var Z=!0;try{Z=A(!0,G)}finally{Z?te():(N=!1,A=null)}}else N=!1}var te;if(typeof b=="function")te=function(){b(K)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,re=W.port2;W.port1.onmessage=K,te=function(){re.postMessage(null)}}else te=function(){E(K,0)};function H(G){A=G,N||(N=!0,te())}function J(G,Z){O=E(function(){G(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_continueExecution=function(){x||y||(x=!0,H(T))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(G){switch(g){case 1:case 2:case 3:var Z=3;break;default:Z=g}var Q=g;g=Z;try{return G()}finally{g=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,Z){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var Q=g;g=G;try{return Z()}finally{g=Q}},e.unstable_scheduleCallback=function(G,Z,Q){var le=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?le+Q:le):Q=le,G){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=Q+L,G={id:m++,callback:Z,priorityLevel:G,startTime:Q,expirationTime:L,sortIndex:-1},Q>le?(G.sortIndex=Q,t(f,G),n(u)===null&&G===n(f)&&(S?(_(O),O=-1):S=!0,J(R,Q-le))):(G.sortIndex=L,t(u,G),x||y||(x=!0,H(T))),G},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(G){var Z=g;return function(){var Q=g;g=Z;try{return G.apply(this,arguments)}finally{g=Q}}}})(F$);j$.exports=F$;var J9=j$.exports;/**
* @license React
* react-dom.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 B$=d,wr=J9;function de(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var z$=new Set,Fu={};function ja(e,t){Jl(e,t),Jl(e+"Capture",t)}function Jl(e,t){for(Fu[e]=t,e=0;e<t.length;e++)z$.add(t[e])}var _i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q0=Object.prototype.hasOwnProperty,eD=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,q_={},Q_={};function tD(e){return Q0.call(Q_,e)?!0:Q0.call(q_,e)?!1:eD.test(e)?Q_[e]=!0:(q_[e]=!0,!1)}function nD(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function rD(e,t,n,r){if(t===null||typeof t>"u"||nD(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Vn(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var bn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){bn[e]=new Vn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];bn[t]=new Vn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){bn[e]=new Vn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){bn[e]=new Vn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){bn[e]=new Vn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){bn[e]=new Vn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){bn[e]=new Vn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){bn[e]=new Vn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){bn[e]=new Vn(e,5,!1,e.toLowerCase(),null,!1,!1)});var hw=/[\-:]([a-z])/g;function pw(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(hw,pw);bn[t]=new Vn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(hw,pw);bn[t]=new Vn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(hw,pw);bn[t]=new Vn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){bn[e]=new Vn(e,1,!1,e.toLowerCase(),null,!1,!1)});bn.xlinkHref=new Vn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){bn[e]=new Vn(e,1,!1,e.toLowerCase(),null,!0,!0)});function mw(e,t,n,r){var o=bn.hasOwnProperty(t)?bn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(rD(t,n,o,r)&&(n=null),r||o===null?tD(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Oi=B$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Jf=Symbol.for("react.element"),vl=Symbol.for("react.portal"),yl=Symbol.for("react.fragment"),gw=Symbol.for("react.strict_mode"),J0=Symbol.for("react.profiler"),U$=Symbol.for("react.provider"),V$=Symbol.for("react.context"),vw=Symbol.for("react.forward_ref"),ey=Symbol.for("react.suspense"),ty=Symbol.for("react.suspense_list"),yw=Symbol.for("react.memo"),ns=Symbol.for("react.lazy"),W$=Symbol.for("react.offscreen"),J_=Symbol.iterator;function eu(e){return e===null||typeof e!="object"?null:(e=J_&&e[J_]||e["@@iterator"],typeof e=="function"?e:null)}var Ft=Object.assign,Kv;function vu(e){if(Kv===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kv=t&&t[1]||""}return`
`+Kv+e}var Gv=!1;function Yv(e,t){if(!e||Gv)return"";Gv=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var r=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){r=f}e.call(t.prototype)}else{try{throw Error()}catch(f){r=f}e()}}catch(f){if(f&&r&&typeof f.stack=="string"){for(var o=f.stack.split(`
`),i=r.stack.split(`
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var u=`
`+o[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{Gv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?vu(e):""}function oD(e){switch(e.tag){case 5:return vu(e.type);case 16:return vu("Lazy");case 13:return vu("Suspense");case 19:return vu("SuspenseList");case 0:case 2:case 15:return e=Yv(e.type,!1),e;case 11:return e=Yv(e.type.render,!1),e;case 1:return e=Yv(e.type,!0),e;default:return""}}function ny(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case yl:return"Fragment";case vl:return"Portal";case J0:return"Profiler";case gw:return"StrictMode";case ey:return"Suspense";case ty:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case V$:return(e.displayName||"Context")+".Consumer";case U$:return(e._context.displayName||"Context")+".Provider";case vw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yw:return t=e.displayName||null,t!==null?t:ny(e.type)||"Memo";case ns:t=e._payload,e=e._init;try{return ny(e(t))}catch{}}return null}function iD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ny(t);case 8:return t===gw?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function As(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function H$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sD(e){var t=H$(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function eh(e){e._valueTracker||(e._valueTracker=sD(e))}function K$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=H$(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function hp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ry(e,t){var n=t.checked;return Ft({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function eE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=As(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function G$(e,t){t=t.checked,t!=null&&mw(e,"checked",t,!1)}function oy(e,t){G$(e,t);var n=As(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?iy(e,t.type,n):t.hasOwnProperty("defaultValue")&&iy(e,t.type,As(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function tE(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function iy(e,t,n){(t!=="number"||hp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var yu=Array.isArray;function Tl(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+As(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function sy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(de(91));return Ft({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function nE(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(de(92));if(yu(n)){if(1<n.length)throw Error(de(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:As(n)}}function Y$(e,t){var n=As(t.value),r=As(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function rE(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function X$(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ay(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?X$(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var th,Z$=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(th=th||document.createElement("div"),th.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=th.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},aD=["Webkit","ms","Moz","O"];Object.keys(Cu).forEach(function(e){aD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cu[t]=Cu[e]})});function q$(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cu.hasOwnProperty(e)&&Cu[e]?(""+t).trim():t+"px"}function Q$(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=q$(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var lD=Ft({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ly(e,t){if(t){if(lD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(de(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(de(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(de(61))}if(t.style!=null&&typeof t.style!="object")throw Error(de(62))}}function cy(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var uy=null;function ww(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dy=null,Al=null,Ml=null;function oE(e){if(e=Md(e)){if(typeof dy!="function")throw Error(de(280));var t=e.stateNode;t&&(t=_m(t),dy(e.stateNode,e.type,t))}}function J$(e){Al?Ml?Ml.push(e):Ml=[e]:Al=e}function e5(){if(Al){var e=Al,t=Ml;if(Ml=Al=null,oE(e),t)for(e=0;e<t.length;e++)oE(t[e])}}function t5(e,t){return e(t)}function n5(){}var Xv=!1;function r5(e,t,n){if(Xv)return e(t,n);Xv=!0;try{return t5(e,t,n)}finally{Xv=!1,(Al!==null||Ml!==null)&&(n5(),e5())}}function zu(e,t){var n=e.stateNode;if(n===null)return null;var r=_m(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(de(231,t,typeof n));return n}var fy=!1;if(_i)try{var tu={};Object.defineProperty(tu,"passive",{get:function(){fy=!0}}),window.addEventListener("test",tu,tu),window.removeEventListener("test",tu,tu)}catch{fy=!1}function cD(e,t,n,r,o,i,s,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(n,f)}catch(m){this.onError(m)}}var $u=!1,pp=null,mp=!1,hy=null,uD={onError:function(e){$u=!0,pp=e}};function dD(e,t,n,r,o,i,s,l,u){$u=!1,pp=null,cD.apply(uD,arguments)}function fD(e,t,n,r,o,i,s,l,u){if(dD.apply(this,arguments),$u){if($u){var f=pp;$u=!1,pp=null}else throw Error(de(198));mp||(mp=!0,hy=f)}}function Fa(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function o5(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function iE(e){if(Fa(e)!==e)throw Error(de(188))}function hD(e){var t=e.alternate;if(!t){if(t=Fa(e),t===null)throw Error(de(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return iE(o),e;if(i===r)return iE(o),t;i=i.sibling}throw Error(de(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(de(189))}}if(n.alternate!==r)throw Error(de(190))}if(n.tag!==3)throw Error(de(188));return n.stateNode.current===n?e:t}function i5(e){return e=hD(e),e!==null?s5(e):null}function s5(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=s5(e);if(t!==null)return t;e=e.sibling}return null}var a5=wr.unstable_scheduleCallback,sE=wr.unstable_cancelCallback,pD=wr.unstable_shouldYield,mD=wr.unstable_requestPaint,Gt=wr.unstable_now,gD=wr.unstable_getCurrentPriorityLevel,xw=wr.unstable_ImmediatePriority,l5=wr.unstable_UserBlockingPriority,gp=wr.unstable_NormalPriority,vD=wr.unstable_LowPriority,c5=wr.unstable_IdlePriority,wm=null,Go=null;function yD(e){if(Go&&typeof Go.onCommitFiberRoot=="function")try{Go.onCommitFiberRoot(wm,e,void 0,(e.current.flags&128)===128)}catch{}}var _o=Math.clz32?Math.clz32:bD,wD=Math.log,xD=Math.LN2;function bD(e){return e>>>=0,e===0?32:31-(wD(e)/xD|0)|0}var nh=64,rh=4194304;function wu(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=wu(l):(i&=s,i!==0&&(r=wu(i)))}else s=n&~o,s!==0?r=wu(s):i!==0&&(r=wu(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-_o(t),o=1<<n,r|=e[n],t&=~o;return r}function SD(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 _D(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-_o(i),l=1<<s,u=o[s];u===-1?(!(l&n)||l&r)&&(o[s]=SD(l,t)):u<=t&&(e.expiredLanes|=l),i&=~l}}function py(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function u5(){var e=nh;return nh<<=1,!(nh&4194240)&&(nh=64),e}function Zv(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Td(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_o(t),e[t]=n}function ED(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-_o(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function bw(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-_o(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var bt=0;function d5(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var f5,Sw,h5,p5,m5,my=!1,oh=[],xs=null,bs=null,Ss=null,Uu=new Map,Vu=new Map,os=[],CD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function aE(e,t){switch(e){case"focusin":case"focusout":xs=null;break;case"dragenter":case"dragleave":bs=null;break;case"mouseover":case"mouseout":Ss=null;break;case"pointerover":case"pointerout":Uu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vu.delete(t.pointerId)}}function nu(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Md(t),t!==null&&Sw(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function $D(e,t,n,r,o){switch(t){case"focusin":return xs=nu(xs,e,t,n,r,o),!0;case"dragenter":return bs=nu(bs,e,t,n,r,o),!0;case"mouseover":return Ss=nu(Ss,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Uu.set(i,nu(Uu.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Vu.set(i,nu(Vu.get(i)||null,e,t,n,r,o)),!0}return!1}function g5(e){var t=fa(e.target);if(t!==null){var n=Fa(t);if(n!==null){if(t=n.tag,t===13){if(t=o5(n),t!==null){e.blockedOn=t,m5(e.priority,function(){h5(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);uy=r,n.target.dispatchEvent(r),uy=null}else return t=Md(n),t!==null&&Sw(t),e.blockedOn=n,!1;t.shift()}return!0}function lE(e,t,n){jh(e)&&n.delete(t)}function RD(){my=!1,xs!==null&&jh(xs)&&(xs=null),bs!==null&&jh(bs)&&(bs=null),Ss!==null&&jh(Ss)&&(Ss=null),Uu.forEach(lE),Vu.forEach(lE)}function ru(e,t){e.blockedOn===t&&(e.blockedOn=null,my||(my=!0,wr.unstable_scheduleCallback(wr.unstable_NormalPriority,RD)))}function Wu(e){function t(o){return ru(o,e)}if(0<oh.length){ru(oh[0],e);for(var n=1;n<oh.length;n++){var r=oh[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xs!==null&&ru(xs,e),bs!==null&&ru(bs,e),Ss!==null&&ru(Ss,e),Uu.forEach(t),Vu.forEach(t),n=0;n<os.length;n++)r=os[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<os.length&&(n=os[0],n.blockedOn===null);)g5(n),n.blockedOn===null&&os.shift()}var Ol=Oi.ReactCurrentBatchConfig,yp=!0;function kD(e,t,n,r){var o=bt,i=Ol.transition;Ol.transition=null;try{bt=1,_w(e,t,n,r)}finally{bt=o,Ol.transition=i}}function PD(e,t,n,r){var o=bt,i=Ol.transition;Ol.transition=null;try{bt=4,_w(e,t,n,r)}finally{bt=o,Ol.transition=i}}function _w(e,t,n,r){if(yp){var o=gy(e,t,n,r);if(o===null)s0(e,t,r,wp,n),aE(e,r);else if($D(o,e,t,n,r))r.stopPropagation();else if(aE(e,r),t&4&&-1<CD.indexOf(e)){for(;o!==null;){var i=Md(o);if(i!==null&&f5(i),i=gy(e,t,n,r),i===null&&s0(e,t,r,wp,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else s0(e,t,r,null,n)}}var wp=null;function gy(e,t,n,r){if(wp=null,e=ww(r),e=fa(e),e!==null)if(t=Fa(e),t===null)e=null;else if(n=t.tag,n===13){if(e=o5(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return wp=e,null}function v5(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(gD()){case xw:return 1;case l5:return 4;case gp:case vD:return 16;case c5:return 536870912;default:return 16}default:return 16}}var hs=null,Ew=null,Fh=null;function y5(){if(Fh)return Fh;var e,t=Ew,n=t.length,r,o="value"in hs?hs.value:hs.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Fh=o.slice(e,1<r?1-r:void 0)}function Bh(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ih(){return!0}function cE(){return!1}function _r(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ih:cE,this.isPropagationStopped=cE,this}return Ft(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ih)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ih)},persist:function(){},isPersistent:ih}),t}var bc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cw=_r(bc),Ad=Ft({},bc,{view:0,detail:0}),TD=_r(Ad),qv,Qv,ou,xm=Ft({},Ad,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$w,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ou&&(ou&&e.type==="mousemove"?(qv=e.screenX-ou.screenX,Qv=e.screenY-ou.screenY):Qv=qv=0,ou=e),qv)},movementY:function(e){return"movementY"in e?e.movementY:Qv}}),uE=_r(xm),AD=Ft({},xm,{dataTransfer:0}),MD=_r(AD),OD=Ft({},Ad,{relatedTarget:0}),Jv=_r(OD),ND=Ft({},bc,{animationName:0,elapsedTime:0,pseudoElement:0}),DD=_r(ND),ID=Ft({},bc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),LD=_r(ID),jD=Ft({},bc,{data:0}),dE=_r(jD),FD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},zD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zD[e])?!!t[e]:!1}function $w(){return UD}var VD=Ft({},Ad,{key:function(e){if(e.key){var t=FD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?BD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$w,charCode:function(e){return e.type==="keypress"?Bh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),WD=_r(VD),HD=Ft({},xm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fE=_r(HD),KD=Ft({},Ad,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$w}),GD=_r(KD),YD=Ft({},bc,{propertyName:0,elapsedTime:0,pseudoElement:0}),XD=_r(YD),ZD=Ft({},xm,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),qD=_r(ZD),QD=[9,13,27,32],Rw=_i&&"CompositionEvent"in window,Ru=null;_i&&"documentMode"in document&&(Ru=document.documentMode);var JD=_i&&"TextEvent"in window&&!Ru,w5=_i&&(!Rw||Ru&&8<Ru&&11>=Ru),hE=" ",pE=!1;function x5(e,t){switch(e){case"keyup":return QD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b5(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wl=!1;function eI(e,t){switch(e){case"compositionend":return b5(t);case"keypress":return t.which!==32?null:(pE=!0,hE);case"textInput":return e=t.data,e===hE&&pE?null:e;default:return null}}function tI(e,t){if(wl)return e==="compositionend"||!Rw&&x5(e,t)?(e=y5(),Fh=Ew=hs=null,wl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return w5&&t.locale!=="ko"?null:t.data;default:return null}}var nI={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function mE(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!nI[e.type]:t==="textarea"}function S5(e,t,n,r){J$(r),t=xp(t,"onChange"),0<t.length&&(n=new Cw("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ku=null,Hu=null;function rI(e){O5(e,0)}function bm(e){var t=Sl(e);if(K$(t))return e}function oI(e,t){if(e==="change")return t}var _5=!1;if(_i){var e0;if(_i){var t0="oninput"in document;if(!t0){var gE=document.createElement("div");gE.setAttribute("oninput","return;"),t0=typeof gE.oninput=="function"}e0=t0}else e0=!1;_5=e0&&(!document.documentMode||9<document.documentMode)}function vE(){ku&&(ku.detachEvent("onpropertychange",E5),Hu=ku=null)}function E5(e){if(e.propertyName==="value"&&bm(Hu)){var t=[];S5(t,Hu,e,ww(e)),r5(rI,t)}}function iI(e,t,n){e==="focusin"?(vE(),ku=t,Hu=n,ku.attachEvent("onpropertychange",E5)):e==="focusout"&&vE()}function sI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bm(Hu)}function aI(e,t){if(e==="click")return bm(t)}function lI(e,t){if(e==="input"||e==="change")return bm(t)}function cI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $o=typeof Object.is=="function"?Object.is:cI;function Ku(e,t){if($o(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Q0.call(t,o)||!$o(e[o],t[o]))return!1}return!0}function yE(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wE(e,t){var n=yE(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yE(n)}}function C5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?C5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $5(){for(var e=window,t=hp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=hp(e.document)}return t}function kw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function uI(e){var t=$5(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&C5(n.ownerDocument.documentElement,n)){if(r!==null&&kw(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=wE(n,i);var s=wE(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var dI=_i&&"documentMode"in document&&11>=document.documentMode,xl=null,vy=null,Pu=null,yy=!1;function xE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yy||xl==null||xl!==hp(r)||(r=xl,"selectionStart"in r&&kw(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Pu&&Ku(Pu,r)||(Pu=r,r=xp(vy,"onSelect"),0<r.length&&(t=new Cw("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=xl)))}function sh(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var bl={animationend:sh("Animation","AnimationEnd"),animationiteration:sh("Animation","AnimationIteration"),animationstart:sh("Animation","AnimationStart"),transitionend:sh("Transition","TransitionEnd")},n0={},R5={};_i&&(R5=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function Sm(e){if(n0[e])return n0[e];if(!bl[e])return e;var t=bl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in R5)return n0[e]=t[n];return e}var k5=Sm("animationend"),P5=Sm("animationiteration"),T5=Sm("animationstart"),A5=Sm("transitionend"),M5=new Map,bE="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ls(e,t){M5.set(e,t),ja(t,[e])}for(var r0=0;r0<bE.length;r0++){var o0=bE[r0],fI=o0.toLowerCase(),hI=o0[0].toUpperCase()+o0.slice(1);Ls(fI,"on"+hI)}Ls(k5,"onAnimationEnd");Ls(P5,"onAnimationIteration");Ls(T5,"onAnimationStart");Ls("dblclick","onDoubleClick");Ls("focusin","onFocus");Ls("focusout","onBlur");Ls(A5,"onTransitionEnd");Jl("onMouseEnter",["mouseout","mouseover"]);Jl("onMouseLeave",["mouseout","mouseover"]);Jl("onPointerEnter",["pointerout","pointerover"]);Jl("onPointerLeave",["pointerout","pointerover"]);ja("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ja("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ja("onBeforeInput",["compositionend","keypress","textInput","paste"]);ja("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ja("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ja("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),pI=new Set("cancel close invalid load scroll toggle".split(" ").concat(xu));function SE(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,fD(r,t,void 0,e),e.currentTarget=null}function O5(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],u=l.instance,f=l.currentTarget;if(l=l.listener,u!==i&&o.isPropagationStopped())break e;SE(o,l,f),i=u}else for(s=0;s<r.length;s++){if(l=r[s],u=l.instance,f=l.currentTarget,l=l.listener,u!==i&&o.isPropagationStopped())break e;SE(o,l,f),i=u}}}if(mp)throw e=hy,mp=!1,hy=null,e}function Tt(e,t){var n=t[_y];n===void 0&&(n=t[_y]=new Set);var r=e+"__bubble";n.has(r)||(N5(t,e,2,!1),n.add(r))}function i0(e,t,n){var r=0;t&&(r|=4),N5(n,e,r,t)}var ah="_reactListening"+Math.random().toString(36).slice(2);function Gu(e){if(!e[ah]){e[ah]=!0,z$.forEach(function(n){n!=="selectionchange"&&(pI.has(n)||i0(n,!1,e),i0(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ah]||(t[ah]=!0,i0("selectionchange",!1,t))}}function N5(e,t,n,r){switch(v5(t)){case 1:var o=kD;break;case 4:o=PD;break;default:o=_w}n=o.bind(null,t,n,e),o=void 0,!fy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function s0(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;s=s.return}for(;l!==null;){if(s=fa(l),s===null)return;if(u=s.tag,u===5||u===6){r=i=s;continue e}l=l.parentNode}}r=r.return}r5(function(){var f=i,m=ww(n),p=[];e:{var g=M5.get(e);if(g!==void 0){var y=Cw,x=e;switch(e){case"keypress":if(Bh(n)===0)break e;case"keydown":case"keyup":y=WD;break;case"focusin":x="focus",y=Jv;break;case"focusout":x="blur",y=Jv;break;case"beforeblur":case"afterblur":y=Jv;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=uE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=MD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=GD;break;case k5:case P5:case T5:y=DD;break;case A5:y=XD;break;case"scroll":y=TD;break;case"wheel":y=qD;break;case"copy":case"cut":case"paste":y=LD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=fE}var S=(t&4)!==0,E=!S&&e==="scroll",_=S?g!==null?g+"Capture":null:g;S=[];for(var b=f,C;b!==null;){C=b;var R=C.stateNode;if(C.tag===5&&R!==null&&(C=R,_!==null&&(R=zu(b,_),R!=null&&S.push(Yu(b,R,C)))),E)break;b=b.return}0<S.length&&(g=new y(g,x,null,n,m),p.push({event:g,listeners:S}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",g&&n!==uy&&(x=n.relatedTarget||n.fromElement)&&(fa(x)||x[Ei]))break e;if((y||g)&&(g=m.window===m?m:(g=m.ownerDocument)?g.defaultView||g.parentWindow:window,y?(x=n.relatedTarget||n.toElement,y=f,x=x?fa(x):null,x!==null&&(E=Fa(x),x!==E||x.tag!==5&&x.tag!==6)&&(x=null)):(y=null,x=f),y!==x)){if(S=uE,R="onMouseLeave",_="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(S=fE,R="onPointerLeave",_="onPointerEnter",b="pointer"),E=y==null?g:Sl(y),C=x==null?g:Sl(x),g=new S(R,b+"leave",y,n,m),g.target=E,g.relatedTarget=C,R=null,fa(m)===f&&(S=new S(_,b+"enter",x,n,m),S.target=C,S.relatedTarget=E,R=S),E=R,y&&x)t:{for(S=y,_=x,b=0,C=S;C;C=il(C))b++;for(C=0,R=_;R;R=il(R))C++;for(;0<b-C;)S=il(S),b--;for(;0<C-b;)_=il(_),C--;for(;b--;){if(S===_||_!==null&&S===_.alternate)break t;S=il(S),_=il(_)}S=null}else S=null;y!==null&&_E(p,g,y,S,!1),x!==null&&E!==null&&_E(p,E,x,S,!0)}}e:{if(g=f?Sl(f):window,y=g.nodeName&&g.nodeName.toLowerCase(),y==="select"||y==="input"&&g.type==="file")var T=oI;else if(mE(g))if(_5)T=lI;else{T=sI;var N=iI}else(y=g.nodeName)&&y.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(T=aI);if(T&&(T=T(e,f))){S5(p,T,n,m);break e}N&&N(e,g,f),e==="focusout"&&(N=g._wrapperState)&&N.controlled&&g.type==="number"&&iy(g,"number",g.value)}switch(N=f?Sl(f):window,e){case"focusin":(mE(N)||N.contentEditable==="true")&&(xl=N,vy=f,Pu=null);break;case"focusout":Pu=vy=xl=null;break;case"mousedown":yy=!0;break;case"contextmenu":case"mouseup":case"dragend":yy=!1,xE(p,n,m);break;case"selectionchange":if(dI)break;case"keydown":case"keyup":xE(p,n,m)}var A;if(Rw)e:{switch(e){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else wl?x5(e,n)&&(O="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(O="onCompositionStart");O&&(w5&&n.locale!=="ko"&&(wl||O!=="onCompositionStart"?O==="onCompositionEnd"&&wl&&(A=y5()):(hs=m,Ew="value"in hs?hs.value:hs.textContent,wl=!0)),N=xp(f,O),0<N.length&&(O=new dE(O,e,null,n,m),p.push({event:O,listeners:N}),A?O.data=A:(A=b5(n),A!==null&&(O.data=A)))),(A=JD?eI(e,n):tI(e,n))&&(f=xp(f,"onBeforeInput"),0<f.length&&(m=new dE("onBeforeInput","beforeinput",null,n,m),p.push({event:m,listeners:f}),m.data=A))}O5(p,t)})}function Yu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xp(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=zu(e,n),i!=null&&r.unshift(Yu(e,i,o)),i=zu(e,t),i!=null&&r.push(Yu(e,i,o))),e=e.return}return r}function il(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _E(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,u=l.alternate,f=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&f!==null&&(l=f,o?(u=zu(n,i),u!=null&&s.unshift(Yu(n,u,l))):o||(u=zu(n,i),u!=null&&s.push(Yu(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var mI=/\r\n?/g,gI=/\u0000|\uFFFD/g;function EE(e){return(typeof e=="string"?e:""+e).replace(mI,`
`).replace(gI,"")}function lh(e,t,n){if(t=EE(t),EE(e)!==t&&n)throw Error(de(425))}function bp(){}var wy=null,xy=null;function by(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sy=typeof setTimeout=="function"?setTimeout:void 0,vI=typeof clearTimeout=="function"?clearTimeout:void 0,CE=typeof Promise=="function"?Promise:void 0,yI=typeof queueMicrotask=="function"?queueMicrotask:typeof CE<"u"?function(e){return CE.resolve(null).then(e).catch(wI)}:Sy;function wI(e){setTimeout(function(){throw e})}function a0(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Wu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Wu(t)}function _s(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $E(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Sc=Math.random().toString(36).slice(2),Fo="__reactFiber$"+Sc,Xu="__reactProps$"+Sc,Ei="__reactContainer$"+Sc,_y="__reactEvents$"+Sc,xI="__reactListeners$"+Sc,bI="__reactHandles$"+Sc;function fa(e){var t=e[Fo];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ei]||n[Fo]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$E(e);e!==null;){if(n=e[Fo])return n;e=$E(e)}return t}e=n,n=e.parentNode}return null}function Md(e){return e=e[Fo]||e[Ei],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Sl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(de(33))}function _m(e){return e[Xu]||null}var Ey=[],_l=-1;function js(e){return{current:e}}function At(e){0>_l||(e.current=Ey[_l],Ey[_l]=null,_l--)}function Rt(e,t){_l++,Ey[_l]=e.current,e.current=t}var Ms={},Pn=js(Ms),Qn=js(!1),Pa=Ms;function ec(e,t){var n=e.type.contextTypes;if(!n)return Ms;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Jn(e){return e=e.childContextTypes,e!=null}function Sp(){At(Qn),At(Pn)}function RE(e,t,n){if(Pn.current!==Ms)throw Error(de(168));Rt(Pn,t),Rt(Qn,n)}function D5(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(de(108,iD(e)||"Unknown",o));return Ft({},n,r)}function _p(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ms,Pa=Pn.current,Rt(Pn,e),Rt(Qn,Qn.current),!0}function kE(e,t,n){var r=e.stateNode;if(!r)throw Error(de(169));n?(e=D5(e,t,Pa),r.__reactInternalMemoizedMergedChildContext=e,At(Qn),At(Pn),Rt(Pn,e)):At(Qn),Rt(Qn,n)}var vi=null,Em=!1,l0=!1;function I5(e){vi===null?vi=[e]:vi.push(e)}function SI(e){Em=!0,I5(e)}function Fs(){if(!l0&&vi!==null){l0=!0;var e=0,t=bt;try{var n=vi;for(bt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vi=null,Em=!1}catch(o){throw vi!==null&&(vi=vi.slice(e+1)),a5(xw,Fs),o}finally{bt=t,l0=!1}}return null}var El=[],Cl=0,Ep=null,Cp=0,Ur=[],Vr=0,Ta=null,yi=1,wi="";function ra(e,t){El[Cl++]=Cp,El[Cl++]=Ep,Ep=e,Cp=t}function L5(e,t,n){Ur[Vr++]=yi,Ur[Vr++]=wi,Ur[Vr++]=Ta,Ta=e;var r=yi;e=wi;var o=32-_o(r)-1;r&=~(1<<o),n+=1;var i=32-_o(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,yi=1<<32-_o(t)+o|n<<o|r,wi=i+e}else yi=1<<i|n<<o|r,wi=e}function Pw(e){e.return!==null&&(ra(e,1),L5(e,1,0))}function Tw(e){for(;e===Ep;)Ep=El[--Cl],El[Cl]=null,Cp=El[--Cl],El[Cl]=null;for(;e===Ta;)Ta=Ur[--Vr],Ur[Vr]=null,wi=Ur[--Vr],Ur[Vr]=null,yi=Ur[--Vr],Ur[Vr]=null}var vr=null,gr=null,Nt=!1,yo=null;function j5(e,t){var n=Yr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function PE(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,vr=e,gr=_s(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,vr=e,gr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ta!==null?{id:yi,overflow:wi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Yr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,vr=e,gr=null,!0):!1;default:return!1}}function Cy(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $y(e){if(Nt){var t=gr;if(t){var n=t;if(!PE(e,t)){if(Cy(e))throw Error(de(418));t=_s(n.nextSibling);var r=vr;t&&PE(e,t)?j5(r,n):(e.flags=e.flags&-4097|2,Nt=!1,vr=e)}}else{if(Cy(e))throw Error(de(418));e.flags=e.flags&-4097|2,Nt=!1,vr=e}}}function TE(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;vr=e}function ch(e){if(e!==vr)return!1;if(!Nt)return TE(e),Nt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!by(e.type,e.memoizedProps)),t&&(t=gr)){if(Cy(e))throw F5(),Error(de(418));for(;t;)j5(e,t),t=_s(t.nextSibling)}if(TE(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(de(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){gr=_s(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}gr=null}}else gr=vr?_s(e.stateNode.nextSibling):null;return!0}function F5(){for(var e=gr;e;)e=_s(e.nextSibling)}function tc(){gr=vr=null,Nt=!1}function Aw(e){yo===null?yo=[e]:yo.push(e)}var _I=Oi.ReactCurrentBatchConfig;function ho(e,t){if(e&&e.defaultProps){t=Ft({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var $p=js(null),Rp=null,$l=null,Mw=null;function Ow(){Mw=$l=Rp=null}function Nw(e){var t=$p.current;At($p),e._currentValue=t}function Ry(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nl(e,t){Rp=e,Mw=$l=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qn=!0),e.firstContext=null)}function Jr(e){var t=e._currentValue;if(Mw!==e)if(e={context:e,memoizedValue:t,next:null},$l===null){if(Rp===null)throw Error(de(308));$l=e,Rp.dependencies={lanes:0,firstContext:e}}else $l=$l.next=e;return t}var ha=null;function Dw(e){ha===null?ha=[e]:ha.push(e)}function B5(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Dw(t)):(n.next=o.next,o.next=n),t.interleaved=n,Ci(e,r)}function Ci(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rs=!1;function Iw(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function z5(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Es(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ft&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Ci(e,n)}return o=r.interleaved,o===null?(t.next=t,Dw(r)):(t.next=o.next,o.next=t),r.interleaved=t,Ci(e,n)}function zh(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bw(e,n)}}function AE(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function kp(e,t,n,r){var o=e.updateQueue;rs=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var u=l,f=u.next;u.next=null,s===null?i=f:s.next=f,s=u;var m=e.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==s&&(l===null?m.firstBaseUpdate=f:l.next=f,m.lastBaseUpdate=u))}if(i!==null){var p=o.baseState;s=0,m=f=u=null,l=i;do{var g=l.lane,y=l.eventTime;if((r&g)===g){m!==null&&(m=m.next={eventTime:y,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,S=l;switch(g=t,y=n,S.tag){case 1:if(x=S.payload,typeof x=="function"){p=x.call(y,p,g);break e}p=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=S.payload,g=typeof x=="function"?x.call(y,p,g):x,g==null)break e;p=Ft({},p,g);break e;case 2:rs=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,g=o.effects,g===null?o.effects=[l]:g.push(l))}else y={eventTime:y,lane:g,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(f=m=y,u=p):m=m.next=y,s|=g;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;g=l,l=g.next,g.next=null,o.lastBaseUpdate=g,o.shared.pending=null}}while(!0);if(m===null&&(u=p),o.baseState=u,o.firstBaseUpdate=f,o.lastBaseUpdate=m,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Ma|=s,e.lanes=s,e.memoizedState=p}}function ME(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(de(191,o));o.call(r)}}}var U5=new B$.Component().refs;function ky(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ft({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cm={isMounted:function(e){return(e=e._reactInternals)?Fa(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Bn(),o=$s(e),i=bi(r,o);i.payload=t,n!=null&&(i.callback=n),t=Es(e,i,o),t!==null&&(Eo(t,e,o,r),zh(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Bn(),o=$s(e),i=bi(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Es(e,i,o),t!==null&&(Eo(t,e,o,r),zh(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Bn(),r=$s(e),o=bi(n,r);o.tag=2,t!=null&&(o.callback=t),t=Es(e,o,r),t!==null&&(Eo(t,e,r,n),zh(t,e,r))}};function OE(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Ku(n,r)||!Ku(o,i):!0}function V5(e,t,n){var r=!1,o=Ms,i=t.contextType;return typeof i=="object"&&i!==null?i=Jr(i):(o=Jn(t)?Pa:Pn.current,r=t.contextTypes,i=(r=r!=null)?ec(e,o):Ms),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Cm,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function NE(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Cm.enqueueReplaceState(t,t.state,null)}function Py(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=U5,Iw(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Jr(i):(i=Jn(t)?Pa:Pn.current,o.context=ec(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ky(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Cm.enqueueReplaceState(o,o.state,null),kp(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function iu(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(de(309));var r=n.stateNode}if(!r)throw Error(de(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;l===U5&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(de(284));if(!n._owner)throw Error(de(290,e))}return e}function uh(e,t){throw e=Object.prototype.toString.call(t),Error(de(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function DE(e){var t=e._init;return t(e._payload)}function W5(e){function t(_,b){if(e){var C=_.deletions;C===null?(_.deletions=[b],_.flags|=16):C.push(b)}}function n(_,b){if(!e)return null;for(;b!==null;)t(_,b),b=b.sibling;return null}function r(_,b){for(_=new Map;b!==null;)b.key!==null?_.set(b.key,b):_.set(b.index,b),b=b.sibling;return _}function o(_,b){return _=Rs(_,b),_.index=0,_.sibling=null,_}function i(_,b,C){return _.index=C,e?(C=_.alternate,C!==null?(C=C.index,C<b?(_.flags|=2,b):C):(_.flags|=2,b)):(_.flags|=1048576,b)}function s(_){return e&&_.alternate===null&&(_.flags|=2),_}function l(_,b,C,R){return b===null||b.tag!==6?(b=m0(C,_.mode,R),b.return=_,b):(b=o(b,C),b.return=_,b)}function u(_,b,C,R){var T=C.type;return T===yl?m(_,b,C.props.children,R,C.key):b!==null&&(b.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===ns&&DE(T)===b.type)?(R=o(b,C.props),R.ref=iu(_,b,C),R.return=_,R):(R=Gh(C.type,C.key,C.props,null,_.mode,R),R.ref=iu(_,b,C),R.return=_,R)}function f(_,b,C,R){return b===null||b.tag!==4||b.stateNode.containerInfo!==C.containerInfo||b.stateNode.implementation!==C.implementation?(b=g0(C,_.mode,R),b.return=_,b):(b=o(b,C.children||[]),b.return=_,b)}function m(_,b,C,R,T){return b===null||b.tag!==7?(b=ka(C,_.mode,R,T),b.return=_,b):(b=o(b,C),b.return=_,b)}function p(_,b,C){if(typeof b=="string"&&b!==""||typeof b=="number")return b=m0(""+b,_.mode,C),b.return=_,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Jf:return C=Gh(b.type,b.key,b.props,null,_.mode,C),C.ref=iu(_,null,b),C.return=_,C;case vl:return b=g0(b,_.mode,C),b.return=_,b;case ns:var R=b._init;return p(_,R(b._payload),C)}if(yu(b)||eu(b))return b=ka(b,_.mode,C,null),b.return=_,b;uh(_,b)}return null}function g(_,b,C,R){var T=b!==null?b.key:null;if(typeof C=="string"&&C!==""||typeof C=="number")return T!==null?null:l(_,b,""+C,R);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Jf:return C.key===T?u(_,b,C,R):null;case vl:return C.key===T?f(_,b,C,R):null;case ns:return T=C._init,g(_,b,T(C._payload),R)}if(yu(C)||eu(C))return T!==null?null:m(_,b,C,R,null);uh(_,C)}return null}function y(_,b,C,R,T){if(typeof R=="string"&&R!==""||typeof R=="number")return _=_.get(C)||null,l(b,_,""+R,T);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case Jf:return _=_.get(R.key===null?C:R.key)||null,u(b,_,R,T);case vl:return _=_.get(R.key===null?C:R.key)||null,f(b,_,R,T);case ns:var N=R._init;return y(_,b,C,N(R._payload),T)}if(yu(R)||eu(R))return _=_.get(C)||null,m(b,_,R,T,null);uh(b,R)}return null}function x(_,b,C,R){for(var T=null,N=null,A=b,O=b=0,U=null;A!==null&&O<C.length;O++){A.index>O?(U=A,A=null):U=A.sibling;var z=g(_,A,C[O],R);if(z===null){A===null&&(A=U);break}e&&A&&z.alternate===null&&t(_,A),b=i(z,b,O),N===null?T=z:N.sibling=z,N=z,A=U}if(O===C.length)return n(_,A),Nt&&ra(_,O),T;if(A===null){for(;O<C.length;O++)A=p(_,C[O],R),A!==null&&(b=i(A,b,O),N===null?T=A:N.sibling=A,N=A);return Nt&&ra(_,O),T}for(A=r(_,A);O<C.length;O++)U=y(A,_,O,C[O],R),U!==null&&(e&&U.alternate!==null&&A.delete(U.key===null?O:U.key),b=i(U,b,O),N===null?T=U:N.sibling=U,N=U);return e&&A.forEach(function(ie){return t(_,ie)}),Nt&&ra(_,O),T}function S(_,b,C,R){var T=eu(C);if(typeof T!="function")throw Error(de(150));if(C=T.call(C),C==null)throw Error(de(151));for(var N=T=null,A=b,O=b=0,U=null,z=C.next();A!==null&&!z.done;O++,z=C.next()){A.index>O?(U=A,A=null):U=A.sibling;var ie=g(_,A,z.value,R);if(ie===null){A===null&&(A=U);break}e&&A&&ie.alternate===null&&t(_,A),b=i(ie,b,O),N===null?T=ie:N.sibling=ie,N=ie,A=U}if(z.done)return n(_,A),Nt&&ra(_,O),T;if(A===null){for(;!z.done;O++,z=C.next())z=p(_,z.value,R),z!==null&&(b=i(z,b,O),N===null?T=z:N.sibling=z,N=z);return Nt&&ra(_,O),T}for(A=r(_,A);!z.done;O++,z=C.next())z=y(A,_,O,z.value,R),z!==null&&(e&&z.alternate!==null&&A.delete(z.key===null?O:z.key),b=i(z,b,O),N===null?T=z:N.sibling=z,N=z);return e&&A.forEach(function(K){return t(_,K)}),Nt&&ra(_,O),T}function E(_,b,C,R){if(typeof C=="object"&&C!==null&&C.type===yl&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Jf:e:{for(var T=C.key,N=b;N!==null;){if(N.key===T){if(T=C.type,T===yl){if(N.tag===7){n(_,N.sibling),b=o(N,C.props.children),b.return=_,_=b;break e}}else if(N.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===ns&&DE(T)===N.type){n(_,N.sibling),b=o(N,C.props),b.ref=iu(_,N,C),b.return=_,_=b;break e}n(_,N);break}else t(_,N);N=N.sibling}C.type===yl?(b=ka(C.props.children,_.mode,R,C.key),b.return=_,_=b):(R=Gh(C.type,C.key,C.props,null,_.mode,R),R.ref=iu(_,b,C),R.return=_,_=R)}return s(_);case vl:e:{for(N=C.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===C.containerInfo&&b.stateNode.implementation===C.implementation){n(_,b.sibling),b=o(b,C.children||[]),b.return=_,_=b;break e}else{n(_,b);break}else t(_,b);b=b.sibling}b=g0(C,_.mode,R),b.return=_,_=b}return s(_);case ns:return N=C._init,E(_,b,N(C._payload),R)}if(yu(C))return x(_,b,C,R);if(eu(C))return S(_,b,C,R);uh(_,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,b!==null&&b.tag===6?(n(_,b.sibling),b=o(b,C),b.return=_,_=b):(n(_,b),b=m0(C,_.mode,R),b.return=_,_=b),s(_)):n(_,b)}return E}var nc=W5(!0),H5=W5(!1),Od={},Yo=js(Od),Zu=js(Od),qu=js(Od);function pa(e){if(e===Od)throw Error(de(174));return e}function Lw(e,t){switch(Rt(qu,t),Rt(Zu,e),Rt(Yo,Od),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ay(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ay(t,e)}At(Yo),Rt(Yo,t)}function rc(){At(Yo),At(Zu),At(qu)}function K5(e){pa(qu.current);var t=pa(Yo.current),n=ay(t,e.type);t!==n&&(Rt(Zu,e),Rt(Yo,n))}function jw(e){Zu.current===e&&(At(Yo),At(Zu))}var It=js(0);function Pp(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var c0=[];function Fw(){for(var e=0;e<c0.length;e++)c0[e]._workInProgressVersionPrimary=null;c0.length=0}var Uh=Oi.ReactCurrentDispatcher,u0=Oi.ReactCurrentBatchConfig,Aa=0,jt=null,on=null,dn=null,Tp=!1,Tu=!1,Qu=0,EI=0;function Cn(){throw Error(de(321))}function Bw(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!$o(e[n],t[n]))return!1;return!0}function zw(e,t,n,r,o,i){if(Aa=i,jt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Uh.current=e===null||e.memoizedState===null?kI:PI,e=n(r,o),Tu){i=0;do{if(Tu=!1,Qu=0,25<=i)throw Error(de(301));i+=1,dn=on=null,t.updateQueue=null,Uh.current=TI,e=n(r,o)}while(Tu)}if(Uh.current=Ap,t=on!==null&&on.next!==null,Aa=0,dn=on=jt=null,Tp=!1,t)throw Error(de(300));return e}function Uw(){var e=Qu!==0;return Qu=0,e}function Oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?jt.memoizedState=dn=e:dn=dn.next=e,dn}function eo(){if(on===null){var e=jt.alternate;e=e!==null?e.memoizedState:null}else e=on.next;var t=dn===null?jt.memoizedState:dn.next;if(t!==null)dn=t,on=e;else{if(e===null)throw Error(de(310));on=e,e={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},dn===null?jt.memoizedState=dn=e:dn=dn.next=e}return dn}function Ju(e,t){return typeof t=="function"?t(e):t}function d0(e){var t=eo(),n=t.queue;if(n===null)throw Error(de(311));n.lastRenderedReducer=e;var r=on,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,u=null,f=i;do{var m=f.lane;if((Aa&m)===m)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),r=f.hasEagerState?f.eagerState:e(r,f.action);else{var p={lane:m,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=p,s=r):u=u.next=p,jt.lanes|=m,Ma|=m}f=f.next}while(f!==null&&f!==i);u===null?s=r:u.next=l,$o(r,t.memoizedState)||(qn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,jt.lanes|=i,Ma|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function f0(e){var t=eo(),n=t.queue;if(n===null)throw Error(de(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);$o(i,t.memoizedState)||(qn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function G5(){}function Y5(e,t){var n=jt,r=eo(),o=t(),i=!$o(r.memoizedState,o);if(i&&(r.memoizedState=o,qn=!0),r=r.queue,Vw(q5.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||dn!==null&&dn.memoizedState.tag&1){if(n.flags|=2048,ed(9,Z5.bind(null,n,r,o,t),void 0,null),fn===null)throw Error(de(349));Aa&30||X5(n,t,o)}return o}function X5(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Z5(e,t,n,r){t.value=n,t.getSnapshot=r,Q5(t)&&J5(e)}function q5(e,t,n){return n(function(){Q5(t)&&J5(e)})}function Q5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$o(e,n)}catch{return!0}}function J5(e){var t=Ci(e,1);t!==null&&Eo(t,e,1,-1)}function IE(e){var t=Oo();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ju,lastRenderedState:e},t.queue=e,e=e.dispatch=RI.bind(null,jt,e),[t.memoizedState,e]}function ed(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function eR(){return eo().memoizedState}function Vh(e,t,n,r){var o=Oo();jt.flags|=e,o.memoizedState=ed(1|t,n,void 0,r===void 0?null:r)}function $m(e,t,n,r){var o=eo();r=r===void 0?null:r;var i=void 0;if(on!==null){var s=on.memoizedState;if(i=s.destroy,r!==null&&Bw(r,s.deps)){o.memoizedState=ed(t,n,i,r);return}}jt.flags|=e,o.memoizedState=ed(1|t,n,i,r)}function LE(e,t){return Vh(8390656,8,e,t)}function Vw(e,t){return $m(2048,8,e,t)}function tR(e,t){return $m(4,2,e,t)}function nR(e,t){return $m(4,4,e,t)}function rR(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function oR(e,t,n){return n=n!=null?n.concat([e]):null,$m(4,4,rR.bind(null,t,e),n)}function Ww(){}function iR(e,t){var n=eo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bw(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function sR(e,t){var n=eo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bw(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function aR(e,t,n){return Aa&21?($o(n,t)||(n=u5(),jt.lanes|=n,Ma|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qn=!0),e.memoizedState=n)}function CI(e,t){var n=bt;bt=n!==0&&4>n?n:4,e(!0);var r=u0.transition;u0.transition={};try{e(!1),t()}finally{bt=n,u0.transition=r}}function lR(){return eo().memoizedState}function $I(e,t,n){var r=$s(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cR(e))uR(t,n);else if(n=B5(e,t,n,r),n!==null){var o=Bn();Eo(n,e,r,o),dR(n,t,r)}}function RI(e,t,n){var r=$s(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cR(e))uR(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,$o(l,s)){var u=t.interleaved;u===null?(o.next=o,Dw(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=B5(e,t,o,r),n!==null&&(o=Bn(),Eo(n,e,r,o),dR(n,t,r))}}function cR(e){var t=e.alternate;return e===jt||t!==null&&t===jt}function uR(e,t){Tu=Tp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dR(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bw(e,n)}}var Ap={readContext:Jr,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useInsertionEffect:Cn,useLayoutEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useMutableSource:Cn,useSyncExternalStore:Cn,useId:Cn,unstable_isNewReconciler:!1},kI={readContext:Jr,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:Jr,useEffect:LE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Vh(4194308,4,rR.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vh(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vh(4,2,e,t)},useMemo:function(e,t){var n=Oo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Oo();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=$I.bind(null,jt,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:IE,useDebugValue:Ww,useDeferredValue:function(e){return Oo().memoizedState=e},useTransition:function(){var e=IE(!1),t=e[0];return e=CI.bind(null,e[1]),Oo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=jt,o=Oo();if(Nt){if(n===void 0)throw Error(de(407));n=n()}else{if(n=t(),fn===null)throw Error(de(349));Aa&30||X5(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,LE(q5.bind(null,r,i,e),[e]),r.flags|=2048,ed(9,Z5.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Oo(),t=fn.identifierPrefix;if(Nt){var n=wi,r=yi;n=(r&~(1<<32-_o(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Qu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=EI++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},PI={readContext:Jr,useCallback:iR,useContext:Jr,useEffect:Vw,useImperativeHandle:oR,useInsertionEffect:tR,useLayoutEffect:nR,useMemo:sR,useReducer:d0,useRef:eR,useState:function(){return d0(Ju)},useDebugValue:Ww,useDeferredValue:function(e){var t=eo();return aR(t,on.memoizedState,e)},useTransition:function(){var e=d0(Ju)[0],t=eo().memoizedState;return[e,t]},useMutableSource:G5,useSyncExternalStore:Y5,useId:lR,unstable_isNewReconciler:!1},TI={readContext:Jr,useCallback:iR,useContext:Jr,useEffect:Vw,useImperativeHandle:oR,useInsertionEffect:tR,useLayoutEffect:nR,useMemo:sR,useReducer:f0,useRef:eR,useState:function(){return f0(Ju)},useDebugValue:Ww,useDeferredValue:function(e){var t=eo();return on===null?t.memoizedState=e:aR(t,on.memoizedState,e)},useTransition:function(){var e=f0(Ju)[0],t=eo().memoizedState;return[e,t]},useMutableSource:G5,useSyncExternalStore:Y5,useId:lR,unstable_isNewReconciler:!1};function oc(e,t){try{var n="",r=t;do n+=oD(r),r=r.return;while(r);var o=n}catch(i){o=`
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function h0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ty(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var AI=typeof WeakMap=="function"?WeakMap:Map;function fR(e,t,n){n=bi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Op||(Op=!0,By=r),Ty(e,t)},n}function hR(e,t,n){n=bi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Ty(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ty(e,t),typeof r!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function jE(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new AI;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=HI.bind(null,e,t,n),t.then(e,e))}function FE(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function BE(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=bi(-1,1),t.tag=2,Es(n,t,1))),n.lanes|=1),e)}var MI=Oi.ReactCurrentOwner,qn=!1;function Ln(e,t,n,r){t.child=e===null?H5(t,null,n,r):nc(t,e.child,n,r)}function zE(e,t,n,r,o){n=n.render;var i=t.ref;return Nl(t,o),r=zw(e,t,n,r,i,o),n=Uw(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,$i(e,t,o)):(Nt&&n&&Pw(t),t.flags|=1,Ln(e,t,r,o),t.child)}function UE(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Qw(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,pR(e,t,i,r,o)):(e=Gh(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ku,n(s,r)&&e.ref===t.ref)return $i(e,t,o)}return t.flags|=1,e=Rs(i,r),e.ref=t.ref,e.return=t,t.child=e}function pR(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Ku(i,r)&&e.ref===t.ref)if(qn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(qn=!0);else return t.lanes=e.lanes,$i(e,t,o)}return Ay(e,t,n,r,o)}function mR(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rt(kl,hr),hr|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Rt(kl,hr),hr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Rt(kl,hr),hr|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Rt(kl,hr),hr|=r;return Ln(e,t,o,n),t.child}function gR(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ay(e,t,n,r,o){var i=Jn(n)?Pa:Pn.current;return i=ec(t,i),Nl(t,o),n=zw(e,t,n,r,i,o),r=Uw(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,$i(e,t,o)):(Nt&&r&&Pw(t),t.flags|=1,Ln(e,t,n,o),t.child)}function VE(e,t,n,r,o){if(Jn(n)){var i=!0;_p(t)}else i=!1;if(Nl(t,o),t.stateNode===null)Wh(e,t),V5(t,n,r),Py(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var u=s.context,f=n.contextType;typeof f=="object"&&f!==null?f=Jr(f):(f=Jn(n)?Pa:Pn.current,f=ec(t,f));var m=n.getDerivedStateFromProps,p=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||u!==f)&&NE(t,s,r,f),rs=!1;var g=t.memoizedState;s.state=g,kp(t,r,s,o),u=t.memoizedState,l!==r||g!==u||Qn.current||rs?(typeof m=="function"&&(ky(t,n,m,r),u=t.memoizedState),(l=rs||OE(t,n,l,r,g,u,f))?(p||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=f,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,z5(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:ho(t.type,l),s.props=f,p=t.pendingProps,g=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=Jr(u):(u=Jn(n)?Pa:Pn.current,u=ec(t,u));var y=n.getDerivedStateFromProps;(m=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==p||g!==u)&&NE(t,s,r,u),rs=!1,g=t.memoizedState,s.state=g,kp(t,r,s,o);var x=t.memoizedState;l!==p||g!==x||Qn.current||rs?(typeof y=="function"&&(ky(t,n,y,r),x=t.memoizedState),(f=rs||OE(t,n,f,r,g,x,u)||!1)?(m||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),s.props=r,s.state=x,s.context=u,r=f):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return My(e,t,n,r,i,o)}function My(e,t,n,r,o,i){gR(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&kE(t,n,!1),$i(e,t,i);r=t.stateNode,MI.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=nc(t,e.child,null,i),t.child=nc(t,null,l,i)):Ln(e,t,l,i),t.memoizedState=r.state,o&&kE(t,n,!0),t.child}function vR(e){var t=e.stateNode;t.pendingContext?RE(e,t.pendingContext,t.pendingContext!==t.context):t.context&&RE(e,t.context,!1),Lw(e,t.containerInfo)}function WE(e,t,n,r,o){return tc(),Aw(o),t.flags|=256,Ln(e,t,n,r),t.child}var Oy={dehydrated:null,treeContext:null,retryLane:0};function Ny(e){return{baseLanes:e,cachePool:null,transitions:null}}function yR(e,t,n){var r=t.pendingProps,o=It.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Rt(It,o&1),e===null)return $y(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Pm(s,r,0,null),e=ka(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Ny(n),t.memoizedState=Oy,e):Hw(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return OI(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Rs(o,u),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Rs(l,i):(i=ka(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Ny(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Oy,r}return i=e.child,e=i.sibling,r=Rs(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Hw(e,t){return t=Pm({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function dh(e,t,n,r){return r!==null&&Aw(r),nc(t,e.child,null,n),e=Hw(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function OI(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=h0(Error(de(422))),dh(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Pm({mode:"visible",children:r.children},o,0,null),i=ka(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&nc(t,e.child,null,s),t.child.memoizedState=Ny(s),t.memoizedState=Oy,i);if(!(t.mode&1))return dh(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(de(419)),r=h0(i,r,void 0),dh(e,t,s,r)}if(l=(s&e.childLanes)!==0,qn||l){if(r=fn,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Ci(e,o),Eo(r,e,o,-1))}return qw(),r=h0(Error(de(421))),dh(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=KI.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,gr=_s(o.nextSibling),vr=t,Nt=!0,yo=null,e!==null&&(Ur[Vr++]=yi,Ur[Vr++]=wi,Ur[Vr++]=Ta,yi=e.id,wi=e.overflow,Ta=t),t=Hw(t,r.children),t.flags|=4096,t)}function HE(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ry(e.return,t,n)}function p0(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function wR(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ln(e,t,r.children,n),r=It.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&HE(e,n,t);else if(e.tag===19)HE(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Rt(It,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Pp(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),p0(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Pp(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}p0(t,!0,n,null,i);break;case"together":p0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wh(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function $i(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ma|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(de(153));if(t.child!==null){for(e=t.child,n=Rs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Rs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function NI(e,t,n){switch(t.tag){case 3:vR(t),tc();break;case 5:K5(t);break;case 1:Jn(t.type)&&_p(t);break;case 4:Lw(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Rt($p,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Rt(It,It.current&1),t.flags|=128,null):n&t.child.childLanes?yR(e,t,n):(Rt(It,It.current&1),e=$i(e,t,n),e!==null?e.sibling:null);Rt(It,It.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return wR(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Rt(It,It.current),r)break;return null;case 22:case 23:return t.lanes=0,mR(e,t,n)}return $i(e,t,n)}var xR,Dy,bR,SR;xR=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Dy=function(){};bR=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,pa(Yo.current);var i=null;switch(n){case"input":o=ry(e,o),r=ry(e,r),i=[];break;case"select":o=Ft({},o,{value:void 0}),r=Ft({},r,{value:void 0}),i=[];break;case"textarea":o=sy(e,o),r=sy(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=bp)}ly(n,r);var s;n=null;for(f in o)if(!r.hasOwnProperty(f)&&o.hasOwnProperty(f)&&o[f]!=null)if(f==="style"){var l=o[f];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Fu.hasOwnProperty(f)?i||(i=[]):(i=i||[]).push(f,null));for(f in r){var u=r[f];if(l=o!=null?o[f]:void 0,r.hasOwnProperty(f)&&u!==l&&(u!=null||l!=null))if(f==="style")if(l){for(s in l)!l.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&l[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(i||(i=[]),i.push(f,n)),n=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(i=i||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(i=i||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Fu.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&Tt("scroll",e),i||l===u||(i=[])):(i=i||[]).push(f,u))}n&&(i=i||[]).push("style",n);var f=i;(t.updateQueue=f)&&(t.flags|=4)}};SR=function(e,t,n,r){n!==r&&(t.flags|=4)};function su(e,t){if(!Nt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $n(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function DI(e,t,n){var r=t.pendingProps;switch(Tw(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $n(t),null;case 1:return Jn(t.type)&&Sp(),$n(t),null;case 3:return r=t.stateNode,rc(),At(Qn),At(Pn),Fw(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ch(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,yo!==null&&(Vy(yo),yo=null))),Dy(e,t),$n(t),null;case 5:jw(t);var o=pa(qu.current);if(n=t.type,e!==null&&t.stateNode!=null)bR(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(de(166));return $n(t),null}if(e=pa(Yo.current),ch(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Fo]=t,r[Xu]=i,e=(t.mode&1)!==0,n){case"dialog":Tt("cancel",r),Tt("close",r);break;case"iframe":case"object":case"embed":Tt("load",r);break;case"video":case"audio":for(o=0;o<xu.length;o++)Tt(xu[o],r);break;case"source":Tt("error",r);break;case"img":case"image":case"link":Tt("error",r),Tt("load",r);break;case"details":Tt("toggle",r);break;case"input":eE(r,i),Tt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Tt("invalid",r);break;case"textarea":nE(r,i),Tt("invalid",r)}ly(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&lh(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&lh(r.textContent,l,e),o=["children",""+l]):Fu.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&Tt("scroll",r)}switch(n){case"input":eh(r),tE(r,i,!0);break;case"textarea":eh(r),rE(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=bp)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=X$(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Fo]=t,e[Xu]=r,xR(e,t,!1,!1),t.stateNode=e;e:{switch(s=cy(n,r),n){case"dialog":Tt("cancel",e),Tt("close",e),o=r;break;case"iframe":case"object":case"embed":Tt("load",e),o=r;break;case"video":case"audio":for(o=0;o<xu.length;o++)Tt(xu[o],e);o=r;break;case"source":Tt("error",e),o=r;break;case"img":case"image":case"link":Tt("error",e),Tt("load",e),o=r;break;case"details":Tt("toggle",e),o=r;break;case"input":eE(e,r),o=ry(e,r),Tt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ft({},r,{value:void 0}),Tt("invalid",e);break;case"textarea":nE(e,r),o=sy(e,r),Tt("invalid",e);break;default:o=r}ly(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var u=l[i];i==="style"?Q$(e,u):i==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Z$(e,u)):i==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Bu(e,u):typeof u=="number"&&Bu(e,""+u):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Fu.hasOwnProperty(i)?u!=null&&i==="onScroll"&&Tt("scroll",e):u!=null&&mw(e,i,u,s))}switch(n){case"input":eh(e),tE(e,r,!1);break;case"textarea":eh(e),rE(e);break;case"option":r.value!=null&&e.setAttribute("value",""+As(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Tl(e,!!r.multiple,i,!1):r.defaultValue!=null&&Tl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=bp)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return $n(t),null;case 6:if(e&&t.stateNode!=null)SR(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(de(166));if(n=pa(qu.current),pa(Yo.current),ch(t)){if(r=t.stateNode,n=t.memoizedProps,r[Fo]=t,(i=r.nodeValue!==n)&&(e=vr,e!==null))switch(e.tag){case 3:lh(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&lh(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Fo]=t,t.stateNode=r}return $n(t),null;case 13:if(At(It),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Nt&&gr!==null&&t.mode&1&&!(t.flags&128))F5(),tc(),t.flags|=98560,i=!1;else if(i=ch(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(de(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(de(317));i[Fo]=t}else tc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$n(t),i=!1}else yo!==null&&(Vy(yo),yo=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||It.current&1?sn===0&&(sn=3):qw())),t.updateQueue!==null&&(t.flags|=4),$n(t),null);case 4:return rc(),Dy(e,t),e===null&&Gu(t.stateNode.containerInfo),$n(t),null;case 10:return Nw(t.type._context),$n(t),null;case 17:return Jn(t.type)&&Sp(),$n(t),null;case 19:if(At(It),i=t.memoizedState,i===null)return $n(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)su(i,!1);else{if(sn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Pp(e),s!==null){for(t.flags|=128,su(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Rt(It,It.current&1|2),t.child}e=e.sibling}i.tail!==null&&Gt()>ic&&(t.flags|=128,r=!0,su(i,!1),t.lanes=4194304)}else{if(!r)if(e=Pp(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),su(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Nt)return $n(t),null}else 2*Gt()-i.renderingStartTime>ic&&n!==1073741824&&(t.flags|=128,r=!0,su(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Gt(),t.sibling=null,n=It.current,Rt(It,r?n&1|2:n&1),t):($n(t),null);case 22:case 23:return Zw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?hr&1073741824&&($n(t),t.subtreeFlags&6&&(t.flags|=8192)):$n(t),null;case 24:return null;case 25:return null}throw Error(de(156,t.tag))}function II(e,t){switch(Tw(t),t.tag){case 1:return Jn(t.type)&&Sp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rc(),At(Qn),At(Pn),Fw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return jw(t),null;case 13:if(At(It),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(de(340));tc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return At(It),null;case 4:return rc(),null;case 10:return Nw(t.type._context),null;case 22:case 23:return Zw(),null;case 24:return null;default:return null}}var fh=!1,kn=!1,LI=typeof WeakSet=="function"?WeakSet:Set,$e=null;function Rl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vt(e,t,r)}else n.current=null}function Iy(e,t,n){try{n()}catch(r){Vt(e,t,r)}}var KE=!1;function jI(e,t){if(wy=yp,e=$5(),kw(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,f=0,m=0,p=e,g=null;t:for(;;){for(var y;p!==n||o!==0&&p.nodeType!==3||(l=s+o),p!==i||r!==0&&p.nodeType!==3||(u=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(y=p.firstChild)!==null;)g=p,p=y;for(;;){if(p===e)break t;if(g===n&&++f===o&&(l=s),g===i&&++m===r&&(u=s),(y=p.nextSibling)!==null)break;p=g,g=p.parentNode}p=y}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(xy={focusedElem:e,selectionRange:n},yp=!1,$e=t;$e!==null;)if(t=$e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$e=e;else for(;$e!==null;){t=$e;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var S=x.memoizedProps,E=x.memoizedState,_=t.stateNode,b=_.getSnapshotBeforeUpdate(t.elementType===t.type?S:ho(t.type,S),E);_.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var C=t.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(de(163))}}catch(R){Vt(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,$e=e;break}$e=t.return}return x=KE,KE=!1,x}function Au(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Iy(t,n,i)}o=o.next}while(o!==r)}}function Rm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ly(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _R(e){var t=e.alternate;t!==null&&(e.alternate=null,_R(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fo],delete t[Xu],delete t[_y],delete t[xI],delete t[bI])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ER(e){return e.tag===5||e.tag===3||e.tag===4}function GE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ER(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bp));else if(r!==4&&(e=e.child,e!==null))for(jy(e,t,n),e=e.sibling;e!==null;)jy(e,t,n),e=e.sibling}function Fy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fy(e,t,n),e=e.sibling;e!==null;)Fy(e,t,n),e=e.sibling}var gn=null,go=!1;function Xi(e,t,n){for(n=n.child;n!==null;)CR(e,t,n),n=n.sibling}function CR(e,t,n){if(Go&&typeof Go.onCommitFiberUnmount=="function")try{Go.onCommitFiberUnmount(wm,n)}catch{}switch(n.tag){case 5:kn||Rl(n,t);case 6:var r=gn,o=go;gn=null,Xi(e,t,n),gn=r,go=o,gn!==null&&(go?(e=gn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):gn.removeChild(n.stateNode));break;case 18:gn!==null&&(go?(e=gn,n=n.stateNode,e.nodeType===8?a0(e.parentNode,n):e.nodeType===1&&a0(e,n),Wu(e)):a0(gn,n.stateNode));break;case 4:r=gn,o=go,gn=n.stateNode.containerInfo,go=!0,Xi(e,t,n),gn=r,go=o;break;case 0:case 11:case 14:case 15:if(!kn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Iy(n,t,s),o=o.next}while(o!==r)}Xi(e,t,n);break;case 1:if(!kn&&(Rl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Vt(n,t,l)}Xi(e,t,n);break;case 21:Xi(e,t,n);break;case 22:n.mode&1?(kn=(r=kn)||n.memoizedState!==null,Xi(e,t,n),kn=r):Xi(e,t,n);break;default:Xi(e,t,n)}}function YE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new LI),t.forEach(function(r){var o=GI.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function co(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:gn=l.stateNode,go=!1;break e;case 3:gn=l.stateNode.containerInfo,go=!0;break e;case 4:gn=l.stateNode.containerInfo,go=!0;break e}l=l.return}if(gn===null)throw Error(de(160));CR(i,s,o),gn=null,go=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(f){Vt(o,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$R(t,e),t=t.sibling}function $R(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(co(t,e),Mo(e),r&4){try{Au(3,e,e.return),Rm(3,e)}catch(S){Vt(e,e.return,S)}try{Au(5,e,e.return)}catch(S){Vt(e,e.return,S)}}break;case 1:co(t,e),Mo(e),r&512&&n!==null&&Rl(n,n.return);break;case 5:if(co(t,e),Mo(e),r&512&&n!==null&&Rl(n,n.return),e.flags&32){var o=e.stateNode;try{Bu(o,"")}catch(S){Vt(e,e.return,S)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&G$(o,i),cy(l,s);var f=cy(l,i);for(s=0;s<u.length;s+=2){var m=u[s],p=u[s+1];m==="style"?Q$(o,p):m==="dangerouslySetInnerHTML"?Z$(o,p):m==="children"?Bu(o,p):mw(o,m,p,f)}switch(l){case"input":oy(o,i);break;case"textarea":Y$(o,i);break;case"select":var g=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?Tl(o,!!i.multiple,y,!1):g!==!!i.multiple&&(i.defaultValue!=null?Tl(o,!!i.multiple,i.defaultValue,!0):Tl(o,!!i.multiple,i.multiple?[]:"",!1))}o[Xu]=i}catch(S){Vt(e,e.return,S)}}break;case 6:if(co(t,e),Mo(e),r&4){if(e.stateNode===null)throw Error(de(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(S){Vt(e,e.return,S)}}break;case 3:if(co(t,e),Mo(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Wu(t.containerInfo)}catch(S){Vt(e,e.return,S)}break;case 4:co(t,e),Mo(e);break;case 13:co(t,e),Mo(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Yw=Gt())),r&4&&YE(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(kn=(f=kn)||m,co(t,e),kn=f):co(t,e),Mo(e),r&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!m&&e.mode&1)for($e=e,m=e.child;m!==null;){for(p=$e=m;$e!==null;){switch(g=$e,y=g.child,g.tag){case 0:case 11:case 14:case 15:Au(4,g,g.return);break;case 1:Rl(g,g.return);var x=g.stateNode;if(typeof x.componentWillUnmount=="function"){r=g,n=g.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(S){Vt(r,n,S)}}break;case 5:Rl(g,g.return);break;case 22:if(g.memoizedState!==null){ZE(p);continue}}y!==null?(y.return=g,$e=y):ZE(p)}m=m.sibling}e:for(m=null,p=e;;){if(p.tag===5){if(m===null){m=p;try{o=p.stateNode,f?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=p.stateNode,u=p.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=q$("display",s))}catch(S){Vt(e,e.return,S)}}}else if(p.tag===6){if(m===null)try{p.stateNode.nodeValue=f?"":p.memoizedProps}catch(S){Vt(e,e.return,S)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;m===p&&(m=null),p=p.return}m===p&&(m=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:co(t,e),Mo(e),r&4&&YE(e);break;case 21:break;default:co(t,e),Mo(e)}}function Mo(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ER(n)){var r=n;break e}n=n.return}throw Error(de(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Bu(o,""),r.flags&=-33);var i=GE(e);Fy(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=GE(e);jy(e,l,s);break;default:throw Error(de(161))}}catch(u){Vt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function FI(e,t,n){$e=e,RR(e)}function RR(e,t,n){for(var r=(e.mode&1)!==0;$e!==null;){var o=$e,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||fh;if(!s){var l=o.alternate,u=l!==null&&l.memoizedState!==null||kn;l=fh;var f=kn;if(fh=s,(kn=u)&&!f)for($e=o;$e!==null;)s=$e,u=s.child,s.tag===22&&s.memoizedState!==null?qE(o):u!==null?(u.return=s,$e=u):qE(o);for(;i!==null;)$e=i,RR(i),i=i.sibling;$e=o,fh=l,kn=f}XE(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,$e=i):XE(e)}}function XE(e){for(;$e!==null;){var t=$e;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:kn||Rm(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!kn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ho(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&ME(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ME(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var m=f.memoizedState;if(m!==null){var p=m.dehydrated;p!==null&&Wu(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(de(163))}kn||t.flags&512&&Ly(t)}catch(g){Vt(t,t.return,g)}}if(t===e){$e=null;break}if(n=t.sibling,n!==null){n.return=t.return,$e=n;break}$e=t.return}}function ZE(e){for(;$e!==null;){var t=$e;if(t===e){$e=null;break}var n=t.sibling;if(n!==null){n.return=t.return,$e=n;break}$e=t.return}}function qE(e){for(;$e!==null;){var t=$e;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Rm(4,t)}catch(u){Vt(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){Vt(t,o,u)}}var i=t.return;try{Ly(t)}catch(u){Vt(t,i,u)}break;case 5:var s=t.return;try{Ly(t)}catch(u){Vt(t,s,u)}}}catch(u){Vt(t,t.return,u)}if(t===e){$e=null;break}var l=t.sibling;if(l!==null){l.return=t.return,$e=l;break}$e=t.return}}var BI=Math.ceil,Mp=Oi.ReactCurrentDispatcher,Kw=Oi.ReactCurrentOwner,qr=Oi.ReactCurrentBatchConfig,ft=0,fn=null,Zt=null,xn=0,hr=0,kl=js(0),sn=0,td=null,Ma=0,km=0,Gw=0,Mu=null,Zn=null,Yw=0,ic=1/0,mi=null,Op=!1,By=null,Cs=null,hh=!1,ps=null,Np=0,Ou=0,zy=null,Hh=-1,Kh=0;function Bn(){return ft&6?Gt():Hh!==-1?Hh:Hh=Gt()}function $s(e){return e.mode&1?ft&2&&xn!==0?xn&-xn:_I.transition!==null?(Kh===0&&(Kh=u5()),Kh):(e=bt,e!==0||(e=window.event,e=e===void 0?16:v5(e.type)),e):1}function Eo(e,t,n,r){if(50<Ou)throw Ou=0,zy=null,Error(de(185));Td(e,n,r),(!(ft&2)||e!==fn)&&(e===fn&&(!(ft&2)&&(km|=n),sn===4&&is(e,xn)),er(e,r),n===1&&ft===0&&!(t.mode&1)&&(ic=Gt()+500,Em&&Fs()))}function er(e,t){var n=e.callbackNode;_D(e,t);var r=vp(e,e===fn?xn:0);if(r===0)n!==null&&sE(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&sE(n),t===1)e.tag===0?SI(QE.bind(null,e)):I5(QE.bind(null,e)),yI(function(){!(ft&6)&&Fs()}),n=null;else{switch(d5(r)){case 1:n=xw;break;case 4:n=l5;break;case 16:n=gp;break;case 536870912:n=c5;break;default:n=gp}n=DR(n,kR.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function kR(e,t){if(Hh=-1,Kh=0,ft&6)throw Error(de(327));var n=e.callbackNode;if(Dl()&&e.callbackNode!==n)return null;var r=vp(e,e===fn?xn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Dp(e,r);else{t=r;var o=ft;ft|=2;var i=TR();(fn!==e||xn!==t)&&(mi=null,ic=Gt()+500,Ra(e,t));do try{VI();break}catch(l){PR(e,l)}while(!0);Ow(),Mp.current=i,ft=o,Zt!==null?t=0:(fn=null,xn=0,t=sn)}if(t!==0){if(t===2&&(o=py(e),o!==0&&(r=o,t=Uy(e,o))),t===1)throw n=td,Ra(e,0),is(e,r),er(e,Gt()),n;if(t===6)is(e,r);else{if(o=e.current.alternate,!(r&30)&&!zI(o)&&(t=Dp(e,r),t===2&&(i=py(e),i!==0&&(r=i,t=Uy(e,i))),t===1))throw n=td,Ra(e,0),is(e,r),er(e,Gt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(de(345));case 2:oa(e,Zn,mi);break;case 3:if(is(e,r),(r&130023424)===r&&(t=Yw+500-Gt(),10<t)){if(vp(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Bn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Sy(oa.bind(null,e,Zn,mi),t);break}oa(e,Zn,mi);break;case 4:if(is(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-_o(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Gt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*BI(r/1960))-r,10<r){e.timeoutHandle=Sy(oa.bind(null,e,Zn,mi),r);break}oa(e,Zn,mi);break;case 5:oa(e,Zn,mi);break;default:throw Error(de(329))}}}return er(e,Gt()),e.callbackNode===n?kR.bind(null,e):null}function Uy(e,t){var n=Mu;return e.current.memoizedState.isDehydrated&&(Ra(e,t).flags|=256),e=Dp(e,t),e!==2&&(t=Zn,Zn=n,t!==null&&Vy(t)),e}function Vy(e){Zn===null?Zn=e:Zn.push.apply(Zn,e)}function zI(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!$o(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function is(e,t){for(t&=~Gw,t&=~km,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_o(t),r=1<<n;e[n]=-1,t&=~r}}function QE(e){if(ft&6)throw Error(de(327));Dl();var t=vp(e,0);if(!(t&1))return er(e,Gt()),null;var n=Dp(e,t);if(e.tag!==0&&n===2){var r=py(e);r!==0&&(t=r,n=Uy(e,r))}if(n===1)throw n=td,Ra(e,0),is(e,t),er(e,Gt()),n;if(n===6)throw Error(de(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,oa(e,Zn,mi),er(e,Gt()),null}function Xw(e,t){var n=ft;ft|=1;try{return e(t)}finally{ft=n,ft===0&&(ic=Gt()+500,Em&&Fs())}}function Oa(e){ps!==null&&ps.tag===0&&!(ft&6)&&Dl();var t=ft;ft|=1;var n=qr.transition,r=bt;try{if(qr.transition=null,bt=1,e)return e()}finally{bt=r,qr.transition=n,ft=t,!(ft&6)&&Fs()}}function Zw(){hr=kl.current,At(kl)}function Ra(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,vI(n)),Zt!==null)for(n=Zt.return;n!==null;){var r=n;switch(Tw(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Sp();break;case 3:rc(),At(Qn),At(Pn),Fw();break;case 5:jw(r);break;case 4:rc();break;case 13:At(It);break;case 19:At(It);break;case 10:Nw(r.type._context);break;case 22:case 23:Zw()}n=n.return}if(fn=e,Zt=e=Rs(e.current,null),xn=hr=t,sn=0,td=null,Gw=km=Ma=0,Zn=Mu=null,ha!==null){for(t=0;t<ha.length;t++)if(n=ha[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}ha=null}return e}function PR(e,t){do{var n=Zt;try{if(Ow(),Uh.current=Ap,Tp){for(var r=jt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Tp=!1}if(Aa=0,dn=on=jt=null,Tu=!1,Qu=0,Kw.current=null,n===null||n.return===null){sn=1,td=t,Zt=null;break}e:{var i=e,s=n.return,l=n,u=t;if(t=xn,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,m=l,p=m.tag;if(!(m.mode&1)&&(p===0||p===11||p===15)){var g=m.alternate;g?(m.updateQueue=g.updateQueue,m.memoizedState=g.memoizedState,m.lanes=g.lanes):(m.updateQueue=null,m.memoizedState=null)}var y=FE(s);if(y!==null){y.flags&=-257,BE(y,s,l,i,t),y.mode&1&&jE(i,f,t),t=y,u=f;var x=t.updateQueue;if(x===null){var S=new Set;S.add(u),t.updateQueue=S}else x.add(u);break e}else{if(!(t&1)){jE(i,f,t),qw();break e}u=Error(de(426))}}else if(Nt&&l.mode&1){var E=FE(s);if(E!==null){!(E.flags&65536)&&(E.flags|=256),BE(E,s,l,i,t),Aw(oc(u,l));break e}}i=u=oc(u,l),sn!==4&&(sn=2),Mu===null?Mu=[i]:Mu.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var _=fR(i,u,t);AE(i,_);break e;case 1:l=u;var b=i.type,C=i.stateNode;if(!(i.flags&128)&&(typeof b.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Cs===null||!Cs.has(C)))){i.flags|=65536,t&=-t,i.lanes|=t;var R=hR(i,l,t);AE(i,R);break e}}i=i.return}while(i!==null)}MR(n)}catch(T){t=T,Zt===n&&n!==null&&(Zt=n=n.return);continue}break}while(!0)}function TR(){var e=Mp.current;return Mp.current=Ap,e===null?Ap:e}function qw(){(sn===0||sn===3||sn===2)&&(sn=4),fn===null||!(Ma&268435455)&&!(km&268435455)||is(fn,xn)}function Dp(e,t){var n=ft;ft|=2;var r=TR();(fn!==e||xn!==t)&&(mi=null,Ra(e,t));do try{UI();break}catch(o){PR(e,o)}while(!0);if(Ow(),ft=n,Mp.current=r,Zt!==null)throw Error(de(261));return fn=null,xn=0,sn}function UI(){for(;Zt!==null;)AR(Zt)}function VI(){for(;Zt!==null&&!pD();)AR(Zt)}function AR(e){var t=NR(e.alternate,e,hr);e.memoizedProps=e.pendingProps,t===null?MR(e):Zt=t,Kw.current=null}function MR(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=II(n,t),n!==null){n.flags&=32767,Zt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{sn=6,Zt=null;return}}else if(n=DI(n,t,hr),n!==null){Zt=n;return}if(t=t.sibling,t!==null){Zt=t;return}Zt=t=e}while(t!==null);sn===0&&(sn=5)}function oa(e,t,n){var r=bt,o=qr.transition;try{qr.transition=null,bt=1,WI(e,t,n,r)}finally{qr.transition=o,bt=r}return null}function WI(e,t,n,r){do Dl();while(ps!==null);if(ft&6)throw Error(de(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(de(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ED(e,i),e===fn&&(Zt=fn=null,xn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||hh||(hh=!0,DR(gp,function(){return Dl(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=qr.transition,qr.transition=null;var s=bt;bt=1;var l=ft;ft|=4,Kw.current=null,jI(e,n),$R(n,e),uI(xy),yp=!!wy,xy=wy=null,e.current=n,FI(n),mD(),ft=l,bt=s,qr.transition=i}else e.current=n;if(hh&&(hh=!1,ps=e,Np=o),i=e.pendingLanes,i===0&&(Cs=null),yD(n.stateNode),er(e,Gt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Op)throw Op=!1,e=By,By=null,e;return Np&1&&e.tag!==0&&Dl(),i=e.pendingLanes,i&1?e===zy?Ou++:(Ou=0,zy=e):Ou=0,Fs(),null}function Dl(){if(ps!==null){var e=d5(Np),t=qr.transition,n=bt;try{if(qr.transition=null,bt=16>e?16:e,ps===null)var r=!1;else{if(e=ps,ps=null,Np=0,ft&6)throw Error(de(331));var o=ft;for(ft|=4,$e=e.current;$e!==null;){var i=$e,s=i.child;if($e.flags&16){var l=i.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for($e=f;$e!==null;){var m=$e;switch(m.tag){case 0:case 11:case 15:Au(8,m,i)}var p=m.child;if(p!==null)p.return=m,$e=p;else for(;$e!==null;){m=$e;var g=m.sibling,y=m.return;if(_R(m),m===f){$e=null;break}if(g!==null){g.return=y,$e=g;break}$e=y}}}var x=i.alternate;if(x!==null){var S=x.child;if(S!==null){x.child=null;do{var E=S.sibling;S.sibling=null,S=E}while(S!==null)}}$e=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,$e=s;else e:for(;$e!==null;){if(i=$e,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Au(9,i,i.return)}var _=i.sibling;if(_!==null){_.return=i.return,$e=_;break e}$e=i.return}}var b=e.current;for($e=b;$e!==null;){s=$e;var C=s.child;if(s.subtreeFlags&2064&&C!==null)C.return=s,$e=C;else e:for(s=b;$e!==null;){if(l=$e,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Rm(9,l)}}catch(T){Vt(l,l.return,T)}if(l===s){$e=null;break e}var R=l.sibling;if(R!==null){R.return=l.return,$e=R;break e}$e=l.return}}if(ft=o,Fs(),Go&&typeof Go.onPostCommitFiberRoot=="function")try{Go.onPostCommitFiberRoot(wm,e)}catch{}r=!0}return r}finally{bt=n,qr.transition=t}}return!1}function JE(e,t,n){t=oc(n,t),t=fR(e,t,1),e=Es(e,t,1),t=Bn(),e!==null&&(Td(e,1,t),er(e,t))}function Vt(e,t,n){if(e.tag===3)JE(e,e,n);else for(;t!==null;){if(t.tag===3){JE(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Cs===null||!Cs.has(r))){e=oc(n,e),e=hR(t,e,1),t=Es(t,e,1),e=Bn(),t!==null&&(Td(t,1,e),er(t,e));break}}t=t.return}}function HI(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Bn(),e.pingedLanes|=e.suspendedLanes&n,fn===e&&(xn&n)===n&&(sn===4||sn===3&&(xn&130023424)===xn&&500>Gt()-Yw?Ra(e,0):Gw|=n),er(e,t)}function OR(e,t){t===0&&(e.mode&1?(t=rh,rh<<=1,!(rh&130023424)&&(rh=4194304)):t=1);var n=Bn();e=Ci(e,t),e!==null&&(Td(e,t,n),er(e,n))}function KI(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),OR(e,n)}function GI(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(de(314))}r!==null&&r.delete(t),OR(e,n)}var NR;NR=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qn.current)qn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qn=!1,NI(e,t,n);qn=!!(e.flags&131072)}else qn=!1,Nt&&t.flags&1048576&&L5(t,Cp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Wh(e,t),e=t.pendingProps;var o=ec(t,Pn.current);Nl(t,n),o=zw(null,t,r,e,o,n);var i=Uw();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jn(r)?(i=!0,_p(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Iw(t),o.updater=Cm,t.stateNode=o,o._reactInternals=t,Py(t,r,e,n),t=My(null,t,r,!0,i,n)):(t.tag=0,Nt&&i&&Pw(t),Ln(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Wh(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=XI(r),e=ho(r,e),o){case 0:t=Ay(null,t,r,e,n);break e;case 1:t=VE(null,t,r,e,n);break e;case 11:t=zE(null,t,r,e,n);break e;case 14:t=UE(null,t,r,ho(r.type,e),n);break e}throw Error(de(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ho(r,o),Ay(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ho(r,o),VE(e,t,r,o,n);case 3:e:{if(vR(t),e===null)throw Error(de(387));r=t.pendingProps,i=t.memoizedState,o=i.element,z5(e,t),kp(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=oc(Error(de(423)),t),t=WE(e,t,r,n,o);break e}else if(r!==o){o=oc(Error(de(424)),t),t=WE(e,t,r,n,o);break e}else for(gr=_s(t.stateNode.containerInfo.firstChild),vr=t,Nt=!0,yo=null,n=H5(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(tc(),r===o){t=$i(e,t,n);break e}Ln(e,t,r,n)}t=t.child}return t;case 5:return K5(t),e===null&&$y(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,by(r,o)?s=null:i!==null&&by(r,i)&&(t.flags|=32),gR(e,t),Ln(e,t,s,n),t.child;case 6:return e===null&&$y(t),null;case 13:return yR(e,t,n);case 4:return Lw(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=nc(t,null,r,n):Ln(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ho(r,o),zE(e,t,r,o,n);case 7:return Ln(e,t,t.pendingProps,n),t.child;case 8:return Ln(e,t,t.pendingProps.children,n),t.child;case 12:return Ln(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Rt($p,r._currentValue),r._currentValue=s,i!==null)if($o(i.value,s)){if(i.children===o.children&&!Qn.current){t=$i(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=bi(-1,n&-n),u.tag=2;var f=i.updateQueue;if(f!==null){f=f.shared;var m=f.pending;m===null?u.next=u:(u.next=m.next,m.next=u),f.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Ry(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(de(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ry(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Ln(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Nl(t,n),o=Jr(o),r=r(o),t.flags|=1,Ln(e,t,r,n),t.child;case 14:return r=t.type,o=ho(r,t.pendingProps),o=ho(r.type,o),UE(e,t,r,o,n);case 15:return pR(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ho(r,o),Wh(e,t),t.tag=1,Jn(r)?(e=!0,_p(t)):e=!1,Nl(t,n),V5(t,r,o),Py(t,r,o,n),My(null,t,r,!0,e,n);case 19:return wR(e,t,n);case 22:return mR(e,t,n)}throw Error(de(156,t.tag))};function DR(e,t){return a5(e,t)}function YI(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(e,t,n,r){return new YI(e,t,n,r)}function Qw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XI(e){if(typeof e=="function")return Qw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vw)return 11;if(e===yw)return 14}return 2}function Rs(e,t){var n=e.alternate;return n===null?(n=Yr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Gh(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Qw(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case yl:return ka(n.children,o,i,t);case gw:s=8,o|=8;break;case J0:return e=Yr(12,n,t,o|2),e.elementType=J0,e.lanes=i,e;case ey:return e=Yr(13,n,t,o),e.elementType=ey,e.lanes=i,e;case ty:return e=Yr(19,n,t,o),e.elementType=ty,e.lanes=i,e;case W$:return Pm(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case U$:s=10;break e;case V$:s=9;break e;case vw:s=11;break e;case yw:s=14;break e;case ns:s=16,r=null;break e}throw Error(de(130,e==null?e:typeof e,""))}return t=Yr(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ka(e,t,n,r){return e=Yr(7,e,r,t),e.lanes=n,e}function Pm(e,t,n,r){return e=Yr(22,e,r,t),e.elementType=W$,e.lanes=n,e.stateNode={isHidden:!1},e}function m0(e,t,n){return e=Yr(6,e,null,t),e.lanes=n,e}function g0(e,t,n){return t=Yr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ZI(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Zv(0),this.expirationTimes=Zv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zv(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Jw(e,t,n,r,o,i,s,l,u){return e=new ZI(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Yr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Iw(i),e}function qI(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:vl,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function IR(e){if(!e)return Ms;e=e._reactInternals;e:{if(Fa(e)!==e||e.tag!==1)throw Error(de(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(de(171))}if(e.tag===1){var n=e.type;if(Jn(n))return D5(e,n,t)}return t}function LR(e,t,n,r,o,i,s,l,u){return e=Jw(n,r,!0,e,o,i,s,l,u),e.context=IR(null),n=e.current,r=Bn(),o=$s(n),i=bi(r,o),i.callback=t??null,Es(n,i,o),e.current.lanes=o,Td(e,o,r),er(e,r),e}function Tm(e,t,n,r){var o=t.current,i=Bn(),s=$s(o);return n=IR(n),t.context===null?t.context=n:t.pendingContext=n,t=bi(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Es(o,t,s),e!==null&&(Eo(e,o,s,i),zh(e,o,s)),s}function Ip(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function eC(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ex(e,t){eC(e,t),(e=e.alternate)&&eC(e,t)}function QI(){return null}var jR=typeof reportError=="function"?reportError:function(e){console.error(e)};function tx(e){this._internalRoot=e}Am.prototype.render=tx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(de(409));Tm(e,t,null,null)};Am.prototype.unmount=tx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Oa(function(){Tm(null,e,null,null)}),t[Ei]=null}};function Am(e){this._internalRoot=e}Am.prototype.unstable_scheduleHydration=function(e){if(e){var t=p5();e={blockedOn:null,target:e,priority:t};for(var n=0;n<os.length&&t!==0&&t<os[n].priority;n++);os.splice(n,0,e),n===0&&g5(e)}};function nx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Mm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function tC(){}function JI(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var f=Ip(s);i.call(f)}}var s=LR(t,r,e,0,null,!1,!1,"",tC);return e._reactRootContainer=s,e[Ei]=s.current,Gu(e.nodeType===8?e.parentNode:e),Oa(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var f=Ip(u);l.call(f)}}var u=Jw(e,0,!1,null,null,!1,!1,"",tC);return e._reactRootContainer=u,e[Ei]=u.current,Gu(e.nodeType===8?e.parentNode:e),Oa(function(){Tm(t,u,n,r)}),u}function Om(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var u=Ip(s);l.call(u)}}Tm(t,s,e,o)}else s=JI(n,t,e,o,r);return Ip(s)}f5=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=wu(t.pendingLanes);n!==0&&(bw(t,n|1),er(t,Gt()),!(ft&6)&&(ic=Gt()+500,Fs()))}break;case 13:Oa(function(){var r=Ci(e,1);if(r!==null){var o=Bn();Eo(r,e,1,o)}}),ex(e,1)}};Sw=function(e){if(e.tag===13){var t=Ci(e,134217728);if(t!==null){var n=Bn();Eo(t,e,134217728,n)}ex(e,134217728)}};h5=function(e){if(e.tag===13){var t=$s(e),n=Ci(e,t);if(n!==null){var r=Bn();Eo(n,e,t,r)}ex(e,t)}};p5=function(){return bt};m5=function(e,t){var n=bt;try{return bt=e,t()}finally{bt=n}};dy=function(e,t,n){switch(t){case"input":if(oy(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=_m(r);if(!o)throw Error(de(90));K$(r),oy(r,o)}}}break;case"textarea":Y$(e,n);break;case"select":t=n.value,t!=null&&Tl(e,!!n.multiple,t,!1)}};t5=Xw;n5=Oa;var eL={usingClientEntryPoint:!1,Events:[Md,Sl,_m,J$,e5,Xw]},au={findFiberByHostInstance:fa,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},tL={bundleType:au.bundleType,version:au.version,rendererPackageName:au.rendererPackageName,rendererConfig:au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Oi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=i5(e),e===null?null:e.stateNode},findFiberByHostInstance:au.findFiberByHostInstance||QI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ph=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ph.isDisabled&&ph.supportsFiber)try{wm=ph.inject(tL),Go=ph}catch{}}Sr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eL;Sr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nx(t))throw Error(de(200));return qI(e,t,null,n)};Sr.createRoot=function(e,t){if(!nx(e))throw Error(de(299));var n=!1,r="",o=jR;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Jw(e,1,!1,null,null,n,!1,r,o),e[Ei]=t.current,Gu(e.nodeType===8?e.parentNode:e),new tx(t)};Sr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(de(188)):(e=Object.keys(e).join(","),Error(de(268,e)));return e=i5(t),e=e===null?null:e.stateNode,e};Sr.flushSync=function(e){return Oa(e)};Sr.hydrate=function(e,t,n){if(!Mm(t))throw Error(de(200));return Om(null,e,t,!0,n)};Sr.hydrateRoot=function(e,t,n){if(!nx(e))throw Error(de(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=jR;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=LR(t,null,e,1,n??null,o,!1,i,s),e[Ei]=t.current,Gu(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Am(t)};Sr.render=function(e,t,n){if(!Mm(t))throw Error(de(200));return Om(null,e,t,!1,n)};Sr.unmountComponentAtNode=function(e){if(!Mm(e))throw Error(de(40));return e._reactRootContainer?(Oa(function(){Om(null,null,e,!1,function(){e._reactRootContainer=null,e[Ei]=null})}),!0):!1};Sr.unstable_batchedUpdates=Xw;Sr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Mm(n))throw Error(de(200));if(e==null||e._reactInternals===void 0)throw Error(de(38));return Om(e,t,n,!1,r)};Sr.version="18.2.0-next-9e3b772b8-20220608";function FR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(FR)}catch(e){console.error(e)}}FR(),L$.exports=Sr;var Bs=L$.exports;const nL=vm(Bs);var nC=Bs;q0.createRoot=nC.createRoot,q0.hydrateRoot=nC.hydrateRoot;var Nd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sc=typeof window>"u"||"Deno"in window;function jr(){}function rL(e,t){return typeof e=="function"?e(t):e}function Wy(e){return typeof e=="number"&&e>=0&&e!==1/0}function BR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function rC(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:l}=e;if(s){if(r){if(t.queryHash!==rx(s,t.options))return!1}else if(!rd(t.queryKey,s))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function oC(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(nd(t.options.mutationKey)!==nd(i))return!1}else if(!rd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function rx(e,t){return((t==null?void 0:t.queryKeyHashFn)||nd)(e)}function nd(e){return JSON.stringify(e,(t,n)=>Ky(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function rd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!rd(e[n],t[n])):!1}function zR(e,t){if(e===t)return e;const n=iC(e)&&iC(t);if(n||Ky(e)&&Ky(t)){const r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),i=o.length,s=n?[]:{};let l=0;for(let u=0;u<i;u++){const f=n?u:o[u];s[f]=zR(e[f],t[f]),s[f]===e[f]&&l++}return r===i&&l===r?e:s}return t}function Hy(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function iC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ky(e){if(!sC(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!sC(n)||!n.hasOwnProperty("isPrototypeOf"))}function sC(e){return Object.prototype.toString.call(e)==="[object Object]"}function UR(e){return new Promise(t=>{setTimeout(t,e)})}function aC(e){UR(0).then(e)}function Gy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?zR(e,t):t}function oL(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function iL(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ya,ss,jl,y$,sL=(y$=class extends Nd{constructor(){super();Te(this,ya,void 0);Te(this,ss,void 0);Te(this,jl,void 0);we(this,jl,t=>{if(!sc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,ss)||this.setEventListener(F(this,jl))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,ss))==null||t.call(this),we(this,ss,void 0))}setEventListener(t){var n;we(this,jl,t),(n=F(this,ss))==null||n.call(this),we(this,ss,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){F(this,ya)!==t&&(we(this,ya,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof F(this,ya)=="boolean"?F(this,ya):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ya=new WeakMap,ss=new WeakMap,jl=new WeakMap,y$),Lp=new sL,Fl,as,Bl,w$,aL=(w$=class extends Nd{constructor(){super();Te(this,Fl,!0);Te(this,as,void 0);Te(this,Bl,void 0);we(this,Bl,t=>{if(!sc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){F(this,as)||this.setEventListener(F(this,Bl))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,as))==null||t.call(this),we(this,as,void 0))}setEventListener(t){var n;we(this,Bl,t),(n=F(this,as))==null||n.call(this),we(this,as,t(this.setOnline.bind(this)))}setOnline(t){F(this,Fl)!==t&&(we(this,Fl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return F(this,Fl)}},Fl=new WeakMap,as=new WeakMap,Bl=new WeakMap,w$),jp=new aL;function lL(e){return Math.min(1e3*2**e,3e4)}function Nm(e){return(e??"online")==="online"?jp.isOnline():!0}var VR=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function v0(e){return e instanceof VR}function WR(e){let t=!1,n=0,r=!1,o,i,s;const l=new Promise((E,_)=>{i=E,s=_}),u=E=>{var _;r||(y(new VR(E)),(_=e.abort)==null||_.call(e))},f=()=>{t=!0},m=()=>{t=!1},p=()=>!Lp.isFocused()||e.networkMode!=="always"&&!jp.isOnline(),g=E=>{var _;r||(r=!0,(_=e.onSuccess)==null||_.call(e,E),o==null||o(),i(E))},y=E=>{var _;r||(r=!0,(_=e.onError)==null||_.call(e,E),o==null||o(),s(E))},x=()=>new Promise(E=>{var _;o=b=>{const C=r||!p();return C&&E(b),C},(_=e.onPause)==null||_.call(e)}).then(()=>{var E;o=void 0,r||(E=e.onContinue)==null||E.call(e)}),S=()=>{if(r)return;let E;try{E=e.fn()}catch(_){E=Promise.reject(_)}Promise.resolve(E).then(g).catch(_=>{var N;if(r)return;const b=e.retry??(sc?0:3),C=e.retryDelay??lL,R=typeof C=="function"?C(n,_):C,T=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,_);if(t||!T){y(_);return}n++,(N=e.onFail)==null||N.call(e,n,_),UR(R).then(()=>{if(p())return x()}).then(()=>{t?y(_):S()})})};return Nm(e.networkMode)?S():x().then(S),{promise:l,cancel:u,continue:()=>(o==null?void 0:o())?l:Promise.resolve(),cancelRetry:f,continueRetry:m}}function cL(){let e=[],t=0,n=m=>{m()},r=m=>{m()};const o=m=>{let p;t++;try{p=m()}finally{t--,t||l()}return p},i=m=>{t?e.push(m):aC(()=>{n(m)})},s=m=>(...p)=>{i(()=>{m(...p)})},l=()=>{const m=e;e=[],m.length&&aC(()=>{r(()=>{m.forEach(p=>{n(p)})})})};return{batch:o,batchCalls:s,schedule:i,setNotifyFunction:m=>{n=m},setBatchNotifyFunction:m=>{r=m}}}var vn=cL(),wa,x$,HR=(x$=class{constructor(){Te(this,wa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wy(this.gcTime)&&we(this,wa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sc?1/0:5*60*1e3))}clearGcTimeout(){F(this,wa)&&(clearTimeout(F(this,wa)),we(this,wa,void 0))}},wa=new WeakMap,x$),zl,Ul,Dr,ls,Ir,un,yd,xa,Vl,Yh,mo,pi,b$,uL=(b$=class extends HR{constructor(t){super();Te(this,Vl);Te(this,mo);Te(this,zl,void 0);Te(this,Ul,void 0);Te(this,Dr,void 0);Te(this,ls,void 0);Te(this,Ir,void 0);Te(this,un,void 0);Te(this,yd,void 0);Te(this,xa,void 0);we(this,xa,!1),we(this,yd,t.defaultOptions),tt(this,Vl,Yh).call(this,t.options),we(this,un,[]),we(this,Dr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,zl,t.state||dL(this.options)),this.state=F(this,zl),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!F(this,un).length&&this.state.fetchStatus==="idle"&&F(this,Dr).remove(this)}setData(t,n){const r=Gy(this.state.data,t,this.options);return tt(this,mo,pi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){tt(this,mo,pi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=F(this,ls);return(r=F(this,Ir))==null||r.cancel(t),n?n.then(jr).catch(jr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(F(this,zl))}isActive(){return F(this,un).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||F(this,un).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!BR(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=F(this,un).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,Ir))==null||n.continue()}onOnline(){var n;const t=F(this,un).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,Ir))==null||n.continue()}addObserver(t){F(this,un).includes(t)||(F(this,un).push(t),this.clearGcTimeout(),F(this,Dr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){F(this,un).includes(t)&&(we(this,un,F(this,un).filter(n=>n!==t)),F(this,un).length||(F(this,Ir)&&(F(this,xa)?F(this,Ir).cancel({revert:!0}):F(this,Ir).cancelRetry()),this.scheduleGc()),F(this,Dr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return F(this,un).length}invalidate(){this.state.isInvalidated||tt(this,mo,pi).call(this,{type:"invalidate"})}fetch(t,n){var f,m,p,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(F(this,ls))return(f=F(this,Ir))==null||f.continueRetry(),F(this,ls)}if(t&&tt(this,Vl,Yh).call(this,t),!this.options.queryFn){const y=F(this,un).find(x=>x.options.queryFn);y&&tt(this,Vl,Yh).call(this,y.options)}const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(we(this,xa,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(we(this,xa,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),l={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(l),(m=this.options.behavior)==null||m.onFetch(l,this),we(this,Ul,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&tt(this,mo,pi).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=y=>{var x,S,E,_;v0(y)&&y.silent||tt(this,mo,pi).call(this,{type:"error",error:y}),v0(y)||((S=(x=F(this,Dr).config).onError)==null||S.call(x,y,this),(_=(E=F(this,Dr).config).onSettled)==null||_.call(E,this.state.data,y,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return we(this,Ir,WR({fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:y=>{var x,S,E,_;if(typeof y>"u"){u(new Error(`${this.queryHash} data is undefined`));return}this.setData(y),(S=(x=F(this,Dr).config).onSuccess)==null||S.call(x,y,this),(_=(E=F(this,Dr).config).onSettled)==null||_.call(E,y,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:u,onFail:(y,x)=>{tt(this,mo,pi).call(this,{type:"failed",failureCount:y,error:x})},onPause:()=>{tt(this,mo,pi).call(this,{type:"pause"})},onContinue:()=>{tt(this,mo,pi).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode})),we(this,ls,F(this,Ir).promise),F(this,ls)}},zl=new WeakMap,Ul=new WeakMap,Dr=new WeakMap,ls=new WeakMap,Ir=new WeakMap,un=new WeakMap,yd=new WeakMap,xa=new WeakMap,Vl=new WeakSet,Yh=function(t){this.options={...F(this,yd),...t},this.updateGcTime(this.options.gcTime)},mo=new WeakSet,pi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Nm(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return v0(o)&&o.revert&&F(this,Ul)?{...F(this,Ul),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),vn.batch(()=>{F(this,un).forEach(r=>{r.onQueryUpdate()}),F(this,Dr).notify({query:this,type:"updated",action:t})})},b$);function dL(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Do,S$,fL=(S$=class extends Nd{constructor(t={}){super();Te(this,Do,void 0);this.config=t,we(this,Do,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??rx(o,n);let s=this.get(i);return s||(s=new uL({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){F(this,Do).has(t.queryHash)||(F(this,Do).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=F(this,Do).get(t.queryHash);n&&(t.destroy(),n===t&&F(this,Do).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,Do).get(t)}getAll(){return[...F(this,Do).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>rC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>rC(t,r)):n}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){vn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Do=new WeakMap,S$),Io,wd,fr,Wl,Lo,es,_$,hL=(_$=class extends HR{constructor(t){super();Te(this,Lo);Te(this,Io,void 0);Te(this,wd,void 0);Te(this,fr,void 0);Te(this,Wl,void 0);this.mutationId=t.mutationId,we(this,wd,t.defaultOptions),we(this,fr,t.mutationCache),we(this,Io,[]),this.state=t.state||pL(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...F(this,wd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,Io).includes(t)||(F(this,Io).push(t),this.clearGcTimeout(),F(this,fr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,Io,F(this,Io).filter(n=>n!==t)),this.scheduleGc(),F(this,fr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,Io).length||(this.state.status==="pending"?this.scheduleGc():F(this,fr).remove(this))}continue(){var t;return((t=F(this,Wl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,l,u,f,m,p,g,y,x,S,E,_,b,C,R,T,N,A;const n=()=>(we(this,Wl,WR({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(O,U)=>{tt(this,Lo,es).call(this,{type:"failed",failureCount:O,error:U})},onPause:()=>{tt(this,Lo,es).call(this,{type:"pause"})},onContinue:()=>{tt(this,Lo,es).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),F(this,Wl).promise),r=this.state.status==="pending";try{if(!r){tt(this,Lo,es).call(this,{type:"pending",variables:t}),await((i=(o=F(this,fr).config).onMutate)==null?void 0:i.call(o,t,this));const U=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t));U!==this.state.context&&tt(this,Lo,es).call(this,{type:"pending",context:U,variables:t})}const O=await n();return await((f=(u=F(this,fr).config).onSuccess)==null?void 0:f.call(u,O,t,this.state.context,this)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,O,t,this.state.context)),await((y=(g=F(this,fr).config).onSettled)==null?void 0:y.call(g,O,null,this.state.variables,this.state.context,this)),await((S=(x=this.options).onSettled)==null?void 0:S.call(x,O,null,t,this.state.context)),tt(this,Lo,es).call(this,{type:"success",data:O}),O}catch(O){try{throw await((_=(E=F(this,fr).config).onError)==null?void 0:_.call(E,O,t,this.state.context,this)),await((C=(b=this.options).onError)==null?void 0:C.call(b,O,t,this.state.context)),await((T=(R=F(this,fr).config).onSettled)==null?void 0:T.call(R,void 0,O,this.state.variables,this.state.context,this)),await((A=(N=this.options).onSettled)==null?void 0:A.call(N,void 0,O,t,this.state.context)),O}finally{tt(this,Lo,es).call(this,{type:"error",error:O})}}}},Io=new WeakMap,wd=new WeakMap,fr=new WeakMap,Wl=new WeakMap,Lo=new WeakSet,es=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Nm(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),vn.batch(()=>{F(this,Io).forEach(r=>{r.onMutationUpdate(t)}),F(this,fr).notify({mutation:this,type:"updated",action:t})})},_$);function pL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Lr,xd,ba,E$,mL=(E$=class extends Nd{constructor(t={}){super();Te(this,Lr,void 0);Te(this,xd,void 0);Te(this,ba,void 0);this.config=t,we(this,Lr,[]),we(this,xd,0)}build(t,n,r){const o=new hL({mutationCache:this,mutationId:++qf(this,xd)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){F(this,Lr).push(t),this.notify({type:"added",mutation:t})}remove(t){we(this,Lr,F(this,Lr).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){vn.batch(()=>{F(this,Lr).forEach(t=>{this.remove(t)})})}getAll(){return F(this,Lr)}find(t){const n={exact:!0,...t};return F(this,Lr).find(r=>oC(n,r))}findAll(t={}){return F(this,Lr).filter(n=>oC(t,n))}notify(t){vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return we(this,ba,(F(this,ba)??Promise.resolve()).then(()=>{const t=F(this,Lr).filter(n=>n.state.isPaused);return vn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(jr)),Promise.resolve()))}).then(()=>{we(this,ba,void 0)})),F(this,ba)}},Lr=new WeakMap,xd=new WeakMap,ba=new WeakMap,E$);function gL(e){return{onFetch:(t,n)=>{const r=async()=>{var x,S,E,_,b;const o=t.options,i=(E=(S=(x=t.fetchOptions)==null?void 0:x.meta)==null?void 0:S.fetchMore)==null?void 0:E.direction,s=((_=t.state.data)==null?void 0:_.pages)||[],l=((b=t.state.data)==null?void 0:b.pageParams)||[],u={pages:[],pageParams:[]};let f=!1;const m=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?f=!0:t.signal.addEventListener("abort",()=>{f=!0}),t.signal)})},p=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(C,R,T)=>{if(f)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const N={queryKey:t.queryKey,pageParam:R,direction:T?"backward":"forward",meta:t.options.meta};m(N);const A=await p(N),{maxPages:O}=t.options,U=T?iL:oL;return{pages:U(C.pages,A,O),pageParams:U(C.pageParams,R,O)}};let y;if(i&&s.length){const C=i==="backward",R=C?vL:lC,T={pages:s,pageParams:l},N=R(o,T);y=await g(T,N,C)}else{y=await g(u,l[0]??o.initialPageParam);const C=e??s.length;for(let R=1;R<C;R++){const T=lC(o,y);y=await g(y,T)}}return y};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function lC(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function vL(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var rn,cs,us,Hl,Kl,ds,Gl,Yl,C$,yL=(C$=class{constructor(e={}){Te(this,rn,void 0);Te(this,cs,void 0);Te(this,us,void 0);Te(this,Hl,void 0);Te(this,Kl,void 0);Te(this,ds,void 0);Te(this,Gl,void 0);Te(this,Yl,void 0);we(this,rn,e.queryCache||new fL),we(this,cs,e.mutationCache||new mL),we(this,us,e.defaultOptions||{}),we(this,Hl,new Map),we(this,Kl,new Map),we(this,ds,0)}mount(){qf(this,ds)._++,F(this,ds)===1&&(we(this,Gl,Lp.subscribe(()=>{Lp.isFocused()&&(this.resumePausedMutations(),F(this,rn).onFocus())})),we(this,Yl,jp.subscribe(()=>{jp.isOnline()&&(this.resumePausedMutations(),F(this,rn).onOnline())})))}unmount(){var e,t;qf(this,ds)._--,F(this,ds)===0&&((e=F(this,Gl))==null||e.call(this),we(this,Gl,void 0),(t=F(this,Yl))==null||t.call(this),we(this,Yl,void 0))}isFetching(e){return F(this,rn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,cs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=F(this,rn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=F(this,rn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=rL(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return F(this,rn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return vn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=F(this,rn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=F(this,rn);vn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=F(this,rn),r={type:"active",...e};return vn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=vn.batch(()=>F(this,rn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(jr).catch(jr)}invalidateQueries(e={},t={}){return vn.batch(()=>{if(F(this,rn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=vn.batch(()=>F(this,rn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(jr)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(jr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=F(this,rn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jr).catch(jr)}fetchInfiniteQuery(e){return e.behavior=gL(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jr).catch(jr)}resumePausedMutations(){return F(this,cs).resumePausedMutations()}getQueryCache(){return F(this,rn)}getMutationCache(){return F(this,cs)}getDefaultOptions(){return F(this,us)}setDefaultOptions(e){we(this,us,e)}setQueryDefaults(e,t){F(this,Hl).set(nd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,Hl).values()];let n={};return t.forEach(r=>{rd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){F(this,Kl).set(nd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,Kl).values()];let n={};return t.forEach(r=>{rd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...F(this,us).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=rx(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,us).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,rn).clear(),F(this,cs).clear()}},rn=new WeakMap,cs=new WeakMap,us=new WeakMap,Hl=new WeakMap,Kl=new WeakMap,ds=new WeakMap,Gl=new WeakMap,Yl=new WeakMap,C$),Yn,$t,Xl,Rn,Sa,Zl,jo,bd,ql,Ql,_a,Ea,fs,Ca,$a,bu,Sd,Yy,_d,Xy,Ed,Zy,Cd,qy,$d,Qy,Rd,Jy,kd,e1,gm,KR,$$,wL=($$=class extends Nd{constructor(t,n){super();Te(this,$a);Te(this,Sd);Te(this,_d);Te(this,Ed);Te(this,Cd);Te(this,$d);Te(this,Rd);Te(this,kd);Te(this,gm);Te(this,Yn,void 0);Te(this,$t,void 0);Te(this,Xl,void 0);Te(this,Rn,void 0);Te(this,Sa,void 0);Te(this,Zl,void 0);Te(this,jo,void 0);Te(this,bd,void 0);Te(this,ql,void 0);Te(this,Ql,void 0);Te(this,_a,void 0);Te(this,Ea,void 0);Te(this,fs,void 0);Te(this,Ca,void 0);we(this,$t,void 0),we(this,Xl,void 0),we(this,Rn,void 0),we(this,Ca,new Set),we(this,Yn,t),this.options=n,we(this,jo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,$t).addObserver(this),cC(F(this,$t),this.options)?tt(this,$a,bu).call(this):this.updateResult(),tt(this,Cd,qy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return t1(F(this,$t),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return t1(F(this,$t),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,tt(this,$d,Qy).call(this),tt(this,Rd,Jy).call(this),F(this,$t).removeObserver(this)}setOptions(t,n){const r=this.options,o=F(this,$t);if(this.options=F(this,Yn).defaultQueryOptions(t),Hy(r,this.options)||F(this,Yn).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,$t),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),tt(this,kd,e1).call(this);const i=this.hasListeners();i&&uC(F(this,$t),o,this.options,r)&&tt(this,$a,bu).call(this),this.updateResult(n),i&&(F(this,$t)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&tt(this,Sd,Yy).call(this);const s=tt(this,_d,Xy).call(this);i&&(F(this,$t)!==o||this.options.enabled!==r.enabled||s!==F(this,fs))&&tt(this,Ed,Zy).call(this,s)}getOptimisticResult(t){const n=F(this,Yn).getQueryCache().build(F(this,Yn),t),r=this.createResult(n,t);return bL(this,r)&&(we(this,Rn,r),we(this,Zl,this.options),we(this,Sa,F(this,$t).state)),r}getCurrentResult(){return F(this,Rn)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(F(this,Ca).add(r),t[r])})}),n}getCurrentQuery(){return F(this,$t)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=F(this,Yn).defaultQueryOptions(t),r=F(this,Yn).getQueryCache().build(F(this,Yn),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return tt(this,$a,bu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,Rn)))}createResult(t,n){var N;const r=F(this,$t),o=this.options,i=F(this,Rn),s=F(this,Sa),l=F(this,Zl),f=t!==r?t.state:F(this,Xl),{state:m}=t;let{error:p,errorUpdatedAt:g,fetchStatus:y,status:x}=m,S=!1,E;if(n._optimisticResults){const A=this.hasListeners(),O=!A&&cC(t,n),U=A&&uC(t,r,n,o);(O||U)&&(y=Nm(t.options.networkMode)?"fetching":"paused",m.dataUpdatedAt||(x="pending")),n._optimisticResults==="isRestoring"&&(y="idle")}if(n.select&&typeof m.data<"u")if(i&&m.data===(s==null?void 0:s.data)&&n.select===F(this,bd))E=F(this,ql);else try{we(this,bd,n.select),E=n.select(m.data),E=Gy(i==null?void 0:i.data,E,n),we(this,ql,E),we(this,jo,null)}catch(A){we(this,jo,A)}else E=m.data;if(typeof n.placeholderData<"u"&&typeof E>"u"&&x==="pending"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((N=F(this,Ql))==null?void 0:N.state.data,F(this,Ql)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),we(this,jo,null)}catch(O){we(this,jo,O)}typeof A<"u"&&(x="success",E=Gy(i==null?void 0:i.data,A,n),S=!0)}F(this,jo)&&(p=F(this,jo),E=F(this,ql),g=Date.now(),x="error");const _=y==="fetching",b=x==="pending",C=x==="error",R=b&&_;return{status:x,fetchStatus:y,isPending:b,isSuccess:x==="success",isError:C,isInitialLoading:R,isLoading:R,data:E,dataUpdatedAt:m.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:_,isRefetching:_&&!b,isLoadingError:C&&m.dataUpdatedAt===0,isPaused:y==="paused",isPlaceholderData:S,isRefetchError:C&&m.dataUpdatedAt!==0,isStale:ox(t,n),refetch:this.refetch}}updateResult(t){const n=F(this,Rn),r=this.createResult(F(this,$t),this.options);if(we(this,Sa,F(this,$t).state),we(this,Zl,this.options),F(this,Sa).data!==void 0&&we(this,Ql,F(this,$t)),Hy(r,n))return;we(this,Rn,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!F(this,Ca).size)return!0;const u=new Set(l??F(this,Ca));return this.options.throwOnError&&u.add("error"),Object.keys(F(this,Rn)).some(f=>{const m=f;return F(this,Rn)[m]!==n[m]&&u.has(m)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),tt(this,gm,KR).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&tt(this,Cd,qy).call(this)}},Yn=new WeakMap,$t=new WeakMap,Xl=new WeakMap,Rn=new WeakMap,Sa=new WeakMap,Zl=new WeakMap,jo=new WeakMap,bd=new WeakMap,ql=new WeakMap,Ql=new WeakMap,_a=new WeakMap,Ea=new WeakMap,fs=new WeakMap,Ca=new WeakMap,$a=new WeakSet,bu=function(t){tt(this,kd,e1).call(this);let n=F(this,$t).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jr)),n},Sd=new WeakSet,Yy=function(){if(tt(this,$d,Qy).call(this),sc||F(this,Rn).isStale||!Wy(this.options.staleTime))return;const n=BR(F(this,Rn).dataUpdatedAt,this.options.staleTime)+1;we(this,_a,setTimeout(()=>{F(this,Rn).isStale||this.updateResult()},n))},_d=new WeakSet,Xy=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,$t)):this.options.refetchInterval)??!1},Ed=new WeakSet,Zy=function(t){tt(this,Rd,Jy).call(this),we(this,fs,t),!(sc||this.options.enabled===!1||!Wy(F(this,fs))||F(this,fs)===0)&&we(this,Ea,setInterval(()=>{(this.options.refetchIntervalInBackground||Lp.isFocused())&&tt(this,$a,bu).call(this)},F(this,fs)))},Cd=new WeakSet,qy=function(){tt(this,Sd,Yy).call(this),tt(this,Ed,Zy).call(this,tt(this,_d,Xy).call(this))},$d=new WeakSet,Qy=function(){F(this,_a)&&(clearTimeout(F(this,_a)),we(this,_a,void 0))},Rd=new WeakSet,Jy=function(){F(this,Ea)&&(clearInterval(F(this,Ea)),we(this,Ea,void 0))},kd=new WeakSet,e1=function(){const t=F(this,Yn).getQueryCache().build(F(this,Yn),this.options);if(t===F(this,$t))return;const n=F(this,$t);we(this,$t,t),we(this,Xl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},gm=new WeakSet,KR=function(t){vn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(F(this,Rn))}),F(this,Yn).getQueryCache().notify({query:F(this,$t),type:"observerResultsUpdated"})})},$$);function xL(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function cC(e,t){return xL(e,t)||e.state.dataUpdatedAt>0&&t1(e,t,t.refetchOnMount)}function t1(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ox(e,t)}return!1}function uC(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&ox(e,n)}function ox(e,t){return e.isStaleByTime(t.staleTime)}function bL(e,t){return!Hy(e.getCurrentResult(),t)}var GR=d.createContext(void 0),SL=e=>{const t=d.useContext(GR);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_L=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.createElement(GR.Provider,{value:e},t)),YR=d.createContext(!1),EL=()=>d.useContext(YR);YR.Provider;function CL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $L=d.createContext(CL()),RL=()=>d.useContext($L);function kL(e,t){return typeof e=="function"?e(...t):!!e}var PL=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},TL=e=>{d.useEffect(()=>{e.clearReset()},[e])},AL=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&kL(n,[e.error,r]),ML=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},OL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,NL=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function DL(e,t,n){const r=SL(n),o=EL(),i=RL(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",ML(s),PL(s,i),TL(i);const[l]=d.useState(()=>new t(r,s)),u=l.getOptimisticResult(s);if(d.useSyncExternalStore(d.useCallback(f=>{const m=o?()=>{}:l.subscribe(vn.batchCalls(f));return l.updateResult(),m},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),OL(s,u))throw l.setOptions(s,{listeners:!1}),NL(s,l,i);if(AL({result:u,errorResetBoundary:i,throwOnError:s.throwOnError,query:l.getCurrentQuery()}))throw u.error;return s.notifyOnChangeProps?u:l.trackResult(u)}function IL(e,t){return DL(e,wL,t)}var No=(e=>(e.RemoveBG="RemoveBG",e.AnimeSeg="AnimeSeg",e.RealESRGAN="RealESRGAN",e.GFPGAN="GFPGAN",e.RestoreFormer="RestoreFormer",e.InteractiveSeg="InteractiveSeg",e))(No||{}),ks=(e=>(e.NAME="name",e.CTIME="ctime",e.MTIME="mtime",e))(ks||{}),Nu=(e=>(e.DESCENDING="desc",e.ASCENDING="asc",e))(Nu||{}),ix=(e=>(e.ddim="ddim",e.plms="plms",e))(ix||{}),sx=(e=>(e.INPAINT_NS="INPAINT_NS",e.INPAINT_TELEA="INPAINT_TELEA",e))(sx||{}),jn=(e=>(e.x="x",e.y="y",e.xy="xy",e))(jn||{}),ma=(e=>(e.text_guided="text-guided",e.shape_guided="shape-guided",e.context_aware="context-aware",e.object_remove="object-remove",e.outpainting="outpainting",e))(ma||{});function XR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=XR(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ZR(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=XR(e))&&(r&&(r+=" "),r+=t);return r}const ax="-";function LL(e){const t=FL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const l=s.split(ax);return l[0]===""&&l.length!==1&&l.shift(),qR(l,t)||jL(s)}function i(s,l){const u=n[s]||[];return l&&r[s]?[...u,...r[s]]:u}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function qR(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?qR(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ax);return(s=t.validators.find(({validator:l})=>l(i)))==null?void 0:s.classGroupId}const dC=/^\[(.+)\]$/;function jL(e){if(dC.test(e)){const t=dC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function FL(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return zL(Object.entries(e.classGroups),n).forEach(([i,s])=>{n1(s,r,i,t)}),r}function n1(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:fC(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(BL(o)){n1(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{n1(s,fC(t,i),n,r)})})}function fC(e,t){let n=e;return t.split(ax).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function BL(e){return e.isThemeGetter}function zL(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,l])=>[t+s,l])):i);return[n,o]}):e}function UL(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const QR="!";function VL(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const l=[];let u=0,f=0,m;for(let S=0;S<s.length;S++){let E=s[S];if(u===0){if(E===r&&(n||s.slice(S,S+o)===t)){l.push(s.slice(f,S)),f=S+o;continue}if(E==="/"){m=S;continue}}E==="["?u++:E==="]"&&u--}const p=l.length===0?s:s.substring(f),g=p.startsWith(QR),y=g?p.substring(1):p,x=m&&m>f?m-f:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:x}}}function WL(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function HL(e){return{cache:UL(e.cacheSize),splitModifiers:VL(e),...LL(e)}}const KL=/\s+/;function GL(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(KL).map(s=>{const{modifiers:l,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:m}=n(s);let p=r(m?f.substring(0,m):f),g=!!m;if(!p){if(!m)return{isTailwindClass:!1,originalClassName:s};if(p=r(f),!p)return{isTailwindClass:!1,originalClassName:s};g=!1}const y=WL(l).join(":");return{isTailwindClass:!0,modifierId:u?y+QR:y,classGroupId:p,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:l,classGroupId:u,hasPostfixModifier:f}=s,m=l+u;return i.has(m)?!1:(i.add(m),o(u,f).forEach(p=>i.add(l+p)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function YL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=JR(t))&&(r&&(r+=" "),r+=n);return r}function JR(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=JR(e[r]))&&(n&&(n+=" "),n+=t);return n}function XL(e,...t){let n,r,o,i=s;function s(u){const f=t.reduce((m,p)=>p(m),e());return n=HL(f),r=n.cache.get,o=n.cache.set,i=l,l(u)}function l(u){const f=r(u);if(f)return f;const m=GL(u,n);return o(u,m),m}return function(){return i(YL.apply(null,arguments))}}function Pt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const ek=/^\[(?:([a-z-]+):)?(.+)\]$/i,ZL=/^\d+\/\d+$/,qL=new Set(["px","full","screen"]),QL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ej=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function uo(e){return ga(e)||qL.has(e)||ZL.test(e)}function Zi(e){return _c(e,"length",cj)}function ga(e){return!!e&&!Number.isNaN(Number(e))}function mh(e){return _c(e,"number",ga)}function lu(e){return!!e&&Number.isInteger(Number(e))}function nj(e){return e.endsWith("%")&&ga(e.slice(0,-1))}function Je(e){return ek.test(e)}function qi(e){return QL.test(e)}const rj=new Set(["length","size","percentage"]);function oj(e){return _c(e,rj,tk)}function ij(e){return _c(e,"position",tk)}const sj=new Set(["image","url"]);function aj(e){return _c(e,sj,dj)}function lj(e){return _c(e,"",uj)}function cu(){return!0}function _c(e,t,n){const r=ek.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function cj(e){return JL.test(e)}function tk(){return!1}function uj(e){return ej.test(e)}function dj(e){return tj.test(e)}function fj(){const e=Pt("colors"),t=Pt("spacing"),n=Pt("blur"),r=Pt("brightness"),o=Pt("borderColor"),i=Pt("borderRadius"),s=Pt("borderSpacing"),l=Pt("borderWidth"),u=Pt("contrast"),f=Pt("grayscale"),m=Pt("hueRotate"),p=Pt("invert"),g=Pt("gap"),y=Pt("gradientColorStops"),x=Pt("gradientColorStopPositions"),S=Pt("inset"),E=Pt("margin"),_=Pt("opacity"),b=Pt("padding"),C=Pt("saturate"),R=Pt("scale"),T=Pt("sepia"),N=Pt("skew"),A=Pt("space"),O=Pt("translate"),U=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],ie=()=>["auto",Je,t],K=()=>[Je,t],te=()=>["",uo,Zi],W=()=>["auto",ga,Je],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],G=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",Je],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[ga,mh],L=()=>[ga,Je];return{cacheSize:500,separator:":",theme:{colors:[cu],spacing:[uo,Zi],blur:["none","",qi,Je],brightness:le(),borderColor:[e],borderRadius:["none","","full",qi,Je],borderSpacing:K(),borderWidth:te(),contrast:le(),grayscale:Z(),hueRotate:L(),invert:Z(),gap:K(),gradientColorStops:[e],gradientColorStopPositions:[nj,Zi],inset:ie(),margin:ie(),opacity:le(),padding:K(),saturate:le(),scale:le(),sepia:Z(),skew:L(),space:K(),translate:K()},classGroups:{aspect:[{aspect:["auto","square","video",Je]}],container:["container"],columns:[{columns:[qi]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),Je]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",lu,Je]}],basis:[{basis:ie()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Je]}],grow:[{grow:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",lu,Je]}],"grid-cols":[{"grid-cols":[cu]}],"col-start-end":[{col:["auto",{span:["full",lu,Je]},Je]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[cu]}],"row-start-end":[{row:["auto",{span:[lu,Je]},Je]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Je]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Je]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[E]}],mx:[{mx:[E]}],my:[{my:[E]}],ms:[{ms:[E]}],me:[{me:[E]}],mt:[{mt:[E]}],mr:[{mr:[E]}],mb:[{mb:[E]}],ml:[{ml:[E]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",Je,t]}],"min-w":[{"min-w":["min","max","fit",Je,uo]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[qi]},qi,Je]}],h:[{h:[Je,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",uo,Je]}],"max-h":[{"max-h":[Je,t,"min","max","fit"]}],"font-size":[{text:["base",qi,Zi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mh]}],"font-family":[{font:[cu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Je]}],"line-clamp":[{"line-clamp":["none",ga,mh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",uo,Je]}],"list-image":[{"list-image":["none",Je]}],"list-style-type":[{list:["none","disc","decimal",Je]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",uo,Zi]}],"underline-offset":[{"underline-offset":["auto",uo,Je]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),ij]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},aj]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[uo,Je]}],"outline-w":[{outline:[uo,Zi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[uo,Zi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qi,lj]}],"shadow-color":[{shadow:[cu]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":J()}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",qi,Je]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[C]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Je]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",Je]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",Je]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[lu,Je]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Je]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Je]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-mr":[{"scroll-mr":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Je]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[uo,Zi,mh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const lx=XL(fj),hj=40,pj=1,nk=200,ms="inpaint",gh="diffusers_sd",hC="diffusers_sdxl",vh="diffusers_sd_inpaint",pC="diffusers_sdxl_inpaint",y0="diffusers_other",Xh="#ffcc00bb",mC="ldm",gC="cv2",rk="Fantasy-Studio/Paint-by-Example",mj="timbrooks/instruct-pix2pix",gj="Sanster/PowerPaint-V1-stable-diffusion-inpainting",vj="Sanster/AnyText",yj="out of frame, lowres, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, disfigured, gross proportions, malformed limbs, watermark, signature",vC="Alt";function xe(...e){return lx(ZR(e))}function wj(){async function e(r=""){return(await fetch(r,{method:"GET",cache:"no-cache"})).json()}const t=()=>{const r=document.location;e(r+"/flaskwebgui-keep-server-alive").then(i=>i)},n=3*1e3;t(),setInterval(t,n)}function yC(e){const t=e.split(",")[0].split(":")[1].split(";")[0],n=atob(e.split(",")[1]),r=[];for(let o=0;o<n.length;o+=1)r.push(n.charCodeAt(o));return new Blob([new Uint8Array(r)],{type:t})}function Su(e,t){return new Promise((n,r)=>{const o=e.src,i=e;i.onload=n,i.onerror=s=>{i.src=o,r(s)},i.src=t})}async function xj(e){const t=URL.createObjectURL(e),n=new Image;return await Su(n,t),n}function wC(e){return new Promise((t,n)=>{const r=new Image;r.addEventListener("load",()=>{t(r)}),r.addEventListener("error",o=>{n(o)}),r.src=e.toDataURL()})}function bj(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const o=new Image;o.onload=()=>{t(o)},o.onerror=()=>{n("无法加载图像。")},o.src=r.result},r.onerror=()=>{n("无法读取文件。")},r.readAsDataURL(e)})}function Du(e,t,n){return fetch(e).then(function(r){return r.arrayBuffer()}).then(function(r){return new File([r],t,{type:n})})}async function Sj(){try{const{state:e}=await navigator.permissions.query({name:"clipboard-write"});return e==="granted"}catch{return!1}}function _j(e,t){return new Promise((n,r)=>e.toBlob(async o=>{o?n(o):r(new Error("Expected toBlob() to be defined"))},t))}const Ej=async e=>{const t=[new ClipboardItem({[e.type]:e})];await navigator.clipboard.write(t)};function xC(e){return e.nativeEvent.button===2}function bC(e){return e.nativeEvent.button===1}async function Cj(e){const t=await _j(e,"image/png");try{await Ej(t)}catch{console.log("Copy image failed!")}}function $j(e,t){const n=document.createElement("a");n.href=e,n.download=t,n.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),setTimeout(()=>{n.remove()},100)}function w0(e){const t=e.nativeEvent;if("touches"in e){const n=e.target.getBoundingClientRect(),o=e.touches[0];return{x:(o.clientX-n.x)/n.width*o.target.offsetWidth,y:(o.clientY-n.y)/n.height*o.target.offsetHeight}}return{x:t.offsetX,y:t.offsetY}}function ok(e,t,n=Xh){e.strokeStyle=n,e.lineCap="round",e.lineJoin="round",t.forEach(r=>{!(r!=null&&r.pts.length)||!r.size||(e.lineWidth=r.size,e.beginPath(),e.moveTo(r.pts[0].x,r.pts[0].y),r.pts.forEach(o=>e.lineTo(o.x,o.y)),e.stroke())})}const Zh=(e,t,n,r=[],o="white")=>{const i=document.createElement("canvas");i.width=e,i.height=t;const s=i.getContext("2d");if(!s)throw new Error("could not retrieve mask canvas");return r.forEach(l=>{s.drawImage(l,0,0,e,t)}),n.forEach(l=>{ok(s,l,o)}),i},Iu=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=o=>{var s;const i=(s=o.target)==null?void 0:s.result;t(i)},r.onerror=o=>{n(o)},r.readAsDataURL(e)});function ik(e,t){return function(){return e.apply(t,arguments)}}const{toString:Rj}=Object.prototype,{getPrototypeOf:cx}=Object,Dm=(e=>t=>{const n=Rj.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ni=e=>(e=e.toLowerCase(),t=>Dm(t)===e),Im=e=>t=>typeof t===e,{isArray:Ec}=Array,od=Im("undefined");function kj(e){return e!==null&&!od(e)&&e.constructor!==null&&!od(e.constructor)&&Qr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const sk=ni("ArrayBuffer");function Pj(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&sk(e.buffer),t}const Tj=Im("string"),Qr=Im("function"),ak=Im("number"),Lm=e=>e!==null&&typeof e=="object",Aj=e=>e===!0||e===!1,qh=e=>{if(Dm(e)!=="object")return!1;const t=cx(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Mj=ni("Date"),Oj=ni("File"),Nj=ni("Blob"),Dj=ni("FileList"),Ij=e=>Lm(e)&&Qr(e.pipe),Lj=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Qr(e.append)&&((t=Dm(e))==="formdata"||t==="object"&&Qr(e.toString)&&e.toString()==="[object FormData]"))},jj=ni("URLSearchParams"),Fj=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Dd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Ec(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(r=0;r<s;r++)l=i[r],t.call(null,e[l],l,e)}}function lk(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const ck=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,uk=e=>!od(e)&&e!==ck;function r1(){const{caseless:e}=uk(this)&&this||{},t={},n=(r,o)=>{const i=e&&lk(t,o)||o;qh(t[i])&&qh(r)?t[i]=r1(t[i],r):qh(r)?t[i]=r1({},r):Ec(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Dd(arguments[r],n);return t}const Bj=(e,t,n,{allOwnKeys:r}={})=>(Dd(t,(o,i)=>{n&&Qr(o)?e[i]=ik(o,n):e[i]=o},{allOwnKeys:r}),e),zj=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Uj=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Vj=(e,t,n,r)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!r||r(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=n!==!1&&cx(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Wj=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Hj=e=>{if(!e)return null;if(Ec(e))return e;let t=e.length;if(!ak(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Kj=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&cx(Uint8Array)),Gj=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Yj=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Xj=ni("HTMLFormElement"),Zj=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),SC=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),qj=ni("RegExp"),dk=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Dd(n,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(r[i]=s||o)}),Object.defineProperties(e,r)},Qj=e=>{dk(e,(t,n)=>{if(Qr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Qr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Jj=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return Ec(e)?r(e):r(String(e).split(t)),n},eF=()=>{},tF=(e,t)=>(e=+e,Number.isFinite(e)?e:t),x0="abcdefghijklmnopqrstuvwxyz",_C="0123456789",fk={DIGIT:_C,ALPHA:x0,ALPHA_DIGIT:x0+x0.toUpperCase()+_C},nF=(e=16,t=fk.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function rF(e){return!!(e&&Qr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const oF=e=>{const t=new Array(10),n=(r,o)=>{if(Lm(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=Ec(r)?[]:{};return Dd(r,(s,l)=>{const u=n(s,o+1);!od(u)&&(i[l]=u)}),t[o]=void 0,i}}return r};return n(e,0)},iF=ni("AsyncFunction"),sF=e=>e&&(Lm(e)||Qr(e))&&Qr(e.then)&&Qr(e.catch),ae={isArray:Ec,isArrayBuffer:sk,isBuffer:kj,isFormData:Lj,isArrayBufferView:Pj,isString:Tj,isNumber:ak,isBoolean:Aj,isObject:Lm,isPlainObject:qh,isUndefined:od,isDate:Mj,isFile:Oj,isBlob:Nj,isRegExp:qj,isFunction:Qr,isStream:Ij,isURLSearchParams:jj,isTypedArray:Kj,isFileList:Dj,forEach:Dd,merge:r1,extend:Bj,trim:Fj,stripBOM:zj,inherits:Uj,toFlatObject:Vj,kindOf:Dm,kindOfTest:ni,endsWith:Wj,toArray:Hj,forEachEntry:Gj,matchAll:Yj,isHTMLForm:Xj,hasOwnProperty:SC,hasOwnProp:SC,reduceDescriptors:dk,freezeMethods:Qj,toObjectSet:Jj,toCamelCase:Zj,noop:eF,toFiniteNumber:tF,findKey:lk,global:ck,isContextDefined:uk,ALPHABET:fk,generateString:nF,isSpecCompliantForm:rF,toJSONObject:oF,isAsyncFn:iF,isThenable:sF};function ut(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}ae.inherits(ut,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ae.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const hk=ut.prototype,pk={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{pk[e]={value:e}});Object.defineProperties(ut,pk);Object.defineProperty(hk,"isAxiosError",{value:!0});ut.from=(e,t,n,r,o,i)=>{const s=Object.create(hk);return ae.toFlatObject(e,s,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),ut.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const aF=null;function o1(e){return ae.isPlainObject(e)||ae.isArray(e)}function mk(e){return ae.endsWith(e,"[]")?e.slice(0,-2):e}function EC(e,t,n){return e?e.concat(t).map(function(o,i){return o=mk(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function lF(e){return ae.isArray(e)&&!e.some(o1)}const cF=ae.toFlatObject(ae,{},null,function(t){return/^is[A-Z]/.test(t)});function jm(e,t,n){if(!ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ae.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,E){return!ae.isUndefined(E[S])});const r=n.metaTokens,o=n.visitor||m,i=n.dots,s=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&ae.isSpecCompliantForm(t);if(!ae.isFunction(o))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(ae.isDate(x))return x.toISOString();if(!u&&ae.isBlob(x))throw new ut("Blob is not supported. Use a Buffer instead.");return ae.isArrayBuffer(x)||ae.isTypedArray(x)?u&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function m(x,S,E){let _=x;if(x&&!E&&typeof x=="object"){if(ae.endsWith(S,"{}"))S=r?S:S.slice(0,-2),x=JSON.stringify(x);else if(ae.isArray(x)&&lF(x)||(ae.isFileList(x)||ae.endsWith(S,"[]"))&&(_=ae.toArray(x)))return S=mk(S),_.forEach(function(C,R){!(ae.isUndefined(C)||C===null)&&t.append(s===!0?EC([S],R,i):s===null?S:S+"[]",f(C))}),!1}return o1(x)?!0:(t.append(EC(E,S,i),f(x)),!1)}const p=[],g=Object.assign(cF,{defaultVisitor:m,convertValue:f,isVisitable:o1});function y(x,S){if(!ae.isUndefined(x)){if(p.indexOf(x)!==-1)throw Error("Circular reference detected in "+S.join("."));p.push(x),ae.forEach(x,function(_,b){(!(ae.isUndefined(_)||_===null)&&o.call(t,_,ae.isString(b)?b.trim():b,S,g))===!0&&y(_,S?S.concat(b):[b])}),p.pop()}}if(!ae.isObject(e))throw new TypeError("data must be an object");return y(e),t}function CC(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ux(e,t){this._pairs=[],e&&jm(e,this,t)}const gk=ux.prototype;gk.append=function(t,n){this._pairs.push([t,n])};gk.toString=function(t){const n=t?function(r){return t.call(this,r,CC)}:CC;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function uF(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function vk(e,t,n){if(!t)return e;const r=n&&n.encode||uF,o=n&&n.serialize;let i;if(o?i=o(t,n):i=ae.isURLSearchParams(t)?t.toString():new ux(t,n).toString(r),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class dF{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ae.forEach(this.handlers,function(r){r!==null&&t(r)})}}const $C=dF,yk={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fF=typeof URLSearchParams<"u"?URLSearchParams:ux,hF=typeof FormData<"u"?FormData:null,pF=typeof Blob<"u"?Blob:null,mF={isBrowser:!0,classes:{URLSearchParams:fF,FormData:hF,Blob:pF},protocols:["http","https","file","blob","url","data"]},wk=typeof window<"u"&&typeof document<"u",gF=(e=>wk&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),vF=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yF=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:wk,hasStandardBrowserEnv:gF,hasStandardBrowserWebWorkerEnv:vF},Symbol.toStringTag,{value:"Module"})),Wo={...yF,...mF};function wF(e,t){return jm(e,new Wo.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return Wo.isNode&&ae.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function xF(e){return ae.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function bF(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function xk(e){function t(n,r,o,i){let s=n[i++];const l=Number.isFinite(+s),u=i>=n.length;return s=!s&&ae.isArray(o)?o.length:s,u?(ae.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!l):((!o[s]||!ae.isObject(o[s]))&&(o[s]=[]),t(n,r,o[s],i)&&ae.isArray(o[s])&&(o[s]=bF(o[s])),!l)}if(ae.isFormData(e)&&ae.isFunction(e.entries)){const n={};return ae.forEachEntry(e,(r,o)=>{t(xF(r),o,n,0)}),n}return null}function SF(e,t,n){if(ae.isString(e))try{return(t||JSON.parse)(e),ae.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const dx={transitional:yk,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=ae.isObject(t);if(i&&ae.isHTMLForm(t)&&(t=new FormData(t)),ae.isFormData(t))return o&&o?JSON.stringify(xk(t)):t;if(ae.isArrayBuffer(t)||ae.isBuffer(t)||ae.isStream(t)||ae.isFile(t)||ae.isBlob(t))return t;if(ae.isArrayBufferView(t))return t.buffer;if(ae.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return wF(t,this.formSerializer).toString();if((l=ae.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return jm(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),SF(t)):t}],transformResponse:[function(t){const n=this.transitional||dx.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(t&&ae.isString(t)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(l){if(s)throw l.name==="SyntaxError"?ut.from(l,ut.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wo.classes.FormData,Blob:Wo.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ae.forEach(["delete","get","head","post","put","patch"],e=>{dx.headers[e]={}});const fx=dx,_F=ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),EF=e=>{const t={};let n,r,o;return e&&e.split(`
`).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||t[n]&&_F[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},RC=Symbol("internals");function uu(e){return e&&String(e).trim().toLowerCase()}function Qh(e){return e===!1||e==null?e:ae.isArray(e)?e.map(Qh):String(e)}function CF(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const $F=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function b0(e,t,n,r,o){if(ae.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!ae.isString(t)){if(ae.isString(r))return t.indexOf(r)!==-1;if(ae.isRegExp(r))return r.test(t)}}function RF(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function kF(e,t){const n=ae.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,s){return this[r].call(this,t,o,i,s)},configurable:!0})})}class Fm{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(l,u,f){const m=uu(u);if(!m)throw new Error("header name must be a non-empty string");const p=ae.findKey(o,m);(!p||o[p]===void 0||f===!0||f===void 0&&o[p]!==!1)&&(o[p||u]=Qh(l))}const s=(l,u)=>ae.forEach(l,(f,m)=>i(f,m,u));return ae.isPlainObject(t)||t instanceof this.constructor?s(t,n):ae.isString(t)&&(t=t.trim())&&!$F(t)?s(EF(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=uu(t),t){const r=ae.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return CF(o);if(ae.isFunction(n))return n.call(this,o,r);if(ae.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=uu(t),t){const r=ae.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||b0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(s){if(s=uu(s),s){const l=ae.findKey(r,s);l&&(!n||b0(r,r[l],l,n))&&(delete r[l],o=!0)}}return ae.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||b0(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return ae.forEach(this,(o,i)=>{const s=ae.findKey(r,i);if(s){n[s]=Qh(o),delete n[i];return}const l=t?RF(i):String(i).trim();l!==i&&delete n[i],n[l]=Qh(o),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ae.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&ae.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[RC]=this[RC]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=uu(s);r[l]||(kF(o,s),r[l]=!0)}return ae.isArray(t)?t.forEach(i):i(t),this}}Fm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ae.reduceDescriptors(Fm.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ae.freezeMethods(Fm);const Si=Fm;function S0(e,t){const n=this||fx,r=t||n,o=Si.from(r.headers);let i=r.data;return ae.forEach(e,function(l){i=l.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function bk(e){return!!(e&&e.__CANCEL__)}function Id(e,t,n){ut.call(this,e??"canceled",ut.ERR_CANCELED,t,n),this.name="CanceledError"}ae.inherits(Id,ut,{__CANCEL__:!0});function PF(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ut("Request failed with status code "+n.status,[ut.ERR_BAD_REQUEST,ut.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const TF=Wo.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];ae.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ae.isString(r)&&s.push("path="+r),ae.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function AF(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function MF(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Sk(e,t){return e&&!AF(t)?MF(e,t):t}const OF=Wo.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(s){const l=ae.isString(s)?o(s):s;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}();function NF(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function DF(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const f=Date.now(),m=r[i];s||(s=f),n[o]=u,r[o]=f;let p=i,g=0;for(;p!==o;)g+=n[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),f-s<t)return;const y=m&&f-m;return y?Math.round(g*1e3/y):void 0}}function kC(e,t){let n=0;const r=DF(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,l=i-n,u=r(l),f=i<=s;n=i;const m={loaded:i,total:s,progress:s?i/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&f?(s-i)/u:void 0,event:o};m[t?"download":"upload"]=!0,e(m)}}const IF=typeof XMLHttpRequest<"u",LF=IF&&function(e){return new Promise(function(n,r){let o=e.data;const i=Si.from(e.headers).normalize();let{responseType:s,withXSRFToken:l}=e,u;function f(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}let m;if(ae.isFormData(o)){if(Wo.hasStandardBrowserEnv||Wo.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((m=i.getContentType())!==!1){const[S,...E]=m?m.split(";").map(_=>_.trim()).filter(Boolean):[];i.setContentType([S||"multipart/form-data",...E].join("; "))}}let p=new XMLHttpRequest;if(e.auth){const S=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(S+":"+E))}const g=Sk(e.baseURL,e.url);p.open(e.method.toUpperCase(),vk(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout;function y(){if(!p)return;const S=Si.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),_={data:!s||s==="text"||s==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:S,config:e,request:p};PF(function(C){n(C),f()},function(C){r(C),f()},_),p=null}if("onloadend"in p?p.onloadend=y:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(y)},p.onabort=function(){p&&(r(new ut("Request aborted",ut.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new ut("Network Error",ut.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let E=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const _=e.transitional||yk;e.timeoutErrorMessage&&(E=e.timeoutErrorMessage),r(new ut(E,_.clarifyTimeoutError?ut.ETIMEDOUT:ut.ECONNABORTED,e,p)),p=null},Wo.hasStandardBrowserEnv&&(l&&ae.isFunction(l)&&(l=l(e)),l||l!==!1&&OF(g))){const S=e.xsrfHeaderName&&e.xsrfCookieName&&TF.read(e.xsrfCookieName);S&&i.set(e.xsrfHeaderName,S)}o===void 0&&i.setContentType(null),"setRequestHeader"in p&&ae.forEach(i.toJSON(),function(E,_){p.setRequestHeader(_,E)}),ae.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),s&&s!=="json"&&(p.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&p.addEventListener("progress",kC(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",kC(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=S=>{p&&(r(!S||S.type?new Id(null,e,p):S),p.abort(),p=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const x=NF(g);if(x&&Wo.protocols.indexOf(x)===-1){r(new ut("Unsupported protocol "+x+":",ut.ERR_BAD_REQUEST,e));return}p.send(o||null)})},i1={http:aF,xhr:LF};ae.forEach(i1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const PC=e=>`- ${e}`,jF=e=>ae.isFunction(e)||e===null||e===!1,_k={getAdapter:e=>{e=ae.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let s;if(r=n,!jF(n)&&(r=i1[(s=String(n)).toLowerCase()],r===void 0))throw new ut(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
`+i.map(PC).join(`
`):" "+PC(i[0]):"as no adapter specified";throw new ut("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:i1};function _0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Id(null,e)}function TC(e){return _0(e),e.headers=Si.from(e.headers),e.data=S0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),_k.getAdapter(e.adapter||fx.adapter)(e).then(function(r){return _0(e),r.data=S0.call(e,e.transformResponse,r),r.headers=Si.from(r.headers),r},function(r){return bk(r)||(_0(e),r&&r.response&&(r.response.data=S0.call(e,e.transformResponse,r.response),r.response.headers=Si.from(r.response.headers))),Promise.reject(r)})}const AC=e=>e instanceof Si?e.toJSON():e;function ac(e,t){t=t||{};const n={};function r(f,m,p){return ae.isPlainObject(f)&&ae.isPlainObject(m)?ae.merge.call({caseless:p},f,m):ae.isPlainObject(m)?ae.merge({},m):ae.isArray(m)?m.slice():m}function o(f,m,p){if(ae.isUndefined(m)){if(!ae.isUndefined(f))return r(void 0,f,p)}else return r(f,m,p)}function i(f,m){if(!ae.isUndefined(m))return r(void 0,m)}function s(f,m){if(ae.isUndefined(m)){if(!ae.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function l(f,m,p){if(p in t)return r(f,m);if(p in e)return r(void 0,f)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(f,m)=>o(AC(f),AC(m),!0)};return ae.forEach(Object.keys(Object.assign({},e,t)),function(m){const p=u[m]||o,g=p(e[m],t[m],m);ae.isUndefined(g)&&p!==l||(n[m]=g)}),n}const Ek="1.6.2",hx={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{hx[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const MC={};hx.transitional=function(t,n,r){function o(i,s){return"[Axios v"+Ek+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,l)=>{if(t===!1)throw new ut(o(s," has been removed"+(n?" in "+n:"")),ut.ERR_DEPRECATED);return n&&!MC[s]&&(MC[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,l):!0}};function FF(e,t,n){if(typeof e!="object")throw new ut("options must be an object",ut.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const l=e[i],u=l===void 0||s(l,i,e);if(u!==!0)throw new ut("option "+i+" must be "+u,ut.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ut("Unknown option "+i,ut.ERR_BAD_OPTION)}}const s1={assertOptions:FF,validators:hx},Qi=s1.validators;class Fp{constructor(t){this.defaults=t,this.interceptors={request:new $C,response:new $C}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ac(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&s1.assertOptions(r,{silentJSONParsing:Qi.transitional(Qi.boolean),forcedJSONParsing:Qi.transitional(Qi.boolean),clarifyTimeoutError:Qi.transitional(Qi.boolean)},!1),o!=null&&(ae.isFunction(o)?n.paramsSerializer={serialize:o}:s1.assertOptions(o,{encode:Qi.function,serialize:Qi.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&ae.merge(i.common,i[n.method]);i&&ae.forEach(["delete","get","head","post","put","patch","common"],x=>{delete i[x]}),n.headers=Si.concat(s,i);const l=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(u=u&&S.synchronous,l.unshift(S.fulfilled,S.rejected))});const f=[];this.interceptors.response.forEach(function(S){f.push(S.fulfilled,S.rejected)});let m,p=0,g;if(!u){const x=[TC.bind(this),void 0];for(x.unshift.apply(x,l),x.push.apply(x,f),g=x.length,m=Promise.resolve(n);p<g;)m=m.then(x[p++],x[p++]);return m}g=l.length;let y=n;for(p=0;p<g;){const x=l[p++],S=l[p++];try{y=x(y)}catch(E){S.call(this,E);break}}try{m=TC.call(this,y)}catch(x){return Promise.reject(x)}for(p=0,g=f.length;p<g;)m=m.then(f[p++],f[p++]);return m}getUri(t){t=ac(this.defaults,t);const n=Sk(t.baseURL,t.url);return vk(n,t.params,t.paramsSerializer)}}ae.forEach(["delete","get","head","options"],function(t){Fp.prototype[t]=function(n,r){return this.request(ac(r||{},{method:t,url:n,data:(r||{}).data}))}});ae.forEach(["post","put","patch"],function(t){function n(r){return function(i,s,l){return this.request(ac(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Fp.prototype[t]=n(),Fp.prototype[t+"Form"]=n(!0)});const Jh=Fp;class px{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{r.subscribe(l),i=l}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,l){r.reason||(r.reason=new Id(i,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new px(function(o){t=o}),cancel:t}}}const BF=px;function zF(e){return function(n){return e.apply(null,n)}}function UF(e){return ae.isObject(e)&&e.isAxiosError===!0}const a1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(a1).forEach(([e,t])=>{a1[t]=e});const VF=a1;function Ck(e){const t=new Jh(e),n=ik(Jh.prototype.request,t);return ae.extend(n,Jh.prototype,t,{allOwnKeys:!0}),ae.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Ck(ac(e,o))},n}const Qt=Ck(fx);Qt.Axios=Jh;Qt.CanceledError=Id;Qt.CancelToken=BF;Qt.isCancel=bk;Qt.VERSION=Ek;Qt.toFormData=jm;Qt.AxiosError=ut;Qt.Cancel=Qt.CanceledError;Qt.all=function(t){return Promise.all(t)};Qt.spread=zF;Qt.isAxiosError=UF;Qt.mergeConfig=ac;Qt.AxiosHeaders=Si;Qt.formToJSON=e=>xk(ae.isHTMLForm(e)?new FormData(e):e);Qt.getAdapter=_k.getAdapter;Qt.HttpStatusCode=VF;Qt.default=Qt;const WF=Qt,Ni="/api/v1",Cc=WF.create({baseURL:Ni}),$c=async e=>{const t=await e.json();throw new Error(`${t.errors}
Please take a screenshot of the detailed error message in your terminal`)};async function HF(e,t,n,r,o,i=null){const s=await Iu(e),l=await Iu(o),u=i?await Iu(i):null,f=await fetch(`${Ni}/inpaint`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:s,mask:l,ldm_steps:t.ldmSteps,ldm_sampler:t.ldmSampler,zits_wireframe:t.zitsWireframe,cv2_flag:t.cv2Flag,cv2_radius:t.cv2Radius,hd_strategy:"Crop",hd_strategy_crop_triger_size:640,hd_strategy_crop_margin:128,hd_trategy_resize_imit:2048,prompt:t.prompt,negative_prompt:t.negativePrompt,use_croper:t.showCropper,croper_x:n.x,croper_y:n.y,croper_height:n.height,croper_width:n.width,use_extender:t.showExtender,extender_x:r.x,extender_y:r.y,extender_height:r.height,extender_width:r.width,sd_mask_blur:t.sdMaskBlur,sd_strength:t.sdStrength,sd_steps:t.sdSteps,sd_guidance_scale:t.sdGuidanceScale,sd_sampler:t.sdSampler,sd_seed:t.seedFixed?t.seed:-1,sd_match_histograms:t.sdMatchHistograms,sd_lcm_lora:t.enableLCMLora,paint_by_example_example_image:u,p2p_image_guidance_scale:t.p2pImageGuidanceScale,enable_controlnet:t.enableControlnet,controlnet_conditioning_scale:t.controlnetConditioningScale,controlnet_method:t.controlnetMethod?t.controlnetMethod:"",enable_brushnet:t.enableBrushNet,brushnet_method:t.brushnetMethod?t.brushnetMethod:"",brushnet_conditioning_scale:t.brushnetConditioningScale,enable_powerpaint_v2:t.enablePowerPaintV2,powerpaint_task:t.showExtender?ma.outpainting:t.powerpaintTask})});if(f.ok){const m=await f.blob();return{blob:URL.createObjectURL(m),seed:f.headers.get("X-Seed")}}throw await $c(f)}async function $k(){return(await Cc.get("/server-config")).data}async function KF(e){return(await Cc.post("/model",{name:e})).data}async function E0(e,t){return Cc.post("/switch_plugin_model",{plugin_name:e,model_name:t})}async function GF(){return(await Cc.get("/model")).data}async function Rk(e,t,n,r,o){const i=await Iu(n),l=await fetch(`${Ni}/${e?"run_plugin_gen_mask":"run_plugin_gen_image"}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,image:i,scale:r,clicks:o})});if(l.ok){const u=await l.blob();return{blob:URL.createObjectURL(u)}}throw await $c(l)}async function YF(e,t){const n=await fetch(`${Ni}/media_file?tab=${e}&filename=${encodeURIComponent(t)}`,{method:"GET"});if(n.ok){const r=await n.blob();return new File([r],t,{type:n.headers.get("Content-Type")??"image/png"})}throw await $c(n)}async function XF(e,t){const n=await fetch(`${Ni}/media_file?tab=${e}&filename=${encodeURIComponent(t)}`,{method:"GET"});if(n.ok)return await n.blob();throw await $c(n)}async function ZF(e){return(await Cc.get("medias",{params:{tab:e}})).data}async function qF(e,t,n){const r=await Du(e.src,t,n),o=new FormData;o.append("file",r);try{const i=await fetch(`${Ni}/save_image`,{method:"POST",body:o});if(!i.ok)throw await $c(i)}catch(i){throw new Error(`Something went wrong: ${i}`)}}async function QF(e){const t=new FormData;return t.append("file",e),(await Cc.post("/gen-info",t)).data}async function JF(e,t,n){const r=await Iu(e),o=await fetch(`${Ni}/adjust_mask`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mask:r,operate:t,kernel_size:n})});if(o.ok)return await o.blob();throw await $c(o)}function eB(){const[e,t]=d.useState(null),n=d.useCallback(()=>{const r=new Headers;r.append("pragma","no-cache"),r.append("cache-control","no-cache"),fetch(`${Ni}/inputimage`,{headers:r}).then(async o=>{var l;if(!o.ok)return;const i=(l=o.headers.get("content-disposition"))==null?void 0:l.split("filename=")[1].split(";")[0],s=await o.blob();if(s&&s.type.startsWith("image")){const u=new File([s],i!==void 0?i:"inputImage");t(u)}}).catch(o=>{console.log(o)})},[t]);return d.useEffect(()=>{n()},[n]),e}function Ro(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var tB=["color"],nB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,tB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),rB=["color"],kk=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,rB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),oB=["color"],iB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,oB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),sB=["color"],aB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,sB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),lB=["color"],cB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,lB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),uB=["color"],Pk=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,uB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),dB=["color"],fB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,dB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),hB=["color"],pB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,hB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),mB=["color"],gB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,mB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),vB=["color"],yB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,vB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M7 2H1.5C1.22386 2 1 2.22386 1 2.5V7H7V2ZM8 2V7H14V2.5C14 2.22386 13.7761 2 13.5 2H8ZM7 8H1V12.5C1 12.7761 1.22386 13 1.5 13H7V8ZM8 13V8H14V12.5C14 12.7761 13.7761 13 13.5 13H8ZM1.5 1C0.671573 1 0 1.67157 0 2.5V12.5C0 13.3284 0.671573 14 1.5 14H13.5C14.3284 14 15 13.3284 15 12.5V2.5C15 1.67157 14.3284 1 13.5 1H1.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),wB=["color"],xB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ro(e,wB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M1.5 2H13.5C13.7761 2 14 2.22386 14 2.5V7H1V2.5C1 2.22386 1.22386 2 1.5 2ZM1 8V12.5C1 12.7761 1.22386 13 1.5 13H13.5C13.7761 13 14 12.7761 14 12.5V8H1ZM0 2.5C0 1.67157 0.671573 1 1.5 1H13.5C14.3284 1 15 1.67157 15 2.5V12.5C15 13.3284 14.3284 14 13.5 14H1.5C0.671573 14 0 13.3284 0 12.5V2.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}function bB(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Bm(...e){return t=>e.forEach(n=>bB(n,t))}function We(...e){return d.useCallback(Bm(...e),e)}const Qo=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),i=o.find(SB);if(i){const s=i.props.children,l=o.map(u=>u===i?d.Children.count(s)>1?d.Children.only(null):d.isValidElement(s)?s.props.children:null:u);return d.createElement(l1,Y({},r,{ref:t}),d.isValidElement(s)?d.cloneElement(s,void 0,l):null)}return d.createElement(l1,Y({},r,{ref:t}),n)});Qo.displayName="Slot";const l1=d.forwardRef((e,t)=>{const{children:n,...r}=e;return d.isValidElement(n)?d.cloneElement(n,{..._B(r,n.props),ref:t?Bm(t,n.ref):n.ref}):d.Children.count(n)>1?d.Children.only(null):null});l1.displayName="SlotClone";const mx=({children:e})=>d.createElement(d.Fragment,null,e);function SB(e){return d.isValidElement(e)&&e.type===mx}function _B(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{i(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const OC=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,NC=ZR,zm=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return NC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(f=>{const m=n==null?void 0:n[f],p=i==null?void 0:i[f];if(m===null)return null;const g=OC(m)||OC(p);return o[f][g]}),l=n&&Object.entries(n).reduce((f,m)=>{let[p,g]=m;return g===void 0||(f[p]=g),f},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:p,className:g,...y}=m;return Object.entries(y).every(x=>{let[S,E]=x;return Array.isArray(E)?E.includes({...i,...l}[S]):{...i,...l}[S]===E})?[...f,p,g]:f},[]);return NC(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)};var EB={VITE_BACKEND:"http://127.0.0.1:8000",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function CB(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;const s=u=>u===null?null:JSON.parse(u,t==null?void 0:t.reviver),l=(i=n.getItem(o))!=null?i:null;return l instanceof Promise?l.then(s):s(l)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,t==null?void 0:t.replacer)),removeItem:o=>n.removeItem(o)}}const id=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return id(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return id(r)(n)}}}},$B=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:E=>E,version:0,merge:(E,_)=>({..._,...E}),...t},s=!1;const l=new Set,u=new Set;let f;try{f=i.getStorage()}catch{}if(!f)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...E)},r,o);const m=id(i.serialize),p=()=>{const E=i.partialize({...r()});let _;const b=m({state:E,version:i.version}).then(C=>f.setItem(i.name,C)).catch(C=>{_=C});if(_)throw _;return b},g=o.setState;o.setState=(E,_)=>{g(E,_),p()};const y=e((...E)=>{n(...E),p()},r,o);let x;const S=()=>{var E;if(!f)return;s=!1,l.forEach(b=>b(r()));const _=((E=i.onRehydrateStorage)==null?void 0:E.call(i,r()))||void 0;return id(f.getItem.bind(f))(i.name).then(b=>{if(b)return i.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==i.version){if(i.migrate)return i.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var C;return x=i.merge(b,(C=r())!=null?C:y),n(x,!0),p()}).then(()=>{_==null||_(x,void 0),s=!0,u.forEach(b=>b(x))}).catch(b=>{_==null||_(void 0,b)})};return o.persist={setOptions:E=>{i={...i,...E},E.getStorage&&(f=E.getStorage())},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>s,onHydrate:E=>(l.add(E),()=>{l.delete(E)}),onFinishHydration:E=>(u.add(E),()=>{u.delete(E)})},S(),x||y},RB=(e,t)=>(n,r,o)=>{let i={storage:CB(()=>localStorage),partialize:S=>S,version:0,merge:(S,E)=>({...E,...S}),...t},s=!1;const l=new Set,u=new Set;let f=i.storage;if(!f)return e((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...S)},r,o);const m=()=>{const S=i.partialize({...r()});return f.setItem(i.name,{state:S,version:i.version})},p=o.setState;o.setState=(S,E)=>{p(S,E),m()};const g=e((...S)=>{n(...S),m()},r,o);let y;const x=()=>{var S,E;if(!f)return;s=!1,l.forEach(b=>{var C;return b((C=r())!=null?C:g)});const _=((E=i.onRehydrateStorage)==null?void 0:E.call(i,(S=r())!=null?S:g))||void 0;return id(f.getItem.bind(f))(i.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==i.version){if(i.migrate)return i.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var C;return y=i.merge(b,(C=r())!=null?C:g),n(y,!0),m()}).then(()=>{_==null||_(y,void 0),y=r(),s=!0,u.forEach(b=>b(y))}).catch(b=>{_==null||_(void 0,b)})};return o.persist={setOptions:S=>{i={...i,...S},S.storage&&(f=S.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>x(),hasHydrated:()=>s,onHydrate:S=>(l.add(S),()=>{l.delete(S)}),onFinishHydration:S=>(u.add(S),()=>{u.delete(S)})},i.skipHydration||x(),y||g},kB=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((EB?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),$B(e,t)):RB(e,t),PB=kB;function TB(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Tk=Symbol.for("immer-nothing"),DC=Symbol.for("immer-draftable"),xr=Symbol.for("immer-state");function wo(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var lc=Object.getPrototypeOf;function cc(e){return!!e&&!!e[xr]}function Na(e){var t;return e?Ak(e)||Array.isArray(e)||!!e[DC]||!!((t=e.constructor)!=null&&t[DC])||Vm(e)||Wm(e):!1}var AB=Object.prototype.constructor.toString();function Ak(e){if(!e||typeof e!="object")return!1;const t=lc(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===AB}function sd(e,t){Um(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Um(e){const t=e[xr];return t?t.type_:Array.isArray(e)?1:Vm(e)?2:Wm(e)?3:0}function c1(e,t){return Um(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Mk(e,t,n){const r=Um(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function MB(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Vm(e){return e instanceof Map}function Wm(e){return e instanceof Set}function ia(e){return e.copy_||e.base_}function u1(e,t){if(Vm(e))return new Map(e);if(Wm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Ak(e))return lc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[xr];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(lc(e),n)}function gx(e,t=!1){return Hm(e)||cc(e)||!Na(e)||(Um(e)>1&&(e.set=e.add=e.clear=e.delete=OB),Object.freeze(e),t&&sd(e,(n,r)=>gx(r,!0))),e}function OB(){wo(2)}function Hm(e){return Object.isFrozen(e)}var NB={};function Da(e){const t=NB[e];return t||wo(0,e),t}var ad;function Ok(){return ad}function DB(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function IC(e,t){t&&(Da("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function d1(e){f1(e),e.drafts_.forEach(IB),e.drafts_=null}function f1(e){e===ad&&(ad=e.parent_)}function LC(e){return ad=DB(ad,e)}function IB(e){const t=e[xr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[xr].modified_&&(d1(t),wo(4)),Na(e)&&(e=Bp(t,e),t.parent_||zp(t,e)),t.patches_&&Da("Patches").generateReplacementPatches_(n[xr].base_,e,t.patches_,t.inversePatches_)):e=Bp(t,n,[]),d1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Tk?e:void 0}function Bp(e,t,n){if(Hm(t))return t;const r=t[xr];if(!r)return sd(t,(o,i)=>FC(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return zp(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),sd(i,(l,u)=>FC(e,r,o,l,u,n,s)),zp(e,o,!1),n&&e.patches_&&Da("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function FC(e,t,n,r,o,i,s){if(cc(o)){const l=i&&t&&t.type_!==3&&!c1(t.assigned_,r)?i.concat(r):void 0,u=Bp(e,o,l);if(Mk(n,r,u),cc(u))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Na(o)&&!Hm(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Bp(e,o),(!t||!t.scope_.parent_)&&zp(e,o)}}function zp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&gx(t,n)}function LB(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Ok(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=vx;n&&(o=[r],i=ld);const{revoke:s,proxy:l}=Proxy.revocable(o,i);return r.draft_=l,r.revoke_=s,l}var vx={get(e,t){if(t===xr)return e;const n=ia(e);if(!c1(n,t))return jB(e,n,t);const r=n[t];return e.finalized_||!Na(r)?r:r===C0(e.base_,t)?($0(e),e.copy_[t]=p1(r,e)):r},has(e,t){return t in ia(e)},ownKeys(e){return Reflect.ownKeys(ia(e))},set(e,t,n){const r=Nk(ia(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=C0(ia(e),t),i=o==null?void 0:o[xr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(MB(n,o)&&(n!==void 0||c1(e.base_,t)))return!0;$0(e),h1(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return C0(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,$0(e),h1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ia(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){wo(11)},getPrototypeOf(e){return lc(e.base_)},setPrototypeOf(){wo(12)}},ld={};sd(vx,(e,t)=>{ld[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ld.deleteProperty=function(e,t){return ld.set.call(this,e,t,void 0)};ld.set=function(e,t,n){return vx.set.call(this,e[0],t,n,e[0])};function C0(e,t){const n=e[xr];return(n?ia(n):e)[t]}function jB(e,t,n){var o;const r=Nk(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function Nk(e,t){if(!(t in e))return;let n=lc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=lc(n)}}function h1(e){e.modified_||(e.modified_=!0,e.parent_&&h1(e.parent_))}function $0(e){e.copy_||(e.copy_=u1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var FB=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(u=i,...f){return s.produce(u,m=>n.call(this,m,...f))}}typeof n!="function"&&wo(6),r!==void 0&&typeof r!="function"&&wo(7);let o;if(Na(t)){const i=LC(this),s=p1(t,void 0);let l=!0;try{o=n(s),l=!1}finally{l?d1(i):f1(i)}return IC(i,r),jC(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===Tk&&(o=void 0),this.autoFreeze_&&gx(o,!0),r){const i=[],s=[];Da("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else wo(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...l)=>this.produceWithPatches(s,u=>t(u,...l));let r,o;return[this.produce(t,n,(s,l)=>{r=s,o=l}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Na(e)||wo(8),cc(e)&&(e=BB(e));const t=LC(this),n=p1(e,void 0);return n[xr].isManual_=!0,f1(t),n}finishDraft(e,t){const n=e&&e[xr];(!n||!n.isManual_)&&wo(9);const{scope_:r}=n;return IC(r,t),jC(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Da("Patches").applyPatches_;return cc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function p1(e,t){const n=Vm(e)?Da("MapSet").proxyMap_(e,t):Wm(e)?Da("MapSet").proxySet_(e,t):LB(e,t);return(t?t.scope_:Ok()).drafts_.push(n),n}function BB(e){return cc(e)||wo(10,e),Dk(e)}function Dk(e){if(!Na(e)||Hm(e))return e;const t=e[xr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=u1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=u1(e,!0);return sd(n,(r,o)=>{Mk(n,r,Dk(o))}),t&&(t.finalized_=!1),n}var br=new FB,zB=br.produce;br.produceWithPatches.bind(br);br.setAutoFreeze.bind(br);br.setUseStrictShallowCopy.bind(br);br.applyPatches.bind(br);br.createDraft.bind(br);br.finishDraft.bind(br);const UB=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const l=typeof o=="function"?zB(o):o;return t(l,i,...s)},e(r.setState,n,r)),VB=UB;var Ik={exports:{}},Lk={},jk={exports:{}},Fk={};/**
* @license React
* use-sync-external-store-shim.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 uc=d;function WB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HB=typeof Object.is=="function"?Object.is:WB,KB=uc.useState,GB=uc.useEffect,YB=uc.useLayoutEffect,XB=uc.useDebugValue;function ZB(e,t){var n=t(),r=KB({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return YB(function(){o.value=n,o.getSnapshot=t,R0(o)&&i({inst:o})},[e,n,t]),GB(function(){return R0(o)&&i({inst:o}),e(function(){R0(o)&&i({inst:o})})},[e]),XB(n),n}function R0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!HB(e,n)}catch{return!0}}function qB(e,t){return t()}var QB=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qB:ZB;Fk.useSyncExternalStore=uc.useSyncExternalStore!==void 0?uc.useSyncExternalStore:QB;jk.exports=Fk;var JB=jk.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.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 Km=d,ez=JB;function tz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nz=typeof Object.is=="function"?Object.is:tz,rz=ez.useSyncExternalStore,oz=Km.useRef,iz=Km.useEffect,sz=Km.useMemo,az=Km.useDebugValue;Lk.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=oz(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=sz(function(){function u(y){if(!f){if(f=!0,m=y,y=r(y),o!==void 0&&s.hasValue){var x=s.value;if(o(x,y))return p=x}return p=y}if(x=p,nz(m,y))return x;var S=r(y);return o!==void 0&&o(x,S)?x:(m=y,p=S)}var f=!1,m,p,g=n===void 0?null:n;return[function(){return u(t())},g===null?void 0:function(){return u(g())}]},[t,n,r,o]);var l=rz(e,i[0],i[1]);return iz(function(){s.hasValue=!0,s.value=l},[l]),az(l),l};Ik.exports=Lk;var lz=Ik.exports;const cz=vm(lz);var uz={VITE_BACKEND:"http://127.0.0.1:8000",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const BC=e=>{let t;const n=new Set,r=(u,f)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const p=t;t=f??typeof m!="object"?m:Object.assign({},t,m),n.forEach(g=>g(t,p))}},o=()=>t,l={setState:r,getState:o,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(uz?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,l),l},dz=e=>e?BC(e):BC,{useDebugValue:fz}=Be,{useSyncExternalStoreWithSelector:hz}=cz;function pz(e,t=e.getState,n){const r=hz(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return fz(r),r}const zC=(e,t)=>{const n=dz(e),r=(o,i=t)=>pz(n,o,i);return Object.assign(r,n),r},mz=(e,t)=>e?zC(e,t):zC,gz=1,vz=1e6;let k0=0;function yz(){return k0=(k0+1)%Number.MAX_VALUE,k0.toString()}const P0=new Map,UC=e=>{if(P0.has(e))return;const t=setTimeout(()=>{P0.delete(e),Lu({type:"REMOVE_TOAST",toastId:e})},vz);P0.set(e,t)},wz=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,gz)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?UC(n):e.toasts.forEach(r=>{UC(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},ep=[];let tp={toasts:[]};function Lu(e){tp=wz(tp,e),ep.forEach(t=>{t(tp)})}function hl({...e}){const t=yz(),n=o=>Lu({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Lu({type:"DISMISS_TOAST",toastId:t});return Lu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Ld(){const[e,t]=d.useState(tp);return d.useEffect(()=>(ep.push(t),()=>{const n=ep.indexOf(t);n>-1&&ep.splice(n,1)}),[e]),{...e,toast:hl,dismiss:n=>Lu({type:"DISMISS_TOAST",toastId:n})}}const na={file:null,paintByExampleFile:null,customMask:null,imageHeight:0,imageWidth:0,isInpainting:!1,isPluginRunning:!1,isAdjustingMask:!1,disableShortCuts:!1,windowSize:{height:600,width:800},editorState:{baseBrushSize:hj,brushSizeScale:1,renders:[],extraMasks:[],prevExtraMasks:[],temporaryMasks:[],lineGroups:[],lastLineGroup:[],curLineGroup:[],redoRenders:[],redoCurLines:[],redoLineGroups:[]},interactiveSegState:{isInteractiveSeg:!1,tmpInteractiveSegMask:null,clicks:[]},cropperState:{x:0,y:0,width:512,height:512},extenderState:{x:0,y:0,width:512,height:512},isCropperExtenderResizing:!1,fileManagerState:{sortBy:ks.CTIME,sortOrder:Nu.DESCENDING,layout:"masonry",searchText:"",inputDirectory:"",outputDirectory:""},serverConfig:{plugins:[],modelInfos:[],removeBGModel:"briaai/RMBG-1.4",removeBGModels:[],realesrganModel:"realesr-general-x4v3",realesrganModels:[],interactiveSegModel:"vit_b",interactiveSegModels:[],enableFileManager:!1,enableAutoSaving:!1,enableControlnet:!1,controlnetMethod:"lllyasviel/control_v11p_sd15_canny",disableModelSwitch:!1,isDesktop:!1,samplers:["DPM++ 2M SDE Karras"]},settings:{model:{name:"lama",path:"lama",model_type:"inpaint",support_controlnet:!1,support_brushnet:!1,support_strength:!1,support_outpainting:!1,support_powerpaint_v2:!1,controlnets:[],brushnets:[],support_lcm_lora:!1,is_single_file_diffusers:!1,need_prompt:!1},showCropper:!1,showExtender:!1,extenderDirection:jn.xy,enableDownloadMask:!1,enableManualInpainting:!1,enableUploadMask:!1,enableAutoExtractPrompt:!0,ldmSteps:30,ldmSampler:ix.ddim,zitsWireframe:!0,cv2Radius:5,cv2Flag:sx.INPAINT_NS,prompt:"",negativePrompt:yj,seed:42,seedFixed:!1,sdMaskBlur:12,sdStrength:1,sdSteps:50,sdGuidanceScale:7.5,sdSampler:"DPM++ 2M",sdMatchHistograms:!1,sdScale:1,p2pImageGuidanceScale:1.5,enableControlnet:!1,controlnetMethod:"lllyasviel/control_v11p_sd15_canny",controlnetConditioningScale:.4,enableBrushNet:!1,brushnetMethod:"random_mask",brushnetConditioningScale:1,enableLCMLora:!1,enablePowerPaintV2:!1,powerpaintTask:ma.text_guided,adjustMaskKernelSize:12}},xt=mz()(PB(VB((e,t)=>({...na,showPrevMask:async()=>{if(t().settings.showExtender)return;const{lastLineGroup:n,curLineGroup:r,prevExtraMasks:o,extraMasks:i}=t().editorState;if(r.length!==0||i.length!==0)return;const{imageWidth:s,imageHeight:l}=t(),u=Zh(s,l,[n],o,Xh);try{const f=await wC(u);e(m=>{m.editorState.temporaryMasks.push(f)})}catch(f){console.error(f);return}},hidePrevMask:()=>{e(n=>{n.editorState.temporaryMasks=[]})},getCurrentTargetFile:async()=>{const n=t().file,r=t().editorState.renders;let o=n;if(r.length>0){const i=r[r.length-1];o=await Du(i.currentSrc,n.name,n.type)}return o},runInpainting:async()=>{const{isInpainting:n,file:r,paintByExampleFile:o,imageWidth:i,imageHeight:s,settings:l,cropperState:u,extenderState:f}=t();if(n||r===null||t().settings.model.support_outpainting&&l.showExtender&&f.x===0&&f.y===0&&f.height===s&&f.width===i)return;const{lastLineGroup:m,curLineGroup:p,lineGroups:g,renders:y,prevExtraMasks:x,extraMasks:S}=t().editorState,E=p.length===0&&S.length===0&&!l.showExtender;let _=[],b=[];if(E===!0?(b=m,_=x):(b=p,_=S),b.length===0&&_===null&&!l.showExtender){hl({variant:"destructive",description:"Please draw mask on picture"});return}const C=[...g,b];e(N=>{N.isInpainting=!0});let R=r;if(E===!0){if(y.length>1){const N=y[y.length-2];R=await Du(N.currentSrc,r.name,r.type)}}else if(y.length>0){const N=y[y.length-1];R=await Du(N.currentSrc,r.name,r.type)}const T=Zh(i,s,[b],_,Xh);if(E){const N=await wC(T);e(A=>{A.editorState.temporaryMasks=[N]})}try{const N=await HF(R,l,u,f,yC(T.toDataURL()),o),{blob:A,seed:O}=N;O&&t().setSeed(parseInt(O,10));const U=new Image;await Su(U,A);const z=[...y,U];t().setImageSize(U.width,U.height),t().updateEditorState({renders:z,lineGroups:C,lastLineGroup:b,curLineGroup:[],extraMasks:[],prevExtraMasks:_})}catch(N){hl({variant:"destructive",description:N.message?N.message:N.toString()})}t().resetRedoState(),e(N=>{N.isInpainting=!1,N.editorState.temporaryMasks=[]})},runRenderablePlugin:async(n,r,o={upscale:1})=>{const{renders:i,lineGroups:s}=t().editorState;e(l=>{l.isPluginRunning=!0});try{const l=new Date,u=await t().getCurrentTargetFile(),f=await Rk(n,r,u,o.upscale),{blob:m}=f;if(n){const y=new Image;await Su(y,m),e(x=>{x.editorState.extraMasks.push(y)})}else{const y=new Image;await Su(y,m),t().setImageSize(y.width,y.height);const x=[...i,y],S=[...s,[]];t().updateEditorState({renders:x,lineGroups:S})}const g=new Date().getTime()-l.getTime();hl({description:`Run ${r} successfully in ${g/1e3}s`})}catch(l){hl({variant:"destructive",description:l.message?l.message:l.toString()})}e(l=>{l.isPluginRunning=!1})},updateEditorState:n=>{e(r=>{r.editorState={...r.editorState,...n}})},cleanCurLineGroup:()=>{t().updateEditorState({curLineGroup:[]})},handleCanvasMouseDown:n=>{let r=[];const o=t();o.runMannually()&&(r=[...o.editorState.curLineGroup]),r.push({size:o.getBrushSize(),pts:[n]}),e(i=>{i.editorState.curLineGroup=r})},handleCanvasMouseMove:n=>{e(r=>{const o=r.editorState.curLineGroup;o.length&&o[o.length-1].pts.push(n)})},runMannually:()=>{const n=t();return n.settings.enableManualInpainting||n.settings.model.model_type!==ms},getIsProcessing:()=>t().isInpainting||t().isPluginRunning||t().isAdjustingMask,isSD:()=>t().settings.model.model_type!==ms,undoDisabled:()=>{const n=t().editorState;if(n.renders.length>0)return!1;if(t().runMannually()){if(n.curLineGroup.length===0)return!0}else if(n.renders.length===0)return!0;return!1},undo:()=>{t().runMannually()&&t().editorState.curLineGroup.length!==0?e(n=>{const r=n.editorState;if(r.curLineGroup.length===0)return;r.lastLineGroup=[];const o=r.curLineGroup.pop();r.redoCurLines.push(o)}):e(n=>{const r=n.editorState;if(r.renders.length===0||r.lineGroups.length===0)return;const o=r.lineGroups.pop();r.redoLineGroups.push(o),r.redoCurLines=[],r.curLineGroup=[];const i=r.renders.pop();r.redoRenders.push(i)})},redoDisabled:()=>{const n=t().editorState;if(n.redoRenders.length>0)return!1;if(t().runMannually()){if(n.redoCurLines.length===0)return!0}else if(n.redoRenders.length===0)return!0;return!1},redo:()=>{t().runMannually()&&t().editorState.redoCurLines.length!==0?e(n=>{const r=n.editorState;if(r.redoCurLines.length===0)return;const o=r.redoCurLines.pop();r.curLineGroup.push(o)}):e(n=>{const r=n.editorState;if(r.redoRenders.length===0||r.redoLineGroups.length===0)return;const o=r.redoLineGroups.pop();r.lineGroups.push(o),r.curLineGroup=[];const i=r.redoRenders.pop();r.renders.push(i)})},resetRedoState:()=>{e(n=>{n.editorState.redoCurLines=[],n.editorState.redoLineGroups=[],n.editorState.redoRenders=[]})},updateAppState:n=>{e(()=>n)},getBrushSize:()=>t().editorState.baseBrushSize*t().editorState.brushSizeScale,showPromptInput:()=>{const n=t().settings.model;return n.model_type!==ms&&n.name!==rk},setServerConfig:n=>{e(r=>{r.serverConfig=n,r.settings.enableControlnet=n.enableControlnet,r.settings.controlnetMethod=n.controlnetMethod})},updateSettings:n=>{e(r=>{r.settings={...r.settings,...n}})},updateEnablePowerPaintV2:n=>{t().updateSettings({enablePowerPaintV2:n}),n&&t().updateSettings({enableBrushNet:!1,enableControlnet:!1,enableLCMLora:!1})},updateEnableBrushNet:n=>{t().updateSettings({enableBrushNet:n}),n&&t().updateSettings({enablePowerPaintV2:!1,enableControlnet:!1,enableLCMLora:!1})},updateEnableControlnet(n){t().updateSettings({enableControlnet:n}),n&&t().updateSettings({enablePowerPaintV2:!1,enableBrushNet:!1})},updateLCMLora(n){t().updateSettings({enableLCMLora:n}),n&&t().updateSettings({enablePowerPaintV2:!1,enableBrushNet:!1})},setModel:n=>{e(r=>{r.settings.model=n,n.support_controlnet&&!n.controlnets.includes(r.settings.controlnetMethod)&&(r.settings.controlnetMethod=n.controlnets[0])})},updateFileManagerState:n=>{e(r=>{r.fileManagerState={...r.fileManagerState,...n}})},updateInteractiveSegState:n=>{e(r=>({...r,interactiveSegState:{...r.interactiveSegState,...n}}))},resetInteractiveSegState:()=>{t().updateInteractiveSegState(na.interactiveSegState)},handleInteractiveSegAccept:()=>{e(n=>{n.interactiveSegState.tmpInteractiveSegMask&&n.editorState.extraMasks.push(n.interactiveSegState.tmpInteractiveSegMask),n.interactiveSegState={...na.interactiveSegState}})},handleFileManagerMaskSelect:async n=>{const r=new Image;await Su(r,URL.createObjectURL(n)),e(o=>{o.editorState.extraMasks.push(r)}),t().runInpainting()},setIsInpainting:n=>e(r=>{r.isInpainting=n}),setFile:async n=>{if(t().settings.enableAutoExtractPrompt)try{const r=await QF(n);r.prompt&&e(o=>{o.settings.prompt=r.prompt}),r.negative_prompt&&e(o=>{o.settings.negativePrompt=r.negative_prompt})}catch(r){hl({variant:"destructive",description:r.message?r.message:r.toString()})}e(r=>{r.file=n,r.interactiveSegState=na.interactiveSegState,r.editorState=na.editorState,r.cropperState=na.cropperState})},setCustomFile:n=>e(r=>{r.customMask=n}),setBaseBrushSize:n=>e(r=>{r.editorState.baseBrushSize=n}),decreaseBaseBrushSize:()=>{const n=t().editorState.baseBrushSize;let r=n;n>10&&(r=n-10),n<=10&&n>0&&(r=n-3),t().setBaseBrushSize(r)},increaseBaseBrushSize:()=>{const n=t().editorState.baseBrushSize,r=Math.min(n+10,nk);t().setBaseBrushSize(r)},setImageSize:(n,r)=>{e(o=>{o.imageWidth=n,o.imageHeight=r,o.editorState.brushSizeScale=Math.max(Math.min(n,r),512)/512}),t().resetExtender(n,r)},setCropperX:n=>e(r=>{r.cropperState.x=n}),setCropperY:n=>e(r=>{r.cropperState.y=n}),setCropperWidth:n=>e(r=>{r.cropperState.width=n}),setCropperHeight:n=>e(r=>{r.cropperState.height=n}),setExtenderX:n=>e(r=>{r.extenderState.x=n}),setExtenderY:n=>e(r=>{r.extenderState.y=n}),setExtenderWidth:n=>e(r=>{r.extenderState.width=n}),setExtenderHeight:n=>e(r=>{r.extenderState.height=n}),setIsCropperExtenderResizing:n=>e(r=>{r.isCropperExtenderResizing=n}),updateExtenderDirection:n=>{console.log(`updateExtenderDirection: ${JSON.stringify(t().extenderState)}`),e(r=>{r.settings.extenderDirection=n,r.extenderState.x=0,r.extenderState.y=0,r.extenderState.width=r.imageWidth,r.extenderState.height=r.imageHeight}),t().updateExtenderByBuiltIn(n,1.5)},updateExtenderByBuiltIn:(n,r)=>{const o={...na.extenderState};let{x:i,y:s,width:l,height:u}=o;const{imageWidth:f,imageHeight:m}=t();switch(l=f,u=m,n){case jn.x:i=-Math.ceil(f*(r-1)/2),l=Math.ceil(f*r);break;case jn.y:s=-Math.ceil(m*(r-1)/2),u=Math.ceil(m*r);break;case jn.xy:i=-Math.ceil(f*(r-1)/2),s=-Math.ceil(m*(r-1)/2),l=Math.ceil(f*r),u=Math.ceil(m*r);break}e(p=>{p.extenderState.x=i,p.extenderState.y=s,p.extenderState.width=l,p.extenderState.height=u})},resetExtender:(n,r)=>{e(o=>{o.extenderState.x=0,o.extenderState.y=0,o.extenderState.width=n,o.extenderState.height=r})},setSeed:n=>e(r=>{r.settings.seed=n}),adjustMask:async n=>{const{imageWidth:r,imageHeight:o}=t(),{curLineGroup:i,extraMasks:s}=t().editorState,{adjustMaskKernelSize:l}=t().settings;if(i.length===0&&s.length===0)return;e(g=>{g.isAdjustingMask=!0});const u=Zh(r,o,[i],s,Xh),f=yC(u.toDataURL()),m=await JF(f,n,l),p=await xj(m);e(g=>{g.editorState.extraMasks=[p],g.editorState.curLineGroup=[]}),e(g=>{g.isAdjustingMask=!1})},clearMask:()=>{e(n=>{n.editorState.extraMasks=[],n.editorState.curLineGroup=[]})}})),{name:"ZUSTAND_STATE",version:2,partialize:e=>Object.fromEntries(Object.entries(e).filter(([t])=>["fileManagerState","settings"].includes(t)))}),TB),Gm=d.forwardRef(({className:e,type:t,...n},r)=>{const o=xt(l=>l.updateAppState),i=()=>{o({disableShortCuts:!0})},s=()=>{o({disableShortCuts:!1})};return v.jsx("input",{type:t,className:xe("flex h-8 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,autoComplete:"off",tabIndex:-1,onFocus:i,onBlur:s,...n})});Gm.displayName="Input";const fo=d.forwardRef(({numberValue:e,allowFloat:t,onNumberValueChange:n,className:r,...o},i)=>{const[s,l]=d.useState(e.toString());d.useEffect(()=>{s!==e.toString()+"."&&l(e.toString())},[e]);const u=f=>{let p=f.target.value;if(t){if(p=p.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"),p.length===0){n(0);return}n(parseFloat(p))}else{if(p=p.replace(/\D/g,""),p.length===0){n(0);return}n(parseInt(p,10))}l(p)};return v.jsx(Gm,{ref:i,value:s,onInput:u,className:xe("text-center h-7 px-1",r),...o})});function fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function xz(e,t){const n=d.createContext(t);function r(i){const{children:s,...l}=i,u=d.useMemo(()=>l,Object.values(l));return d.createElement(n.Provider,{value:u},s)}function o(i){const s=d.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function An(e,t=[]){let n=[];function r(i,s){const l=d.createContext(s),u=n.length;n=[...n,s];function f(p){const{scope:g,children:y,...x}=p,S=(g==null?void 0:g[e][u])||l,E=d.useMemo(()=>x,Object.values(x));return d.createElement(S.Provider,{value:E},y)}function m(p,g){const y=(g==null?void 0:g[e][u])||l,x=d.useContext(y);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return f.displayName=i+"Provider",[f,m]}const o=()=>{const i=n.map(s=>d.createContext(s));return function(l){const u=(l==null?void 0:l[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return o.scopeName=e,[r,bz(o,...t)]}function bz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((l,{useScope:u,scopeName:f})=>{const p=u(i)[`__scope${f}`];return{...l,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const Sz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ae=Sz.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:i,...s}=r,l=i?Qo:t;return d.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),d.createElement(l,Y({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function yx(e,t){e&&Bs.flushSync(()=>e.dispatchEvent(t))}function Lt(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function _z(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const m1="dismissableLayer.update",Ez="dismissableLayer.pointerDownOutside",Cz="dismissableLayer.focusOutside";let VC;const Bk=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rc=d.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:u,...f}=e,m=d.useContext(Bk),[p,g]=d.useState(null),y=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,x]=d.useState({}),S=We(t,O=>g(O)),E=Array.from(m.layers),[_]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),b=E.indexOf(_),C=p?E.indexOf(p):-1,R=m.layersWithOutsidePointerEventsDisabled.size>0,T=C>=b,N=Rz(O=>{const U=O.target,z=[...m.branches].some(ie=>ie.contains(U));!T||z||(i==null||i(O),l==null||l(O),O.defaultPrevented||u==null||u())},y),A=kz(O=>{const U=O.target;[...m.branches].some(ie=>ie.contains(U))||(s==null||s(O),l==null||l(O),O.defaultPrevented||u==null||u())},y);return _z(O=>{C===m.layers.size-1&&(o==null||o(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},y),d.useEffect(()=>{if(p)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(VC=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),WC(),()=>{r&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=VC)}},[p,y,r,m]),d.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),WC())},[p,m]),d.useEffect(()=>{const O=()=>x({});return document.addEventListener(m1,O),()=>document.removeEventListener(m1,O)},[]),d.createElement(Ae.div,Y({},f,{ref:S,style:{pointerEvents:R?T?"auto":"none":void 0,...e.style},onFocusCapture:fe(e.onFocusCapture,A.onFocusCapture),onBlurCapture:fe(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:fe(e.onPointerDownCapture,N.onPointerDownCapture)}))}),$z=d.forwardRef((e,t)=>{const n=d.useContext(Bk),r=d.useRef(null),o=We(t,r);return d.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),d.createElement(Ae.div,Y({},e,{ref:o}))});function Rz(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let m=function(){zk(Ez,n,f,{discrete:!0})};var u=m;const f={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=m,t.addEventListener("click",o.current,{once:!0})):m()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kz(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e),r=d.useRef(!1);return d.useEffect(()=>{const o=i=>{i.target&&!r.current&&zk(Cz,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function WC(){const e=new CustomEvent(m1);document.dispatchEvent(e)}function zk(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?yx(o,i):o.dispatchEvent(i)}const Pz=Rc,Tz=$z,Tn=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},Az=K9.useId||(()=>{});let Mz=0;function tr(e){const[t,n]=d.useState(Az());return Tn(()=>{e||n(r=>r??String(Mz++))},[e]),e||(t?`radix-${t}`:"")}const Oz=["top","right","bottom","left"],Os=Math.min,pr=Math.max,Up=Math.round,yh=Math.floor,Ns=e=>({x:e,y:e}),Nz={left:"right",right:"left",bottom:"top",top:"bottom"},Dz={start:"end",end:"start"};function g1(e,t,n){return pr(e,Os(t,n))}function Ri(e,t){return typeof e=="function"?e(t):e}function ki(e){return e.split("-")[0]}function kc(e){return e.split("-")[1]}function wx(e){return e==="x"?"y":"x"}function xx(e){return e==="y"?"height":"width"}function Pc(e){return["top","bottom"].includes(ki(e))?"y":"x"}function bx(e){return wx(Pc(e))}function Iz(e,t,n){n===void 0&&(n=!1);const r=kc(e),o=bx(e),i=xx(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Vp(s)),[s,Vp(s)]}function Lz(e){const t=Vp(e);return[v1(e),t,v1(t)]}function v1(e){return e.replace(/start|end/g,t=>Dz[t])}function jz(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Fz(e,t,n,r){const o=kc(e);let i=jz(ki(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(v1)))),i}function Vp(e){return e.replace(/left|right|bottom|top/g,t=>Nz[t])}function Bz(e){return{top:0,right:0,bottom:0,left:0,...e}}function Uk(e){return typeof e!="number"?Bz(e):{top:e,right:e,bottom:e,left:e}}function Wp(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function HC(e,t,n){let{reference:r,floating:o}=e;const i=Pc(t),s=bx(t),l=xx(s),u=ki(t),f=i==="y",m=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,g=r[l]/2-o[l]/2;let y;switch(u){case"top":y={x:m,y:r.y-o.height};break;case"bottom":y={x:m,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-o.width,y:p};break;default:y={x:r.x,y:r.y}}switch(kc(t)){case"start":y[s]-=g*(n&&f?-1:1);break;case"end":y[s]+=g*(n&&f?-1:1);break}return y}const zz=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:p}=HC(f,r,u),g=r,y={},x=0;for(let S=0;S<l.length;S++){const{name:E,fn:_}=l[S],{x:b,y:C,data:R,reset:T}=await _({x:m,y:p,initialPlacement:r,placement:g,strategy:o,middlewareData:y,rects:f,platform:s,elements:{reference:e,floating:t}});if(m=b??m,p=C??p,y={...y,[E]:{...y[E],...R}},T&&x<=50){x++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(f=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:m,y:p}=HC(f,g,u)),S=-1;continue}}return{x:m,y:p,placement:g,strategy:o,middlewareData:y}};async function cd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:g=!1,padding:y=0}=Ri(t,e),x=Uk(y),E=l[g?p==="floating"?"reference":"floating":p],_=Wp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:f,rootBoundary:m,strategy:u})),b=p==="floating"?{...s.floating,x:r,y:o}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),R=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},T=Wp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:C,strategy:u}):b);return{top:(_.top-T.top+x.top)/R.y,bottom:(T.bottom-_.bottom+x.bottom)/R.y,left:(_.left-T.left+x.left)/R.x,right:(T.right-_.right+x.right)/R.x}}const KC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:u}=t,{element:f,padding:m=0}=Ri(e,t)||{};if(f==null)return{};const p=Uk(m),g={x:n,y:r},y=bx(o),x=xx(y),S=await s.getDimensions(f),E=y==="y",_=E?"top":"left",b=E?"bottom":"right",C=E?"clientHeight":"clientWidth",R=i.reference[x]+i.reference[y]-g[y]-i.floating[x],T=g[y]-i.reference[y],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let A=N?N[C]:0;(!A||!await(s.isElement==null?void 0:s.isElement(N)))&&(A=l.floating[C]||i.floating[x]);const O=R/2-T/2,U=A/2-S[x]/2-1,z=Os(p[_],U),ie=Os(p[b],U),K=z,te=A-S[x]-ie,W=A/2-S[x]/2+O,re=g1(K,W,te),H=!u.arrow&&kc(o)!=null&&W!=re&&i.reference[x]/2-(W<K?z:ie)-S[x]/2<0,J=H?W<K?W-K:W-te:0;return{[y]:g[y]+J,data:{[y]:re,centerOffset:W-re-J,...H&&{alignmentOffset:J}},reset:H}}}),Uz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:u,elements:f}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...E}=Ri(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=ki(o),b=ki(l)===l,C=await(u.isRTL==null?void 0:u.isRTL(f.floating)),R=g||(b||!S?[Vp(l)]:Lz(l));!g&&x!=="none"&&R.push(...Fz(l,S,x,C));const T=[l,...R],N=await cd(t,E),A=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(m&&A.push(N[_]),p){const K=Iz(o,s,C);A.push(N[K[0]],N[K[1]])}if(O=[...O,{placement:o,overflows:A}],!A.every(K=>K<=0)){var U,z;const K=(((U=i.flip)==null?void 0:U.index)||0)+1,te=T[K];if(te)return{data:{index:K,overflows:O},reset:{placement:te}};let W=(z=O.filter(re=>re.overflows[0]<=0).sort((re,H)=>re.overflows[1]-H.overflows[1])[0])==null?void 0:z.placement;if(!W)switch(y){case"bestFit":{var ie;const re=(ie=O.map(H=>[H.placement,H.overflows.filter(J=>J>0).reduce((J,G)=>J+G,0)]).sort((H,J)=>H[1]-J[1])[0])==null?void 0:ie[0];re&&(W=re);break}case"initialPlacement":W=l;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function GC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function YC(e){return Oz.some(t=>e[t]>=0)}const Vz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ri(e,t);switch(r){case"referenceHidden":{const i=await cd(t,{...o,elementContext:"reference"}),s=GC(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:YC(s)}}}case"escaped":{const i=await cd(t,{...o,altBoundary:!0}),s=GC(i,n.floating);return{data:{escapedOffsets:s,escaped:YC(s)}}}default:return{}}}}};async function Wz(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ki(n),l=kc(n),u=Pc(n)==="y",f=["left","top"].includes(s)?-1:1,m=i&&u?-1:1,p=Ri(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return l&&typeof x=="number"&&(y=l==="end"?x*-1:x),u?{x:y*m,y:g*f}:{x:g*f,y:y*m}}const Hz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await Wz(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},Kz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:E=>{let{x:_,y:b}=E;return{x:_,y:b}}},...u}=Ri(e,t),f={x:n,y:r},m=await cd(t,u),p=Pc(ki(o)),g=wx(p);let y=f[g],x=f[p];if(i){const E=g==="y"?"top":"left",_=g==="y"?"bottom":"right",b=y+m[E],C=y-m[_];y=g1(b,y,C)}if(s){const E=p==="y"?"top":"left",_=p==="y"?"bottom":"right",b=x+m[E],C=x-m[_];x=g1(b,x,C)}const S=l.fn({...t,[g]:y,[p]:x});return{...S,data:{x:S.x-n,y:S.y-r}}}}},Gz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:u=!0,crossAxis:f=!0}=Ri(e,t),m={x:n,y:r},p=Pc(o),g=wx(p);let y=m[g],x=m[p];const S=Ri(l,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(u){const C=g==="y"?"height":"width",R=i.reference[g]-i.floating[C]+E.mainAxis,T=i.reference[g]+i.reference[C]-E.mainAxis;y<R?y=R:y>T&&(y=T)}if(f){var _,b;const C=g==="y"?"width":"height",R=["top","left"].includes(ki(o)),T=i.reference[p]-i.floating[C]+(R&&((_=s.offset)==null?void 0:_[p])||0)+(R?0:E.crossAxis),N=i.reference[p]+i.reference[C]+(R?0:((b=s.offset)==null?void 0:b[p])||0)-(R?E.crossAxis:0);x<T?x=T:x>N&&(x=N)}return{[g]:y,[p]:x}}}},Yz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...l}=Ri(e,t),u=await cd(t,l),f=ki(n),m=kc(n),p=Pc(n)==="y",{width:g,height:y}=r.floating;let x,S;f==="top"||f==="bottom"?(x=f,S=m===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(S=f,x=m==="end"?"top":"bottom");const E=y-u[x],_=g-u[S],b=!t.middlewareData.shift;let C=E,R=_;if(p){const N=g-u.left-u.right;R=m||b?Os(_,N):N}else{const N=y-u.top-u.bottom;C=m||b?Os(E,N):N}if(b&&!m){const N=pr(u.left,0),A=pr(u.right,0),O=pr(u.top,0),U=pr(u.bottom,0);p?R=g-2*(N!==0||A!==0?N+A:pr(u.left,u.right)):C=y-2*(O!==0||U!==0?O+U:pr(u.top,u.bottom))}await s({...t,availableWidth:R,availableHeight:C});const T=await o.getDimensions(i.floating);return g!==T.width||y!==T.height?{reset:{rects:!0}}:{}}}};function Ds(e){return Vk(e)?(e.nodeName||"").toLowerCase():"#document"}function yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Di(e){var t;return(t=(Vk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vk(e){return e instanceof Node||e instanceof yr(e).Node}function Pi(e){return e instanceof Element||e instanceof yr(e).Element}function Jo(e){return e instanceof HTMLElement||e instanceof yr(e).HTMLElement}function XC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yr(e).ShadowRoot}function jd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=to(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Xz(e){return["table","td","th"].includes(Ds(e))}function Sx(e){const t=_x(),n=to(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Zz(e){let t=dc(e);for(;Jo(t)&&!Ym(t);){if(Sx(t))return t;t=dc(t)}return null}function _x(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ym(e){return["html","body","#document"].includes(Ds(e))}function to(e){return yr(e).getComputedStyle(e)}function Xm(e){return Pi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dc(e){if(Ds(e)==="html")return e;const t=e.assignedSlot||e.parentNode||XC(e)&&e.host||Di(e);return XC(t)?t.host:t}function Wk(e){const t=dc(e);return Ym(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jo(t)&&jd(t)?t:Wk(t)}function ud(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Wk(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=yr(o);return i?t.concat(s,s.visualViewport||[],jd(o)?o:[],s.frameElement&&n?ud(s.frameElement):[]):t.concat(o,ud(o,[],n))}function Hk(e){const t=to(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jo(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=Up(n)!==i||Up(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Ex(e){return Pi(e)?e:e.contextElement}function Il(e){const t=Ex(e);if(!Jo(t))return Ns(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Hk(t);let s=(i?Up(n.width):n.width)/r,l=(i?Up(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const qz=Ns(0);function Kk(e){const t=yr(e);return!_x()||!t.visualViewport?qz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yr(e)?!1:t}function Ia(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ex(e);let s=Ns(1);t&&(r?Pi(r)&&(s=Il(r)):s=Il(e));const l=Qz(i,n,r)?Kk(i):Ns(0);let u=(o.left+l.x)/s.x,f=(o.top+l.y)/s.y,m=o.width/s.x,p=o.height/s.y;if(i){const g=yr(i),y=r&&Pi(r)?yr(r):r;let x=g.frameElement;for(;x&&r&&y!==g;){const S=Il(x),E=x.getBoundingClientRect(),_=to(x),b=E.left+(x.clientLeft+parseFloat(_.paddingLeft))*S.x,C=E.top+(x.clientTop+parseFloat(_.paddingTop))*S.y;u*=S.x,f*=S.y,m*=S.x,p*=S.y,u+=b,f+=C,x=yr(x).frameElement}}return Wp({width:m,height:p,x:u,y:f})}function Jz(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Jo(n),i=Di(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},l=Ns(1);const u=Ns(0);if((o||!o&&r!=="fixed")&&((Ds(n)!=="body"||jd(i))&&(s=Xm(n)),Jo(n))){const f=Ia(n);l=Il(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-s.scrollLeft*l.x+u.x,y:t.y*l.y-s.scrollTop*l.y+u.y}}function eU(e){return Array.from(e.getClientRects())}function Gk(e){return Ia(Di(e)).left+Xm(e).scrollLeft}function tU(e){const t=Di(e),n=Xm(e),r=e.ownerDocument.body,o=pr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Gk(e);const l=-n.scrollTop;return to(r).direction==="rtl"&&(s+=pr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function nU(e,t){const n=yr(e),r=Di(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){i=o.width,s=o.height;const f=_x();(!f||f&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:i,height:s,x:l,y:u}}function rU(e,t){const n=Ia(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Jo(e)?Il(e):Ns(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,u=o*i.x,f=r*i.y;return{width:s,height:l,x:u,y:f}}function ZC(e,t,n){let r;if(t==="viewport")r=nU(e,n);else if(t==="document")r=tU(Di(e));else if(Pi(t))r=rU(t,n);else{const o=Kk(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Wp(r)}function Yk(e,t){const n=dc(e);return n===t||!Pi(n)||Ym(n)?!1:to(n).position==="fixed"||Yk(n,t)}function oU(e,t){const n=t.get(e);if(n)return n;let r=ud(e,[],!1).filter(l=>Pi(l)&&Ds(l)!=="body"),o=null;const i=to(e).position==="fixed";let s=i?dc(e):e;for(;Pi(s)&&!Ym(s);){const l=to(s),u=Sx(s);!u&&l.position==="fixed"&&(o=null),(i?!u&&!o:!u&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||jd(s)&&!u&&Yk(e,s))?r=r.filter(m=>m!==s):o=l,s=dc(s)}return t.set(e,r),r}function iU(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?oU(t,this._c):[].concat(n),r],l=s[0],u=s.reduce((f,m)=>{const p=ZC(t,m,o);return f.top=pr(p.top,f.top),f.right=Os(p.right,f.right),f.bottom=Os(p.bottom,f.bottom),f.left=pr(p.left,f.left),f},ZC(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function sU(e){return Hk(e)}function aU(e,t,n){const r=Jo(t),o=Di(t),i=n==="fixed",s=Ia(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const u=Ns(0);if(r||!r&&!i)if((Ds(t)!=="body"||jd(o))&&(l=Xm(t)),r){const f=Ia(t,!0,i,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else o&&(u.x=Gk(o));return{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function qC(e,t){return!Jo(e)||to(e).position==="fixed"?null:t?t(e):e.offsetParent}function Xk(e,t){const n=yr(e);if(!Jo(e))return n;let r=qC(e,t);for(;r&&Xz(r)&&to(r).position==="static";)r=qC(r,t);return r&&(Ds(r)==="html"||Ds(r)==="body"&&to(r).position==="static"&&!Sx(r))?n:r||Zz(e)||n}const lU=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Xk,i=this.getDimensions;return{reference:aU(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function cU(e){return to(e).direction==="rtl"}const uU={convertOffsetParentRelativeRectToViewportRelativeRect:Jz,getDocumentElement:Di,getClippingRect:iU,getOffsetParent:Xk,getElementRects:lU,getClientRects:eU,getDimensions:sU,getScale:Il,isElement:Pi,isRTL:cU};function dU(e,t){let n=null,r;const o=Di(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),i();const{left:f,top:m,width:p,height:g}=e.getBoundingClientRect();if(l||t(),!p||!g)return;const y=yh(m),x=yh(o.clientWidth-(f+p)),S=yh(o.clientHeight-(m+g)),E=yh(f),b={rootMargin:-y+"px "+-x+"px "+-S+"px "+-E+"px",threshold:pr(0,Os(1,u))||1};let C=!0;function R(T){const N=T[0].intersectionRatio;if(N!==u){if(!C)return s();N?s(!1,N):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(R,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,b)}n.observe(e)}return s(!0),i}function fU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=Ex(e),m=o||i?[...f?ud(f):[],...ud(t)]:[];m.forEach(_=>{o&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const p=f&&l?dU(f,n):null;let g=-1,y=null;s&&(y=new ResizeObserver(_=>{let[b]=_;b&&b.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),f&&!u&&y.observe(f),y.observe(t));let x,S=u?Ia(e):null;u&&E();function E(){const _=Ia(e);S&&(_.x!==S.x||_.y!==S.y||_.width!==S.width||_.height!==S.height)&&n(),S=_,x=requestAnimationFrame(E)}return n(),()=>{m.forEach(_=>{o&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),p&&p(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(x)}}const hU=(e,t,n)=>{const r=new Map,o={platform:uU,...n},i={...o.platform,_c:r};return zz(e,t,{...o,platform:i})},pU=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?KC({element:r.current,padding:o}).fn(n):{}:r?KC({element:r,padding:o}).fn(n):{}}}};var np=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Hp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Hp(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Hp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Zk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function QC(e,t){const n=Zk(e);return Math.round(t*n)/n}function JC(e){const t=d.useRef(e);return np(()=>{t.current=e}),t}function mU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:u,open:f}=e,[m,p]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=d.useState(r);Hp(g,r)||y(r);const[x,S]=d.useState(null),[E,_]=d.useState(null),b=d.useCallback(H=>{H!=N.current&&(N.current=H,S(H))},[S]),C=d.useCallback(H=>{H!==A.current&&(A.current=H,_(H))},[_]),R=i||x,T=s||E,N=d.useRef(null),A=d.useRef(null),O=d.useRef(m),U=JC(u),z=JC(o),ie=d.useCallback(()=>{if(!N.current||!A.current)return;const H={placement:t,strategy:n,middleware:g};z.current&&(H.platform=z.current),hU(N.current,A.current,H).then(J=>{const G={...J,isPositioned:!0};K.current&&!Hp(O.current,G)&&(O.current=G,Bs.flushSync(()=>{p(G)}))})},[g,t,n,z]);np(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[f]);const K=d.useRef(!1);np(()=>(K.current=!0,()=>{K.current=!1}),[]),np(()=>{if(R&&(N.current=R),T&&(A.current=T),R&&T){if(U.current)return U.current(R,T,ie);ie()}},[R,T,ie,U]);const te=d.useMemo(()=>({reference:N,floating:A,setReference:b,setFloating:C}),[b,C]),W=d.useMemo(()=>({reference:R,floating:T}),[R,T]),re=d.useMemo(()=>{const H={position:n,left:0,top:0};if(!W.floating)return H;const J=QC(W.floating,m.x),G=QC(W.floating,m.y);return l?{...H,transform:"translate("+J+"px, "+G+"px)",...Zk(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:G}},[n,l,W.floating,m.x,m.y]);return d.useMemo(()=>({...m,update:ie,refs:te,elements:W,floatingStyles:re}),[m,ie,te,W,re])}function Cx(e){const[t,n]=d.useState(void 0);return Tn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const u=i.borderBoxSize,f=Array.isArray(u)?u[0]:u;s=f.inlineSize,l=f.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const qk="Popper",[Qk,zs]=An(qk),[gU,Jk]=Qk(qk),vU=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return d.createElement(gU,{scope:t,anchor:r,onAnchorChange:o},n)},yU="PopperAnchor",wU=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Jk(yU,n),s=d.useRef(null),l=We(t,s);return d.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:d.createElement(Ae.div,Y({},o,{ref:l}))}),eP="PopperContent",[xU,yte]=Qk(eP),bU=d.forwardRef((e,t)=>{var n,r,o,i,s,l,u,f;const{__scopePopper:m,side:p="bottom",sideOffset:g=0,align:y="center",alignOffset:x=0,arrowPadding:S=0,avoidCollisions:E=!0,collisionBoundary:_=[],collisionPadding:b=0,sticky:C="partial",hideWhenDetached:R=!1,updatePositionStrategy:T="optimized",onPlaced:N,...A}=e,O=Jk(eP,m),[U,z]=d.useState(null),ie=We(t,Yt=>z(Yt)),[K,te]=d.useState(null),W=Cx(K),re=(n=W==null?void 0:W.width)!==null&&n!==void 0?n:0,H=(r=W==null?void 0:W.height)!==null&&r!==void 0?r:0,J=p+(y!=="center"?"-"+y:""),G=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},Z=Array.isArray(_)?_:[_],Q=Z.length>0,le={padding:G,boundary:Z.filter(SU),altBoundary:Q},{refs:L,floatingStyles:ue,placement:Ne,isPositioned:Ke,middlewareData:Me}=mU({strategy:"fixed",placement:J,whileElementsMounted:(...Yt)=>fU(...Yt,{animationFrame:T==="always"}),elements:{reference:O.anchor},middleware:[Hz({mainAxis:g+H,alignmentAxis:x}),E&&Kz({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?Gz():void 0,...le}),E&&Uz({...le}),Yz({...le,apply:({elements:Yt,rects:rr,availableWidth:en,availableHeight:Li})=>{const{width:D,height:X}=rr.reference,ee=Yt.floating.style;ee.setProperty("--radix-popper-available-width",`${en}px`),ee.setProperty("--radix-popper-available-height",`${Li}px`),ee.setProperty("--radix-popper-anchor-width",`${D}px`),ee.setProperty("--radix-popper-anchor-height",`${X}px`)}}),K&&pU({element:K,padding:S}),_U({arrowWidth:re,arrowHeight:H}),R&&Vz({strategy:"referenceHidden",...le})]}),[me,be]=tP(Ne),Ee=Lt(N);Tn(()=>{Ke&&(Ee==null||Ee())},[Ke,Ee]);const Oe=(o=Me.arrow)===null||o===void 0?void 0:o.x,Ie=(i=Me.arrow)===null||i===void 0?void 0:i.y,ze=((s=Me.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[ht,st]=d.useState();return Tn(()=>{U&&st(window.getComputedStyle(U).zIndex)},[U]),d.createElement("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...ue,transform:Ke?ue.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ht,"--radix-popper-transform-origin":[(l=Me.transformOrigin)===null||l===void 0?void 0:l.x,(u=Me.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")},dir:e.dir},d.createElement(xU,{scope:m,placedSide:me,onArrowChange:te,arrowX:Oe,arrowY:Ie,shouldHideArrow:ze},d.createElement(Ae.div,Y({"data-side":me,"data-align":be},A,{ref:ie,style:{...A.style,animation:Ke?void 0:"none",opacity:(f=Me.hide)!==null&&f!==void 0&&f.referenceHidden?0:void 0}}))))});function SU(e){return e!==null}const _U=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:l,rects:u,middlewareData:f}=t,p=((n=f.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=p?0:e.arrowWidth,y=p?0:e.arrowHeight,[x,S]=tP(l),E={start:"0%",center:"50%",end:"100%"}[S],_=((r=(o=f.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+g/2,b=((i=(s=f.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+y/2;let C="",R="";return x==="bottom"?(C=p?E:`${_}px`,R=`${-y}px`):x==="top"?(C=p?E:`${_}px`,R=`${u.floating.height+y}px`):x==="right"?(C=`${-y}px`,R=p?E:`${b}px`):x==="left"&&(C=`${u.floating.width+y}px`,R=p?E:`${b}px`),{data:{x:C,y:R}}}});function tP(e){const[t,n="center"]=e.split("-");return[t,n]}const Fd=vU,Zm=wU,qm=bU,Bd=d.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?nL.createPortal(d.createElement(Ae.div,Y({},o,{ref:t})),r):null});function EU(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Sn=e=>{const{present:t,children:n}=e,r=CU(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),i=We(r.ref,o.ref);return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:i}):null};Sn.displayName="Presence";function CU(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),i=d.useRef("none"),s=e?"mounted":"unmounted",[l,u]=EU(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const f=wh(r.current);i.current=l==="mounted"?f:"none"},[l]),Tn(()=>{const f=r.current,m=o.current;if(m!==e){const g=i.current,y=wh(f);e?u("MOUNT"):y==="none"||(f==null?void 0:f.display)==="none"?u("UNMOUNT"):u(m&&g!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Tn(()=>{if(t){const f=p=>{const y=wh(r.current).includes(p.animationName);p.target===t&&y&&Bs.flushSync(()=>u("ANIMATION_END"))},m=p=>{p.target===t&&(i.current=wh(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function wh(e){return(e==null?void 0:e.animationName)||"none"}function no({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=$U({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,l=Lt(n),u=d.useCallback(f=>{if(i){const p=typeof f=="function"?f(e):f;p!==e&&l(p)}else o(f)},[i,e,o,l]);return[s,u]}function $U({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),i=Lt(t);return d.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Qm=d.forwardRef((e,t)=>d.createElement(Ae.span,Y({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),RU=Qm,[Jm,wte]=An("Tooltip",[zs]),$x=zs(),kU="TooltipProvider",PU=700,y1="tooltip.open",[TU,Rx]=Jm(kU),AU=e=>{const{__scopeTooltip:t,delayDuration:n=PU,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,l]=d.useState(!0),u=d.useRef(!1),f=d.useRef(0);return d.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),d.createElement(TU,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(f.current),l(!1)},[]),onClose:d.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:d.useCallback(m=>{u.current=m},[]),disableHoverableContent:o},i)},kx="Tooltip",[MU,eg]=Jm(kx),OU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=e,u=Rx(kx,e.__scopeTooltip),f=$x(t),[m,p]=d.useState(null),g=tr(),y=d.useRef(0),x=s??u.disableHoverableContent,S=l??u.delayDuration,E=d.useRef(!1),[_=!1,b]=no({prop:r,defaultProp:o,onChange:A=>{A?(u.onOpen(),document.dispatchEvent(new CustomEvent(y1))):u.onClose(),i==null||i(A)}}),C=d.useMemo(()=>_?E.current?"delayed-open":"instant-open":"closed",[_]),R=d.useCallback(()=>{window.clearTimeout(y.current),E.current=!1,b(!0)},[b]),T=d.useCallback(()=>{window.clearTimeout(y.current),b(!1)},[b]),N=d.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{E.current=!0,b(!0)},S)},[S,b]);return d.useEffect(()=>()=>window.clearTimeout(y.current),[]),d.createElement(Fd,f,d.createElement(MU,{scope:t,contentId:g,open:_,stateAttribute:C,trigger:m,onTriggerChange:p,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?N():R()},[u.isOpenDelayed,N,R]),onTriggerLeave:d.useCallback(()=>{x?T():window.clearTimeout(y.current)},[T,x]),onOpen:R,onClose:T,disableHoverableContent:x},n))},e2="TooltipTrigger",NU=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=eg(e2,n),i=Rx(e2,n),s=$x(n),l=d.useRef(null),u=We(t,l,o.onTriggerChange),f=d.useRef(!1),m=d.useRef(!1),p=d.useCallback(()=>f.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),d.createElement(Zm,Y({asChild:!0},s),d.createElement(Ae.button,Y({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:u,onPointerMove:fe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:fe(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:fe(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:fe(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:fe(e.onBlur,o.onClose),onClick:fe(e.onClick,o.onClose)})))}),DU="TooltipPortal",[xte,IU]=Jm(DU,{forceMount:void 0}),dd="TooltipContent",LU=d.forwardRef((e,t)=>{const n=IU(dd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=eg(dd,e.__scopeTooltip);return d.createElement(Sn,{present:r||s.open},s.disableHoverableContent?d.createElement(nP,Y({side:o},i,{ref:t})):d.createElement(jU,Y({side:o},i,{ref:t})))}),jU=d.forwardRef((e,t)=>{const n=eg(dd,e.__scopeTooltip),r=Rx(dd,e.__scopeTooltip),o=d.useRef(null),i=We(t,o),[s,l]=d.useState(null),{trigger:u,onClose:f}=n,m=o.current,{onPointerInTransitChange:p}=r,g=d.useCallback(()=>{l(null),p(!1)},[p]),y=d.useCallback((x,S)=>{const E=x.currentTarget,_={x:x.clientX,y:x.clientY},b=BU(_,E.getBoundingClientRect()),C=zU(_,b),R=UU(S.getBoundingClientRect()),T=WU([...C,...R]);l(T),p(!0)},[p]);return d.useEffect(()=>()=>g(),[g]),d.useEffect(()=>{if(u&&m){const x=E=>y(E,m),S=E=>y(E,u);return u.addEventListener("pointerleave",x),m.addEventListener("pointerleave",S),()=>{u.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",S)}}},[u,m,y,g]),d.useEffect(()=>{if(s){const x=S=>{const E=S.target,_={x:S.clientX,y:S.clientY},b=(u==null?void 0:u.contains(E))||(m==null?void 0:m.contains(E)),C=!VU(_,s);b?g():C&&(g(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[u,m,s,f,g]),d.createElement(nP,Y({},e,{ref:i}))}),[FU,bte]=Jm(kx,{isInside:!1}),nP=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=e,u=eg(dd,n),f=$x(n),{onClose:m}=u;return d.useEffect(()=>(document.addEventListener(y1,m),()=>document.removeEventListener(y1,m)),[m]),d.useEffect(()=>{if(u.trigger){const p=g=>{const y=g.target;y!=null&&y.contains(u.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,m]),d.createElement(Rc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:m},d.createElement(qm,Y({"data-state":u.stateAttribute},f,l,{ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),d.createElement(mx,null,r),d.createElement(FU,{scope:n,isInside:!0},d.createElement(RU,{id:u.contentId,role:"tooltip"},o||r))))});function BU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function zU(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function UU(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function VU(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i].x,u=t[i].y,f=t[s].x,m=t[s].y;u>r!=m>r&&n<(f-l)*(r-u)/(m-u)+l&&(o=!o)}return o}function WU(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),HU(t)}function HU(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const KU=AU,GU=OU,YU=NU,rP=LU,XU=KU,oP=GU,iP=YU,Px=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(rP,{ref:r,sideOffset:t,className:xe("z-50 border overflow-hidden rounded-md bg-background text-foreground px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Px.displayName=rP.displayName;const Tx=zm("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),wn=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Qo:"button";return v.jsx(s,{className:xe(Tx({variant:t,size:n,className:e}),"outline-none cursor-default select-none"),ref:i,tabIndex:-1,...o})});wn.displayName="Button";const yn=d.forwardRef(({tooltip:e,children:t,...n},r)=>v.jsxs(oP,{children:[v.jsx(iP,{asChild:!0,children:v.jsx(wn,{variant:"ghost",size:"icon",...n,ref:r,tabIndex:-1,className:"cursor-default bg-background",children:v.jsx("div",{className:"icon-button-icon-wrapper",children:t})})}),v.jsx(Px,{children:v.jsx("p",{children:e})})]})),w1=e=>{const{onFileUpload:t,children:n,...r}=e,[o]=d.useState(`file-upload-${Math.random().toString()}`),i=s=>{var u;const l=(u=s.currentTarget.files)==null?void 0:u[0];l&&t(l)};return v.jsxs(v.Fragment,{children:[v.jsx("label",{htmlFor:o,children:v.jsx(yn,{...r,asChild:!0,children:n})}),v.jsx(Gm,{style:{display:"none"},id:o,name:o,type:"file",onChange:i,accept:"image/png, image/jpeg"})]})};var ZU={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const qU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Jt=(e,t)=>{const n=d.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:s,children:l,...u},f)=>d.createElement("svg",{ref:f,...ZU,width:o,height:o,stroke:r,strokeWidth:s?Number(i)*24/Number(o):i,className:`lucide lucide-${qU(e)}`,...u},[...t.map(([m,p])=>d.createElement(m,p)),...(Array.isArray(l)?l:[l])||[]]));return n.displayName=`${e}`,n},QU=Jt("Blocks",[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]]),JU=Jt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),eV=Jt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),tV=Jt("Coffee",[["path",{d:"M17 8h1a4 4 0 1 1 0 8h-1",key:"jx4kbh"}],["path",{d:"M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z",key:"1bxrl0"}],["line",{x1:"6",x2:"6",y1:"2",y2:"4",key:"1cr9l3"}],["line",{x1:"10",x2:"10",y1:"2",y2:"4",key:"170wym"}],["line",{x1:"14",x2:"14",y1:"2",y2:"4",key:"1c5f70"}]]),nV=Jt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),rV=Jt("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),oV=Jt("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]),iV=Jt("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),sV=Jt("FolderClosed",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]]),sP=Jt("Fullscreen",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]]),aV=Jt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),lV=Jt("Keyboard",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",ry:"2",key:"15u882"}],["path",{d:"M6 8h.001",key:"1ej0i3"}],["path",{d:"M10 8h.001",key:"1x2st2"}],["path",{d:"M14 8h.001",key:"1vkmyp"}],["path",{d:"M18 8h.001",key:"kfsenl"}],["path",{d:"M8 12h.001",key:"1sjpby"}],["path",{d:"M12 12h.001",key:"al75ts"}],["path",{d:"M16 12h.001",key:"931bgk"}],["path",{d:"M7 16h10",key:"wp8him"}]]),cV=Jt("MousePointerClick",[["path",{d:"m9 9 5 12 1.8-5.2L21 14Z",key:"1b76lo"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}]]),uV=Jt("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]),dV=Jt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),fV=Jt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),t2=Jt("Slice",[["path",{d:"m8 14-6 6h9v-3",key:"zo3j9a"}],["path",{d:"M18.37 3.63 8 14l3 3L21.37 6.63a2.12 2.12 0 1 0-3-3Z",key:"1dzx0j"}]]),n2=Jt("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),hV=Jt("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]),aP=Jt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);function pV(e,t){const[n,r]=d.useState(e);return d.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}function lP(e){const[t,n]=d.useState(()=>typeof e=="boolean"?e:!!e),r=d.useCallback(o=>n(typeof o=="boolean"?o:i=>!i),[]);return[t,r]}const T0="focusScope.autoFocusOnMount",A0="focusScope.autoFocusOnUnmount",r2={bubbles:!1,cancelable:!0},tg=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,u]=d.useState(null),f=Lt(o),m=Lt(i),p=d.useRef(null),g=We(t,S=>u(S)),y=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let b=function(N){if(y.paused||!l)return;const A=N.target;l.contains(A)?p.current=A:ts(p.current,{select:!0})},C=function(N){if(y.paused||!l)return;const A=N.relatedTarget;A!==null&&(l.contains(A)||ts(p.current,{select:!0}))},R=function(N){if(document.activeElement===document.body)for(const O of N)O.removedNodes.length>0&&ts(l)};var S=b,E=C,_=R;document.addEventListener("focusin",b),document.addEventListener("focusout",C);const T=new MutationObserver(R);return l&&T.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",C),T.disconnect()}}},[r,l,y.paused]),d.useEffect(()=>{if(l){i2.add(y);const S=document.activeElement;if(!l.contains(S)){const _=new CustomEvent(T0,r2);l.addEventListener(T0,f),l.dispatchEvent(_),_.defaultPrevented||(mV(xV(cP(l)),{select:!0}),document.activeElement===S&&ts(l))}return()=>{l.removeEventListener(T0,f),setTimeout(()=>{const _=new CustomEvent(A0,r2);l.addEventListener(A0,m),l.dispatchEvent(_),_.defaultPrevented||ts(S??document.body,{select:!0}),l.removeEventListener(A0,m),i2.remove(y)},0)}}},[l,f,m,y]);const x=d.useCallback(S=>{if(!n&&!r||y.paused)return;const E=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,_=document.activeElement;if(E&&_){const b=S.currentTarget,[C,R]=gV(b);C&&R?!S.shiftKey&&_===R?(S.preventDefault(),n&&ts(C,{select:!0})):S.shiftKey&&_===C&&(S.preventDefault(),n&&ts(R,{select:!0})):_===b&&S.preventDefault()}},[n,r,y.paused]);return d.createElement(Ae.div,Y({tabIndex:-1},s,{ref:g,onKeyDown:x}))});function mV(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ts(r,{select:t}),document.activeElement!==n)return}function gV(e){const t=cP(e),n=o2(t,e),r=o2(t.reverse(),e);return[n,r]}function cP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function o2(e,t){for(const n of e)if(!vV(n,{upTo:t}))return n}function vV(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yV(e){return e instanceof HTMLInputElement&&"select"in e}function ts(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yV(e)&&t&&e.select()}}const i2=wV();function wV(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=s2(e,t),e.unshift(t)},remove(t){var n;e=s2(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function s2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xV(e){return e.filter(t=>t.tagName!=="A")}let M0=0;function ng(){d.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:a2()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:a2()),M0++,()=>{M0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),M0--}},[])}function a2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Bo=function(){return Bo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Bo.apply(this,arguments)};function uP(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function bV(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var rp="right-scroll-bar-position",op="width-before-scroll-bar",SV="with-scroll-bars-hidden",_V="--removed-body-scroll-bar-size";function EV(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function CV(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function $V(e,t){return CV(t||null,function(n){return e.forEach(function(r){return EV(r,n)})})}function RV(e){return e}function kV(e,t){t===void 0&&(t=RV);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(i),s=n}var u=function(){var m=s;s=[],m.forEach(i)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(m){s.push(m),f()},filter:function(m){return s=s.filter(m),n}}}};return o}function PV(e){e===void 0&&(e={});var t=kV(null);return t.options=Bo({async:!0,ssr:!1},e),t}var dP=function(e){var t=e.sideCar,n=uP(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Bo({},n))};dP.isSideCarExport=!0;function TV(e,t){return e.useMedium(t),dP}var fP=PV(),O0=function(){},rg=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:O0,onWheelCapture:O0,onTouchMoveCapture:O0}),o=r[0],i=r[1],s=e.forwardProps,l=e.children,u=e.className,f=e.removeScrollBar,m=e.enabled,p=e.shards,g=e.sideCar,y=e.noIsolation,x=e.inert,S=e.allowPinchZoom,E=e.as,_=E===void 0?"div":E,b=uP(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=g,R=$V([n,t]),T=Bo(Bo({},b),o);return d.createElement(d.Fragment,null,m&&d.createElement(C,{sideCar:fP,removeScrollBar:f,shards:p,noIsolation:y,inert:x,setCallbacks:i,allowPinchZoom:!!S,lockRef:n}),s?d.cloneElement(d.Children.only(l),Bo(Bo({},T),{ref:R})):d.createElement(_,Bo({},T,{className:u,ref:R}),l))});rg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rg.classNames={fullWidth:op,zeroRight:rp};var l2,AV=function(){if(l2)return l2;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=AV();return t&&e.setAttribute("nonce",t),e}function OV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function NV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var DV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=MV())&&(OV(t,n),NV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},IV=function(){var e=DV();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hP=function(){var e=IV(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},LV={left:0,top:0,right:0,gap:0},N0=function(e){return parseInt(e||"",10)||0},jV=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[N0(n),N0(r),N0(o)]},FV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return LV;var t=jV(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},BV=hP(),zV=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
.`.concat(SV,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(l,"px ").concat(r,`;
}
body {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(i,`px;
padding-right: `).concat(s,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(rp,` {
right: `).concat(l,"px ").concat(r,`;
}
.`).concat(op,` {
margin-right: `).concat(l,"px ").concat(r,`;
}
.`).concat(rp," .").concat(rp,` {
right: 0 `).concat(r,`;
}
.`).concat(op," .").concat(op,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat(_V,": ").concat(l,`px;
}
`)},UV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=d.useMemo(function(){return FV(o)},[o]);return d.createElement(BV,{styles:zV(i,!t,o,n?"":"!important")})},x1=!1;if(typeof window<"u")try{var xh=Object.defineProperty({},"passive",{get:function(){return x1=!0,!0}});window.addEventListener("test",xh,xh),window.removeEventListener("test",xh,xh)}catch{x1=!1}var sl=x1?{passive:!1}:!1,VV=function(e){return e.tagName==="TEXTAREA"},pP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!VV(e)&&n[t]==="visible")},WV=function(e){return pP(e,"overflowY")},HV=function(e){return pP(e,"overflowX")},c2=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=mP(e,n);if(r){var o=gP(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},KV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},GV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},mP=function(e,t){return e==="v"?WV(t):HV(t)},gP=function(e,t){return e==="v"?KV(t):GV(t)},YV=function(e,t){return e==="h"&&t==="rtl"?-1:1},XV=function(e,t,n,r,o){var i=YV(e,window.getComputedStyle(t).direction),s=i*r,l=n.target,u=t.contains(l),f=!1,m=s>0,p=0,g=0;do{var y=gP(e,l),x=y[0],S=y[1],E=y[2],_=S-E-i*x;(x||_)&&mP(e,l)&&(p+=_,g+=x),l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(m&&(o&&p===0||!o&&s>p)||!m&&(o&&g===0||!o&&-s>g))&&(f=!0),f},bh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},u2=function(e){return[e.deltaX,e.deltaY]},d2=function(e){return e&&"current"in e?e.current:e},ZV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qV=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},QV=0,al=[];function JV(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(QV++)[0],i=d.useState(function(){return hP()})[0],s=d.useRef(e);d.useEffect(function(){s.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=bV([e.lockRef.current],(e.shards||[]).map(d2),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(S,E){if("touches"in S&&S.touches.length===2)return!s.current.allowPinchZoom;var _=bh(S),b=n.current,C="deltaX"in S?S.deltaX:b[0]-_[0],R="deltaY"in S?S.deltaY:b[1]-_[1],T,N=S.target,A=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in S&&A==="h"&&N.type==="range")return!1;var O=c2(A,N);if(!O)return!0;if(O?T=A:(T=A==="v"?"h":"v",O=c2(A,N)),!O)return!1;if(!r.current&&"changedTouches"in S&&(C||R)&&(r.current=T),!T)return!0;var U=r.current||T;return XV(U,E,S,U==="h"?C:R,!0)},[]),u=d.useCallback(function(S){var E=S;if(!(!al.length||al[al.length-1]!==i)){var _="deltaY"in E?u2(E):bh(E),b=t.current.filter(function(T){return T.name===E.type&&T.target===E.target&&ZV(T.delta,_)})[0];if(b&&b.should){E.cancelable&&E.preventDefault();return}if(!b){var C=(s.current.shards||[]).map(d2).filter(Boolean).filter(function(T){return T.contains(E.target)}),R=C.length>0?l(E,C[0]):!s.current.noIsolation;R&&E.cancelable&&E.preventDefault()}}},[]),f=d.useCallback(function(S,E,_,b){var C={name:S,delta:E,target:_,should:b};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),m=d.useCallback(function(S){n.current=bh(S),r.current=void 0},[]),p=d.useCallback(function(S){f(S.type,u2(S),S.target,l(S,e.lockRef.current))},[]),g=d.useCallback(function(S){f(S.type,bh(S),S.target,l(S,e.lockRef.current))},[]);d.useEffect(function(){return al.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,sl),document.addEventListener("touchmove",u,sl),document.addEventListener("touchstart",m,sl),function(){al=al.filter(function(S){return S!==i}),document.removeEventListener("wheel",u,sl),document.removeEventListener("touchmove",u,sl),document.removeEventListener("touchstart",m,sl)}},[]);var y=e.removeScrollBar,x=e.inert;return d.createElement(d.Fragment,null,x?d.createElement(i,{styles:qV(o)}):null,y?d.createElement(UV,{gapMode:"margin"}):null)}const eW=TV(fP,JV);var vP=d.forwardRef(function(e,t){return d.createElement(rg,Bo({},e,{ref:t,sideCar:eW}))});vP.classNames=rg.classNames;const og=vP;var tW=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ll=new WeakMap,Sh=new WeakMap,_h={},D0=0,yP=function(e){return e&&(e.host||yP(e.parentNode))},nW=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=yP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},rW=function(e,t,n,r){var o=nW(t,Array.isArray(e)?e:[e]);_h[n]||(_h[n]=new WeakMap);var i=_h[n],s=[],l=new Set,u=new Set(o),f=function(p){!p||l.has(p)||(l.add(p),f(p.parentNode))};o.forEach(f);var m=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(l.has(g))m(g);else{var y=g.getAttribute(r),x=y!==null&&y!=="false",S=(ll.get(g)||0)+1,E=(i.get(g)||0)+1;ll.set(g,S),i.set(g,E),s.push(g),S===1&&x&&Sh.set(g,!0),E===1&&g.setAttribute(n,"true"),x||g.setAttribute(r,"true")}})};return m(t),l.clear(),D0++,function(){s.forEach(function(p){var g=ll.get(p)-1,y=i.get(p)-1;ll.set(p,g),i.set(p,y),g||(Sh.has(p)||p.removeAttribute(r),Sh.delete(p)),y||p.removeAttribute(n)}),D0--,D0||(ll=new WeakMap,ll=new WeakMap,Sh=new WeakMap,_h={})}},ig=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||tW(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),rW(r,o,n,"aria-hidden")):function(){return null}};const wP="Dialog",[xP,bP]=An(wP),[oW,ko]=xP(wP),iW=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=d.useRef(null),u=d.useRef(null),[f=!1,m]=no({prop:r,defaultProp:o,onChange:i});return d.createElement(oW,{scope:t,triggerRef:l,contentRef:u,contentId:tr(),titleId:tr(),descriptionId:tr(),open:f,onOpenChange:m,onOpenToggle:d.useCallback(()=>m(p=>!p),[m]),modal:s},n)},sW="DialogTrigger",SP=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ko(sW,n),i=We(t,o.triggerRef);return d.createElement(Ae.button,Y({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ax(o.open)},r,{ref:i,onClick:fe(e.onClick,o.onOpenToggle)}))}),_P="DialogPortal",[aW,EP]=xP(_P,{forceMount:void 0}),lW=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=ko(_P,t);return d.createElement(aW,{scope:t,forceMount:n},d.Children.map(r,s=>d.createElement(Sn,{present:n||i.open},d.createElement(Bd,{asChild:!0,container:o},s))))},b1="DialogOverlay",cW=d.forwardRef((e,t)=>{const n=EP(b1,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ko(b1,e.__scopeDialog);return i.modal?d.createElement(Sn,{present:r||i.open},d.createElement(uW,Y({},o,{ref:t}))):null}),uW=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ko(b1,n);return d.createElement(og,{as:Qo,allowPinchZoom:!0,shards:[o.contentRef]},d.createElement(Ae.div,Y({"data-state":Ax(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),fc="DialogContent",dW=d.forwardRef((e,t)=>{const n=EP(fc,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ko(fc,e.__scopeDialog);return d.createElement(Sn,{present:r||i.open},i.modal?d.createElement(fW,Y({},o,{ref:t})):d.createElement(hW,Y({},o,{ref:t})))}),fW=d.forwardRef((e,t)=>{const n=ko(fc,e.__scopeDialog),r=d.useRef(null),o=We(t,n.contentRef,r);return d.useEffect(()=>{const i=r.current;if(i)return ig(i)},[]),d.createElement(CP,Y({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:fe(e.onFocusOutside,i=>i.preventDefault())}))}),hW=d.forwardRef((e,t)=>{const n=ko(fc,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return d.createElement(CP,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var l;r.current||(l=n.triggerRef.current)===null||l===void 0||l.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,l;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=i.target;((l=n.triggerRef.current)===null||l===void 0?void 0:l.contains(u))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),CP=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=ko(fc,n),u=d.useRef(null),f=We(t,u);return ng(),d.createElement(d.Fragment,null,d.createElement(tg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},d.createElement(Rc,Y({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ax(l.open)},s,{ref:f,onDismiss:()=>l.onOpenChange(!1)}))),!1)}),$P="DialogTitle",pW=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ko($P,n);return d.createElement(Ae.h2,Y({id:o.titleId},r,{ref:t}))}),mW="DialogDescription",RP=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ko(mW,n);return d.createElement(Ae.p,Y({id:o.descriptionId},r,{ref:t}))}),gW="DialogClose",vW=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ko(gW,n);return d.createElement(Ae.button,Y({type:"button"},r,{ref:t,onClick:fe(e.onClick,()=>o.onOpenChange(!1))}))});function Ax(e){return e?"open":"closed"}const yW="DialogTitleWarning",[wW,Ste]=xz(yW,{contentName:fc,titleName:$P,docsSlug:"dialog"}),Mx=iW,kP=SP,Ox=lW,zd=cW,Ud=dW,Vd=pW,Wd=RP,Nx=vW,sg=Mx,Dx=kP,xW=Ox,PP=d.forwardRef(({className:e,...t},n)=>v.jsx(zd,{ref:n,className:xe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));PP.displayName=zd.displayName;const Hd=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(xW,{children:[v.jsx(PP,{}),v.jsxs(Ud,{ref:r,className:xe("fixed left-[50%] top-[50%] z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e,"outline-none"),onCloseAutoFocus:o=>o.preventDefault(),...n,children:[t,v.jsxs(Nx,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[v.jsx(Pk,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Hd.displayName=Ud.displayName;const TP=({className:e,...t})=>v.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});TP.displayName="DialogHeader";const Kd=d.forwardRef(({className:e,...t},n)=>v.jsx(Vd,{ref:n,className:xe("text-2xl font-semibold leading-none tracking-tight",e),...t}));Kd.displayName=Vd.displayName;const bW=d.forwardRef(({className:e,...t},n)=>v.jsx(Wd,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));bW.displayName=Wd.displayName;function S1(){return S1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S1.apply(this,arguments)}var AP=["shift","alt","meta","mod","ctrl"],SW={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function gs(e){return(SW[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function _W(e){return AP.includes(e)}function I0(e,t){return t===void 0&&(t=","),e.split(t)}function L0(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(s){return gs(s)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},i=r.filter(function(s){return!AP.includes(s)});return S1({},o,{keys:i,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&MP([gs(e.key),gs(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&OP([gs(e.key),gs(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){vs.clear()})})();var vs=new Set;function Ix(e){return Array.isArray(e)}function EW(e,t){t===void 0&&(t=",");var n=Ix(e)?e:e.split(t);return n.every(function(r){return vs.has(r.trim().toLowerCase())})}function MP(e){var t=Array.isArray(e)?e:[e];vs.has("meta")&&vs.forEach(function(n){return!_W(n)&&vs.delete(n.toLowerCase())}),t.forEach(function(n){return vs.add(n.toLowerCase())})}function OP(e){var t=Array.isArray(e)?e:[e];e==="meta"?vs.clear():t.forEach(function(n){return vs.delete(n.toLowerCase())})}function CW(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function $W(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function RW(e){return NP(e,["input","textarea","select"])}function NP(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return Ix(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function kW(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var PW=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,i=n.meta,s=n.mod,l=n.shift,u=n.ctrl,f=n.keys,m=t.key,p=t.code,g=t.ctrlKey,y=t.metaKey,x=t.shiftKey,S=t.altKey,E=gs(p),_=m.toLowerCase();if(!r){if(o===!S&&_!=="alt"||l===!x&&_!=="shift")return!1;if(s){if(!y&&!g)return!1}else if(i===!y&&_!=="meta"&&_!=="os"||u===!g&&_!=="ctrl"&&_!=="control")return!1}return f&&f.length===1&&(f.includes(_)||f.includes(E))?!0:f?EW(f):!f},TW=d.createContext(void 0),AW=function(){return d.useContext(TW)};function DP(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&DP(e[r],t[r])},!0):e===t}var MW=d.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),OW=function(){return d.useContext(MW)};function NW(e){var t=d.useRef(void 0);return DP(t.current,e)||(t.current=e),t.current}var f2=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},DW=typeof window<"u"?d.useLayoutEffect:d.useEffect;function IW(e,t,n,r){var o=d.useRef(null),i=d.useRef(!1),s=n instanceof Array?r instanceof Array?void 0:r:n,l=Ix(e)?e.join(s==null?void 0:s.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,f=d.useCallback(t,u??[]),m=d.useRef(f);u?m.current=f:m.current=t;var p=NW(s),g=OW(),y=g.enabledScopes,x=AW();return DW(function(){if(!((p==null?void 0:p.enabled)===!1||!kW(y,p==null?void 0:p.scopes))){var S=function(R,T){var N;if(T===void 0&&(T=!1),!(RW(R)&&!NP(R,p==null?void 0:p.enableOnFormTags))&&!(p!=null&&p.ignoreEventWhen!=null&&p.ignoreEventWhen(R))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){f2(R);return}(N=R.target)!=null&&N.isContentEditable&&!(p!=null&&p.enableOnContentEditable)||I0(l,p==null?void 0:p.splitKey).forEach(function(A){var O,U=L0(A,p==null?void 0:p.combinationKey);if(PW(R,U,p==null?void 0:p.ignoreModifiers)||(O=U.keys)!=null&&O.includes("*")){if(T&&i.current)return;if(CW(R,U,p==null?void 0:p.preventDefault),!$W(R,U,p==null?void 0:p.enabled)){f2(R);return}m.current(R,U),T||(i.current=!0)}})}},E=function(R){R.key!==void 0&&(MP(gs(R.code)),((p==null?void 0:p.keydown)===void 0&&(p==null?void 0:p.keyup)!==!0||p!=null&&p.keydown)&&S(R))},_=function(R){R.key!==void 0&&(OP(gs(R.code)),i.current=!1,p!=null&&p.keyup&&S(R,!0))},b=o.current||(s==null?void 0:s.document)||document;return b.addEventListener("keyup",_),b.addEventListener("keydown",E),x&&I0(l,p==null?void 0:p.splitKey).forEach(function(C){return x.addHotkey(L0(C,p==null?void 0:p.combinationKey,p==null?void 0:p.description))}),function(){b.removeEventListener("keyup",_),b.removeEventListener("keydown",E),x&&I0(l,p==null?void 0:p.splitKey).forEach(function(C){return x.removeHotkey(L0(C,p==null?void 0:p.combinationKey,p==null?void 0:p.description))})}}},[l,p,y]),o}const Xn=(e,t,n)=>{const r=xt(i=>i.disableShortCuts);return IW(e,t,{enabled:!r},n)};function dr(e){const{content:t,keys:n}=e;return v.jsxs("div",{className:"flex justify-between",children:[v.jsx("div",{children:t}),v.jsx("div",{className:"flex gap-[8px]",children:n.map(r=>v.jsx("div",{className:"border px-2 py-1 rounded-lg",children:r},r))})]})}const LW=function(){return/macintosh|mac os x/i.test(navigator.userAgent)},Eh=()=>LW()?"Cmd":"Ctrl";function jW(){const[e,t]=lP(!1);return Xn("h",()=>{t()}),v.jsxs(sg,{open:e,onOpenChange:t,children:[v.jsx(Dx,{asChild:!0,children:v.jsx(yn,{tooltip:"Hotkeys",children:v.jsx(lV,{})})}),v.jsx(Hd,{children:v.jsxs(TP,{children:[v.jsx(Kd,{children:"Hotkeys"}),v.jsxs("div",{className:"flex gap-2 flex-col pt-4",children:[v.jsx(dr,{content:"Pan",keys:["Space + Drag"]}),v.jsx(dr,{content:"Reset Zoom/Pan",keys:["Esc"]}),v.jsx(dr,{content:"Decrease Brush Size",keys:["["]}),v.jsx(dr,{content:"Increase Brush Size",keys:["]"]}),v.jsx(dr,{content:"View Original Image",keys:["Hold Tab"]}),v.jsx(dr,{content:"Undo",keys:[Eh(),"Z"]}),v.jsx(dr,{content:"Redo",keys:[Eh(),"Shift","Z"]}),v.jsx(dr,{content:"Copy Result",keys:[Eh(),"C"]}),v.jsx(dr,{content:"Paste Image",keys:[Eh(),"V"]}),v.jsx(dr,{content:"Trigger Manually Inpainting",keys:["Shift","R"]}),v.jsx(dr,{content:"Toggle Hotkeys Dialog",keys:["H"]}),v.jsx(dr,{content:"Toggle Settings Dialog",keys:["S"]}),v.jsx(dr,{content:"Toggle File Manager",keys:["F"]})]})]})})]})}function Lx(e){const[t]=d.useState(new Image),[n,r]=d.useState(!1);return d.useEffect(()=>{if(e)return t.onload=()=>{r(!0)},r(!1),t.src=URL.createObjectURL(e),()=>{t.onload=null}},[e,t]),[t,n]}const IP="Popover",[LP,_te]=An(IP,[zs]),jx=zs(),[FW,Tc]=LP(IP),BW=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=jx(t),u=d.useRef(null),[f,m]=d.useState(!1),[p=!1,g]=no({prop:r,defaultProp:o,onChange:i});return d.createElement(Fd,l,d.createElement(FW,{scope:t,contentId:tr(),triggerRef:u,open:p,onOpenChange:g,onOpenToggle:d.useCallback(()=>g(y=>!y),[g]),hasCustomAnchor:f,onCustomAnchorAdd:d.useCallback(()=>m(!0),[]),onCustomAnchorRemove:d.useCallback(()=>m(!1),[]),modal:s},n))},zW="PopoverTrigger",UW=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Tc(zW,n),i=jx(n),s=We(t,o.triggerRef),l=d.createElement(Ae.button,Y({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":BP(o.open)},r,{ref:s,onClick:fe(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?l:d.createElement(Zm,Y({asChild:!0},i),l)}),jP="PopoverPortal",[VW,WW]=LP(jP,{forceMount:void 0}),HW=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Tc(jP,t);return d.createElement(VW,{scope:t,forceMount:n},d.createElement(Sn,{present:n||i.open},d.createElement(Bd,{asChild:!0,container:o},r)))},fd="PopoverContent",KW=d.forwardRef((e,t)=>{const n=WW(fd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Tc(fd,e.__scopePopover);return d.createElement(Sn,{present:r||i.open},i.modal?d.createElement(GW,Y({},o,{ref:t})):d.createElement(YW,Y({},o,{ref:t})))}),GW=d.forwardRef((e,t)=>{const n=Tc(fd,e.__scopePopover),r=d.useRef(null),o=We(t,r),i=d.useRef(!1);return d.useEffect(()=>{const s=r.current;if(s)return ig(s)},[]),d.createElement(og,{as:Qo,allowPinchZoom:!0},d.createElement(FP,Y({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),i.current||(l=n.triggerRef.current)===null||l===void 0||l.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:fe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),YW=d.forwardRef((e,t)=>{const n=Tc(fd,e.__scopePopover),r=d.useRef(!1),o=d.useRef(!1);return d.createElement(FP,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var l;r.current||(l=n.triggerRef.current)===null||l===void 0||l.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,l;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=i.target;((l=n.triggerRef.current)===null||l===void 0?void 0:l.contains(u))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),FP=d.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:m,...p}=e,g=Tc(fd,n),y=jx(n);return ng(),d.createElement(tg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},d.createElement(Rc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:m,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1)},d.createElement(qm,Y({"data-state":BP(g.open),role:"dialog",id:g.contentId},y,p,{ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function BP(e){return e?"open":"closed"}const XW=BW,ZW=UW,qW=HW,zP=KW,QW=XW,JW=ZW,UP=d.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>v.jsx(qW,{children:v.jsx(zP,{ref:o,align:t,tabIndex:-1,sideOffset:n,className:xe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));UP.displayName=zP.displayName;function eH(){var e=d.useRef(!0);return e.current?(e.current=!1,!0):e.current}var tH=function(e,t){var n=eH();d.useEffect(function(){if(!n)return e()},t)};const nH=tH;var rH=function(){};function Fx(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function Bx(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var ip=typeof window<"u",oH=function(e,t){return typeof t=="boolean"?t:!e},iH=function(e){return d.useReducer(oH,e)};const zx=iH;var sH=["mousedown","touchstart"],aH=function(e,t,n){n===void 0&&(n=sH);var r=d.useRef(t);d.useEffect(function(){r.current=t},[t]),d.useEffect(function(){for(var o=function(u){var f=e.current;f&&!f.contains(u.target)&&r.current(u)},i=0,s=n;i<s.length;i++){var l=s[i];Fx(document,l,o)}return function(){for(var u=0,f=n;u<f.length;u++){var m=f[u];Bx(document,m,o)}}},[n,e])};const VP=aH;var lH=function(e){d.useEffect(e,[])};const cH=lH;var uH=ip?window:null,h2=function(e){return!!e.addEventListener},p2=function(e){return!!e.on},dH=function(e,t,n,r){n===void 0&&(n=uH),d.useEffect(function(){if(t&&n)return h2(n)?Fx(n,e,t,r):p2(n)&&n.on(e,t,r),function(){h2(n)?Bx(n,e,t,r):p2(n)&&n.off(e,t,r)}},[e,t,n,JSON.stringify(r)])};const fH=dH;var hH=function(e){return typeof e=="function"?e:typeof e=="string"?function(t){return t.key===e}:e?function(){return!0}:function(){return!1}},pH=function(e,t,n,r){t===void 0&&(t=rH),n===void 0&&(n={}),r===void 0&&(r=[e]);var o=n.event,i=o===void 0?"keydown":o,s=n.target,l=n.options,u=d.useMemo(function(){var f=hH(e),m=function(p){if(f(p))return t(p)};return m},r);fH(i,u,s,l)};const m2=pH;var mH=function(e){var t=d.useState([!1,null]),n=t[0],r=t[1];return m2(e,function(o){return r([!0,o])},{event:"keydown"},[n]),m2(e,function(o){return r([!1,o])},{event:"keyup"},[n]),n};const gH=mH;var vH=function(e,t,n,r){r===void 0&&(r=gH);var o=r(e),i=o[0],s=o[1];nH(function(){!i&&n?n(s):i&&t&&t(s)},[i])};const j0=vH;var yH=function(e){var t=d.useRef(e);t.current=e,cH(function(){return function(){return t.current()}})};const wH=yH;var xH=function(e){var t=d.useRef(0),n=d.useState(e),r=n[0],o=n[1],i=d.useCallback(function(s){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){o(s)})},[]);return wH(function(){cancelAnimationFrame(t.current)}),[r,i]};const bH=xH;var SH=function(e,t){e===void 0&&(e=1/0),t===void 0&&(t=1/0);var n=bH({width:ip?window.innerWidth:e,height:ip?window.innerHeight:t}),r=n[0],o=n[1];return d.useEffect(function(){if(ip){var i=function(){o({width:window.innerWidth,height:window.innerHeight})};return Fx(window,"resize",i),function(){Bx(window,"resize",i)}}},[]),r};const _H=SH,Ux=d.forwardRef(({className:e,...t},n)=>{const r=xt(s=>s.updateAppState),o=()=>{r({disableShortCuts:!0})},i=()=>{r({disableShortCuts:!1})};return v.jsx("textarea",{className:xe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","overflow-auto",e),tabIndex:-1,ref:n,onFocus:o,onBlur:i,...t})});Ux.displayName="Textarea";const EH=()=>{const[e,t,n,r,o,i]=xt(x=>[x.getIsProcessing(),x.settings.prompt,x.updateSettings,x.runInpainting,x.showPrevMask,x.hidePrevMask]),[s,l]=zx(!1),u=d.useRef(null);VP(u,()=>{u!=null&&u.current&&u.current.blur()});const f=x=>{x.preventDefault(),x.stopPropagation();const S=x.target;n({prompt:S.value})},m=()=>{e||r()},p=x=>{x.key==="Enter"&&x.ctrlKey&&t.length!==0&&m()},g=()=>{o()},y=()=>{i()};return v.jsx("div",{className:"flex gap-4 relative w-full justify-center h-full",children:v.jsxs("div",{className:"absolute flex gap-4",children:[v.jsx(Ux,{ref:u,placeholder:"I want to repaint of...",className:xe(s?"focus:overflow-y-auto":"overflow-y-hidden","min-h-[32px] h-[32px] overflow-x-hidden focus:h-[120px] overflow-y-hidden transition-[height] w-[500px] py-1 px-3 bg-background resize-none"),style:{scrollbarGutter:"stable"},value:t,onInput:f,onKeyUp:p,onTransitionEnd:l}),v.jsx(wn,{size:"sm",onClick:m,disabled:e,onMouseEnter:g,onMouseLeave:y,children:"Paint"})]})})};var Kp={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/Kp.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",p=1,g=2,y=4,x=1,S=2,E=1,_=2,b=4,C=8,R=16,T=32,N=64,A=128,O=256,U=512,z=30,ie="...",K=800,te=16,W=1,re=2,H=3,J=1/0,G=9007199254740991,Z=17976931348623157e292,Q=NaN,le=4294967295,L=le-1,ue=le>>>1,Ne=[["ary",A],["bind",E],["bindKey",_],["curry",C],["curryRight",R],["flip",U],["partial",T],["partialRight",N],["rearg",O]],Ke="[object Arguments]",Me="[object Array]",me="[object AsyncFunction]",be="[object Boolean]",Ee="[object Date]",Oe="[object DOMException]",Ie="[object Error]",ze="[object Function]",ht="[object GeneratorFunction]",st="[object Map]",Yt="[object Number]",rr="[object Null]",en="[object Object]",Li="[object Promise]",D="[object Proxy]",X="[object RegExp]",ee="[object Set]",Se="[object String]",pe="[object Symbol]",he="[object Undefined]",Pe="[object WeakMap]",dt="[object WeakSet]",gt="[object ArrayBuffer]",Mn="[object DataView]",On="[object Float32Array]",ji="[object Float64Array]",Cr="[object Int8Array]",$r="[object Int16Array]",Ks="[object Int32Array]",ri="[object Uint8Array]",Fi="[object Uint8ClampedArray]",or="[object Uint16Array]",Jd="[object Uint32Array]",kg=/\b__p \+= '';/g,ef=/\b(__p \+=) '' \+/g,Pg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,tf=/&(?:amp|lt|gt|quot|#39);/g,Dc=/[&<>"']/g,nf=RegExp(tf.source),rf=RegExp(Dc.source),of=/<%-([\s\S]+?)%>/g,sf=/<%([\s\S]+?)%>/g,Va=/<%=([\s\S]+?)%>/g,Tg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ic=/^\w*$/,af=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wa=/[\\^$.*+?()[\]{}|]/g,Ag=RegExp(Wa.source),Lc=/^\s+/,Mg=/\s/,Og=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,V=/\{\n\/\* \[wrapped with (.+)\] \*/,Ue=/,? & /,at=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oo=/[()=,{}\[\]\/\s]/,ln=/\\(\\)?/g,lf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sb=/\w*$/,gM=/^[-+]0x[0-9a-f]+$/i,vM=/^0b[01]+$/i,yM=/^\[object .+?Constructor\]$/,wM=/^0o[0-7]+$/i,xM=/^(?:0|[1-9]\d*)$/,bM=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,cf=/($^)/,SM=/['\n\r\u2028\u2029\\]/g,uf="\\ud800-\\udfff",_M="\\u0300-\\u036f",EM="\\ufe20-\\ufe2f",CM="\\u20d0-\\u20ff",_b=_M+EM+CM,Eb="\\u2700-\\u27bf",Cb="a-z\\xdf-\\xf6\\xf8-\\xff",$M="\\xac\\xb1\\xd7\\xf7",RM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kM="\\u2000-\\u206f",PM=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$b="A-Z\\xc0-\\xd6\\xd8-\\xde",Rb="\\ufe0e\\ufe0f",kb=$M+RM+kM+PM,Ng="[']",TM="["+uf+"]",Pb="["+kb+"]",df="["+_b+"]",Tb="\\d+",AM="["+Eb+"]",Ab="["+Cb+"]",Mb="[^"+uf+kb+Tb+Eb+Cb+$b+"]",Dg="\\ud83c[\\udffb-\\udfff]",MM="(?:"+df+"|"+Dg+")",Ob="[^"+uf+"]",Ig="(?:\\ud83c[\\udde6-\\uddff]){2}",Lg="[\\ud800-\\udbff][\\udc00-\\udfff]",Ha="["+$b+"]",Nb="\\u200d",Db="(?:"+Ab+"|"+Mb+")",OM="(?:"+Ha+"|"+Mb+")",Ib="(?:"+Ng+"(?:d|ll|m|re|s|t|ve))?",Lb="(?:"+Ng+"(?:D|LL|M|RE|S|T|VE))?",jb=MM+"?",Fb="["+Rb+"]?",NM="(?:"+Nb+"(?:"+[Ob,Ig,Lg].join("|")+")"+Fb+jb+")*",DM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",IM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bb=Fb+jb+NM,LM="(?:"+[AM,Ig,Lg].join("|")+")"+Bb,jM="(?:"+[Ob+df+"?",df,Ig,Lg,TM].join("|")+")",FM=RegExp(Ng,"g"),BM=RegExp(df,"g"),jg=RegExp(Dg+"(?="+Dg+")|"+jM+Bb,"g"),zM=RegExp([Ha+"?"+Ab+"+"+Ib+"(?="+[Pb,Ha,"$"].join("|")+")",OM+"+"+Lb+"(?="+[Pb,Ha+Db,"$"].join("|")+")",Ha+"?"+Db+"+"+Ib,Ha+"+"+Lb,IM,DM,Tb,LM].join("|"),"g"),UM=RegExp("["+Nb+uf+_b+Rb+"]"),VM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,WM=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],HM=-1,kt={};kt[On]=kt[ji]=kt[Cr]=kt[$r]=kt[Ks]=kt[ri]=kt[Fi]=kt[or]=kt[Jd]=!0,kt[Ke]=kt[Me]=kt[gt]=kt[be]=kt[Mn]=kt[Ee]=kt[Ie]=kt[ze]=kt[st]=kt[Yt]=kt[en]=kt[X]=kt[ee]=kt[Se]=kt[Pe]=!1;var Ct={};Ct[Ke]=Ct[Me]=Ct[gt]=Ct[Mn]=Ct[be]=Ct[Ee]=Ct[On]=Ct[ji]=Ct[Cr]=Ct[$r]=Ct[Ks]=Ct[st]=Ct[Yt]=Ct[en]=Ct[X]=Ct[ee]=Ct[Se]=Ct[pe]=Ct[ri]=Ct[Fi]=Ct[or]=Ct[Jd]=!0,Ct[Ie]=Ct[ze]=Ct[Pe]=!1;var KM={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},GM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},YM={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},XM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ZM=parseFloat,qM=parseInt,zb=typeof Jc=="object"&&Jc&&Jc.Object===Object&&Jc,QM=typeof self=="object"&&self&&self.Object===Object&&self,hn=zb||QM||Function("return this")(),Fg=t&&!t.nodeType&&t,Gs=Fg&&!0&&e&&!e.nodeType&&e,Ub=Gs&&Gs.exports===Fg,Bg=Ub&&zb.process,Rr=function(){try{var j=Gs&&Gs.require&&Gs.require("util").types;return j||Bg&&Bg.binding&&Bg.binding("util")}catch{}}(),Vb=Rr&&Rr.isArrayBuffer,Wb=Rr&&Rr.isDate,Hb=Rr&&Rr.isMap,Kb=Rr&&Rr.isRegExp,Gb=Rr&&Rr.isSet,Yb=Rr&&Rr.isTypedArray;function ir(j,ne,q){switch(q.length){case 0:return j.call(ne);case 1:return j.call(ne,q[0]);case 2:return j.call(ne,q[0],q[1]);case 3:return j.call(ne,q[0],q[1],q[2])}return j.apply(ne,q)}function JM(j,ne,q,Ce){for(var Ge=-1,pt=j==null?0:j.length;++Ge<pt;){var tn=j[Ge];ne(Ce,tn,q(tn),j)}return Ce}function kr(j,ne){for(var q=-1,Ce=j==null?0:j.length;++q<Ce&&ne(j[q],q,j)!==!1;);return j}function e6(j,ne){for(var q=j==null?0:j.length;q--&&ne(j[q],q,j)!==!1;);return j}function Xb(j,ne){for(var q=-1,Ce=j==null?0:j.length;++q<Ce;)if(!ne(j[q],q,j))return!1;return!0}function Bi(j,ne){for(var q=-1,Ce=j==null?0:j.length,Ge=0,pt=[];++q<Ce;){var tn=j[q];ne(tn,q,j)&&(pt[Ge++]=tn)}return pt}function ff(j,ne){var q=j==null?0:j.length;return!!q&&Ka(j,ne,0)>-1}function zg(j,ne,q){for(var Ce=-1,Ge=j==null?0:j.length;++Ce<Ge;)if(q(ne,j[Ce]))return!0;return!1}function Mt(j,ne){for(var q=-1,Ce=j==null?0:j.length,Ge=Array(Ce);++q<Ce;)Ge[q]=ne(j[q],q,j);return Ge}function zi(j,ne){for(var q=-1,Ce=ne.length,Ge=j.length;++q<Ce;)j[Ge+q]=ne[q];return j}function Ug(j,ne,q,Ce){var Ge=-1,pt=j==null?0:j.length;for(Ce&&pt&&(q=j[++Ge]);++Ge<pt;)q=ne(q,j[Ge],Ge,j);return q}function t6(j,ne,q,Ce){var Ge=j==null?0:j.length;for(Ce&&Ge&&(q=j[--Ge]);Ge--;)q=ne(q,j[Ge],Ge,j);return q}function Vg(j,ne){for(var q=-1,Ce=j==null?0:j.length;++q<Ce;)if(ne(j[q],q,j))return!0;return!1}var n6=Wg("length");function r6(j){return j.split("")}function o6(j){return j.match(at)||[]}function Zb(j,ne,q){var Ce;return q(j,function(Ge,pt,tn){if(ne(Ge,pt,tn))return Ce=pt,!1}),Ce}function hf(j,ne,q,Ce){for(var Ge=j.length,pt=q+(Ce?1:-1);Ce?pt--:++pt<Ge;)if(ne(j[pt],pt,j))return pt;return-1}function Ka(j,ne,q){return ne===ne?g6(j,ne,q):hf(j,qb,q)}function i6(j,ne,q,Ce){for(var Ge=q-1,pt=j.length;++Ge<pt;)if(Ce(j[Ge],ne))return Ge;return-1}function qb(j){return j!==j}function Qb(j,ne){var q=j==null?0:j.length;return q?Kg(j,ne)/q:Q}function Wg(j){return function(ne){return ne==null?n:ne[j]}}function Hg(j){return function(ne){return j==null?n:j[ne]}}function Jb(j,ne,q,Ce,Ge){return Ge(j,function(pt,tn,_t){q=Ce?(Ce=!1,pt):ne(q,pt,tn,_t)}),q}function s6(j,ne){var q=j.length;for(j.sort(ne);q--;)j[q]=j[q].value;return j}function Kg(j,ne){for(var q,Ce=-1,Ge=j.length;++Ce<Ge;){var pt=ne(j[Ce]);pt!==n&&(q=q===n?pt:q+pt)}return q}function Gg(j,ne){for(var q=-1,Ce=Array(j);++q<j;)Ce[q]=ne(q);return Ce}function a6(j,ne){return Mt(ne,function(q){return[q,j[q]]})}function eS(j){return j&&j.slice(0,oS(j)+1).replace(Lc,"")}function sr(j){return function(ne){return j(ne)}}function Yg(j,ne){return Mt(ne,function(q){return j[q]})}function jc(j,ne){return j.has(ne)}function tS(j,ne){for(var q=-1,Ce=j.length;++q<Ce&&Ka(ne,j[q],0)>-1;);return q}function nS(j,ne){for(var q=j.length;q--&&Ka(ne,j[q],0)>-1;);return q}function l6(j,ne){for(var q=j.length,Ce=0;q--;)j[q]===ne&&++Ce;return Ce}var c6=Hg(KM),u6=Hg(GM);function d6(j){return"\\"+XM[j]}function f6(j,ne){return j==null?n:j[ne]}function Ga(j){return UM.test(j)}function h6(j){return VM.test(j)}function p6(j){for(var ne,q=[];!(ne=j.next()).done;)q.push(ne.value);return q}function Xg(j){var ne=-1,q=Array(j.size);return j.forEach(function(Ce,Ge){q[++ne]=[Ge,Ce]}),q}function rS(j,ne){return function(q){return j(ne(q))}}function Ui(j,ne){for(var q=-1,Ce=j.length,Ge=0,pt=[];++q<Ce;){var tn=j[q];(tn===ne||tn===m)&&(j[q]=m,pt[Ge++]=q)}return pt}function pf(j){var ne=-1,q=Array(j.size);return j.forEach(function(Ce){q[++ne]=Ce}),q}function m6(j){var ne=-1,q=Array(j.size);return j.forEach(function(Ce){q[++ne]=[Ce,Ce]}),q}function g6(j,ne,q){for(var Ce=q-1,Ge=j.length;++Ce<Ge;)if(j[Ce]===ne)return Ce;return-1}function v6(j,ne,q){for(var Ce=q+1;Ce--;)if(j[Ce]===ne)return Ce;return Ce}function Ya(j){return Ga(j)?w6(j):n6(j)}function io(j){return Ga(j)?x6(j):r6(j)}function oS(j){for(var ne=j.length;ne--&&Mg.test(j.charAt(ne)););return ne}var y6=Hg(YM);function w6(j){for(var ne=jg.lastIndex=0;jg.test(j);)++ne;return ne}function x6(j){return j.match(jg)||[]}function b6(j){return j.match(zM)||[]}var S6=function j(ne){ne=ne==null?hn:Xa.defaults(hn.Object(),ne,Xa.pick(hn,WM));var q=ne.Array,Ce=ne.Date,Ge=ne.Error,pt=ne.Function,tn=ne.Math,_t=ne.Object,Zg=ne.RegExp,_6=ne.String,Pr=ne.TypeError,mf=q.prototype,E6=pt.prototype,Za=_t.prototype,gf=ne["__core-js_shared__"],vf=E6.toString,yt=Za.hasOwnProperty,C6=0,iS=function(){var a=/[^.]+$/.exec(gf&&gf.keys&&gf.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),yf=Za.toString,$6=vf.call(_t),R6=hn._,k6=Zg("^"+vf.call(yt).replace(Wa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wf=Ub?ne.Buffer:n,Vi=ne.Symbol,xf=ne.Uint8Array,sS=wf?wf.allocUnsafe:n,bf=rS(_t.getPrototypeOf,_t),aS=_t.create,lS=Za.propertyIsEnumerable,Sf=mf.splice,cS=Vi?Vi.isConcatSpreadable:n,Fc=Vi?Vi.iterator:n,Ys=Vi?Vi.toStringTag:n,_f=function(){try{var a=Js(_t,"defineProperty");return a({},"",{}),a}catch{}}(),P6=ne.clearTimeout!==hn.clearTimeout&&ne.clearTimeout,T6=Ce&&Ce.now!==hn.Date.now&&Ce.now,A6=ne.setTimeout!==hn.setTimeout&&ne.setTimeout,Ef=tn.ceil,Cf=tn.floor,qg=_t.getOwnPropertySymbols,M6=wf?wf.isBuffer:n,uS=ne.isFinite,O6=mf.join,N6=rS(_t.keys,_t),nn=tn.max,_n=tn.min,D6=Ce.now,I6=ne.parseInt,dS=tn.random,L6=mf.reverse,Qg=Js(ne,"DataView"),Bc=Js(ne,"Map"),Jg=Js(ne,"Promise"),qa=Js(ne,"Set"),zc=Js(ne,"WeakMap"),Uc=Js(_t,"create"),$f=zc&&new zc,Qa={},j6=ea(Qg),F6=ea(Bc),B6=ea(Jg),z6=ea(qa),U6=ea(zc),Rf=Vi?Vi.prototype:n,Vc=Rf?Rf.valueOf:n,fS=Rf?Rf.toString:n;function k(a){if(Bt(a)&&!Ye(a)&&!(a instanceof ot)){if(a instanceof Tr)return a;if(yt.call(a,"__wrapped__"))return h_(a)}return new Tr(a)}var Ja=function(){function a(){}return function(c){if(!Dt(c))return{};if(aS)return aS(c);a.prototype=c;var h=new a;return a.prototype=n,h}}();function kf(){}function Tr(a,c){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}k.templateSettings={escape:of,evaluate:sf,interpolate:Va,variable:"",imports:{_:k}},k.prototype=kf.prototype,k.prototype.constructor=k,Tr.prototype=Ja(kf.prototype),Tr.prototype.constructor=Tr;function ot(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=le,this.__views__=[]}function V6(){var a=new ot(this.__wrapped__);return a.__actions__=Wn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Wn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Wn(this.__views__),a}function W6(){if(this.__filtered__){var a=new ot(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function H6(){var a=this.__wrapped__.value(),c=this.__dir__,h=Ye(a),w=c<0,$=h?a.length:0,P=rO(0,$,this.__views__),M=P.start,I=P.end,B=I-M,oe=w?I:M-1,se=this.__iteratees__,ce=se.length,ve=0,ke=_n(B,this.__takeCount__);if(!h||!w&&$==B&&ke==B)return IS(a,this.__actions__);var je=[];e:for(;B--&&ve<ke;){oe+=c;for(var Qe=-1,Fe=a[oe];++Qe<ce;){var nt=se[Qe],lt=nt.iteratee,cr=nt.type,In=lt(Fe);if(cr==re)Fe=In;else if(!In){if(cr==W)continue e;break e}}je[ve++]=Fe}return je}ot.prototype=Ja(kf.prototype),ot.prototype.constructor=ot;function Xs(a){var c=-1,h=a==null?0:a.length;for(this.clear();++c<h;){var w=a[c];this.set(w[0],w[1])}}function K6(){this.__data__=Uc?Uc(null):{},this.size=0}function G6(a){var c=this.has(a)&&delete this.__data__[a];return this.size-=c?1:0,c}function Y6(a){var c=this.__data__;if(Uc){var h=c[a];return h===u?n:h}return yt.call(c,a)?c[a]:n}function X6(a){var c=this.__data__;return Uc?c[a]!==n:yt.call(c,a)}function Z6(a,c){var h=this.__data__;return this.size+=this.has(a)?0:1,h[a]=Uc&&c===n?u:c,this}Xs.prototype.clear=K6,Xs.prototype.delete=G6,Xs.prototype.get=Y6,Xs.prototype.has=X6,Xs.prototype.set=Z6;function oi(a){var c=-1,h=a==null?0:a.length;for(this.clear();++c<h;){var w=a[c];this.set(w[0],w[1])}}function q6(){this.__data__=[],this.size=0}function Q6(a){var c=this.__data__,h=Pf(c,a);if(h<0)return!1;var w=c.length-1;return h==w?c.pop():Sf.call(c,h,1),--this.size,!0}function J6(a){var c=this.__data__,h=Pf(c,a);return h<0?n:c[h][1]}function e7(a){return Pf(this.__data__,a)>-1}function t7(a,c){var h=this.__data__,w=Pf(h,a);return w<0?(++this.size,h.push([a,c])):h[w][1]=c,this}oi.prototype.clear=q6,oi.prototype.delete=Q6,oi.prototype.get=J6,oi.prototype.has=e7,oi.prototype.set=t7;function ii(a){var c=-1,h=a==null?0:a.length;for(this.clear();++c<h;){var w=a[c];this.set(w[0],w[1])}}function n7(){this.size=0,this.__data__={hash:new Xs,map:new(Bc||oi),string:new Xs}}function r7(a){var c=zf(this,a).delete(a);return this.size-=c?1:0,c}function o7(a){return zf(this,a).get(a)}function i7(a){return zf(this,a).has(a)}function s7(a,c){var h=zf(this,a),w=h.size;return h.set(a,c),this.size+=h.size==w?0:1,this}ii.prototype.clear=n7,ii.prototype.delete=r7,ii.prototype.get=o7,ii.prototype.has=i7,ii.prototype.set=s7;function Zs(a){var c=-1,h=a==null?0:a.length;for(this.__data__=new ii;++c<h;)this.add(a[c])}function a7(a){return this.__data__.set(a,u),this}function l7(a){return this.__data__.has(a)}Zs.prototype.add=Zs.prototype.push=a7,Zs.prototype.has=l7;function so(a){var c=this.__data__=new oi(a);this.size=c.size}function c7(){this.__data__=new oi,this.size=0}function u7(a){var c=this.__data__,h=c.delete(a);return this.size=c.size,h}function d7(a){return this.__data__.get(a)}function f7(a){return this.__data__.has(a)}function h7(a,c){var h=this.__data__;if(h instanceof oi){var w=h.__data__;if(!Bc||w.length<o-1)return w.push([a,c]),this.size=++h.size,this;h=this.__data__=new ii(w)}return h.set(a,c),this.size=h.size,this}so.prototype.clear=c7,so.prototype.delete=u7,so.prototype.get=d7,so.prototype.has=f7,so.prototype.set=h7;function hS(a,c){var h=Ye(a),w=!h&&ta(a),$=!h&&!w&&Yi(a),P=!h&&!w&&!$&&rl(a),M=h||w||$||P,I=M?Gg(a.length,_6):[],B=I.length;for(var oe in a)(c||yt.call(a,oe))&&!(M&&(oe=="length"||$&&(oe=="offset"||oe=="parent")||P&&(oe=="buffer"||oe=="byteLength"||oe=="byteOffset")||ci(oe,B)))&&I.push(oe);return I}function pS(a){var c=a.length;return c?a[uv(0,c-1)]:n}function p7(a,c){return Uf(Wn(a),qs(c,0,a.length))}function m7(a){return Uf(Wn(a))}function ev(a,c,h){(h!==n&&!ao(a[c],h)||h===n&&!(c in a))&&si(a,c,h)}function Wc(a,c,h){var w=a[c];(!(yt.call(a,c)&&ao(w,h))||h===n&&!(c in a))&&si(a,c,h)}function Pf(a,c){for(var h=a.length;h--;)if(ao(a[h][0],c))return h;return-1}function g7(a,c,h,w){return Wi(a,function($,P,M){c(w,$,h($),M)}),w}function mS(a,c){return a&&To(c,cn(c),a)}function v7(a,c){return a&&To(c,Kn(c),a)}function si(a,c,h){c=="__proto__"&&_f?_f(a,c,{configurable:!0,enumerable:!0,value:h,writable:!0}):a[c]=h}function tv(a,c){for(var h=-1,w=c.length,$=q(w),P=a==null;++h<w;)$[h]=P?n:Dv(a,c[h]);return $}function qs(a,c,h){return a===a&&(h!==n&&(a=a<=h?a:h),c!==n&&(a=a>=c?a:c)),a}function Ar(a,c,h,w,$,P){var M,I=c&p,B=c&g,oe=c&y;if(h&&(M=$?h(a,w,$,P):h(a)),M!==n)return M;if(!Dt(a))return a;var se=Ye(a);if(se){if(M=iO(a),!I)return Wn(a,M)}else{var ce=En(a),ve=ce==ze||ce==ht;if(Yi(a))return FS(a,I);if(ce==en||ce==Ke||ve&&!$){if(M=B||ve?{}:o_(a),!I)return B?Y7(a,v7(M,a)):G7(a,mS(M,a))}else{if(!Ct[ce])return $?a:{};M=sO(a,ce,I)}}P||(P=new so);var ke=P.get(a);if(ke)return ke;P.set(a,M),O_(a)?a.forEach(function(Fe){M.add(Ar(Fe,c,h,Fe,a,P))}):A_(a)&&a.forEach(function(Fe,nt){M.set(nt,Ar(Fe,c,h,nt,a,P))});var je=oe?B?bv:xv:B?Kn:cn,Qe=se?n:je(a);return kr(Qe||a,function(Fe,nt){Qe&&(nt=Fe,Fe=a[nt]),Wc(M,nt,Ar(Fe,c,h,nt,a,P))}),M}function y7(a){var c=cn(a);return function(h){return gS(h,a,c)}}function gS(a,c,h){var w=h.length;if(a==null)return!w;for(a=_t(a);w--;){var $=h[w],P=c[$],M=a[$];if(M===n&&!($ in a)||!P(M))return!1}return!0}function vS(a,c,h){if(typeof a!="function")throw new Pr(s);return qc(function(){a.apply(n,h)},c)}function Hc(a,c,h,w){var $=-1,P=ff,M=!0,I=a.length,B=[],oe=c.length;if(!I)return B;h&&(c=Mt(c,sr(h))),w?(P=zg,M=!1):c.length>=o&&(P=jc,M=!1,c=new Zs(c));e:for(;++$<I;){var se=a[$],ce=h==null?se:h(se);if(se=w||se!==0?se:0,M&&ce===ce){for(var ve=oe;ve--;)if(c[ve]===ce)continue e;B.push(se)}else P(c,ce,w)||B.push(se)}return B}var Wi=WS(Po),yS=WS(rv,!0);function w7(a,c){var h=!0;return Wi(a,function(w,$,P){return h=!!c(w,$,P),h}),h}function Tf(a,c,h){for(var w=-1,$=a.length;++w<$;){var P=a[w],M=c(P);if(M!=null&&(I===n?M===M&&!lr(M):h(M,I)))var I=M,B=P}return B}function x7(a,c,h,w){var $=a.length;for(h=qe(h),h<0&&(h=-h>$?0:$+h),w=w===n||w>$?$:qe(w),w<0&&(w+=$),w=h>w?0:D_(w);h<w;)a[h++]=c;return a}function wS(a,c){var h=[];return Wi(a,function(w,$,P){c(w,$,P)&&h.push(w)}),h}function pn(a,c,h,w,$){var P=-1,M=a.length;for(h||(h=lO),$||($=[]);++P<M;){var I=a[P];c>0&&h(I)?c>1?pn(I,c-1,h,w,$):zi($,I):w||($[$.length]=I)}return $}var nv=HS(),xS=HS(!0);function Po(a,c){return a&&nv(a,c,cn)}function rv(a,c){return a&&xS(a,c,cn)}function Af(a,c){return Bi(c,function(h){return ui(a[h])})}function Qs(a,c){c=Ki(c,a);for(var h=0,w=c.length;a!=null&&h<w;)a=a[Ao(c[h++])];return h&&h==w?a:n}function bS(a,c,h){var w=c(a);return Ye(a)?w:zi(w,h(a))}function Nn(a){return a==null?a===n?he:rr:Ys&&Ys in _t(a)?nO(a):mO(a)}function ov(a,c){return a>c}function b7(a,c){return a!=null&&yt.call(a,c)}function S7(a,c){return a!=null&&c in _t(a)}function _7(a,c,h){return a>=_n(c,h)&&a<nn(c,h)}function iv(a,c,h){for(var w=h?zg:ff,$=a[0].length,P=a.length,M=P,I=q(P),B=1/0,oe=[];M--;){var se=a[M];M&&c&&(se=Mt(se,sr(c))),B=_n(se.length,B),I[M]=!h&&(c||$>=120&&se.length>=120)?new Zs(M&&se):n}se=a[0];var ce=-1,ve=I[0];e:for(;++ce<$&&oe.length<B;){var ke=se[ce],je=c?c(ke):ke;if(ke=h||ke!==0?ke:0,!(ve?jc(ve,je):w(oe,je,h))){for(M=P;--M;){var Qe=I[M];if(!(Qe?jc(Qe,je):w(a[M],je,h)))continue e}ve&&ve.push(je),oe.push(ke)}}return oe}function E7(a,c,h,w){return Po(a,function($,P,M){c(w,h($),P,M)}),w}function Kc(a,c,h){c=Ki(c,a),a=l_(a,c);var w=a==null?a:a[Ao(Or(c))];return w==null?n:ir(w,a,h)}function SS(a){return Bt(a)&&Nn(a)==Ke}function C7(a){return Bt(a)&&Nn(a)==gt}function $7(a){return Bt(a)&&Nn(a)==Ee}function Gc(a,c,h,w,$){return a===c?!0:a==null||c==null||!Bt(a)&&!Bt(c)?a!==a&&c!==c:R7(a,c,h,w,Gc,$)}function R7(a,c,h,w,$,P){var M=Ye(a),I=Ye(c),B=M?Me:En(a),oe=I?Me:En(c);B=B==Ke?en:B,oe=oe==Ke?en:oe;var se=B==en,ce=oe==en,ve=B==oe;if(ve&&Yi(a)){if(!Yi(c))return!1;M=!0,se=!1}if(ve&&!se)return P||(P=new so),M||rl(a)?t_(a,c,h,w,$,P):eO(a,c,B,h,w,$,P);if(!(h&x)){var ke=se&&yt.call(a,"__wrapped__"),je=ce&&yt.call(c,"__wrapped__");if(ke||je){var Qe=ke?a.value():a,Fe=je?c.value():c;return P||(P=new so),$(Qe,Fe,h,w,P)}}return ve?(P||(P=new so),tO(a,c,h,w,$,P)):!1}function k7(a){return Bt(a)&&En(a)==st}function sv(a,c,h,w){var $=h.length,P=$,M=!w;if(a==null)return!P;for(a=_t(a);$--;){var I=h[$];if(M&&I[2]?I[1]!==a[I[0]]:!(I[0]in a))return!1}for(;++$<P;){I=h[$];var B=I[0],oe=a[B],se=I[1];if(M&&I[2]){if(oe===n&&!(B in a))return!1}else{var ce=new so;if(w)var ve=w(oe,se,B,a,c,ce);if(!(ve===n?Gc(se,oe,x|S,w,ce):ve))return!1}}return!0}function _S(a){if(!Dt(a)||uO(a))return!1;var c=ui(a)?k6:yM;return c.test(ea(a))}function P7(a){return Bt(a)&&Nn(a)==X}function T7(a){return Bt(a)&&En(a)==ee}function A7(a){return Bt(a)&&Yf(a.length)&&!!kt[Nn(a)]}function ES(a){return typeof a=="function"?a:a==null?Gn:typeof a=="object"?Ye(a)?RS(a[0],a[1]):$S(a):K_(a)}function av(a){if(!Zc(a))return N6(a);var c=[];for(var h in _t(a))yt.call(a,h)&&h!="constructor"&&c.push(h);return c}function M7(a){if(!Dt(a))return pO(a);var c=Zc(a),h=[];for(var w in a)w=="constructor"&&(c||!yt.call(a,w))||h.push(w);return h}function lv(a,c){return a<c}function CS(a,c){var h=-1,w=Hn(a)?q(a.length):[];return Wi(a,function($,P,M){w[++h]=c($,P,M)}),w}function $S(a){var c=_v(a);return c.length==1&&c[0][2]?s_(c[0][0],c[0][1]):function(h){return h===a||sv(h,a,c)}}function RS(a,c){return Cv(a)&&i_(c)?s_(Ao(a),c):function(h){var w=Dv(h,a);return w===n&&w===c?Iv(h,a):Gc(c,w,x|S)}}function Mf(a,c,h,w,$){a!==c&&nv(c,function(P,M){if($||($=new so),Dt(P))O7(a,c,M,h,Mf,w,$);else{var I=w?w(Rv(a,M),P,M+"",a,c,$):n;I===n&&(I=P),ev(a,M,I)}},Kn)}function O7(a,c,h,w,$,P,M){var I=Rv(a,h),B=Rv(c,h),oe=M.get(B);if(oe){ev(a,h,oe);return}var se=P?P(I,B,h+"",a,c,M):n,ce=se===n;if(ce){var ve=Ye(B),ke=!ve&&Yi(B),je=!ve&&!ke&&rl(B);se=B,ve||ke||je?Ye(I)?se=I:Ht(I)?se=Wn(I):ke?(ce=!1,se=FS(B,!0)):je?(ce=!1,se=BS(B,!0)):se=[]:Qc(B)||ta(B)?(se=I,ta(I)?se=I_(I):(!Dt(I)||ui(I))&&(se=o_(B))):ce=!1}ce&&(M.set(B,se),$(se,B,w,P,M),M.delete(B)),ev(a,h,se)}function kS(a,c){var h=a.length;if(h)return c+=c<0?h:0,ci(c,h)?a[c]:n}function PS(a,c,h){c.length?c=Mt(c,function(P){return Ye(P)?function(M){return Qs(M,P.length===1?P[0]:P)}:P}):c=[Gn];var w=-1;c=Mt(c,sr(Le()));var $=CS(a,function(P,M,I){var B=Mt(c,function(oe){return oe(P)});return{criteria:B,index:++w,value:P}});return s6($,function(P,M){return K7(P,M,h)})}function N7(a,c){return TS(a,c,function(h,w){return Iv(a,w)})}function TS(a,c,h){for(var w=-1,$=c.length,P={};++w<$;){var M=c[w],I=Qs(a,M);h(I,M)&&Yc(P,Ki(M,a),I)}return P}function D7(a){return function(c){return Qs(c,a)}}function cv(a,c,h,w){var $=w?i6:Ka,P=-1,M=c.length,I=a;for(a===c&&(c=Wn(c)),h&&(I=Mt(a,sr(h)));++P<M;)for(var B=0,oe=c[P],se=h?h(oe):oe;(B=$(I,se,B,w))>-1;)I!==a&&Sf.call(I,B,1),Sf.call(a,B,1);return a}function AS(a,c){for(var h=a?c.length:0,w=h-1;h--;){var $=c[h];if(h==w||$!==P){var P=$;ci($)?Sf.call(a,$,1):hv(a,$)}}return a}function uv(a,c){return a+Cf(dS()*(c-a+1))}function I7(a,c,h,w){for(var $=-1,P=nn(Ef((c-a)/(h||1)),0),M=q(P);P--;)M[w?P:++$]=a,a+=h;return M}function dv(a,c){var h="";if(!a||c<1||c>G)return h;do c%2&&(h+=a),c=Cf(c/2),c&&(a+=a);while(c);return h}function et(a,c){return kv(a_(a,c,Gn),a+"")}function L7(a){return pS(ol(a))}function j7(a,c){var h=ol(a);return Uf(h,qs(c,0,h.length))}function Yc(a,c,h,w){if(!Dt(a))return a;c=Ki(c,a);for(var $=-1,P=c.length,M=P-1,I=a;I!=null&&++$<P;){var B=Ao(c[$]),oe=h;if(B==="__proto__"||B==="constructor"||B==="prototype")return a;if($!=M){var se=I[B];oe=w?w(se,B,I):n,oe===n&&(oe=Dt(se)?se:ci(c[$+1])?[]:{})}Wc(I,B,oe),I=I[B]}return a}var MS=$f?function(a,c){return $f.set(a,c),a}:Gn,F7=_f?function(a,c){return _f(a,"toString",{configurable:!0,enumerable:!1,value:jv(c),writable:!0})}:Gn;function B7(a){return Uf(ol(a))}function Mr(a,c,h){var w=-1,$=a.length;c<0&&(c=-c>$?0:$+c),h=h>$?$:h,h<0&&(h+=$),$=c>h?0:h-c>>>0,c>>>=0;for(var P=q($);++w<$;)P[w]=a[w+c];return P}function z7(a,c){var h;return Wi(a,function(w,$,P){return h=c(w,$,P),!h}),!!h}function Of(a,c,h){var w=0,$=a==null?w:a.length;if(typeof c=="number"&&c===c&&$<=ue){for(;w<$;){var P=w+$>>>1,M=a[P];M!==null&&!lr(M)&&(h?M<=c:M<c)?w=P+1:$=P}return $}return fv(a,c,Gn,h)}function fv(a,c,h,w){var $=0,P=a==null?0:a.length;if(P===0)return 0;c=h(c);for(var M=c!==c,I=c===null,B=lr(c),oe=c===n;$<P;){var se=Cf(($+P)/2),ce=h(a[se]),ve=ce!==n,ke=ce===null,je=ce===ce,Qe=lr(ce);if(M)var Fe=w||je;else oe?Fe=je&&(w||ve):I?Fe=je&&ve&&(w||!ke):B?Fe=je&&ve&&!ke&&(w||!Qe):ke||Qe?Fe=!1:Fe=w?ce<=c:ce<c;Fe?$=se+1:P=se}return _n(P,L)}function OS(a,c){for(var h=-1,w=a.length,$=0,P=[];++h<w;){var M=a[h],I=c?c(M):M;if(!h||!ao(I,B)){var B=I;P[$++]=M===0?0:M}}return P}function NS(a){return typeof a=="number"?a:lr(a)?Q:+a}function ar(a){if(typeof a=="string")return a;if(Ye(a))return Mt(a,ar)+"";if(lr(a))return fS?fS.call(a):"";var c=a+"";return c=="0"&&1/a==-J?"-0":c}function Hi(a,c,h){var w=-1,$=ff,P=a.length,M=!0,I=[],B=I;if(h)M=!1,$=zg;else if(P>=o){var oe=c?null:Q7(a);if(oe)return pf(oe);M=!1,$=jc,B=new Zs}else B=c?[]:I;e:for(;++w<P;){var se=a[w],ce=c?c(se):se;if(se=h||se!==0?se:0,M&&ce===ce){for(var ve=B.length;ve--;)if(B[ve]===ce)continue e;c&&B.push(ce),I.push(se)}else $(B,ce,h)||(B!==I&&B.push(ce),I.push(se))}return I}function hv(a,c){return c=Ki(c,a),a=l_(a,c),a==null||delete a[Ao(Or(c))]}function DS(a,c,h,w){return Yc(a,c,h(Qs(a,c)),w)}function Nf(a,c,h,w){for(var $=a.length,P=w?$:-1;(w?P--:++P<$)&&c(a[P],P,a););return h?Mr(a,w?0:P,w?P+1:$):Mr(a,w?P+1:0,w?$:P)}function IS(a,c){var h=a;return h instanceof ot&&(h=h.value()),Ug(c,function(w,$){return $.func.apply($.thisArg,zi([w],$.args))},h)}function pv(a,c,h){var w=a.length;if(w<2)return w?Hi(a[0]):[];for(var $=-1,P=q(w);++$<w;)for(var M=a[$],I=-1;++I<w;)I!=$&&(P[$]=Hc(P[$]||M,a[I],c,h));return Hi(pn(P,1),c,h)}function LS(a,c,h){for(var w=-1,$=a.length,P=c.length,M={};++w<$;){var I=w<P?c[w]:n;h(M,a[w],I)}return M}function mv(a){return Ht(a)?a:[]}function gv(a){return typeof a=="function"?a:Gn}function Ki(a,c){return Ye(a)?a:Cv(a,c)?[a]:f_(vt(a))}var U7=et;function Gi(a,c,h){var w=a.length;return h=h===n?w:h,!c&&h>=w?a:Mr(a,c,h)}var jS=P6||function(a){return hn.clearTimeout(a)};function FS(a,c){if(c)return a.slice();var h=a.length,w=sS?sS(h):new a.constructor(h);return a.copy(w),w}function vv(a){var c=new a.constructor(a.byteLength);return new xf(c).set(new xf(a)),c}function V7(a,c){var h=c?vv(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.byteLength)}function W7(a){var c=new a.constructor(a.source,Sb.exec(a));return c.lastIndex=a.lastIndex,c}function H7(a){return Vc?_t(Vc.call(a)):{}}function BS(a,c){var h=c?vv(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.length)}function zS(a,c){if(a!==c){var h=a!==n,w=a===null,$=a===a,P=lr(a),M=c!==n,I=c===null,B=c===c,oe=lr(c);if(!I&&!oe&&!P&&a>c||P&&M&&B&&!I&&!oe||w&&M&&B||!h&&B||!$)return 1;if(!w&&!P&&!oe&&a<c||oe&&h&&$&&!w&&!P||I&&h&&$||!M&&$||!B)return-1}return 0}function K7(a,c,h){for(var w=-1,$=a.criteria,P=c.criteria,M=$.length,I=h.length;++w<M;){var B=zS($[w],P[w]);if(B){if(w>=I)return B;var oe=h[w];return B*(oe=="desc"?-1:1)}}return a.index-c.index}function US(a,c,h,w){for(var $=-1,P=a.length,M=h.length,I=-1,B=c.length,oe=nn(P-M,0),se=q(B+oe),ce=!w;++I<B;)se[I]=c[I];for(;++$<M;)(ce||$<P)&&(se[h[$]]=a[$]);for(;oe--;)se[I++]=a[$++];return se}function VS(a,c,h,w){for(var $=-1,P=a.length,M=-1,I=h.length,B=-1,oe=c.length,se=nn(P-I,0),ce=q(se+oe),ve=!w;++$<se;)ce[$]=a[$];for(var ke=$;++B<oe;)ce[ke+B]=c[B];for(;++M<I;)(ve||$<P)&&(ce[ke+h[M]]=a[$++]);return ce}function Wn(a,c){var h=-1,w=a.length;for(c||(c=q(w));++h<w;)c[h]=a[h];return c}function To(a,c,h,w){var $=!h;h||(h={});for(var P=-1,M=c.length;++P<M;){var I=c[P],B=w?w(h[I],a[I],I,h,a):n;B===n&&(B=a[I]),$?si(h,I,B):Wc(h,I,B)}return h}function G7(a,c){return To(a,Ev(a),c)}function Y7(a,c){return To(a,n_(a),c)}function Df(a,c){return function(h,w){var $=Ye(h)?JM:g7,P=c?c():{};return $(h,a,Le(w,2),P)}}function el(a){return et(function(c,h){var w=-1,$=h.length,P=$>1?h[$-1]:n,M=$>2?h[2]:n;for(P=a.length>3&&typeof P=="function"?($--,P):n,M&&Dn(h[0],h[1],M)&&(P=$<3?n:P,$=1),c=_t(c);++w<$;){var I=h[w];I&&a(c,I,w,P)}return c})}function WS(a,c){return function(h,w){if(h==null)return h;if(!Hn(h))return a(h,w);for(var $=h.length,P=c?$:-1,M=_t(h);(c?P--:++P<$)&&w(M[P],P,M)!==!1;);return h}}function HS(a){return function(c,h,w){for(var $=-1,P=_t(c),M=w(c),I=M.length;I--;){var B=M[a?I:++$];if(h(P[B],B,P)===!1)break}return c}}function X7(a,c,h){var w=c&E,$=Xc(a);function P(){var M=this&&this!==hn&&this instanceof P?$:a;return M.apply(w?h:this,arguments)}return P}function KS(a){return function(c){c=vt(c);var h=Ga(c)?io(c):n,w=h?h[0]:c.charAt(0),$=h?Gi(h,1).join(""):c.slice(1);return w[a]()+$}}function tl(a){return function(c){return Ug(W_(V_(c).replace(FM,"")),a,"")}}function Xc(a){return function(){var c=arguments;switch(c.length){case 0:return new a;case 1:return new a(c[0]);case 2:return new a(c[0],c[1]);case 3:return new a(c[0],c[1],c[2]);case 4:return new a(c[0],c[1],c[2],c[3]);case 5:return new a(c[0],c[1],c[2],c[3],c[4]);case 6:return new a(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new a(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var h=Ja(a.prototype),w=a.apply(h,c);return Dt(w)?w:h}}function Z7(a,c,h){var w=Xc(a);function $(){for(var P=arguments.length,M=q(P),I=P,B=nl($);I--;)M[I]=arguments[I];var oe=P<3&&M[0]!==B&&M[P-1]!==B?[]:Ui(M,B);if(P-=oe.length,P<h)return qS(a,c,If,$.placeholder,n,M,oe,n,n,h-P);var se=this&&this!==hn&&this instanceof $?w:a;return ir(se,this,M)}return $}function GS(a){return function(c,h,w){var $=_t(c);if(!Hn(c)){var P=Le(h,3);c=cn(c),h=function(I){return P($[I],I,$)}}var M=a(c,h,w);return M>-1?$[P?c[M]:M]:n}}function YS(a){return li(function(c){var h=c.length,w=h,$=Tr.prototype.thru;for(a&&c.reverse();w--;){var P=c[w];if(typeof P!="function")throw new Pr(s);if($&&!M&&Bf(P)=="wrapper")var M=new Tr([],!0)}for(w=M?w:h;++w<h;){P=c[w];var I=Bf(P),B=I=="wrapper"?Sv(P):n;B&&$v(B[0])&&B[1]==(A|C|T|O)&&!B[4].length&&B[9]==1?M=M[Bf(B[0])].apply(M,B[3]):M=P.length==1&&$v(P)?M[I]():M.thru(P)}return function(){var oe=arguments,se=oe[0];if(M&&oe.length==1&&Ye(se))return M.plant(se).value();for(var ce=0,ve=h?c[ce].apply(this,oe):se;++ce<h;)ve=c[ce].call(this,ve);return ve}})}function If(a,c,h,w,$,P,M,I,B,oe){var se=c&A,ce=c&E,ve=c&_,ke=c&(C|R),je=c&U,Qe=ve?n:Xc(a);function Fe(){for(var nt=arguments.length,lt=q(nt),cr=nt;cr--;)lt[cr]=arguments[cr];if(ke)var In=nl(Fe),ur=l6(lt,In);if(w&&(lt=US(lt,w,$,ke)),P&&(lt=VS(lt,P,M,ke)),nt-=ur,ke&&nt<oe){var Kt=Ui(lt,In);return qS(a,c,If,Fe.placeholder,h,lt,Kt,I,B,oe-nt)}var lo=ce?h:this,fi=ve?lo[a]:a;return nt=lt.length,I?lt=gO(lt,I):je&&nt>1&&lt.reverse(),se&&B<nt&&(lt.length=B),this&&this!==hn&&this instanceof Fe&&(fi=Qe||Xc(fi)),fi.apply(lo,lt)}return Fe}function XS(a,c){return function(h,w){return E7(h,a,c(w),{})}}function Lf(a,c){return function(h,w){var $;if(h===n&&w===n)return c;if(h!==n&&($=h),w!==n){if($===n)return w;typeof h=="string"||typeof w=="string"?(h=ar(h),w=ar(w)):(h=NS(h),w=NS(w)),$=a(h,w)}return $}}function yv(a){return li(function(c){return c=Mt(c,sr(Le())),et(function(h){var w=this;return a(c,function($){return ir($,w,h)})})})}function jf(a,c){c=c===n?" ":ar(c);var h=c.length;if(h<2)return h?dv(c,a):c;var w=dv(c,Ef(a/Ya(c)));return Ga(c)?Gi(io(w),0,a).join(""):w.slice(0,a)}function q7(a,c,h,w){var $=c&E,P=Xc(a);function M(){for(var I=-1,B=arguments.length,oe=-1,se=w.length,ce=q(se+B),ve=this&&this!==hn&&this instanceof M?P:a;++oe<se;)ce[oe]=w[oe];for(;B--;)ce[oe++]=arguments[++I];return ir(ve,$?h:this,ce)}return M}function ZS(a){return function(c,h,w){return w&&typeof w!="number"&&Dn(c,h,w)&&(h=w=n),c=di(c),h===n?(h=c,c=0):h=di(h),w=w===n?c<h?1:-1:di(w),I7(c,h,w,a)}}function Ff(a){return function(c,h){return typeof c=="string"&&typeof h=="string"||(c=Nr(c),h=Nr(h)),a(c,h)}}function qS(a,c,h,w,$,P,M,I,B,oe){var se=c&C,ce=se?M:n,ve=se?n:M,ke=se?P:n,je=se?n:P;c|=se?T:N,c&=~(se?N:T),c&b||(c&=~(E|_));var Qe=[a,c,$,ke,ce,je,ve,I,B,oe],Fe=h.apply(n,Qe);return $v(a)&&c_(Fe,Qe),Fe.placeholder=w,u_(Fe,a,c)}function wv(a){var c=tn[a];return function(h,w){if(h=Nr(h),w=w==null?0:_n(qe(w),292),w&&uS(h)){var $=(vt(h)+"e").split("e"),P=c($[0]+"e"+(+$[1]+w));return $=(vt(P)+"e").split("e"),+($[0]+"e"+(+$[1]-w))}return c(h)}}var Q7=qa&&1/pf(new qa([,-0]))[1]==J?function(a){return new qa(a)}:zv;function QS(a){return function(c){var h=En(c);return h==st?Xg(c):h==ee?m6(c):a6(c,a(c))}}function ai(a,c,h,w,$,P,M,I){var B=c&_;if(!B&&typeof a!="function")throw new Pr(s);var oe=w?w.length:0;if(oe||(c&=~(T|N),w=$=n),M=M===n?M:nn(qe(M),0),I=I===n?I:qe(I),oe-=$?$.length:0,c&N){var se=w,ce=$;w=$=n}var ve=B?n:Sv(a),ke=[a,c,h,w,$,se,ce,P,M,I];if(ve&&hO(ke,ve),a=ke[0],c=ke[1],h=ke[2],w=ke[3],$=ke[4],I=ke[9]=ke[9]===n?B?0:a.length:nn(ke[9]-oe,0),!I&&c&(C|R)&&(c&=~(C|R)),!c||c==E)var je=X7(a,c,h);else c==C||c==R?je=Z7(a,c,I):(c==T||c==(E|T))&&!$.length?je=q7(a,c,h,w):je=If.apply(n,ke);var Qe=ve?MS:c_;return u_(Qe(je,ke),a,c)}function JS(a,c,h,w){return a===n||ao(a,Za[h])&&!yt.call(w,h)?c:a}function e_(a,c,h,w,$,P){return Dt(a)&&Dt(c)&&(P.set(c,a),Mf(a,c,n,e_,P),P.delete(c)),a}function J7(a){return Qc(a)?n:a}function t_(a,c,h,w,$,P){var M=h&x,I=a.length,B=c.length;if(I!=B&&!(M&&B>I))return!1;var oe=P.get(a),se=P.get(c);if(oe&&se)return oe==c&&se==a;var ce=-1,ve=!0,ke=h&S?new Zs:n;for(P.set(a,c),P.set(c,a);++ce<I;){var je=a[ce],Qe=c[ce];if(w)var Fe=M?w(Qe,je,ce,c,a,P):w(je,Qe,ce,a,c,P);if(Fe!==n){if(Fe)continue;ve=!1;break}if(ke){if(!Vg(c,function(nt,lt){if(!jc(ke,lt)&&(je===nt||$(je,nt,h,w,P)))return ke.push(lt)})){ve=!1;break}}else if(!(je===Qe||$(je,Qe,h,w,P))){ve=!1;break}}return P.delete(a),P.delete(c),ve}function eO(a,c,h,w,$,P,M){switch(h){case Mn:if(a.byteLength!=c.byteLength||a.byteOffset!=c.byteOffset)return!1;a=a.buffer,c=c.buffer;case gt:return!(a.byteLength!=c.byteLength||!P(new xf(a),new xf(c)));case be:case Ee:case Yt:return ao(+a,+c);case Ie:return a.name==c.name&&a.message==c.message;case X:case Se:return a==c+"";case st:var I=Xg;case ee:var B=w&x;if(I||(I=pf),a.size!=c.size&&!B)return!1;var oe=M.get(a);if(oe)return oe==c;w|=S,M.set(a,c);var se=t_(I(a),I(c),w,$,P,M);return M.delete(a),se;case pe:if(Vc)return Vc.call(a)==Vc.call(c)}return!1}function tO(a,c,h,w,$,P){var M=h&x,I=xv(a),B=I.length,oe=xv(c),se=oe.length;if(B!=se&&!M)return!1;for(var ce=B;ce--;){var ve=I[ce];if(!(M?ve in c:yt.call(c,ve)))return!1}var ke=P.get(a),je=P.get(c);if(ke&&je)return ke==c&&je==a;var Qe=!0;P.set(a,c),P.set(c,a);for(var Fe=M;++ce<B;){ve=I[ce];var nt=a[ve],lt=c[ve];if(w)var cr=M?w(lt,nt,ve,c,a,P):w(nt,lt,ve,a,c,P);if(!(cr===n?nt===lt||$(nt,lt,h,w,P):cr)){Qe=!1;break}Fe||(Fe=ve=="constructor")}if(Qe&&!Fe){var In=a.constructor,ur=c.constructor;In!=ur&&"constructor"in a&&"constructor"in c&&!(typeof In=="function"&&In instanceof In&&typeof ur=="function"&&ur instanceof ur)&&(Qe=!1)}return P.delete(a),P.delete(c),Qe}function li(a){return kv(a_(a,n,g_),a+"")}function xv(a){return bS(a,cn,Ev)}function bv(a){return bS(a,Kn,n_)}var Sv=$f?function(a){return $f.get(a)}:zv;function Bf(a){for(var c=a.name+"",h=Qa[c],w=yt.call(Qa,c)?h.length:0;w--;){var $=h[w],P=$.func;if(P==null||P==a)return $.name}return c}function nl(a){var c=yt.call(k,"placeholder")?k:a;return c.placeholder}function Le(){var a=k.iteratee||Fv;return a=a===Fv?ES:a,arguments.length?a(arguments[0],arguments[1]):a}function zf(a,c){var h=a.__data__;return cO(c)?h[typeof c=="string"?"string":"hash"]:h.map}function _v(a){for(var c=cn(a),h=c.length;h--;){var w=c[h],$=a[w];c[h]=[w,$,i_($)]}return c}function Js(a,c){var h=f6(a,c);return _S(h)?h:n}function nO(a){var c=yt.call(a,Ys),h=a[Ys];try{a[Ys]=n;var w=!0}catch{}var $=yf.call(a);return w&&(c?a[Ys]=h:delete a[Ys]),$}var Ev=qg?function(a){return a==null?[]:(a=_t(a),Bi(qg(a),function(c){return lS.call(a,c)}))}:Uv,n_=qg?function(a){for(var c=[];a;)zi(c,Ev(a)),a=bf(a);return c}:Uv,En=Nn;(Qg&&En(new Qg(new ArrayBuffer(1)))!=Mn||Bc&&En(new Bc)!=st||Jg&&En(Jg.resolve())!=Li||qa&&En(new qa)!=ee||zc&&En(new zc)!=Pe)&&(En=function(a){var c=Nn(a),h=c==en?a.constructor:n,w=h?ea(h):"";if(w)switch(w){case j6:return Mn;case F6:return st;case B6:return Li;case z6:return ee;case U6:return Pe}return c});function rO(a,c,h){for(var w=-1,$=h.length;++w<$;){var P=h[w],M=P.size;switch(P.type){case"drop":a+=M;break;case"dropRight":c-=M;break;case"take":c=_n(c,a+M);break;case"takeRight":a=nn(a,c-M);break}}return{start:a,end:c}}function oO(a){var c=a.match(V);return c?c[1].split(Ue):[]}function r_(a,c,h){c=Ki(c,a);for(var w=-1,$=c.length,P=!1;++w<$;){var M=Ao(c[w]);if(!(P=a!=null&&h(a,M)))break;a=a[M]}return P||++w!=$?P:($=a==null?0:a.length,!!$&&Yf($)&&ci(M,$)&&(Ye(a)||ta(a)))}function iO(a){var c=a.length,h=new a.constructor(c);return c&&typeof a[0]=="string"&&yt.call(a,"index")&&(h.index=a.index,h.input=a.input),h}function o_(a){return typeof a.constructor=="function"&&!Zc(a)?Ja(bf(a)):{}}function sO(a,c,h){var w=a.constructor;switch(c){case gt:return vv(a);case be:case Ee:return new w(+a);case Mn:return V7(a,h);case On:case ji:case Cr:case $r:case Ks:case ri:case Fi:case or:case Jd:return BS(a,h);case st:return new w;case Yt:case Se:return new w(a);case X:return W7(a);case ee:return new w;case pe:return H7(a)}}function aO(a,c){var h=c.length;if(!h)return a;var w=h-1;return c[w]=(h>1?"& ":"")+c[w],c=c.join(h>2?", ":" "),a.replace(Og,`{
/* [wrapped with `+c+`] */
`)}function lO(a){return Ye(a)||ta(a)||!!(cS&&a&&a[cS])}function ci(a,c){var h=typeof a;return c=c??G,!!c&&(h=="number"||h!="symbol"&&xM.test(a))&&a>-1&&a%1==0&&a<c}function Dn(a,c,h){if(!Dt(h))return!1;var w=typeof c;return(w=="number"?Hn(h)&&ci(c,h.length):w=="string"&&c in h)?ao(h[c],a):!1}function Cv(a,c){if(Ye(a))return!1;var h=typeof a;return h=="number"||h=="symbol"||h=="boolean"||a==null||lr(a)?!0:Ic.test(a)||!Tg.test(a)||c!=null&&a in _t(c)}function cO(a){var c=typeof a;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?a!=="__proto__":a===null}function $v(a){var c=Bf(a),h=k[c];if(typeof h!="function"||!(c in ot.prototype))return!1;if(a===h)return!0;var w=Sv(h);return!!w&&a===w[0]}function uO(a){return!!iS&&iS in a}var dO=gf?ui:Vv;function Zc(a){var c=a&&a.constructor,h=typeof c=="function"&&c.prototype||Za;return a===h}function i_(a){return a===a&&!Dt(a)}function s_(a,c){return function(h){return h==null?!1:h[a]===c&&(c!==n||a in _t(h))}}function fO(a){var c=Kf(a,function(w){return h.size===f&&h.clear(),w}),h=c.cache;return c}function hO(a,c){var h=a[1],w=c[1],$=h|w,P=$<(E|_|A),M=w==A&&h==C||w==A&&h==O&&a[7].length<=c[8]||w==(A|O)&&c[7].length<=c[8]&&h==C;if(!(P||M))return a;w&E&&(a[2]=c[2],$|=h&E?0:b);var I=c[3];if(I){var B=a[3];a[3]=B?US(B,I,c[4]):I,a[4]=B?Ui(a[3],m):c[4]}return I=c[5],I&&(B=a[5],a[5]=B?VS(B,I,c[6]):I,a[6]=B?Ui(a[5],m):c[6]),I=c[7],I&&(a[7]=I),w&A&&(a[8]=a[8]==null?c[8]:_n(a[8],c[8])),a[9]==null&&(a[9]=c[9]),a[0]=c[0],a[1]=$,a}function pO(a){var c=[];if(a!=null)for(var h in _t(a))c.push(h);return c}function mO(a){return yf.call(a)}function a_(a,c,h){return c=nn(c===n?a.length-1:c,0),function(){for(var w=arguments,$=-1,P=nn(w.length-c,0),M=q(P);++$<P;)M[$]=w[c+$];$=-1;for(var I=q(c+1);++$<c;)I[$]=w[$];return I[c]=h(M),ir(a,this,I)}}function l_(a,c){return c.length<2?a:Qs(a,Mr(c,0,-1))}function gO(a,c){for(var h=a.length,w=_n(c.length,h),$=Wn(a);w--;){var P=c[w];a[w]=ci(P,h)?$[P]:n}return a}function Rv(a,c){if(!(c==="constructor"&&typeof a[c]=="function")&&c!="__proto__")return a[c]}var c_=d_(MS),qc=A6||function(a,c){return hn.setTimeout(a,c)},kv=d_(F7);function u_(a,c,h){var w=c+"";return kv(a,aO(w,vO(oO(w),h)))}function d_(a){var c=0,h=0;return function(){var w=D6(),$=te-(w-h);if(h=w,$>0){if(++c>=K)return arguments[0]}else c=0;return a.apply(n,arguments)}}function Uf(a,c){var h=-1,w=a.length,$=w-1;for(c=c===n?w:c;++h<c;){var P=uv(h,$),M=a[P];a[P]=a[h],a[h]=M}return a.length=c,a}var f_=fO(function(a){var c=[];return a.charCodeAt(0)===46&&c.push(""),a.replace(af,function(h,w,$,P){c.push($?P.replace(ln,"$1"):w||h)}),c});function Ao(a){if(typeof a=="string"||lr(a))return a;var c=a+"";return c=="0"&&1/a==-J?"-0":c}function ea(a){if(a!=null){try{return vf.call(a)}catch{}try{return a+""}catch{}}return""}function vO(a,c){return kr(Ne,function(h){var w="_."+h[0];c&h[1]&&!ff(a,w)&&a.push(w)}),a.sort()}function h_(a){if(a instanceof ot)return a.clone();var c=new Tr(a.__wrapped__,a.__chain__);return c.__actions__=Wn(a.__actions__),c.__index__=a.__index__,c.__values__=a.__values__,c}function yO(a,c,h){(h?Dn(a,c,h):c===n)?c=1:c=nn(qe(c),0);var w=a==null?0:a.length;if(!w||c<1)return[];for(var $=0,P=0,M=q(Ef(w/c));$<w;)M[P++]=Mr(a,$,$+=c);return M}function wO(a){for(var c=-1,h=a==null?0:a.length,w=0,$=[];++c<h;){var P=a[c];P&&($[w++]=P)}return $}function xO(){var a=arguments.length;if(!a)return[];for(var c=q(a-1),h=arguments[0],w=a;w--;)c[w-1]=arguments[w];return zi(Ye(h)?Wn(h):[h],pn(c,1))}var bO=et(function(a,c){return Ht(a)?Hc(a,pn(c,1,Ht,!0)):[]}),SO=et(function(a,c){var h=Or(c);return Ht(h)&&(h=n),Ht(a)?Hc(a,pn(c,1,Ht,!0),Le(h,2)):[]}),_O=et(function(a,c){var h=Or(c);return Ht(h)&&(h=n),Ht(a)?Hc(a,pn(c,1,Ht,!0),n,h):[]});function EO(a,c,h){var w=a==null?0:a.length;return w?(c=h||c===n?1:qe(c),Mr(a,c<0?0:c,w)):[]}function CO(a,c,h){var w=a==null?0:a.length;return w?(c=h||c===n?1:qe(c),c=w-c,Mr(a,0,c<0?0:c)):[]}function $O(a,c){return a&&a.length?Nf(a,Le(c,3),!0,!0):[]}function RO(a,c){return a&&a.length?Nf(a,Le(c,3),!0):[]}function kO(a,c,h,w){var $=a==null?0:a.length;return $?(h&&typeof h!="number"&&Dn(a,c,h)&&(h=0,w=$),x7(a,c,h,w)):[]}function p_(a,c,h){var w=a==null?0:a.length;if(!w)return-1;var $=h==null?0:qe(h);return $<0&&($=nn(w+$,0)),hf(a,Le(c,3),$)}function m_(a,c,h){var w=a==null?0:a.length;if(!w)return-1;var $=w-1;return h!==n&&($=qe(h),$=h<0?nn(w+$,0):_n($,w-1)),hf(a,Le(c,3),$,!0)}function g_(a){var c=a==null?0:a.length;return c?pn(a,1):[]}function PO(a){var c=a==null?0:a.length;return c?pn(a,J):[]}function TO(a,c){var h=a==null?0:a.length;return h?(c=c===n?1:qe(c),pn(a,c)):[]}function AO(a){for(var c=-1,h=a==null?0:a.length,w={};++c<h;){var $=a[c];w[$[0]]=$[1]}return w}function v_(a){return a&&a.length?a[0]:n}function MO(a,c,h){var w=a==null?0:a.length;if(!w)return-1;var $=h==null?0:qe(h);return $<0&&($=nn(w+$,0)),Ka(a,c,$)}function OO(a){var c=a==null?0:a.length;return c?Mr(a,0,-1):[]}var NO=et(function(a){var c=Mt(a,mv);return c.length&&c[0]===a[0]?iv(c):[]}),DO=et(function(a){var c=Or(a),h=Mt(a,mv);return c===Or(h)?c=n:h.pop(),h.length&&h[0]===a[0]?iv(h,Le(c,2)):[]}),IO=et(function(a){var c=Or(a),h=Mt(a,mv);return c=typeof c=="function"?c:n,c&&h.pop(),h.length&&h[0]===a[0]?iv(h,n,c):[]});function LO(a,c){return a==null?"":O6.call(a,c)}function Or(a){var c=a==null?0:a.length;return c?a[c-1]:n}function jO(a,c,h){var w=a==null?0:a.length;if(!w)return-1;var $=w;return h!==n&&($=qe(h),$=$<0?nn(w+$,0):_n($,w-1)),c===c?v6(a,c,$):hf(a,qb,$,!0)}function FO(a,c){return a&&a.length?kS(a,qe(c)):n}var BO=et(y_);function y_(a,c){return a&&a.length&&c&&c.length?cv(a,c):a}function zO(a,c,h){return a&&a.length&&c&&c.length?cv(a,c,Le(h,2)):a}function UO(a,c,h){return a&&a.length&&c&&c.length?cv(a,c,n,h):a}var VO=li(function(a,c){var h=a==null?0:a.length,w=tv(a,c);return AS(a,Mt(c,function($){return ci($,h)?+$:$}).sort(zS)),w});function WO(a,c){var h=[];if(!(a&&a.length))return h;var w=-1,$=[],P=a.length;for(c=Le(c,3);++w<P;){var M=a[w];c(M,w,a)&&(h.push(M),$.push(w))}return AS(a,$),h}function Pv(a){return a==null?a:L6.call(a)}function HO(a,c,h){var w=a==null?0:a.length;return w?(h&&typeof h!="number"&&Dn(a,c,h)?(c=0,h=w):(c=c==null?0:qe(c),h=h===n?w:qe(h)),Mr(a,c,h)):[]}function KO(a,c){return Of(a,c)}function GO(a,c,h){return fv(a,c,Le(h,2))}function YO(a,c){var h=a==null?0:a.length;if(h){var w=Of(a,c);if(w<h&&ao(a[w],c))return w}return-1}function XO(a,c){return Of(a,c,!0)}function ZO(a,c,h){return fv(a,c,Le(h,2),!0)}function qO(a,c){var h=a==null?0:a.length;if(h){var w=Of(a,c,!0)-1;if(ao(a[w],c))return w}return-1}function QO(a){return a&&a.length?OS(a):[]}function JO(a,c){return a&&a.length?OS(a,Le(c,2)):[]}function e4(a){var c=a==null?0:a.length;return c?Mr(a,1,c):[]}function t4(a,c,h){return a&&a.length?(c=h||c===n?1:qe(c),Mr(a,0,c<0?0:c)):[]}function n4(a,c,h){var w=a==null?0:a.length;return w?(c=h||c===n?1:qe(c),c=w-c,Mr(a,c<0?0:c,w)):[]}function r4(a,c){return a&&a.length?Nf(a,Le(c,3),!1,!0):[]}function o4(a,c){return a&&a.length?Nf(a,Le(c,3)):[]}var i4=et(function(a){return Hi(pn(a,1,Ht,!0))}),s4=et(function(a){var c=Or(a);return Ht(c)&&(c=n),Hi(pn(a,1,Ht,!0),Le(c,2))}),a4=et(function(a){var c=Or(a);return c=typeof c=="function"?c:n,Hi(pn(a,1,Ht,!0),n,c)});function l4(a){return a&&a.length?Hi(a):[]}function c4(a,c){return a&&a.length?Hi(a,Le(c,2)):[]}function u4(a,c){return c=typeof c=="function"?c:n,a&&a.length?Hi(a,n,c):[]}function Tv(a){if(!(a&&a.length))return[];var c=0;return a=Bi(a,function(h){if(Ht(h))return c=nn(h.length,c),!0}),Gg(c,function(h){return Mt(a,Wg(h))})}function w_(a,c){if(!(a&&a.length))return[];var h=Tv(a);return c==null?h:Mt(h,function(w){return ir(c,n,w)})}var d4=et(function(a,c){return Ht(a)?Hc(a,c):[]}),f4=et(function(a){return pv(Bi(a,Ht))}),h4=et(function(a){var c=Or(a);return Ht(c)&&(c=n),pv(Bi(a,Ht),Le(c,2))}),p4=et(function(a){var c=Or(a);return c=typeof c=="function"?c:n,pv(Bi(a,Ht),n,c)}),m4=et(Tv);function g4(a,c){return LS(a||[],c||[],Wc)}function v4(a,c){return LS(a||[],c||[],Yc)}var y4=et(function(a){var c=a.length,h=c>1?a[c-1]:n;return h=typeof h=="function"?(a.pop(),h):n,w_(a,h)});function x_(a){var c=k(a);return c.__chain__=!0,c}function w4(a,c){return c(a),a}function Vf(a,c){return c(a)}var x4=li(function(a){var c=a.length,h=c?a[0]:0,w=this.__wrapped__,$=function(P){return tv(P,a)};return c>1||this.__actions__.length||!(w instanceof ot)||!ci(h)?this.thru($):(w=w.slice(h,+h+(c?1:0)),w.__actions__.push({func:Vf,args:[$],thisArg:n}),new Tr(w,this.__chain__).thru(function(P){return c&&!P.length&&P.push(n),P}))});function b4(){return x_(this)}function S4(){return new Tr(this.value(),this.__chain__)}function _4(){this.__values__===n&&(this.__values__=N_(this.value()));var a=this.__index__>=this.__values__.length,c=a?n:this.__values__[this.__index__++];return{done:a,value:c}}function E4(){return this}function C4(a){for(var c,h=this;h instanceof kf;){var w=h_(h);w.__index__=0,w.__values__=n,c?$.__wrapped__=w:c=w;var $=w;h=h.__wrapped__}return $.__wrapped__=a,c}function $4(){var a=this.__wrapped__;if(a instanceof ot){var c=a;return this.__actions__.length&&(c=new ot(this)),c=c.reverse(),c.__actions__.push({func:Vf,args:[Pv],thisArg:n}),new Tr(c,this.__chain__)}return this.thru(Pv)}function R4(){return IS(this.__wrapped__,this.__actions__)}var k4=Df(function(a,c,h){yt.call(a,h)?++a[h]:si(a,h,1)});function P4(a,c,h){var w=Ye(a)?Xb:w7;return h&&Dn(a,c,h)&&(c=n),w(a,Le(c,3))}function T4(a,c){var h=Ye(a)?Bi:wS;return h(a,Le(c,3))}var A4=GS(p_),M4=GS(m_);function O4(a,c){return pn(Wf(a,c),1)}function N4(a,c){return pn(Wf(a,c),J)}function D4(a,c,h){return h=h===n?1:qe(h),pn(Wf(a,c),h)}function b_(a,c){var h=Ye(a)?kr:Wi;return h(a,Le(c,3))}function S_(a,c){var h=Ye(a)?e6:yS;return h(a,Le(c,3))}var I4=Df(function(a,c,h){yt.call(a,h)?a[h].push(c):si(a,h,[c])});function L4(a,c,h,w){a=Hn(a)?a:ol(a),h=h&&!w?qe(h):0;var $=a.length;return h<0&&(h=nn($+h,0)),Xf(a)?h<=$&&a.indexOf(c,h)>-1:!!$&&Ka(a,c,h)>-1}var j4=et(function(a,c,h){var w=-1,$=typeof c=="function",P=Hn(a)?q(a.length):[];return Wi(a,function(M){P[++w]=$?ir(c,M,h):Kc(M,c,h)}),P}),F4=Df(function(a,c,h){si(a,h,c)});function Wf(a,c){var h=Ye(a)?Mt:CS;return h(a,Le(c,3))}function B4(a,c,h,w){return a==null?[]:(Ye(c)||(c=c==null?[]:[c]),h=w?n:h,Ye(h)||(h=h==null?[]:[h]),PS(a,c,h))}var z4=Df(function(a,c,h){a[h?0:1].push(c)},function(){return[[],[]]});function U4(a,c,h){var w=Ye(a)?Ug:Jb,$=arguments.length<3;return w(a,Le(c,4),h,$,Wi)}function V4(a,c,h){var w=Ye(a)?t6:Jb,$=arguments.length<3;return w(a,Le(c,4),h,$,yS)}function W4(a,c){var h=Ye(a)?Bi:wS;return h(a,Gf(Le(c,3)))}function H4(a){var c=Ye(a)?pS:L7;return c(a)}function K4(a,c,h){(h?Dn(a,c,h):c===n)?c=1:c=qe(c);var w=Ye(a)?p7:j7;return w(a,c)}function G4(a){var c=Ye(a)?m7:B7;return c(a)}function Y4(a){if(a==null)return 0;if(Hn(a))return Xf(a)?Ya(a):a.length;var c=En(a);return c==st||c==ee?a.size:av(a).length}function X4(a,c,h){var w=Ye(a)?Vg:z7;return h&&Dn(a,c,h)&&(c=n),w(a,Le(c,3))}var Z4=et(function(a,c){if(a==null)return[];var h=c.length;return h>1&&Dn(a,c[0],c[1])?c=[]:h>2&&Dn(c[0],c[1],c[2])&&(c=[c[0]]),PS(a,pn(c,1),[])}),Hf=T6||function(){return hn.Date.now()};function q4(a,c){if(typeof c!="function")throw new Pr(s);return a=qe(a),function(){if(--a<1)return c.apply(this,arguments)}}function __(a,c,h){return c=h?n:c,c=a&&c==null?a.length:c,ai(a,A,n,n,n,n,c)}function E_(a,c){var h;if(typeof c!="function")throw new Pr(s);return a=qe(a),function(){return--a>0&&(h=c.apply(this,arguments)),a<=1&&(c=n),h}}var Av=et(function(a,c,h){var w=E;if(h.length){var $=Ui(h,nl(Av));w|=T}return ai(a,w,c,h,$)}),C_=et(function(a,c,h){var w=E|_;if(h.length){var $=Ui(h,nl(C_));w|=T}return ai(c,w,a,h,$)});function $_(a,c,h){c=h?n:c;var w=ai(a,C,n,n,n,n,n,c);return w.placeholder=$_.placeholder,w}function R_(a,c,h){c=h?n:c;var w=ai(a,R,n,n,n,n,n,c);return w.placeholder=R_.placeholder,w}function k_(a,c,h){var w,$,P,M,I,B,oe=0,se=!1,ce=!1,ve=!0;if(typeof a!="function")throw new Pr(s);c=Nr(c)||0,Dt(h)&&(se=!!h.leading,ce="maxWait"in h,P=ce?nn(Nr(h.maxWait)||0,c):P,ve="trailing"in h?!!h.trailing:ve);function ke(Kt){var lo=w,fi=$;return w=$=n,oe=Kt,M=a.apply(fi,lo),M}function je(Kt){return oe=Kt,I=qc(nt,c),se?ke(Kt):M}function Qe(Kt){var lo=Kt-B,fi=Kt-oe,G_=c-lo;return ce?_n(G_,P-fi):G_}function Fe(Kt){var lo=Kt-B,fi=Kt-oe;return B===n||lo>=c||lo<0||ce&&fi>=P}function nt(){var Kt=Hf();if(Fe(Kt))return lt(Kt);I=qc(nt,Qe(Kt))}function lt(Kt){return I=n,ve&&w?ke(Kt):(w=$=n,M)}function cr(){I!==n&&jS(I),oe=0,w=B=$=I=n}function In(){return I===n?M:lt(Hf())}function ur(){var Kt=Hf(),lo=Fe(Kt);if(w=arguments,$=this,B=Kt,lo){if(I===n)return je(B);if(ce)return jS(I),I=qc(nt,c),ke(B)}return I===n&&(I=qc(nt,c)),M}return ur.cancel=cr,ur.flush=In,ur}var Q4=et(function(a,c){return vS(a,1,c)}),J4=et(function(a,c,h){return vS(a,Nr(c)||0,h)});function eN(a){return ai(a,U)}function Kf(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new Pr(s);var h=function(){var w=arguments,$=c?c.apply(this,w):w[0],P=h.cache;if(P.has($))return P.get($);var M=a.apply(this,w);return h.cache=P.set($,M)||P,M};return h.cache=new(Kf.Cache||ii),h}Kf.Cache=ii;function Gf(a){if(typeof a!="function")throw new Pr(s);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}function tN(a){return E_(2,a)}var nN=U7(function(a,c){c=c.length==1&&Ye(c[0])?Mt(c[0],sr(Le())):Mt(pn(c,1),sr(Le()));var h=c.length;return et(function(w){for(var $=-1,P=_n(w.length,h);++$<P;)w[$]=c[$].call(this,w[$]);return ir(a,this,w)})}),Mv=et(function(a,c){var h=Ui(c,nl(Mv));return ai(a,T,n,c,h)}),P_=et(function(a,c){var h=Ui(c,nl(P_));return ai(a,N,n,c,h)}),rN=li(function(a,c){return ai(a,O,n,n,n,c)});function oN(a,c){if(typeof a!="function")throw new Pr(s);return c=c===n?c:qe(c),et(a,c)}function iN(a,c){if(typeof a!="function")throw new Pr(s);return c=c==null?0:nn(qe(c),0),et(function(h){var w=h[c],$=Gi(h,0,c);return w&&zi($,w),ir(a,this,$)})}function sN(a,c,h){var w=!0,$=!0;if(typeof a!="function")throw new Pr(s);return Dt(h)&&(w="leading"in h?!!h.leading:w,$="trailing"in h?!!h.trailing:$),k_(a,c,{leading:w,maxWait:c,trailing:$})}function aN(a){return __(a,1)}function lN(a,c){return Mv(gv(c),a)}function cN(){if(!arguments.length)return[];var a=arguments[0];return Ye(a)?a:[a]}function uN(a){return Ar(a,y)}function dN(a,c){return c=typeof c=="function"?c:n,Ar(a,y,c)}function fN(a){return Ar(a,p|y)}function hN(a,c){return c=typeof c=="function"?c:n,Ar(a,p|y,c)}function pN(a,c){return c==null||gS(a,c,cn(c))}function ao(a,c){return a===c||a!==a&&c!==c}var mN=Ff(ov),gN=Ff(function(a,c){return a>=c}),ta=SS(function(){return arguments}())?SS:function(a){return Bt(a)&&yt.call(a,"callee")&&!lS.call(a,"callee")},Ye=q.isArray,vN=Vb?sr(Vb):C7;function Hn(a){return a!=null&&Yf(a.length)&&!ui(a)}function Ht(a){return Bt(a)&&Hn(a)}function yN(a){return a===!0||a===!1||Bt(a)&&Nn(a)==be}var Yi=M6||Vv,wN=Wb?sr(Wb):$7;function xN(a){return Bt(a)&&a.nodeType===1&&!Qc(a)}function bN(a){if(a==null)return!0;if(Hn(a)&&(Ye(a)||typeof a=="string"||typeof a.splice=="function"||Yi(a)||rl(a)||ta(a)))return!a.length;var c=En(a);if(c==st||c==ee)return!a.size;if(Zc(a))return!av(a).length;for(var h in a)if(yt.call(a,h))return!1;return!0}function SN(a,c){return Gc(a,c)}function _N(a,c,h){h=typeof h=="function"?h:n;var w=h?h(a,c):n;return w===n?Gc(a,c,n,h):!!w}function Ov(a){if(!Bt(a))return!1;var c=Nn(a);return c==Ie||c==Oe||typeof a.message=="string"&&typeof a.name=="string"&&!Qc(a)}function EN(a){return typeof a=="number"&&uS(a)}function ui(a){if(!Dt(a))return!1;var c=Nn(a);return c==ze||c==ht||c==me||c==D}function T_(a){return typeof a=="number"&&a==qe(a)}function Yf(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=G}function Dt(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function Bt(a){return a!=null&&typeof a=="object"}var A_=Hb?sr(Hb):k7;function CN(a,c){return a===c||sv(a,c,_v(c))}function $N(a,c,h){return h=typeof h=="function"?h:n,sv(a,c,_v(c),h)}function RN(a){return M_(a)&&a!=+a}function kN(a){if(dO(a))throw new Ge(i);return _S(a)}function PN(a){return a===null}function TN(a){return a==null}function M_(a){return typeof a=="number"||Bt(a)&&Nn(a)==Yt}function Qc(a){if(!Bt(a)||Nn(a)!=en)return!1;var c=bf(a);if(c===null)return!0;var h=yt.call(c,"constructor")&&c.constructor;return typeof h=="function"&&h instanceof h&&vf.call(h)==$6}var Nv=Kb?sr(Kb):P7;function AN(a){return T_(a)&&a>=-G&&a<=G}var O_=Gb?sr(Gb):T7;function Xf(a){return typeof a=="string"||!Ye(a)&&Bt(a)&&Nn(a)==Se}function lr(a){return typeof a=="symbol"||Bt(a)&&Nn(a)==pe}var rl=Yb?sr(Yb):A7;function MN(a){return a===n}function ON(a){return Bt(a)&&En(a)==Pe}function NN(a){return Bt(a)&&Nn(a)==dt}var DN=Ff(lv),IN=Ff(function(a,c){return a<=c});function N_(a){if(!a)return[];if(Hn(a))return Xf(a)?io(a):Wn(a);if(Fc&&a[Fc])return p6(a[Fc]());var c=En(a),h=c==st?Xg:c==ee?pf:ol;return h(a)}function di(a){if(!a)return a===0?a:0;if(a=Nr(a),a===J||a===-J){var c=a<0?-1:1;return c*Z}return a===a?a:0}function qe(a){var c=di(a),h=c%1;return c===c?h?c-h:c:0}function D_(a){return a?qs(qe(a),0,le):0}function Nr(a){if(typeof a=="number")return a;if(lr(a))return Q;if(Dt(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=Dt(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=eS(a);var h=vM.test(a);return h||wM.test(a)?qM(a.slice(2),h?2:8):gM.test(a)?Q:+a}function I_(a){return To(a,Kn(a))}function LN(a){return a?qs(qe(a),-G,G):a===0?a:0}function vt(a){return a==null?"":ar(a)}var jN=el(function(a,c){if(Zc(c)||Hn(c)){To(c,cn(c),a);return}for(var h in c)yt.call(c,h)&&Wc(a,h,c[h])}),L_=el(function(a,c){To(c,Kn(c),a)}),Zf=el(function(a,c,h,w){To(c,Kn(c),a,w)}),FN=el(function(a,c,h,w){To(c,cn(c),a,w)}),BN=li(tv);function zN(a,c){var h=Ja(a);return c==null?h:mS(h,c)}var UN=et(function(a,c){a=_t(a);var h=-1,w=c.length,$=w>2?c[2]:n;for($&&Dn(c[0],c[1],$)&&(w=1);++h<w;)for(var P=c[h],M=Kn(P),I=-1,B=M.length;++I<B;){var oe=M[I],se=a[oe];(se===n||ao(se,Za[oe])&&!yt.call(a,oe))&&(a[oe]=P[oe])}return a}),VN=et(function(a){return a.push(n,e_),ir(j_,n,a)});function WN(a,c){return Zb(a,Le(c,3),Po)}function HN(a,c){return Zb(a,Le(c,3),rv)}function KN(a,c){return a==null?a:nv(a,Le(c,3),Kn)}function GN(a,c){return a==null?a:xS(a,Le(c,3),Kn)}function YN(a,c){return a&&Po(a,Le(c,3))}function XN(a,c){return a&&rv(a,Le(c,3))}function ZN(a){return a==null?[]:Af(a,cn(a))}function qN(a){return a==null?[]:Af(a,Kn(a))}function Dv(a,c,h){var w=a==null?n:Qs(a,c);return w===n?h:w}function QN(a,c){return a!=null&&r_(a,c,b7)}function Iv(a,c){return a!=null&&r_(a,c,S7)}var JN=XS(function(a,c,h){c!=null&&typeof c.toString!="function"&&(c=yf.call(c)),a[c]=h},jv(Gn)),e8=XS(function(a,c,h){c!=null&&typeof c.toString!="function"&&(c=yf.call(c)),yt.call(a,c)?a[c].push(h):a[c]=[h]},Le),t8=et(Kc);function cn(a){return Hn(a)?hS(a):av(a)}function Kn(a){return Hn(a)?hS(a,!0):M7(a)}function n8(a,c){var h={};return c=Le(c,3),Po(a,function(w,$,P){si(h,c(w,$,P),w)}),h}function r8(a,c){var h={};return c=Le(c,3),Po(a,function(w,$,P){si(h,$,c(w,$,P))}),h}var o8=el(function(a,c,h){Mf(a,c,h)}),j_=el(function(a,c,h,w){Mf(a,c,h,w)}),i8=li(function(a,c){var h={};if(a==null)return h;var w=!1;c=Mt(c,function(P){return P=Ki(P,a),w||(w=P.length>1),P}),To(a,bv(a),h),w&&(h=Ar(h,p|g|y,J7));for(var $=c.length;$--;)hv(h,c[$]);return h});function s8(a,c){return F_(a,Gf(Le(c)))}var a8=li(function(a,c){return a==null?{}:N7(a,c)});function F_(a,c){if(a==null)return{};var h=Mt(bv(a),function(w){return[w]});return c=Le(c),TS(a,h,function(w,$){return c(w,$[0])})}function l8(a,c,h){c=Ki(c,a);var w=-1,$=c.length;for($||($=1,a=n);++w<$;){var P=a==null?n:a[Ao(c[w])];P===n&&(w=$,P=h),a=ui(P)?P.call(a):P}return a}function c8(a,c,h){return a==null?a:Yc(a,c,h)}function u8(a,c,h,w){return w=typeof w=="function"?w:n,a==null?a:Yc(a,c,h,w)}var B_=QS(cn),z_=QS(Kn);function d8(a,c,h){var w=Ye(a),$=w||Yi(a)||rl(a);if(c=Le(c,4),h==null){var P=a&&a.constructor;$?h=w?new P:[]:Dt(a)?h=ui(P)?Ja(bf(a)):{}:h={}}return($?kr:Po)(a,function(M,I,B){return c(h,M,I,B)}),h}function f8(a,c){return a==null?!0:hv(a,c)}function h8(a,c,h){return a==null?a:DS(a,c,gv(h))}function p8(a,c,h,w){return w=typeof w=="function"?w:n,a==null?a:DS(a,c,gv(h),w)}function ol(a){return a==null?[]:Yg(a,cn(a))}function m8(a){return a==null?[]:Yg(a,Kn(a))}function g8(a,c,h){return h===n&&(h=c,c=n),h!==n&&(h=Nr(h),h=h===h?h:0),c!==n&&(c=Nr(c),c=c===c?c:0),qs(Nr(a),c,h)}function v8(a,c,h){return c=di(c),h===n?(h=c,c=0):h=di(h),a=Nr(a),_7(a,c,h)}function y8(a,c,h){if(h&&typeof h!="boolean"&&Dn(a,c,h)&&(c=h=n),h===n&&(typeof c=="boolean"?(h=c,c=n):typeof a=="boolean"&&(h=a,a=n)),a===n&&c===n?(a=0,c=1):(a=di(a),c===n?(c=a,a=0):c=di(c)),a>c){var w=a;a=c,c=w}if(h||a%1||c%1){var $=dS();return _n(a+$*(c-a+ZM("1e-"+(($+"").length-1))),c)}return uv(a,c)}var w8=tl(function(a,c,h){return c=c.toLowerCase(),a+(h?U_(c):c)});function U_(a){return Lv(vt(a).toLowerCase())}function V_(a){return a=vt(a),a&&a.replace(bM,c6).replace(BM,"")}function x8(a,c,h){a=vt(a),c=ar(c);var w=a.length;h=h===n?w:qs(qe(h),0,w);var $=h;return h-=c.length,h>=0&&a.slice(h,$)==c}function b8(a){return a=vt(a),a&&rf.test(a)?a.replace(Dc,u6):a}function S8(a){return a=vt(a),a&&Ag.test(a)?a.replace(Wa,"\\$&"):a}var _8=tl(function(a,c,h){return a+(h?"-":"")+c.toLowerCase()}),E8=tl(function(a,c,h){return a+(h?" ":"")+c.toLowerCase()}),C8=KS("toLowerCase");function $8(a,c,h){a=vt(a),c=qe(c);var w=c?Ya(a):0;if(!c||w>=c)return a;var $=(c-w)/2;return jf(Cf($),h)+a+jf(Ef($),h)}function R8(a,c,h){a=vt(a),c=qe(c);var w=c?Ya(a):0;return c&&w<c?a+jf(c-w,h):a}function k8(a,c,h){a=vt(a),c=qe(c);var w=c?Ya(a):0;return c&&w<c?jf(c-w,h)+a:a}function P8(a,c,h){return h||c==null?c=0:c&&(c=+c),I6(vt(a).replace(Lc,""),c||0)}function T8(a,c,h){return(h?Dn(a,c,h):c===n)?c=1:c=qe(c),dv(vt(a),c)}function A8(){var a=arguments,c=vt(a[0]);return a.length<3?c:c.replace(a[1],a[2])}var M8=tl(function(a,c,h){return a+(h?"_":"")+c.toLowerCase()});function O8(a,c,h){return h&&typeof h!="number"&&Dn(a,c,h)&&(c=h=n),h=h===n?le:h>>>0,h?(a=vt(a),a&&(typeof c=="string"||c!=null&&!Nv(c))&&(c=ar(c),!c&&Ga(a))?Gi(io(a),0,h):a.split(c,h)):[]}var N8=tl(function(a,c,h){return a+(h?" ":"")+Lv(c)});function D8(a,c,h){return a=vt(a),h=h==null?0:qs(qe(h),0,a.length),c=ar(c),a.slice(h,h+c.length)==c}function I8(a,c,h){var w=k.templateSettings;h&&Dn(a,c,h)&&(c=n),a=vt(a),c=Zf({},c,w,JS);var $=Zf({},c.imports,w.imports,JS),P=cn($),M=Yg($,P),I,B,oe=0,se=c.interpolate||cf,ce="__p += '",ve=Zg((c.escape||cf).source+"|"+se.source+"|"+(se===Va?lf:cf).source+"|"+(c.evaluate||cf).source+"|$","g"),ke="//# sourceURL="+(yt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++HM+"]")+`
`;a.replace(ve,function(Fe,nt,lt,cr,In,ur){return lt||(lt=cr),ce+=a.slice(oe,ur).replace(SM,d6),nt&&(I=!0,ce+=`' +
__e(`+nt+`) +
'`),In&&(B=!0,ce+=`';
`+In+`;
__p += '`),lt&&(ce+=`' +
((__t = (`+lt+`)) == null ? '' : __t) +
'`),oe=ur+Fe.length,Fe}),ce+=`';
`;var je=yt.call(c,"variable")&&c.variable;if(!je)ce=`with (obj) {
`+ce+`
}
`;else if(oo.test(je))throw new Ge(l);ce=(B?ce.replace(kg,""):ce).replace(ef,"$1").replace(Pg,"$1;"),ce="function("+(je||"obj")+`) {
`+(je?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(I?", __e = _.escape":"")+(B?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+ce+`return __p
}`;var Qe=H_(function(){return pt(P,ke+"return "+ce).apply(n,M)});if(Qe.source=ce,Ov(Qe))throw Qe;return Qe}function L8(a){return vt(a).toLowerCase()}function j8(a){return vt(a).toUpperCase()}function F8(a,c,h){if(a=vt(a),a&&(h||c===n))return eS(a);if(!a||!(c=ar(c)))return a;var w=io(a),$=io(c),P=tS(w,$),M=nS(w,$)+1;return Gi(w,P,M).join("")}function B8(a,c,h){if(a=vt(a),a&&(h||c===n))return a.slice(0,oS(a)+1);if(!a||!(c=ar(c)))return a;var w=io(a),$=nS(w,io(c))+1;return Gi(w,0,$).join("")}function z8(a,c,h){if(a=vt(a),a&&(h||c===n))return a.replace(Lc,"");if(!a||!(c=ar(c)))return a;var w=io(a),$=tS(w,io(c));return Gi(w,$).join("")}function U8(a,c){var h=z,w=ie;if(Dt(c)){var $="separator"in c?c.separator:$;h="length"in c?qe(c.length):h,w="omission"in c?ar(c.omission):w}a=vt(a);var P=a.length;if(Ga(a)){var M=io(a);P=M.length}if(h>=P)return a;var I=h-Ya(w);if(I<1)return w;var B=M?Gi(M,0,I).join(""):a.slice(0,I);if($===n)return B+w;if(M&&(I+=B.length-I),Nv($)){if(a.slice(I).search($)){var oe,se=B;for($.global||($=Zg($.source,vt(Sb.exec($))+"g")),$.lastIndex=0;oe=$.exec(se);)var ce=oe.index;B=B.slice(0,ce===n?I:ce)}}else if(a.indexOf(ar($),I)!=I){var ve=B.lastIndexOf($);ve>-1&&(B=B.slice(0,ve))}return B+w}function V8(a){return a=vt(a),a&&nf.test(a)?a.replace(tf,y6):a}var W8=tl(function(a,c,h){return a+(h?" ":"")+c.toUpperCase()}),Lv=KS("toUpperCase");function W_(a,c,h){return a=vt(a),c=h?n:c,c===n?h6(a)?b6(a):o6(a):a.match(c)||[]}var H_=et(function(a,c){try{return ir(a,n,c)}catch(h){return Ov(h)?h:new Ge(h)}}),H8=li(function(a,c){return kr(c,function(h){h=Ao(h),si(a,h,Av(a[h],a))}),a});function K8(a){var c=a==null?0:a.length,h=Le();return a=c?Mt(a,function(w){if(typeof w[1]!="function")throw new Pr(s);return[h(w[0]),w[1]]}):[],et(function(w){for(var $=-1;++$<c;){var P=a[$];if(ir(P[0],this,w))return ir(P[1],this,w)}})}function G8(a){return y7(Ar(a,p))}function jv(a){return function(){return a}}function Y8(a,c){return a==null||a!==a?c:a}var X8=YS(),Z8=YS(!0);function Gn(a){return a}function Fv(a){return ES(typeof a=="function"?a:Ar(a,p))}function q8(a){return $S(Ar(a,p))}function Q8(a,c){return RS(a,Ar(c,p))}var J8=et(function(a,c){return function(h){return Kc(h,a,c)}}),e9=et(function(a,c){return function(h){return Kc(a,h,c)}});function Bv(a,c,h){var w=cn(c),$=Af(c,w);h==null&&!(Dt(c)&&($.length||!w.length))&&(h=c,c=a,a=this,$=Af(c,cn(c)));var P=!(Dt(h)&&"chain"in h)||!!h.chain,M=ui(a);return kr($,function(I){var B=c[I];a[I]=B,M&&(a.prototype[I]=function(){var oe=this.__chain__;if(P||oe){var se=a(this.__wrapped__),ce=se.__actions__=Wn(this.__actions__);return ce.push({func:B,args:arguments,thisArg:a}),se.__chain__=oe,se}return B.apply(a,zi([this.value()],arguments))})}),a}function t9(){return hn._===this&&(hn._=R6),this}function zv(){}function n9(a){return a=qe(a),et(function(c){return kS(c,a)})}var r9=yv(Mt),o9=yv(Xb),i9=yv(Vg);function K_(a){return Cv(a)?Wg(Ao(a)):D7(a)}function s9(a){return function(c){return a==null?n:Qs(a,c)}}var a9=ZS(),l9=ZS(!0);function Uv(){return[]}function Vv(){return!1}function c9(){return{}}function u9(){return""}function d9(){return!0}function f9(a,c){if(a=qe(a),a<1||a>G)return[];var h=le,w=_n(a,le);c=Le(c),a-=le;for(var $=Gg(w,c);++h<a;)c(h);return $}function h9(a){return Ye(a)?Mt(a,Ao):lr(a)?[a]:Wn(f_(vt(a)))}function p9(a){var c=++C6;return vt(a)+c}var m9=Lf(function(a,c){return a+c},0),g9=wv("ceil"),v9=Lf(function(a,c){return a/c},1),y9=wv("floor");function w9(a){return a&&a.length?Tf(a,Gn,ov):n}function x9(a,c){return a&&a.length?Tf(a,Le(c,2),ov):n}function b9(a){return Qb(a,Gn)}function S9(a,c){return Qb(a,Le(c,2))}function _9(a){return a&&a.length?Tf(a,Gn,lv):n}function E9(a,c){return a&&a.length?Tf(a,Le(c,2),lv):n}var C9=Lf(function(a,c){return a*c},1),$9=wv("round"),R9=Lf(function(a,c){return a-c},0);function k9(a){return a&&a.length?Kg(a,Gn):0}function P9(a,c){return a&&a.length?Kg(a,Le(c,2)):0}return k.after=q4,k.ary=__,k.assign=jN,k.assignIn=L_,k.assignInWith=Zf,k.assignWith=FN,k.at=BN,k.before=E_,k.bind=Av,k.bindAll=H8,k.bindKey=C_,k.castArray=cN,k.chain=x_,k.chunk=yO,k.compact=wO,k.concat=xO,k.cond=K8,k.conforms=G8,k.constant=jv,k.countBy=k4,k.create=zN,k.curry=$_,k.curryRight=R_,k.debounce=k_,k.defaults=UN,k.defaultsDeep=VN,k.defer=Q4,k.delay=J4,k.difference=bO,k.differenceBy=SO,k.differenceWith=_O,k.drop=EO,k.dropRight=CO,k.dropRightWhile=$O,k.dropWhile=RO,k.fill=kO,k.filter=T4,k.flatMap=O4,k.flatMapDeep=N4,k.flatMapDepth=D4,k.flatten=g_,k.flattenDeep=PO,k.flattenDepth=TO,k.flip=eN,k.flow=X8,k.flowRight=Z8,k.fromPairs=AO,k.functions=ZN,k.functionsIn=qN,k.groupBy=I4,k.initial=OO,k.intersection=NO,k.intersectionBy=DO,k.intersectionWith=IO,k.invert=JN,k.invertBy=e8,k.invokeMap=j4,k.iteratee=Fv,k.keyBy=F4,k.keys=cn,k.keysIn=Kn,k.map=Wf,k.mapKeys=n8,k.mapValues=r8,k.matches=q8,k.matchesProperty=Q8,k.memoize=Kf,k.merge=o8,k.mergeWith=j_,k.method=J8,k.methodOf=e9,k.mixin=Bv,k.negate=Gf,k.nthArg=n9,k.omit=i8,k.omitBy=s8,k.once=tN,k.orderBy=B4,k.over=r9,k.overArgs=nN,k.overEvery=o9,k.overSome=i9,k.partial=Mv,k.partialRight=P_,k.partition=z4,k.pick=a8,k.pickBy=F_,k.property=K_,k.propertyOf=s9,k.pull=BO,k.pullAll=y_,k.pullAllBy=zO,k.pullAllWith=UO,k.pullAt=VO,k.range=a9,k.rangeRight=l9,k.rearg=rN,k.reject=W4,k.remove=WO,k.rest=oN,k.reverse=Pv,k.sampleSize=K4,k.set=c8,k.setWith=u8,k.shuffle=G4,k.slice=HO,k.sortBy=Z4,k.sortedUniq=QO,k.sortedUniqBy=JO,k.split=O8,k.spread=iN,k.tail=e4,k.take=t4,k.takeRight=n4,k.takeRightWhile=r4,k.takeWhile=o4,k.tap=w4,k.throttle=sN,k.thru=Vf,k.toArray=N_,k.toPairs=B_,k.toPairsIn=z_,k.toPath=h9,k.toPlainObject=I_,k.transform=d8,k.unary=aN,k.union=i4,k.unionBy=s4,k.unionWith=a4,k.uniq=l4,k.uniqBy=c4,k.uniqWith=u4,k.unset=f8,k.unzip=Tv,k.unzipWith=w_,k.update=h8,k.updateWith=p8,k.values=ol,k.valuesIn=m8,k.without=d4,k.words=W_,k.wrap=lN,k.xor=f4,k.xorBy=h4,k.xorWith=p4,k.zip=m4,k.zipObject=g4,k.zipObjectDeep=v4,k.zipWith=y4,k.entries=B_,k.entriesIn=z_,k.extend=L_,k.extendWith=Zf,Bv(k,k),k.add=m9,k.attempt=H_,k.camelCase=w8,k.capitalize=U_,k.ceil=g9,k.clamp=g8,k.clone=uN,k.cloneDeep=fN,k.cloneDeepWith=hN,k.cloneWith=dN,k.conformsTo=pN,k.deburr=V_,k.defaultTo=Y8,k.divide=v9,k.endsWith=x8,k.eq=ao,k.escape=b8,k.escapeRegExp=S8,k.every=P4,k.find=A4,k.findIndex=p_,k.findKey=WN,k.findLast=M4,k.findLastIndex=m_,k.findLastKey=HN,k.floor=y9,k.forEach=b_,k.forEachRight=S_,k.forIn=KN,k.forInRight=GN,k.forOwn=YN,k.forOwnRight=XN,k.get=Dv,k.gt=mN,k.gte=gN,k.has=QN,k.hasIn=Iv,k.head=v_,k.identity=Gn,k.includes=L4,k.indexOf=MO,k.inRange=v8,k.invoke=t8,k.isArguments=ta,k.isArray=Ye,k.isArrayBuffer=vN,k.isArrayLike=Hn,k.isArrayLikeObject=Ht,k.isBoolean=yN,k.isBuffer=Yi,k.isDate=wN,k.isElement=xN,k.isEmpty=bN,k.isEqual=SN,k.isEqualWith=_N,k.isError=Ov,k.isFinite=EN,k.isFunction=ui,k.isInteger=T_,k.isLength=Yf,k.isMap=A_,k.isMatch=CN,k.isMatchWith=$N,k.isNaN=RN,k.isNative=kN,k.isNil=TN,k.isNull=PN,k.isNumber=M_,k.isObject=Dt,k.isObjectLike=Bt,k.isPlainObject=Qc,k.isRegExp=Nv,k.isSafeInteger=AN,k.isSet=O_,k.isString=Xf,k.isSymbol=lr,k.isTypedArray=rl,k.isUndefined=MN,k.isWeakMap=ON,k.isWeakSet=NN,k.join=LO,k.kebabCase=_8,k.last=Or,k.lastIndexOf=jO,k.lowerCase=E8,k.lowerFirst=C8,k.lt=DN,k.lte=IN,k.max=w9,k.maxBy=x9,k.mean=b9,k.meanBy=S9,k.min=_9,k.minBy=E9,k.stubArray=Uv,k.stubFalse=Vv,k.stubObject=c9,k.stubString=u9,k.stubTrue=d9,k.multiply=C9,k.nth=FO,k.noConflict=t9,k.noop=zv,k.now=Hf,k.pad=$8,k.padEnd=R8,k.padStart=k8,k.parseInt=P8,k.random=y8,k.reduce=U4,k.reduceRight=V4,k.repeat=T8,k.replace=A8,k.result=l8,k.round=$9,k.runInContext=j,k.sample=H4,k.size=Y4,k.snakeCase=M8,k.some=X4,k.sortedIndex=KO,k.sortedIndexBy=GO,k.sortedIndexOf=YO,k.sortedLastIndex=XO,k.sortedLastIndexBy=ZO,k.sortedLastIndexOf=qO,k.startCase=N8,k.startsWith=D8,k.subtract=R9,k.sum=k9,k.sumBy=P9,k.template=I8,k.times=f9,k.toFinite=di,k.toInteger=qe,k.toLength=D_,k.toLower=L8,k.toNumber=Nr,k.toSafeInteger=LN,k.toString=vt,k.toUpper=j8,k.trim=F8,k.trimEnd=B8,k.trimStart=z8,k.truncate=U8,k.unescape=V8,k.uniqueId=p9,k.upperCase=W8,k.upperFirst=Lv,k.each=b_,k.eachRight=S_,k.first=v_,Bv(k,function(){var a={};return Po(k,function(c,h){yt.call(k.prototype,h)||(a[h]=c)}),a}(),{chain:!1}),k.VERSION=r,kr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){k[a].placeholder=k}),kr(["drop","take"],function(a,c){ot.prototype[a]=function(h){h=h===n?1:nn(qe(h),0);var w=this.__filtered__&&!c?new ot(this):this.clone();return w.__filtered__?w.__takeCount__=_n(h,w.__takeCount__):w.__views__.push({size:_n(h,le),type:a+(w.__dir__<0?"Right":"")}),w},ot.prototype[a+"Right"]=function(h){return this.reverse()[a](h).reverse()}}),kr(["filter","map","takeWhile"],function(a,c){var h=c+1,w=h==W||h==H;ot.prototype[a]=function($){var P=this.clone();return P.__iteratees__.push({iteratee:Le($,3),type:h}),P.__filtered__=P.__filtered__||w,P}}),kr(["head","last"],function(a,c){var h="take"+(c?"Right":"");ot.prototype[a]=function(){return this[h](1).value()[0]}}),kr(["initial","tail"],function(a,c){var h="drop"+(c?"":"Right");ot.prototype[a]=function(){return this.__filtered__?new ot(this):this[h](1)}}),ot.prototype.compact=function(){return this.filter(Gn)},ot.prototype.find=function(a){return this.filter(a).head()},ot.prototype.findLast=function(a){return this.reverse().find(a)},ot.prototype.invokeMap=et(function(a,c){return typeof a=="function"?new ot(this):this.map(function(h){return Kc(h,a,c)})}),ot.prototype.reject=function(a){return this.filter(Gf(Le(a)))},ot.prototype.slice=function(a,c){a=qe(a);var h=this;return h.__filtered__&&(a>0||c<0)?new ot(h):(a<0?h=h.takeRight(-a):a&&(h=h.drop(a)),c!==n&&(c=qe(c),h=c<0?h.dropRight(-c):h.take(c-a)),h)},ot.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},ot.prototype.toArray=function(){return this.take(le)},Po(ot.prototype,function(a,c){var h=/^(?:filter|find|map|reject)|While$/.test(c),w=/^(?:head|last)$/.test(c),$=k[w?"take"+(c=="last"?"Right":""):c],P=w||/^find/.test(c);$&&(k.prototype[c]=function(){var M=this.__wrapped__,I=w?[1]:arguments,B=M instanceof ot,oe=I[0],se=B||Ye(M),ce=function(nt){var lt=$.apply(k,zi([nt],I));return w&&ve?lt[0]:lt};se&&h&&typeof oe=="function"&&oe.length!=1&&(B=se=!1);var ve=this.__chain__,ke=!!this.__actions__.length,je=P&&!ve,Qe=B&&!ke;if(!P&&se){M=Qe?M:new ot(this);var Fe=a.apply(M,I);return Fe.__actions__.push({func:Vf,args:[ce],thisArg:n}),new Tr(Fe,ve)}return je&&Qe?a.apply(this,I):(Fe=this.thru(ce),je?w?Fe.value()[0]:Fe.value():Fe)})}),kr(["pop","push","shift","sort","splice","unshift"],function(a){var c=mf[a],h=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",w=/^(?:pop|shift)$/.test(a);k.prototype[a]=function(){var $=arguments;if(w&&!this.__chain__){var P=this.value();return c.apply(Ye(P)?P:[],$)}return this[h](function(M){return c.apply(Ye(M)?M:[],$)})}}),Po(ot.prototype,function(a,c){var h=k[c];if(h){var w=h.name+"";yt.call(Qa,w)||(Qa[w]=[]),Qa[w].push({name:c,func:h})}}),Qa[If(n,_).name]=[{name:"wrapper",func:n}],ot.prototype.clone=V6,ot.prototype.reverse=W6,ot.prototype.value=H6,k.prototype.at=x4,k.prototype.chain=b4,k.prototype.commit=S4,k.prototype.next=_4,k.prototype.plant=C4,k.prototype.reverse=$4,k.prototype.toJSON=k.prototype.valueOf=k.prototype.value=R4,k.prototype.first=k.prototype.head,Fc&&(k.prototype[Fc]=E4),k},Xa=S6();Gs?((Gs.exports=Xa)._=Xa,Fg._=Xa):hn._=Xa}).call(Jc)})(Kp,Kp.exports);var CH=Kp.exports;const $H=vm(CH);function Xr({width:e,height:t}){return e/t}function Gp(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function RH(e){return(t,n)=>e(n)-e(t)}class kH{constructor(t){this.comparator=t,this.heap=[],this.n=0}greater(t,n){return this.comparator(this.heap[t],this.heap[n])<0}swap(t,n){const r=this.heap[t];this.heap[t]=this.heap[n],this.heap[n]=r}swim(t){let n=t,r=Math.floor(n/2);for(;n>1&&this.greater(r,n);)this.swap(r,n),n=r,r=Math.floor(n/2)}sink(t){let n=t,r=n*2;for(;r<=this.n&&(r<this.n&&this.greater(r,r+1)&&(r+=1),!!this.greater(n,r));)this.swap(n,r),n=r,r=n*2}push(t){this.n+=1,this.heap[this.n]=t,this.swim(this.n)}pop(){if(this.n===0)return;this.swap(1,this.n),this.n-=1;const t=this.heap.pop();return this.sink(1),t}size(){return this.n}}function PH(e,t,n){const r=new Map,o=new Set,i=new Map;i.set(t,0);const s=new kH(RH(l=>l.weight));for(s.push({id:t,weight:0});s.size()>0;){const{id:l,weight:u}=s.pop();if(!o.has(l)){const f=e(l);o.add(l),f.forEach((m,p)=>{const g=u+m,y=r.get(p),x=i.get(p);(x===void 0||x>g&&(x/g>1.005||y!==void 0&&y<l))&&(i.set(p,g),s.push({id:p,weight:g}),r.set(p,l))})}}return i.has(n)?r:void 0}function TH(e,t){const n=[];for(let r=t;r!==void 0;r=e.get(r))n.push(r);return n.reverse()}function AH(e,t,n){const r=PH(e,t,n);return r?TH(r,n):void 0}function MH({photos:e,targetRowHeight:t,containerWidth:n}){const r=e.reduce((o,i)=>Math.min(Xr(i),o),Number.MAX_VALUE);return Gp(n/t/r)+2}function WP(e,t,n,r){const o=t-(e.length-1)*n-2*r*e.length,i=e.reduce((s,l)=>s+Xr(l),0);return o/i}function OH(e,t,n,r,o,i,s){const l=e.slice(t,n),u=WP(l,r,i,s);return u>0?(u-o)**2*l.length:void 0}function NH({photos:e,layoutOptions:t,targetRowHeight:n,limitNodeSearch:r,rowConstraints:o}){return i=>{var s,l;const{containerWidth:u,spacing:f,padding:m}=t,p=new Map;p.set(i,0);const g=(s=o==null?void 0:o.minPhotos)!=null?s:1,y=Math.min(r,(l=o==null?void 0:o.maxPhotos)!=null?l:1/0);for(let x=i+g;x<e.length+1&&!(x-i>y);x+=1){const S=OH(e,i,x,u,n,f,m);if(S===void 0)break;p.set(x,S)}return p}}function DH({photos:e,layoutOptions:t}){const{spacing:n,padding:r,containerWidth:o,targetRowHeight:i,rowConstraints:s}=t,l=MH({photos:e,containerWidth:o,targetRowHeight:i}),u=NH({photos:e,layoutOptions:t,targetRowHeight:i,limitNodeSearch:l,rowConstraints:s}),f=AH(u,0,e.length);if(f===void 0)return;const m=[];for(let p=1;p<f.length;p+=1){const g=e.map((x,S)=>({photo:x,index:S})).slice(f[p-1],f[p]),y=WP(g.map(({photo:x})=>x),o,n,r);m.push(g.map(({photo:x,index:S},E)=>({photo:x,layout:{height:y,width:y*Xr(x),index:S,photoIndex:E,photosCount:g.length}})))}return m}function ag(...e){return[...e].filter(t=>!!t).join(" ")}function HP(e,{width:t,photosCount:n},{spacing:r,padding:o,containerWidth:i}){const s=r*(n-1)+2*o*n;return`calc((${e} - ${s}px) / ${Gp((i-s)/t,5)})`}function IH(e,t){return t.layout!=="rows"?`calc(100% - ${2*t.padding}px)`:HP("100%",e,t)}function g2(e,t,n){var r,o;return HP((o=(r=e.match(/calc\((.*)\)/))==null?void 0:r[1])!=null?o:e,t,n)}function LH(e,t,n){let r,o;const i=e.srcSet||e.images;return i&&i.length>0&&(r=i.concat(i.find(({width:s})=>s===e.width)?[]:[{src:e.src,width:e.width,height:e.height}]).sort((s,l)=>s.width-l.width).map(s=>`${s.src} ${s.width}w`).join(", ")),n.sizes?o=(n.sizes.sizes||[]).map(({viewport:s,size:l})=>`${s} ${g2(l,t,n)}`).concat(g2(n.sizes.size,t,n)).join(", "):r&&(o=`${Math.ceil(t.width/n.containerWidth*100)}vw`),{srcSet:r,sizes:o}}function Vx(e){var t,n;const{photo:r,layout:o,layoutOptions:i,imageProps:{style:s,className:l,...u}={},renderPhoto:f}=e,{onClick:m}=i,p={display:"block",boxSizing:"content-box",width:IH(o,i),height:"auto",aspectRatio:`${r.width} / ${r.height}`,...i.padding?{padding:`${i.padding}px`}:null,...(i.layout==="columns"||i.layout==="masonry")&&o.photoIndex<o.photosCount-1?{marginBottom:`${i.spacing}px`}:null,...m?{cursor:"pointer"}:null,...s},g=m?E=>{m({event:E,photo:r,index:o.index})}:void 0,y={src:r.src,alt:(t=r.alt)!=null?t:"",title:r.title,onClick:g,style:p,className:ag("react-photo-album--photo",l),loading:"lazy",decoding:"async",...LH(r,o,i),...u},x=E=>{const{src:_,alt:b,srcSet:C,sizes:R,style:T,...N}=y;return d.createElement("img",{alt:b,...C?{srcSet:C,sizes:R}:null,src:_,style:E!=null&&E.wrapped?{display:"block",width:"100%",height:"100%"}:T,...N})},S=(({display:E,boxSizing:_,width:b,aspectRatio:C,padding:R,marginBottom:T,cursor:N})=>({display:E,boxSizing:_,width:b,aspectRatio:C,padding:R,marginBottom:T,cursor:N}))(p);return d.createElement(d.Fragment,null,(n=f==null?void 0:f({photo:r,layout:o,layoutOptions:i,imageProps:y,renderDefaultPhoto:x,wrapperStyle:S}))!=null?n:x())}function jH({rowContainerProps:e,children:t}){return d.createElement("div",{...e},t)}function FH(e){const{layoutOptions:t,rowIndex:n,rowsCount:r,renderRowContainer:o,rowContainerProps:{style:i,className:s,...l}={},children:u}=e,f={className:ag("react-photo-album--row",s),style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"flex-start",justifyContent:"space-between",...n<r-1?{marginBottom:`${t.spacing}px`}:null,...i},...l};return d.createElement(d.Fragment,null,(o??jH)({layoutOptions:t,rowIndex:n,rowsCount:r,rowContainerProps:f,children:u}))}function BH(e){const{photos:t,layoutOptions:n,renderPhoto:r,renderRowContainer:o,componentsProps:{imageProps:i,rowContainerProps:s}}=e,l=DH({photos:t,layoutOptions:n});return l?d.createElement(d.Fragment,null,l.map((u,f)=>d.createElement(FH,{key:`row-${f}`,layoutOptions:n,rowIndex:f,rowsCount:l.length,renderRowContainer:o,rowContainerProps:s},u.map(({photo:m,layout:p})=>d.createElement(Vx,{key:m.key||m.src,photo:m,layout:p,layoutOptions:n,renderPhoto:r,imageProps:i}))))):null}function zH(e,t,n,r){const o=new Map,i=new Set;i.add(n);for(let s=0;s<t;s+=1){const l=[...i.keys()];i.clear(),l.forEach(u=>{const f=s>0?o.get(u)[s].weight:0;e(u).forEach(({neighbor:m,weight:p})=>{let g=o.get(m);g||(g=[],o.set(m,g));const y=f+p,x=g[s+1];(!x||x.weight>y&&(x.weight/y>1.0001||u<x.node))&&(g[s+1]={node:u,weight:y}),s<t-1&&m!==r&&i.add(m)})})}return o}function UH(e,t,n){const r=[n];for(let o=n,i=t;i>0;i-=1)o=e.get(o)[i].node,r.push(o);return r.reverse()}function VH(e,t,n,r){return UH(zH(e,t,n,r),t,r)}function WH({photos:e,spacing:t,padding:n,targetColumnWidth:r,targetColumnHeight:o}){return i=>{const s=[],l=o*1.5;let u=r/Xr(e[i])+2*n;for(let f=i+1;f<e.length+1&&(s.push({neighbor:f,weight:(o-u)**2}),!(u>l||f===e.length));f+=1)u+=r/Xr(e[f])+t+2*n;return s}}function v2({path:e,photos:t,containerWidth:n,columnsGaps:r,columnsRatios:o,spacing:i,padding:s}){const l=[],u=o.reduce((f,m)=>f+m,0);for(let f=0;f<e.length-1;f+=1){const m=t.map((y,x)=>({photo:y,index:x})).slice(e[f],e[f+1]),p=o.reduce((y,x,S)=>y+(r[f]-r[S])*x,0),g=(n-(e.length-2)*i-2*(e.length-1)*s-p)*o[f]/u;l.push(m.map(({photo:y,index:x},S)=>({photo:y,layout:{width:g,height:g/Xr(y),index:x,photoIndex:S,photosCount:m.length}})))}return l}function HH({photos:e,layoutOptions:t,targetColumnWidth:n}){const{columns:r,spacing:o,padding:i,containerWidth:s}=t,l=[],u=[];if(e.length<=r){const y=e.length>0?e.reduce((S,E)=>S+Xr(E),0)/e.length:1;for(let S=0;S<r;S+=1)l[S]=2*i,u[S]=S<e.length?Xr(e[S]):y;const x=v2({path:Array.from({length:r+1}).map((S,E)=>Math.min(E,e.length)),photos:e,columnsRatios:u,columnsGaps:l,containerWidth:s,spacing:o,padding:i});return{columnsGaps:l,columnsRatios:u,columnsModel:x}}const f=(e.reduce((y,x)=>y+n/Xr(x),0)+o*(e.length-r)+2*i*e.length)/r,m=WH({photos:e,targetColumnWidth:n,targetColumnHeight:f,spacing:o,padding:i}),p=VH(m,r,0,e.length);for(let y=0;y<p.length-1;y+=1){const x=e.slice(p[y],p[y+1]);l[y]=o*(x.length-1)+2*i*x.length,u[y]=1/x.reduce((S,E)=>S+1/Xr(E),0)}const g=v2({path:p,photos:e,columnsRatios:u,columnsGaps:l,containerWidth:s,spacing:o,padding:i});return{columnsGaps:l,columnsRatios:u,columnsModel:g}}function KP(e){const{photos:t,layoutOptions:n}=e,{columns:r,spacing:o,padding:i,containerWidth:s}=n,l=(s-o*(r-1)-2*i*r)/r,{columnsGaps:u,columnsRatios:f,columnsModel:m}=HH({photos:t,layoutOptions:n,targetColumnWidth:l});return m.findIndex(p=>p.findIndex(({layout:{width:g,height:y}})=>g<0||y<0)>=0)>=0?r>1?KP({photos:t,layoutOptions:{...n,columns:r-1}}):void 0:{columnsModel:m,columnsGaps:u,columnsRatios:f}}function KH({photos:e,layoutOptions:t}){return KP({photos:e,layoutOptions:t})}function GH({columnContainerProps:e,children:t}){return d.createElement("div",{...e},t)}function YH(e){const{layoutOptions:t,columnIndex:n,columnsCount:r,columnsGaps:o,columnsRatios:i}=e,{layout:s,spacing:l,padding:u}=t;if(s==="masonry"||!o||!i)return`calc((100% - ${l*(r-1)}px) / ${r})`;const f=i.reduce((p,g)=>p+g,0),m=i.reduce((p,g,y)=>p+(o[n]-o[y])*g,0);return`calc((100% - ${Gp((r-1)*l+2*r*u+m,3)}px) * ${Gp(i[n]/f,5)} + ${2*u}px)`}function GP(e){const{layoutOptions:t,renderColumnContainer:n,children:r,columnContainerProps:{style:o,className:i,...s}={},...l}=e,u={className:ag("react-photo-album--column",i),style:{display:"flex",flexDirection:"column",flexWrap:"nowrap",alignItems:"flex-start",width:YH(e),justifyContent:t.layout==="columns"?"space-between":"flex-start",...o},...s};return d.createElement(d.Fragment,null,(n??GH)({layoutOptions:t,columnContainerProps:u,children:r,...l}))}function XH(e){const{photos:t,layoutOptions:n,renderPhoto:r,renderColumnContainer:o,componentsProps:{imageProps:i,columnContainerProps:s}}=e,l=KH({photos:t,layoutOptions:n});if(!l)return null;const{columnsModel:u,columnsRatios:f,columnsGaps:m}=l;return d.createElement(d.Fragment,null,u.map((p,g)=>d.createElement(GP,{key:`column-${g}`,layoutOptions:n,columnIndex:g,columnsCount:u.length,columnsGaps:m,columnsRatios:f,renderColumnContainer:o,columnContainerProps:s},p.map(({photo:y,layout:x})=>d.createElement(Vx,{key:y.key||y.src,photo:y,layout:x,layoutOptions:n,renderPhoto:r,imageProps:i})))))}function YP(e){const{photos:t,layoutOptions:n}=e,{columns:r,spacing:o,padding:i,containerWidth:s}=n,l=(s-o*(r-1)-2*i*r)/r;if(l<=0)return r>1?YP({...e,layoutOptions:{...n,columns:r-1}}):void 0;const u=[];for(let m=0;m<r;m+=1)u[m]=0;return t.reduce((m,p,g)=>{const y=u.reduce((x,S,E)=>S<u[x]-1?E:x,0);return u[y]=u[y]+l/Xr(p)+o+2*i,m[y].push({photo:p,index:g}),m},Array.from({length:r}).map(()=>[])).map(m=>m.map(({photo:p,index:g},y)=>({photo:p,layout:{width:l,height:l/Xr(p),index:g,photoIndex:y,photosCount:m.length}})))}function ZH(e){const{photos:t,layoutOptions:n,renderPhoto:r,renderColumnContainer:o,componentsProps:{imageProps:i,columnContainerProps:s}}=e,l=YP({photos:t,layoutOptions:n});return l?d.createElement(d.Fragment,null,l.map((u,f)=>d.createElement(GP,{key:`masonry-column-${f}`,layoutOptions:n,columnsCount:l.length,columnIndex:f,renderColumnContainer:o,columnContainerProps:s},u.map(({photo:m,layout:p})=>d.createElement(Vx,{key:m.key||m.src,photo:m,layout:p,layoutOptions:n,renderPhoto:r,imageProps:i}))))):null}function qH({containerProps:e,children:t,containerRef:n}){return d.createElement("div",{ref:n,...e},t)}function QH(e){const{layout:t,renderContainer:n,children:r,containerRef:o,containerProps:{style:i,className:s,...l}={}}=e,u={className:ag("react-photo-album",`react-photo-album--${t}`,s),style:{display:"flex",flexWrap:"nowrap",justifyContent:"space-between",flexDirection:t==="rows"?"column":"row",...i},...l};return d.createElement(d.Fragment,null,(n??qH)({containerProps:u,containerRef:o,layout:t,children:r}))}function JH(e){const t=d.useRef(e);return(!e||!t.current||e.join()!==t.current.join())&&(t.current=e),t.current}function eK(e,{newContainerWidth:t,newScrollbarWidth:n}){const{containerWidth:r,scrollbarWidth:o}=e;return r!==void 0&&o!==void 0&&t!==void 0&&n!==void 0&&t>r&&t-r<=20&&n<o?{containerWidth:r,scrollbarWidth:n}:r!==t||o!==n?{containerWidth:t,scrollbarWidth:n}:e}function tK(e,t){let n=e==null?void 0:e.clientWidth;if(n!==void 0&&t&&t.length>0){const r=[...t.filter(i=>i>0)].sort((i,s)=>s-i);r.push(Math.floor(r[r.length-1]/2));const o=n;n=r.find((i,s)=>i<=o||s===r.length-1)}return n}function nK(e,t){const[{containerWidth:n},r]=d.useReducer(eK,{containerWidth:t}),o=d.useRef(null),i=d.useRef();return{containerRef:d.useCallback(l=>{var u;(u=i.current)==null||u.disconnect(),i.current=void 0,o.current=l;const f=()=>r({newContainerWidth:tK(o.current,e),newScrollbarWidth:window.innerWidth-document.documentElement.clientWidth});f(),l&&typeof ResizeObserver<"u"&&(i.current=new ResizeObserver(f),i.current.observe(l))},[e]),containerWidth:n}}const rK=Object.freeze([1200,600,300,0]);function Wx(e,t){return typeof e=="function"?e(t):e}function XP(e,t){return typeof e<"u"?Wx(e,t):void 0}function oK(e,t){const n=rK.findIndex(r=>r<=t);return Wx(e[n>=0?n:0],t)}function Ch(e,t,n,r=0){const o=XP(e,t);return Math.round(Math.max(o===void 0?oK(n,t):o,r))}function iK({layout:e,onClick:t,containerWidth:n,targetRowHeight:r,rowConstraints:o,columns:i,spacing:s,padding:l,sizes:u}){return{layout:e,onClick:t,containerWidth:n,columns:Ch(i,n,[5,4,3,2],1),spacing:Ch(s,n,[20,15,10,5]),padding:Ch(l,n,[0,0,0,0,0]),targetRowHeight:Ch(r,n,[f=>f/5,f=>f/4,f=>f/3,f=>f/2]),rowConstraints:XP(o,n),sizes:u}}function sK(e,t,n){const{photos:r,componentsProps:o}=e,i=Wx(o,t)||{};if(n){const{layout:s,spacing:l,padding:u,rowConstraints:f}=n;if(s==="rows"){const{singleRowMaxHeight:m}=f||{};if(m){const p=Math.floor(r.reduce((g,{width:y,height:x})=>g+y/x*m-2*u,u*r.length*2+l*(r.length-1)));p>0&&(i.containerProps=i.containerProps||{},i.containerProps.style={maxWidth:p,...i.containerProps.style})}}}return i}function aK(e,t,n){const{photos:r,layout:o,renderPhoto:i,renderRowContainer:s,renderColumnContainer:l}=e,u={photos:r,renderPhoto:i,componentsProps:t};return o==="rows"?d.createElement(BH,{layoutOptions:n,renderRowContainer:s,...u}):o==="columns"?d.createElement(XH,{layoutOptions:n,renderColumnContainer:l,...u}):d.createElement(ZH,{layoutOptions:n,renderColumnContainer:l,...u})}function lK(e){const{photos:t,layout:n,renderContainer:r,defaultContainerWidth:o,breakpoints:i}=e,{containerRef:s,containerWidth:l}=nK(JH(i),o);if(!n||!["rows","columns","masonry"].includes(n)||!Array.isArray(t))return null;const u=l?iK({containerWidth:l,...e}):void 0,f=sK(e,l,u);return d.createElement(QH,{layout:n,containerRef:s,renderContainer:r,containerProps:f.containerProps},u&&aK(e,f,u))}function cK({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25"}))}const uK=d.forwardRef(cK),dK=uK;function fK({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"}))}const hK=d.forwardRef(fK),pK=hK;function mK({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672L13.684 16.6m0 0l-2.51 2.225.569-9.47 5.227 7.917-3.286-.672zM12 2.25V4.5m5.834.166l-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243l-1.59-1.59"}))}const gK=d.forwardRef(mK),vK=gK;function Ti(e){return Array.isArray?Array.isArray(e):QP(e)==="[object Array]"}const yK=1/0;function wK(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-yK?"-0":t}function xK(e){return e==null?"":wK(e)}function Ho(e){return typeof e=="string"}function ZP(e){return typeof e=="number"}function bK(e){return e===!0||e===!1||SK(e)&&QP(e)=="[object Boolean]"}function qP(e){return typeof e=="object"}function SK(e){return qP(e)&&e!==null}function mr(e){return e!=null}function F0(e){return!e.trim().length}function QP(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const _K="Incorrect 'index' type",EK=e=>`Invalid value for key ${e}`,CK=e=>`Pattern length exceeds max of ${e}.`,$K=e=>`Missing ${e} property in key`,RK=e=>`Property 'weight' in key '${e}' must be a positive integer`,y2=Object.prototype.hasOwnProperty;class kK{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let o=JP(r);this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function JP(e){let t=null,n=null,r=null,o=1,i=null;if(Ho(e)||Ti(e))r=e,t=w2(e),n=_1(e);else{if(!y2.call(e,"name"))throw new Error($K("name"));const s=e.name;if(r=s,y2.call(e,"weight")&&(o=e.weight,o<=0))throw new Error(RK(s));t=w2(s),n=_1(s),i=e.getFn}return{path:t,id:n,weight:o,src:r,getFn:i}}function w2(e){return Ti(e)?e:e.split(".")}function _1(e){return Ti(e)?e.join("."):e}function PK(e,t){let n=[],r=!1;const o=(i,s,l)=>{if(mr(i))if(!s[l])n.push(i);else{let u=s[l];const f=i[u];if(!mr(f))return;if(l===s.length-1&&(Ho(f)||ZP(f)||bK(f)))n.push(xK(f));else if(Ti(f)){r=!0;for(let m=0,p=f.length;m<p;m+=1)o(f[m],s,l+1)}else s.length&&o(f,s,l+1)}};return o(e,Ho(t)?t.split("."):t,0),r?n:n[0]}const TK={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},AK={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},MK={location:0,threshold:.6,distance:100},OK={useExtendedSearch:!1,getFn:PK,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var He={...AK,...TK,...MK,...OK};const NK=/[^ ]+/g;function DK(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(o){const i=o.match(NK).length;if(n.has(i))return n.get(i);const s=1/Math.pow(i,.5*e),l=parseFloat(Math.round(s*r)/r);return n.set(i,l),l},clear(){n.clear()}}}class Hx{constructor({getFn:t=He.getFn,fieldNormWeight:n=He.fieldNormWeight}={}){this.norm=DK(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ho(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();Ho(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!mr(t)||F0(t))return;let r={v:t,i:n,n:this.norm.get(t)};this.records.push(r)}_addObject(t,n){let r={i:n,$:{}};this.keys.forEach((o,i)=>{let s=o.getFn?o.getFn(t):this.getFn(t,o.path);if(mr(s)){if(Ti(s)){let l=[];const u=[{nestedArrIndex:-1,value:s}];for(;u.length;){const{nestedArrIndex:f,value:m}=u.pop();if(mr(m))if(Ho(m)&&!F0(m)){let p={v:m,i:f,n:this.norm.get(m)};l.push(p)}else Ti(m)&&m.forEach((p,g)=>{u.push({nestedArrIndex:g,value:p})})}r.$[i]=l}else if(Ho(s)&&!F0(s)){let l={v:s,n:this.norm.get(s)};r.$[i]=l}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function eT(e,t,{getFn:n=He.getFn,fieldNormWeight:r=He.fieldNormWeight}={}){const o=new Hx({getFn:n,fieldNormWeight:r});return o.setKeys(e.map(JP)),o.setSources(t),o.create(),o}function IK(e,{getFn:t=He.getFn,fieldNormWeight:n=He.fieldNormWeight}={}){const{keys:r,records:o}=e,i=new Hx({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(o),i}function $h(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:o=He.distance,ignoreLocation:i=He.ignoreLocation}={}){const s=t/e.length;if(i)return s;const l=Math.abs(r-n);return o?s+l/o:l?1:s}function LK(e=[],t=He.minMatchCharLength){let n=[],r=-1,o=-1,i=0;for(let s=e.length;i<s;i+=1){let l=e[i];l&&r===-1?r=i:!l&&r!==-1&&(o=i-1,o-r+1>=t&&n.push([r,o]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}const ua=32;function jK(e,t,n,{location:r=He.location,distance:o=He.distance,threshold:i=He.threshold,findAllMatches:s=He.findAllMatches,minMatchCharLength:l=He.minMatchCharLength,includeMatches:u=He.includeMatches,ignoreLocation:f=He.ignoreLocation}={}){if(t.length>ua)throw new Error(CK(ua));const m=t.length,p=e.length,g=Math.max(0,Math.min(r,p));let y=i,x=g;const S=l>1||u,E=S?Array(p):[];let _;for(;(_=e.indexOf(t,x))>-1;){let A=$h(t,{currentLocation:_,expectedLocation:g,distance:o,ignoreLocation:f});if(y=Math.min(A,y),x=_+m,S){let O=0;for(;O<m;)E[_+O]=1,O+=1}}x=-1;let b=[],C=1,R=m+p;const T=1<<m-1;for(let A=0;A<m;A+=1){let O=0,U=R;for(;O<U;)$h(t,{errors:A,currentLocation:g+U,expectedLocation:g,distance:o,ignoreLocation:f})<=y?O=U:R=U,U=Math.floor((R-O)/2+O);R=U;let z=Math.max(1,g-U+1),ie=s?p:Math.min(g+U,p)+m,K=Array(ie+2);K[ie+1]=(1<<A)-1;for(let W=ie;W>=z;W-=1){let re=W-1,H=n[e.charAt(re)];if(S&&(E[re]=+!!H),K[W]=(K[W+1]<<1|1)&H,A&&(K[W]|=(b[W+1]|b[W])<<1|1|b[W+1]),K[W]&T&&(C=$h(t,{errors:A,currentLocation:re,expectedLocation:g,distance:o,ignoreLocation:f}),C<=y)){if(y=C,x=re,x<=g)break;z=Math.max(1,2*g-x)}}if($h(t,{errors:A+1,currentLocation:g,expectedLocation:g,distance:o,ignoreLocation:f})>y)break;b=K}const N={isMatch:x>=0,score:Math.max(.001,C)};if(S){const A=LK(E,l);A.length?u&&(N.indices=A):N.isMatch=!1}return N}function FK(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const o=e.charAt(n);t[o]=(t[o]||0)|1<<r-n-1}return t}class tT{constructor(t,{location:n=He.location,threshold:r=He.threshold,distance:o=He.distance,includeMatches:i=He.includeMatches,findAllMatches:s=He.findAllMatches,minMatchCharLength:l=He.minMatchCharLength,isCaseSensitive:u=He.isCaseSensitive,ignoreLocation:f=He.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:s,minMatchCharLength:l,isCaseSensitive:u,ignoreLocation:f},this.pattern=u?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const m=(g,y)=>{this.chunks.push({pattern:g,alphabet:FK(g),startIndex:y})},p=this.pattern.length;if(p>ua){let g=0;const y=p%ua,x=p-y;for(;g<x;)m(this.pattern.substr(g,ua),g),g+=ua;if(y){const S=p-ua;m(this.pattern.substr(S),S)}}else m(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,includeMatches:r}=this.options;if(n||(t=t.toLowerCase()),this.pattern===t){let x={isMatch:!0,score:0};return r&&(x.indices=[[0,t.length-1]]),x}const{location:o,distance:i,threshold:s,findAllMatches:l,minMatchCharLength:u,ignoreLocation:f}=this.options;let m=[],p=0,g=!1;this.chunks.forEach(({pattern:x,alphabet:S,startIndex:E})=>{const{isMatch:_,score:b,indices:C}=jK(t,x,S,{location:o+E,distance:i,threshold:s,findAllMatches:l,minMatchCharLength:u,includeMatches:r,ignoreLocation:f});_&&(g=!0),p+=b,_&&C&&(m=[...m,...C])});let y={isMatch:g,score:g?p/this.chunks.length:1};return g&&r&&(y.indices=m),y}}class Us{constructor(t){this.pattern=t}static isMultiMatch(t){return x2(t,this.multiRegex)}static isSingleMatch(t){return x2(t,this.singleRegex)}search(){}}function x2(e,t){const n=e.match(t);return n?n[1]:null}class BK extends Us{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class zK extends Us{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class UK extends Us{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class VK extends Us{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class WK extends Us{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class HK extends Us{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class nT extends Us{constructor(t,{location:n=He.location,threshold:r=He.threshold,distance:o=He.distance,includeMatches:i=He.includeMatches,findAllMatches:s=He.findAllMatches,minMatchCharLength:l=He.minMatchCharLength,isCaseSensitive:u=He.isCaseSensitive,ignoreLocation:f=He.ignoreLocation}={}){super(t),this._bitapSearch=new tT(t,{location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:s,minMatchCharLength:l,isCaseSensitive:u,ignoreLocation:f})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class rT extends Us{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const o=[],i=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+i,o.push([r,n-1]);const s=!!o.length;return{isMatch:s,score:s?0:1,indices:o}}}const E1=[BK,rT,UK,VK,HK,WK,zK,nT],b2=E1.length,KK=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,GK="|";function YK(e,t={}){return e.split(GK).map(n=>{let r=n.trim().split(KK).filter(i=>i&&!!i.trim()),o=[];for(let i=0,s=r.length;i<s;i+=1){const l=r[i];let u=!1,f=-1;for(;!u&&++f<b2;){const m=E1[f];let p=m.isMultiMatch(l);p&&(o.push(new m(p,t)),u=!0)}if(!u)for(f=-1;++f<b2;){const m=E1[f];let p=m.isSingleMatch(l);if(p){o.push(new m(p,t));break}}}return o})}const XK=new Set([nT.type,rT.type]);class ZK{constructor(t,{isCaseSensitive:n=He.isCaseSensitive,includeMatches:r=He.includeMatches,minMatchCharLength:o=He.minMatchCharLength,ignoreLocation:i=He.ignoreLocation,findAllMatches:s=He.findAllMatches,location:l=He.location,threshold:u=He.threshold,distance:f=He.distance}={}){this.query=null,this.options={isCaseSensitive:n,includeMatches:r,minMatchCharLength:o,findAllMatches:s,ignoreLocation:i,location:l,threshold:u,distance:f},this.pattern=n?t:t.toLowerCase(),this.query=YK(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:o}=this.options;t=o?t:t.toLowerCase();let i=0,s=[],l=0;for(let u=0,f=n.length;u<f;u+=1){const m=n[u];s.length=0,i=0;for(let p=0,g=m.length;p<g;p+=1){const y=m[p],{isMatch:x,indices:S,score:E}=y.search(t);if(x){if(i+=1,l+=E,r){const _=y.constructor.type;XK.has(_)?s=[...s,...S]:s.push(S)}}else{l=0,i=0,s.length=0;break}}if(i){let p={isMatch:!0,score:l/i};return r&&(p.indices=s),p}}return{isMatch:!1,score:1}}}const C1=[];function qK(...e){C1.push(...e)}function $1(e,t){for(let n=0,r=C1.length;n<r;n+=1){let o=C1[n];if(o.condition(e,t))return new o(e,t)}return new tT(e,t)}const Yp={AND:"$and",OR:"$or"},R1={PATH:"$path",PATTERN:"$val"},k1=e=>!!(e[Yp.AND]||e[Yp.OR]),QK=e=>!!e[R1.PATH],JK=e=>!Ti(e)&&qP(e)&&!k1(e),S2=e=>({[Yp.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function oT(e,t,{auto:n=!0}={}){const r=o=>{let i=Object.keys(o);const s=QK(o);if(!s&&i.length>1&&!k1(o))return r(S2(o));if(JK(o)){const u=s?o[R1.PATH]:i[0],f=s?o[R1.PATTERN]:o[u];if(!Ho(f))throw new Error(EK(u));const m={keyId:_1(u),pattern:f};return n&&(m.searcher=$1(f,t)),m}let l={children:[],operator:i[0]};return i.forEach(u=>{const f=o[u];Ti(f)&&f.forEach(m=>{l.children.push(r(m))})}),l};return k1(e)||(e=S2(e)),r(e)}function eG(e,{ignoreFieldNorm:t=He.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:o,norm:i,score:s})=>{const l=o?o.weight:null;r*=Math.pow(s===0&&l?Number.EPSILON:s,(l||1)*(t?1:i))}),n.score=r})}function tG(e,t){const n=e.matches;t.matches=[],mr(n)&&n.forEach(r=>{if(!mr(r.indices)||!r.indices.length)return;const{indices:o,value:i}=r;let s={indices:o,value:i};r.key&&(s.key=r.key.src),r.idx>-1&&(s.refIndex=r.idx),t.matches.push(s)})}function nG(e,t){t.score=e.score}function rG(e,t,{includeMatches:n=He.includeMatches,includeScore:r=He.includeScore}={}){const o=[];return n&&o.push(tG),r&&o.push(nG),e.map(i=>{const{idx:s}=i,l={item:t[s],refIndex:s};return o.length&&o.forEach(u=>{u(i,l)}),l})}class Ac{constructor(t,n={},r){this.options={...He,...n},this.options.useExtendedSearch,this._keyStore=new kK(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof Hx))throw new Error(_K);this._myIndex=n||eT(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){mr(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,o=this._docs.length;r<o;r+=1){const i=this._docs[r];t(i,r)&&(this.removeAt(r),r-=1,o-=1,n.push(i))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:i,sortFn:s,ignoreFieldNorm:l}=this.options;let u=Ho(t)?Ho(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return eG(u,{ignoreFieldNorm:l}),i&&u.sort(s),ZP(n)&&n>-1&&(u=u.slice(0,n)),rG(u,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(t){const n=$1(t,this.options),{records:r}=this._myIndex,o=[];return r.forEach(({v:i,i:s,n:l})=>{if(!mr(i))return;const{isMatch:u,score:f,indices:m}=n.searchIn(i);u&&o.push({item:i,idx:s,matches:[{score:f,value:i,norm:l,indices:m}]})}),o}_searchLogical(t){const n=oT(t,this.options),r=(l,u,f)=>{if(!l.children){const{keyId:p,searcher:g}=l,y=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(u,p),searcher:g});return y&&y.length?[{idx:f,item:u,matches:y}]:[]}const m=[];for(let p=0,g=l.children.length;p<g;p+=1){const y=l.children[p],x=r(y,u,f);if(x.length)m.push(...x);else if(l.operator===Yp.AND)return[]}return m},o=this._myIndex.records,i={},s=[];return o.forEach(({$:l,i:u})=>{if(mr(l)){let f=r(n,l,u);f.length&&(i[u]||(i[u]={idx:u,item:l,matches:[]},s.push(i[u])),f.forEach(({matches:m})=>{i[u].matches.push(...m)}))}}),s}_searchObjectList(t){const n=$1(t,this.options),{keys:r,records:o}=this._myIndex,i=[];return o.forEach(({$:s,i:l})=>{if(!mr(s))return;let u=[];r.forEach((f,m)=>{u.push(...this._findMatches({key:f,value:s[m],searcher:n}))}),u.length&&i.push({idx:l,item:s,matches:u})}),i}_findMatches({key:t,value:n,searcher:r}){if(!mr(n))return[];let o=[];if(Ti(n))n.forEach(({v:i,i:s,n:l})=>{if(!mr(i))return;const{isMatch:u,score:f,indices:m}=r.searchIn(i);u&&o.push({score:f,key:t,value:i,idx:s,norm:l,indices:m})});else{const{v:i,n:s}=n,{isMatch:l,score:u,indices:f}=r.searchIn(i);l&&o.push({score:u,key:t,value:i,norm:s,indices:f})}return o}}Ac.version="7.0.0";Ac.createIndex=eT;Ac.parseIndex=IK;Ac.config=He;Ac.parseQuery=oT;qK(ZK);function Gd(e){const t=e+"CollectionProvider",[n,r]=An(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:S}=y,E=Be.useRef(null),_=Be.useRef(new Map).current;return Be.createElement(o,{scope:x,itemMap:_,collectionRef:E},S)},l=e+"CollectionSlot",u=Be.forwardRef((y,x)=>{const{scope:S,children:E}=y,_=i(l,S),b=We(x,_.collectionRef);return Be.createElement(Qo,{ref:b},E)}),f=e+"CollectionItemSlot",m="data-radix-collection-item",p=Be.forwardRef((y,x)=>{const{scope:S,children:E,..._}=y,b=Be.useRef(null),C=We(x,b),R=i(f,S);return Be.useEffect(()=>(R.itemMap.set(b,{ref:b,..._}),()=>void R.itemMap.delete(b))),Be.createElement(Qo,{[m]:"",ref:C},E)});function g(y){const x=i(e+"CollectionConsumer",y);return Be.useCallback(()=>{const E=x.collectionRef.current;if(!E)return[];const _=Array.from(E.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((R,T)=>_.indexOf(R.ref.current)-_.indexOf(T.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:p},g,r]}const oG=d.createContext(void 0);function Mc(e){const t=d.useContext(oG);return e||t||"ltr"}const B0="rovingFocusGroup.onEntryFocus",iG={bubbles:!1,cancelable:!0},Kx="RovingFocusGroup",[P1,iT,sG]=Gd(Kx),[aG,lg]=An(Kx,[sG]),[lG,cG]=aG(Kx),uG=d.forwardRef((e,t)=>d.createElement(P1.Provider,{scope:e.__scopeRovingFocusGroup},d.createElement(P1.Slot,{scope:e.__scopeRovingFocusGroup},d.createElement(dG,Y({},e,{ref:t}))))),dG=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:f,...m}=e,p=d.useRef(null),g=We(t,p),y=Mc(i),[x=null,S]=no({prop:s,defaultProp:l,onChange:u}),[E,_]=d.useState(!1),b=Lt(f),C=iT(n),R=d.useRef(!1),[T,N]=d.useState(0);return d.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(B0,b),()=>A.removeEventListener(B0,b)},[b]),d.createElement(lG,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:x,onItemFocus:d.useCallback(A=>S(A),[S]),onItemShiftTab:d.useCallback(()=>_(!0),[]),onFocusableItemAdd:d.useCallback(()=>N(A=>A+1),[]),onFocusableItemRemove:d.useCallback(()=>N(A=>A-1),[])},d.createElement(Ae.div,Y({tabIndex:E||T===0?-1:0,"data-orientation":r},m,{ref:g,style:{outline:"none",...e.style},onMouseDown:fe(e.onMouseDown,()=>{R.current=!0}),onFocus:fe(e.onFocus,A=>{const O=!R.current;if(A.target===A.currentTarget&&O&&!E){const U=new CustomEvent(B0,iG);if(A.currentTarget.dispatchEvent(U),!U.defaultPrevented){const z=C().filter(re=>re.focusable),ie=z.find(re=>re.active),K=z.find(re=>re.id===x),W=[ie,K,...z].filter(Boolean).map(re=>re.ref.current);sT(W)}}R.current=!1}),onBlur:fe(e.onBlur,()=>_(!1))})))}),fG="RovingFocusGroupItem",hG=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,l=tr(),u=i||l,f=cG(fG,n),m=f.currentTabStopId===u,p=iT(n),{onFocusableItemAdd:g,onFocusableItemRemove:y}=f;return d.useEffect(()=>{if(r)return g(),()=>y()},[r,g,y]),d.createElement(P1.ItemSlot,{scope:n,id:u,focusable:r,active:o},d.createElement(Ae.span,Y({tabIndex:m?0:-1,"data-orientation":f.orientation},s,{ref:t,onMouseDown:fe(e.onMouseDown,x=>{r?f.onItemFocus(u):x.preventDefault()}),onFocus:fe(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:fe(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=gG(x,f.orientation,f.dir);if(S!==void 0){x.preventDefault();let _=p().filter(b=>b.focusable).map(b=>b.ref.current);if(S==="last")_.reverse();else if(S==="prev"||S==="next"){S==="prev"&&_.reverse();const b=_.indexOf(x.currentTarget);_=f.loop?vG(_,b+1):_.slice(b+1)}setTimeout(()=>sT(_))}})})))}),pG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gG(e,t,n){const r=mG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return pG[r]}function sT(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function vG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const aT=uG,lT=hG,cT="Tabs",[yG,Ete]=An(cT,[lg]),uT=lg(),[wG,Gx]=yG(cT),xG=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:u="automatic",...f}=e,m=Mc(l),[p,g]=no({prop:r,onChange:o,defaultProp:i});return d.createElement(wG,{scope:n,baseId:tr(),value:p,onValueChange:g,orientation:s,dir:m,activationMode:u},d.createElement(Ae.div,Y({dir:m,"data-orientation":s},f,{ref:t})))}),bG="TabsList",SG=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Gx(bG,n),s=uT(n);return d.createElement(aT,Y({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),d.createElement(Ae.div,Y({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),_G="TabsTrigger",EG=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Gx(_G,n),l=uT(n),u=dT(s.baseId,r),f=fT(s.baseId,r),m=r===s.value;return d.createElement(lT,Y({asChild:!0},l,{focusable:!o,active:m}),d.createElement(Ae.button,Y({type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u},i,{ref:t,onMouseDown:fe(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(r):p.preventDefault()}),onKeyDown:fe(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(r)}),onFocus:fe(e.onFocus,()=>{const p=s.activationMode!=="manual";!m&&!o&&p&&s.onValueChange(r)})})))}),CG="TabsContent",$G=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,l=Gx(CG,n),u=dT(l.baseId,r),f=fT(l.baseId,r),m=r===l.value,p=d.useRef(m);return d.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),d.createElement(Sn,{present:o||m},({present:g})=>d.createElement(Ae.div,Y({"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:f,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0}}),g&&i))});function dT(e,t){return`${e}-trigger-${t}`}function fT(e,t){return`${e}-content-${t}`}const RG=xG,hT=SG,pT=EG,mT=$G,gT=RG,Yx=d.forwardRef(({className:e,...t},n)=>v.jsx(hT,{ref:n,className:xe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),tabIndex:-1,...t}));Yx.displayName=hT.displayName;const ys=d.forwardRef(({className:e,...t},n)=>v.jsx(pT,{ref:n,className:xe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),tabIndex:-1,...t}));ys.displayName=pT.displayName;const _u=d.forwardRef(({className:e,...t},n)=>v.jsx(mT,{ref:n,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),tabIndex:-1,...t}));_u.displayName=mT.displayName;function hd(e,[t,n]){return Math.min(n,Math.max(t,e))}function Xx(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const kG=[" ","Enter","ArrowUp","ArrowDown"],PG=[" ","Enter"],cg="Select",[ug,dg,TG]=Gd(cg),[Oc,Cte]=An(cg,[TG,zs]),Zx=zs(),[AG,Ba]=Oc(cg),[MG,OG]=Oc(cg),NG=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:u,dir:f,name:m,autoComplete:p,disabled:g,required:y}=e,x=Zx(t),[S,E]=d.useState(null),[_,b]=d.useState(null),[C,R]=d.useState(!1),T=Mc(f),[N=!1,A]=no({prop:r,defaultProp:o,onChange:i}),[O,U]=no({prop:s,defaultProp:l,onChange:u}),z=d.useRef(null),ie=S?!!S.closest("form"):!0,[K,te]=d.useState(new Set),W=Array.from(K).map(re=>re.props.value).join(";");return d.createElement(Fd,x,d.createElement(AG,{required:y,scope:t,trigger:S,onTriggerChange:E,valueNode:_,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:R,contentId:tr(),value:O,onValueChange:U,open:N,onOpenChange:A,dir:T,triggerPointerDownPosRef:z,disabled:g},d.createElement(ug.Provider,{scope:t},d.createElement(MG,{scope:e.__scopeSelect,onNativeOptionAdd:d.useCallback(re=>{te(H=>new Set(H).add(re))},[]),onNativeOptionRemove:d.useCallback(re=>{te(H=>{const J=new Set(H);return J.delete(re),J})},[])},n)),ie?d.createElement(bT,{key:W,"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:p,value:O,onChange:re=>U(re.target.value),disabled:g},O===void 0?d.createElement("option",{value:""}):null,Array.from(K)):null))},DG="SelectTrigger",IG=d.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Zx(n),s=Ba(DG,n),l=s.disabled||r,u=We(t,s.onTriggerChange),f=dg(n),[m,p,g]=ST(x=>{const S=f().filter(b=>!b.disabled),E=S.find(b=>b.value===s.value),_=_T(S,x,E);_!==void 0&&s.onValueChange(_.value)}),y=()=>{l||(s.onOpenChange(!0),g())};return d.createElement(Zm,Y({asChild:!0},i),d.createElement(Ae.button,Y({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":xT(s.value)?"":void 0},o,{ref:u,onClick:fe(o.onClick,x=>{x.currentTarget.focus()}),onPointerDown:fe(o.onPointerDown,x=>{const S=x.target;S.hasPointerCapture(x.pointerId)&&S.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&(y(),s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)},x.preventDefault())}),onKeyDown:fe(o.onKeyDown,x=>{const S=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(S&&x.key===" ")&&kG.includes(x.key)&&(y(),x.preventDefault())})})))}),LG="SelectValue",jG=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...l}=e,u=Ba(LG,n),{onValueNodeHasChildrenChange:f}=u,m=i!==void 0,p=We(t,u.onValueNodeChange);return Tn(()=>{f(m)},[f,m]),d.createElement(Ae.span,Y({},l,{ref:p,style:{pointerEvents:"none"}}),xT(u.value)?d.createElement(d.Fragment,null,s):i)}),FG=d.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d.createElement(Ae.span,Y({"aria-hidden":!0},o,{ref:t}),r||"▼")}),BG=e=>d.createElement(Bd,Y({asChild:!0},e)),hc="SelectContent",zG=d.forwardRef((e,t)=>{const n=Ba(hc,e.__scopeSelect),[r,o]=d.useState();if(Tn(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Bs.createPortal(d.createElement(vT,{scope:e.__scopeSelect},d.createElement(ug.Slot,{scope:e.__scopeSelect},d.createElement("div",null,e.children))),i):null}return d.createElement(UG,Y({},e,{ref:t}))}),gi=10,[vT,za]=Oc(hc),UG=d.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:u,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:E,..._}=e,b=Ba(hc,n),[C,R]=d.useState(null),[T,N]=d.useState(null),A=We(t,me=>R(me)),[O,U]=d.useState(null),[z,ie]=d.useState(null),K=dg(n),[te,W]=d.useState(!1),re=d.useRef(!1);d.useEffect(()=>{if(C)return ig(C)},[C]),ng();const H=d.useCallback(me=>{const[be,...Ee]=K().map(ze=>ze.ref.current),[Oe]=Ee.slice(-1),Ie=document.activeElement;for(const ze of me)if(ze===Ie||(ze==null||ze.scrollIntoView({block:"nearest"}),ze===be&&T&&(T.scrollTop=0),ze===Oe&&T&&(T.scrollTop=T.scrollHeight),ze==null||ze.focus(),document.activeElement!==Ie))return},[K,T]),J=d.useCallback(()=>H([O,C]),[H,O,C]);d.useEffect(()=>{te&&J()},[te,J]);const{onOpenChange:G,triggerPointerDownPosRef:Z}=b;d.useEffect(()=>{if(C){let me={x:0,y:0};const be=Oe=>{var Ie,ze,ht,st;me={x:Math.abs(Math.round(Oe.pageX)-((Ie=(ze=Z.current)===null||ze===void 0?void 0:ze.x)!==null&&Ie!==void 0?Ie:0)),y:Math.abs(Math.round(Oe.pageY)-((ht=(st=Z.current)===null||st===void 0?void 0:st.y)!==null&&ht!==void 0?ht:0))}},Ee=Oe=>{me.x<=10&&me.y<=10?Oe.preventDefault():C.contains(Oe.target)||G(!1),document.removeEventListener("pointermove",be),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",Ee,{capture:!0})}}},[C,G,Z]),d.useEffect(()=>{const me=()=>G(!1);return window.addEventListener("blur",me),window.addEventListener("resize",me),()=>{window.removeEventListener("blur",me),window.removeEventListener("resize",me)}},[G]);const[Q,le]=ST(me=>{const be=K().filter(Ie=>!Ie.disabled),Ee=be.find(Ie=>Ie.ref.current===document.activeElement),Oe=_T(be,me,Ee);Oe&&setTimeout(()=>Oe.ref.current.focus())}),L=d.useCallback((me,be,Ee)=>{const Oe=!re.current&&!Ee;(b.value!==void 0&&b.value===be||Oe)&&(U(me),Oe&&(re.current=!0))},[b.value]),ue=d.useCallback(()=>C==null?void 0:C.focus(),[C]),Ne=d.useCallback((me,be,Ee)=>{const Oe=!re.current&&!Ee;(b.value!==void 0&&b.value===be||Oe)&&ie(me)},[b.value]),Ke=r==="popper"?_2:VG,Me=Ke===_2?{side:l,sideOffset:u,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:E}:{};return d.createElement(vT,{scope:n,content:C,viewport:T,onViewportChange:N,itemRefCallback:L,selectedItem:O,onItemLeave:ue,itemTextRefCallback:Ne,focusSelectedItem:J,selectedItemText:z,position:r,isPositioned:te,searchRef:Q},d.createElement(og,{as:Qo,allowPinchZoom:!0},d.createElement(tg,{asChild:!0,trapped:b.open,onMountAutoFocus:me=>{me.preventDefault()},onUnmountAutoFocus:fe(o,me=>{var be;(be=b.trigger)===null||be===void 0||be.focus({preventScroll:!0}),me.preventDefault()})},d.createElement(Rc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:me=>me.preventDefault(),onDismiss:()=>b.onOpenChange(!1)},d.createElement(Ke,Y({role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:me=>me.preventDefault()},_,Me,{onPlaced:()=>W(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:fe(_.onKeyDown,me=>{const be=me.ctrlKey||me.altKey||me.metaKey;if(me.key==="Tab"&&me.preventDefault(),!be&&me.key.length===1&&le(me.key),["ArrowUp","ArrowDown","Home","End"].includes(me.key)){let Oe=K().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(me.key)&&(Oe=Oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(me.key)){const Ie=me.target,ze=Oe.indexOf(Ie);Oe=Oe.slice(ze+1)}setTimeout(()=>H(Oe)),me.preventDefault()}})}))))))}),VG=d.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ba(hc,n),s=za(hc,n),[l,u]=d.useState(null),[f,m]=d.useState(null),p=We(t,A=>m(A)),g=dg(n),y=d.useRef(!1),x=d.useRef(!0),{viewport:S,selectedItem:E,selectedItemText:_,focusSelectedItem:b}=s,C=d.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&f&&S&&E&&_){const A=i.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),z=_.getBoundingClientRect();if(i.dir!=="rtl"){const Ie=z.left-O.left,ze=U.left-Ie,ht=A.left-ze,st=A.width+ht,Yt=Math.max(st,O.width),rr=window.innerWidth-gi,en=hd(ze,[gi,rr-Yt]);l.style.minWidth=st+"px",l.style.left=en+"px"}else{const Ie=O.right-z.right,ze=window.innerWidth-U.right-Ie,ht=window.innerWidth-A.right-ze,st=A.width+ht,Yt=Math.max(st,O.width),rr=window.innerWidth-gi,en=hd(ze,[gi,rr-Yt]);l.style.minWidth=st+"px",l.style.right=en+"px"}const ie=g(),K=window.innerHeight-gi*2,te=S.scrollHeight,W=window.getComputedStyle(f),re=parseInt(W.borderTopWidth,10),H=parseInt(W.paddingTop,10),J=parseInt(W.borderBottomWidth,10),G=parseInt(W.paddingBottom,10),Z=re+H+te+G+J,Q=Math.min(E.offsetHeight*5,Z),le=window.getComputedStyle(S),L=parseInt(le.paddingTop,10),ue=parseInt(le.paddingBottom,10),Ne=A.top+A.height/2-gi,Ke=K-Ne,Me=E.offsetHeight/2,me=E.offsetTop+Me,be=re+H+me,Ee=Z-be;if(be<=Ne){const Ie=E===ie[ie.length-1].ref.current;l.style.bottom="0px";const ze=f.clientHeight-S.offsetTop-S.offsetHeight,ht=Math.max(Ke,Me+(Ie?ue:0)+ze+J),st=be+ht;l.style.height=st+"px"}else{const Ie=E===ie[0].ref.current;l.style.top="0px";const ht=Math.max(Ne,re+S.offsetTop+(Ie?L:0)+Me)+Ee;l.style.height=ht+"px",S.scrollTop=be-Ne+S.offsetTop}l.style.margin=`${gi}px 0`,l.style.minHeight=Q+"px",l.style.maxHeight=K+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[g,i.trigger,i.valueNode,l,f,S,E,_,i.dir,r]);Tn(()=>C(),[C]);const[R,T]=d.useState();Tn(()=>{f&&T(window.getComputedStyle(f).zIndex)},[f]);const N=d.useCallback(A=>{A&&x.current===!0&&(C(),b==null||b(),x.current=!1)},[C,b]);return d.createElement(WG,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:N},d.createElement("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R}},d.createElement(Ae.div,Y({},o,{ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),_2=d.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=gi,...i}=e,s=Zx(n);return d.createElement(qm,Y({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[WG,qx]=Oc(hc,{}),E2="SelectViewport",HG=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=za(E2,n),i=qx(E2,n),s=We(t,o.onViewportChange),l=d.useRef(0);return d.createElement(d.Fragment,null,d.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),d.createElement(ug.Slot,{scope:n},d.createElement(Ae.div,Y({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:fe(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&m){const g=Math.abs(l.current-f.scrollTop);if(g>0){const y=window.innerHeight-gi*2,x=parseFloat(m.style.minHeight),S=parseFloat(m.style.height),E=Math.max(x,S);if(E<y){const _=E+g,b=Math.min(y,_),C=_-b;m.style.height=b+"px",m.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,m.style.justifyContent="flex-end")}}}l.current=f.scrollTop})}))))}),KG="SelectGroup",[GG,YG]=Oc(KG),XG=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=tr();return d.createElement(GG,{scope:n,id:o},d.createElement(Ae.div,Y({role:"group","aria-labelledby":o},r,{ref:t})))}),ZG="SelectLabel",qG=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=YG(ZG,n);return d.createElement(Ae.div,Y({id:o.id},r,{ref:t}))}),T1="SelectItem",[QG,yT]=Oc(T1),JG=d.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,l=Ba(T1,n),u=za(T1,n),f=l.value===r,[m,p]=d.useState(i??""),[g,y]=d.useState(!1),x=We(t,_=>{var b;return(b=u.itemRefCallback)===null||b===void 0?void 0:b.call(u,_,r,o)}),S=tr(),E=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.createElement(QG,{scope:n,value:r,disabled:o,textId:S,isSelected:f,onItemTextChange:d.useCallback(_=>{p(b=>{var C;return b||((C=_==null?void 0:_.textContent)!==null&&C!==void 0?C:"").trim()})},[])},d.createElement(ug.ItemSlot,{scope:n,value:r,disabled:o,textValue:m},d.createElement(Ae.div,Y({role:"option","aria-labelledby":S,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:x,onFocus:fe(s.onFocus,()=>y(!0)),onBlur:fe(s.onBlur,()=>y(!1)),onPointerUp:fe(s.onPointerUp,E),onPointerMove:fe(s.onPointerMove,_=>{if(o){var b;(b=u.onItemLeave)===null||b===void 0||b.call(u)}else _.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(s.onPointerLeave,_=>{if(_.currentTarget===document.activeElement){var b;(b=u.onItemLeave)===null||b===void 0||b.call(u)}}),onKeyDown:fe(s.onKeyDown,_=>{var b;((b=u.searchRef)===null||b===void 0?void 0:b.current)!==""&&_.key===" "||(PG.includes(_.key)&&E(),_.key===" "&&_.preventDefault())})}))))}),Rh="SelectItemText",eY=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Ba(Rh,n),l=za(Rh,n),u=yT(Rh,n),f=OG(Rh,n),[m,p]=d.useState(null),g=We(t,_=>p(_),u.onItemTextChange,_=>{var b;return(b=l.itemTextRefCallback)===null||b===void 0?void 0:b.call(l,_,u.value,u.disabled)}),y=m==null?void 0:m.textContent,x=d.useMemo(()=>d.createElement("option",{key:u.value,value:u.value,disabled:u.disabled},y),[u.disabled,u.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:E}=f;return Tn(()=>(S(x),()=>E(x)),[S,E,x]),d.createElement(d.Fragment,null,d.createElement(Ae.span,Y({id:u.textId},i,{ref:g})),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Bs.createPortal(i.children,s.valueNode):null)}),tY="SelectItemIndicator",nY=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return yT(tY,n).isSelected?d.createElement(Ae.span,Y({"aria-hidden":!0},r,{ref:t})):null}),C2="SelectScrollUpButton",rY=d.forwardRef((e,t)=>{const n=za(C2,e.__scopeSelect),r=qx(C2,e.__scopeSelect),[o,i]=d.useState(!1),s=We(t,r.onScrollButtonChange);return Tn(()=>{if(n.viewport&&n.isPositioned){let f=function(){const m=u.scrollTop>0;i(m)};var l=f;const u=n.viewport;return f(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),o?d.createElement(wT,Y({},e,{ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}})):null}),$2="SelectScrollDownButton",oY=d.forwardRef((e,t)=>{const n=za($2,e.__scopeSelect),r=qx($2,e.__scopeSelect),[o,i]=d.useState(!1),s=We(t,r.onScrollButtonChange);return Tn(()=>{if(n.viewport&&n.isPositioned){let f=function(){const m=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<m;i(p)};var l=f;const u=n.viewport;return f(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),o?d.createElement(wT,Y({},e,{ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}})):null}),wT=d.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=za("SelectScrollButton",n),s=d.useRef(null),l=dg(n),u=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>u(),[u]),Tn(()=>{var f;const m=l().find(p=>p.ref.current===document.activeElement);m==null||(f=m.ref.current)===null||f===void 0||f.scrollIntoView({block:"nearest"})},[l]),d.createElement(Ae.div,Y({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:fe(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:fe(o.onPointerMove,()=>{var f;(f=i.onItemLeave)===null||f===void 0||f.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:fe(o.onPointerLeave,()=>{u()})}))}),iY=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.createElement(Ae.div,Y({"aria-hidden":!0},r,{ref:t}))});function xT(e){return e===""||e===void 0}const bT=d.forwardRef((e,t)=>{const{value:n,...r}=e,o=d.useRef(null),i=We(t,o),s=Xx(n);return d.useEffect(()=>{const l=o.current,u=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==n&&m){const p=new Event("change",{bubbles:!0});m.call(l,n),l.dispatchEvent(p)}},[s,n]),d.createElement(Qm,{asChild:!0},d.createElement("select",Y({},r,{ref:i,defaultValue:n})))});bT.displayName="BubbleSelect";function ST(e){const t=Lt(e),n=d.useRef(""),r=d.useRef(0),o=d.useCallback(s=>{const l=n.current+s;t(l),function u(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[t]),i=d.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function _T(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=sY(e,Math.max(i,0));o.length===1&&(s=s.filter(f=>f!==n));const u=s.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function sY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const aY=NG,ET=IG,lY=jG,cY=FG,uY=BG,CT=zG,dY=HG,fY=XG,$T=qG,RT=JG,hY=eY,pY=nY,kT=rY,PT=oY,TT=iY,xo=aY,zo=fY,bo=lY,Hr=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(ET,{ref:r,className:xe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent pl-2 pr-1 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),tabIndex:-1,...n,children:[t,v.jsx(cY,{asChild:!0,children:v.jsx(nB,{className:"h-4 w-4 opacity-50"})})]}));Hr.displayName=ET.displayName;const AT=d.forwardRef(({className:e,...t},n)=>v.jsx(kT,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(cB,{})}));AT.displayName=kT.displayName;const MT=d.forwardRef(({className:e,...t},n)=>v.jsx(PT,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(iB,{})}));MT.displayName=PT.displayName;const Kr=d.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>v.jsx(uY,{children:v.jsxs(CT,{ref:o,className:xe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,onCloseAutoFocus:i=>i.preventDefault(),...r,children:[v.jsx(AT,{}),v.jsx(dY,{className:xe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(MT,{})]})}));Kr.displayName=CT.displayName;const mY=d.forwardRef(({className:e,...t},n)=>v.jsx($T,{ref:n,className:xe("px-2 py-1.5 text-sm font-semibold",e),...t}));mY.displayName=$T.displayName;const Gr=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(RT,{ref:r,className:xe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(pY,{children:v.jsx(kk,{className:"h-4 w-4"})})}),v.jsx(hY,{children:t})]}));Gr.displayName=RT.displayName;const gY=d.forwardRef(({className:e,...t},n)=>v.jsx(TT,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));gY.displayName=TT.displayName;function vY(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const OT="ScrollArea",[NT,$te]=An(OT),[yY,ro]=NT(OT),wY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[l,u]=d.useState(null),[f,m]=d.useState(null),[p,g]=d.useState(null),[y,x]=d.useState(null),[S,E]=d.useState(null),[_,b]=d.useState(0),[C,R]=d.useState(0),[T,N]=d.useState(!1),[A,O]=d.useState(!1),U=We(t,ie=>u(ie)),z=Mc(o);return d.createElement(yY,{scope:n,type:r,dir:z,scrollHideDelay:i,scrollArea:l,viewport:f,onViewportChange:m,content:p,onContentChange:g,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:T,onScrollbarXEnabledChange:N,scrollbarY:S,onScrollbarYChange:E,scrollbarYEnabled:A,onScrollbarYEnabledChange:O,onCornerWidthChange:b,onCornerHeightChange:R},d.createElement(Ae.div,Y({dir:z},s,{ref:U,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})))}),xY="ScrollAreaViewport",bY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=ro(xY,n),s=d.useRef(null),l=We(t,s,i.onViewportChange);return d.createElement(d.Fragment,null,d.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),d.createElement(Ae.div,Y({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),d.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Ii="ScrollAreaScrollbar",DT=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ro(Ii,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,l=e.orientation==="horizontal";return d.useEffect(()=>(l?i(!0):s(!0),()=>{l?i(!1):s(!1)}),[l,i,s]),o.type==="hover"?d.createElement(SY,Y({},r,{ref:t,forceMount:n})):o.type==="scroll"?d.createElement(_Y,Y({},r,{ref:t,forceMount:n})):o.type==="auto"?d.createElement(IT,Y({},r,{ref:t,forceMount:n})):o.type==="always"?d.createElement(Qx,Y({},r,{ref:t})):null}),SY=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ro(Ii,e.__scopeScrollArea),[i,s]=d.useState(!1);return d.useEffect(()=>{const l=o.scrollArea;let u=0;if(l){const f=()=>{window.clearTimeout(u),s(!0)},m=()=>{u=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),d.createElement(Sn,{present:n||i},d.createElement(IT,Y({"data-state":i?"visible":"hidden"},r,{ref:t})))}),_Y=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ro(Ii,e.__scopeScrollArea),i=e.orientation==="horizontal",s=hg(()=>u("SCROLL_END"),100),[l,u]=vY("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,o.scrollHideDelay,u]),d.useEffect(()=>{const f=o.viewport,m=i?"scrollLeft":"scrollTop";if(f){let p=f[m];const g=()=>{const y=f[m];p!==y&&(u("SCROLL"),s()),p=y};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[o.viewport,i,u,s]),d.createElement(Sn,{present:n||l!=="hidden"},d.createElement(Qx,Y({"data-state":l==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:fe(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:fe(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),IT=d.forwardRef((e,t)=>{const n=ro(Ii,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=d.useState(!1),l=e.orientation==="horizontal",u=hg(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;s(l?f:m)}},10);return pc(n.viewport,u),pc(n.content,u),d.createElement(Sn,{present:r||i},d.createElement(Qx,Y({"data-state":i?"visible":"hidden"},o,{ref:t})))}),Qx=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ro(Ii,e.__scopeScrollArea),i=d.useRef(null),s=d.useRef(0),[l,u]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=BT(l.viewport,l.content),m={...r,sizes:l,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:g=>s.current=g};function p(g,y){return AY(g,s.current,l,y)}return n==="horizontal"?d.createElement(EY,Y({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const g=o.viewport.scrollLeft,y=R2(g,l,o.dir);i.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=p(g,o.dir))}})):n==="vertical"?d.createElement(CY,Y({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const g=o.viewport.scrollTop,y=R2(g,l);i.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=p(g))}})):null}),EY=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ro(Ii,e.__scopeScrollArea),[s,l]=d.useState(),u=d.useRef(null),f=We(t,u,i.onScrollbarXChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(jT,Y({"data-orientation":"horizontal"},o,{ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":fg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(i.viewport){const g=i.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),UT(g,p)&&m.preventDefault()}},onResize:()=>{u.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Xp(s.paddingLeft),paddingEnd:Xp(s.paddingRight)}})}}))}),CY=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ro(Ii,e.__scopeScrollArea),[s,l]=d.useState(),u=d.useRef(null),f=We(t,u,i.onScrollbarYChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(jT,Y({"data-orientation":"vertical"},o,{ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":fg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(i.viewport){const g=i.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),UT(g,p)&&m.preventDefault()}},onResize:()=>{u.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Xp(s.paddingTop),paddingEnd:Xp(s.paddingBottom)}})}}))}),[$Y,LT]=NT(Ii),jT=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:m,onResize:p,...g}=e,y=ro(Ii,n),[x,S]=d.useState(null),E=We(t,U=>S(U)),_=d.useRef(null),b=d.useRef(""),C=y.viewport,R=r.content-r.viewport,T=Lt(m),N=Lt(u),A=hg(p,10);function O(U){if(_.current){const z=U.clientX-_.current.left,ie=U.clientY-_.current.top;f({x:z,y:ie})}}return d.useEffect(()=>{const U=z=>{const ie=z.target;(x==null?void 0:x.contains(ie))&&T(z,R)};return document.addEventListener("wheel",U,{passive:!1}),()=>document.removeEventListener("wheel",U,{passive:!1})},[C,x,R,T]),d.useEffect(N,[r,N]),pc(x,A),pc(y.content,A),d.createElement($Y,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Lt(i),onThumbPointerUp:Lt(s),onThumbPositionChange:N,onThumbPointerDown:Lt(l)},d.createElement(Ae.div,Y({},g,{ref:E,style:{position:"absolute",...g.style},onPointerDown:fe(e.onPointerDown,U=>{U.button===0&&(U.target.setPointerCapture(U.pointerId),_.current=x.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),O(U))}),onPointerMove:fe(e.onPointerMove,O),onPointerUp:fe(e.onPointerUp,U=>{const z=U.target;z.hasPointerCapture(U.pointerId)&&z.releasePointerCapture(U.pointerId),document.body.style.webkitUserSelect=b.current,y.viewport&&(y.viewport.style.scrollBehavior=""),_.current=null})})))}),A1="ScrollAreaThumb",RY=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=LT(A1,e.__scopeScrollArea);return d.createElement(Sn,{present:n||o.hasThumb},d.createElement(kY,Y({ref:t},r)))}),kY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ro(A1,n),s=LT(A1,n),{onThumbPositionChange:l}=s,u=We(t,p=>s.onThumbChange(p)),f=d.useRef(),m=hg(()=>{f.current&&(f.current(),f.current=void 0)},100);return d.useEffect(()=>{const p=i.viewport;if(p){const g=()=>{if(m(),!f.current){const y=MY(p,l);f.current=y,l()}};return l(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[i.viewport,m,l]),d.createElement(Ae.div,Y({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:fe(e.onPointerDownCapture,p=>{const y=p.target.getBoundingClientRect(),x=p.clientX-y.left,S=p.clientY-y.top;s.onThumbPointerDown({x,y:S})}),onPointerUp:fe(e.onPointerUp,s.onThumbPointerUp)}))}),FT="ScrollAreaCorner",PY=d.forwardRef((e,t)=>{const n=ro(FT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.createElement(TY,Y({},e,{ref:t})):null}),TY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ro(FT,n),[i,s]=d.useState(0),[l,u]=d.useState(0),f=!!(i&&l);return pc(o.scrollbarX,()=>{var m;const p=((m=o.scrollbarX)===null||m===void 0?void 0:m.offsetHeight)||0;o.onCornerHeightChange(p),u(p)}),pc(o.scrollbarY,()=>{var m;const p=((m=o.scrollbarY)===null||m===void 0?void 0:m.offsetWidth)||0;o.onCornerWidthChange(p),s(p)}),f?d.createElement(Ae.div,Y({},r,{ref:t,style:{width:i,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Xp(e){return e?parseInt(e,10):0}function BT(e,t){const n=e/t;return isNaN(n)?0:n}function fg(e){const t=BT(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function AY(e,t,n,r="ltr"){const o=fg(n),i=o/2,s=t||i,l=o-s,u=n.scrollbar.paddingStart+s,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return zT([u,f],p)(e)}function R2(e,t,n="ltr"){const r=fg(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,l=i-r,u=n==="ltr"?[0,s]:[s*-1,0],f=hd(e,u);return zT([0,s],[0,l])(f)}function zT(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function UT(e,t){return e>0&&e<t}const MY=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,l=n.top!==i.top;(s||l)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function hg(e,t){const n=Lt(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function pc(e,t){const n=Lt(t);Tn(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const VT=wY,OY=bY,NY=PY,pg=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(VT,{ref:r,className:xe("relative overflow-hidden",e),scrollHideDelay:400,...n,children:[v.jsx(OY,{className:"h-full w-full rounded-[inherit]",children:t}),v.jsx(WT,{}),v.jsx(NY,{})]}));pg.displayName=VT.displayName;const WT=d.forwardRef(({className:e,orientation:t="vertical",...n},r)=>v.jsx(DT,{ref:r,orientation:t,className:xe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:v.jsx(RY,{className:"relative flex-1 rounded-full bg-border"})}));WT.displayName=DT.displayName;const HT="Name",KT="Created time",GT="Modified time",k2="input",DY="output",YT="mask",P2={[ks.NAME]:HT,[ks.CTIME]:KT,[ks.MTIME]:GT};function IY(e){const{onPhotoClick:t,photoWidth:n}=e,[r,o]=zx(!1),[i,s]=xt(z=>[z.fileManagerState,z.updateFileManagerState]),{toast:l}=Ld(),[u,f]=d.useState(0),[m,p]=d.useState(0),g=d.useRef(null),y=pV(i.searchText,300),[x,S]=d.useState(k2),[E,_]=d.useState([]),[b,C]=d.useState([]),[R,T]=d.useState(0);Xn("f",()=>{o()}),Xn("left",()=>{let z=R;R>0&&(z=R-1),T(z),t(x,b[z].name)},[R,b]),Xn("right",()=>{let z=R;R<b.length-1&&(z=R+1),T(z),t(x,b[z].name)},[R,b]),d.useEffect(()=>{r||p(u)},[r,u]);const N=d.useCallback(z=>{z!==null&&r&&setTimeout(()=>{z.scrollTo({top:m,left:0})},100)},[r,m]);d.useEffect(()=>{(async()=>{try{const ie=await ZF(x);_(ie)}catch(ie){l({variant:"destructive",title:"Uh oh! Something went wrong.",description:ie.message?ie.message:ie.toString()})}})()},[x]),d.useEffect(()=>{if(!r)return;(async()=>{try{let ie=E;y&&(ie=new Ac(ie,{keys:["name"]}).search(y).map(re=>ie[re.refIndex])),ie=$H.orderBy(ie,i.sortBy,i.sortOrder);const K=ie.map(te=>{const W=n,re=te.height*(W/te.width);return{src:`${Ni}/media_thumbnail_file?tab=${x}&filename=${encodeURIComponent(te.name)}&width=${Math.ceil(W)}&height=${Math.ceil(re)}`,height:re,width:W,name:te.name}});C(K)}catch(ie){l({variant:"destructive",title:"Uh oh! Something went wrong.",description:ie.message?ie.message:ie.toString()})}})()},[E,y,i,n,r]);const A=z=>{f(z.currentTarget.scrollTop)},O=({index:z})=>{o(),T(z),t(x,b[z].name)},U=()=>v.jsxs("div",{className:"flex justify-start items-center gap-[12px]",children:[v.jsx("div",{children:`Images (${b.length})`}),v.jsxs("div",{className:"flex",children:[v.jsx(yn,{tooltip:"Rows layout",onClick:()=>{s({layout:"rows"})},children:v.jsx(xB,{className:i.layout!=="rows"?"opacity-50":""})}),v.jsx(yn,{tooltip:"Grid layout",onClick:()=>{s({layout:"masonry"})},children:v.jsx(yB,{className:i.layout!=="masonry"?"opacity-50":""})})]})]});return v.jsxs(sg,{open:r,onOpenChange:o,children:[v.jsx(SP,{asChild:!0,children:v.jsx(yn,{tooltip:"File Manager",children:v.jsx(sV,{})})}),v.jsxs(Hd,{className:"h-4/5 max-w-6xl",children:[v.jsx(Kd,{children:U()}),v.jsxs("div",{className:"flex justify-between gap-8 items-center",children:[v.jsxs("div",{className:"flex relative justify-start items-center",children:[v.jsx(pB,{className:"absolute left-[8px]"}),v.jsx(Gm,{ref:g,value:i.searchText,className:"w-[250px] pl-[30px]",tabIndex:-1,onInput:z=>{z.preventDefault(),z.stopPropagation();const ie=z.target;s({searchText:ie.value})},placeholder:"Search by file name"})]}),v.jsx(gT,{defaultValue:x,onValueChange:z=>S(z),children:v.jsxs(Yx,{"aria-label":"Manage your account",children:[v.jsx(ys,{value:k2,children:"Image Directory"}),v.jsx(ys,{value:DY,children:"Output Directory"}),v.jsx(ys,{value:YT,children:"Mask Directory"})]})}),v.jsx("div",{className:"flex gap-2",children:v.jsxs("div",{className:"flex gap-1",children:[v.jsxs(xo,{value:P2[i.sortBy],onValueChange:z=>{switch(z){case HT:s({sortBy:ks.NAME});break;case KT:s({sortBy:ks.CTIME});break;case GT:s({sortBy:ks.MTIME});break}},children:[v.jsx(Hr,{className:"w-[140px]",children:v.jsx(bo,{})}),v.jsx(Kr,{children:Object.values(P2).map(z=>v.jsx(Gr,{value:z,children:z},z))})]}),i.sortOrder===Nu.DESCENDING?v.jsx(yn,{tooltip:"Descending Order",onClick:()=>{s({sortOrder:Nu.ASCENDING})},children:v.jsx(dK,{})}):v.jsx(yn,{tooltip:"Ascending Order",onClick:()=>{s({sortOrder:Nu.DESCENDING})},children:v.jsx(pK,{})})]})})]}),v.jsx(pg,{className:"w-full h-full rounded-md",onScroll:A,ref:N,children:v.jsx(lK,{layout:i.layout,photos:b,spacing:12,padding:0,onClick:O})})]})]})}var Yd=e=>e.type==="checkbox",Pl=e=>e instanceof Date,Fn=e=>e==null;const XT=e=>typeof e=="object";var an=e=>!Fn(e)&&!Array.isArray(e)&&XT(e)&&!Pl(e),ZT=e=>an(e)&&e.target?Yd(e.target)?e.target.checked:e.target.value:e,LY=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qT=(e,t)=>e.has(LY(t)),jY=e=>{const t=e.constructor&&e.constructor.prototype;return an(t)&&t.hasOwnProperty("isPrototypeOf")},Jx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function po(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Jx&&(e instanceof Blob||e instanceof FileList))&&(n||an(e)))if(t=n?[]:{},!n&&!jY(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=po(e[r]));else return e;return t}var Xd=e=>Array.isArray(e)?e.filter(Boolean):[],Wt=e=>e===void 0,ye=(e,t,n)=>{if(!t||!an(e))return n;const r=Xd(t.split(/[,[\].]+?/)).reduce((o,i)=>Fn(o)?o:o[i],e);return Wt(r)||r===e?Wt(e[t])?n:e[t]:r},Uo=e=>typeof e=="boolean";const Zp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},So={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},hi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},QT=Be.createContext(null),mg=()=>Be.useContext(QT),FY=e=>{const{children:t,...n}=e;return Be.createElement(QT.Provider,{value:n},t)};var JT=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==So.all&&(t._proxyFormState[s]=!r||So.all),n&&(n[s]=!0),e[s]}});return o},Fr=e=>an(e)&&!Object.keys(e).length,e3=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Fr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||So.all))},sp=e=>Array.isArray(e)?e:[e],t3=(e,t,n)=>!e||!t||e===t||sp(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function eb(e){const t=Be.useRef(e);t.current=e,Be.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function BY(e){const t=mg(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[s,l]=Be.useState(n._formState),u=Be.useRef(!0),f=Be.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),m=Be.useRef(o);return m.current=o,eb({disabled:r,next:p=>u.current&&t3(m.current,p.name,i)&&e3(p,f.current,n._updateFormState)&&l({...n._formState,...p}),subject:n._subjects.state}),Be.useEffect(()=>(u.current=!0,f.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),JT(s,n,f.current,!1)}var Ko=e=>typeof e=="string",n3=(e,t,n,r,o)=>Ko(e)?(r&&t.watch.add(e),ye(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),ye(n,i))):(r&&(t.watchAll=!0),n);function zY(e){const t=mg(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:s}=e||{},l=Be.useRef(r);l.current=r,eb({disabled:i,subject:n._subjects.values,next:m=>{t3(l.current,m.name,s)&&f(po(n3(l.current,n._names,m.values||n._formValues,!1,o)))}});const[u,f]=Be.useState(n._getWatch(r,o));return Be.useEffect(()=>n._removeUnmounted()),u}var tb=e=>/^\w*$/.test(e),r3=e=>Xd(e.replace(/["|']|\]/g,"").split(/\.|\[/));function wt(e,t,n){let r=-1;const o=tb(t)?[t]:r3(t),i=o.length,s=i-1;for(;++r<i;){const l=o[r];let u=n;if(r!==s){const f=e[l];u=an(f)||Array.isArray(f)?f:isNaN(+o[r+1])?{}:[]}e[l]=u,e=e[l]}return e}function UY(e){const t=mg(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i}=e,s=qT(o._names.array,n),l=zY({control:o,name:n,defaultValue:ye(o._formValues,n,ye(o._defaultValues,n,e.defaultValue)),exact:!0}),u=BY({control:o,name:n}),f=Be.useRef(o.register(n,{...e.rules,value:l}));return f.current=o.register(n,e.rules),Be.useEffect(()=>{const m=o._options.shouldUnregister||i,p=(g,y)=>{const x=ye(o._fields,g);x&&(x._f.mount=y)};if(p(n,!0),m){const g=po(ye(o._options.defaultValues,n));wt(o._defaultValues,n,g),Wt(ye(o._formValues,n))&&wt(o._formValues,n,g)}return()=>{(s?m&&!o._state.action:m)?o.unregister(n):p(n,!1)}},[n,o,s,i]),Be.useEffect(()=>{ye(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n,value:ye(o._fields,n)._f.value})},[r,n,o]),{field:{name:n,value:l,...Uo(r)||Uo(u.disabled)?{disabled:u.disabled||r}:{},onChange:Be.useCallback(m=>f.current.onChange({target:{value:ZT(m),name:n},type:Zp.CHANGE}),[n]),onBlur:Be.useCallback(()=>f.current.onBlur({target:{value:ye(o._formValues,n),name:n},type:Zp.BLUR}),[n,o]),ref:m=>{const p=ye(o._fields,n);p&&m&&(p._f.ref={focus:()=>m.focus(),select:()=>m.select(),setCustomValidity:g=>m.setCustomValidity(g),reportValidity:()=>m.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ye(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!ye(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ye(u.touchedFields,n)},error:{enumerable:!0,get:()=>ye(u.errors,n)}})}}const VY=e=>e.render(UY(e));var o3=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},T2=e=>({isOnSubmit:!e||e===So.onSubmit,isOnBlur:e===So.onBlur,isOnChange:e===So.onChange,isOnAll:e===So.all,isOnTouch:e===So.onTouched}),A2=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const ap=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=ye(e,o);if(i){const{_f:s,...l}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!r)break;if(s.ref&&t(s.ref,s.name)&&!r)break}else an(l)&&ap(l,t)}}};var WY=(e,t,n)=>{const r=Xd(ye(e,n));return wt(r,"root",t[n]),wt(e,n,r),e},nb=e=>e.type==="file",ws=e=>typeof e=="function",qp=e=>{if(!Jx)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},lp=e=>Ko(e),rb=e=>e.type==="radio",Qp=e=>e instanceof RegExp;const M2={value:!1,isValid:!1},O2={value:!0,isValid:!0};var i3=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Wt(e[0].attributes.value)?Wt(e[0].value)||e[0].value===""?O2:{value:e[0].value,isValid:!0}:O2:M2}return M2};const N2={isValid:!1,value:null};var s3=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,N2):N2;function D2(e,t,n="validate"){if(lp(e)||Array.isArray(e)&&e.every(lp)||Uo(e)&&!e)return{type:n,message:lp(e)?e:"",ref:t}}var cl=e=>an(e)&&!Qp(e)?e:{value:e,message:""},I2=async(e,t,n,r,o)=>{const{ref:i,refs:s,required:l,maxLength:u,minLength:f,min:m,max:p,pattern:g,validate:y,name:x,valueAsNumber:S,mount:E,disabled:_}=e._f,b=ye(t,x);if(!E||_)return{};const C=s?s[0]:i,R=K=>{r&&C.reportValidity&&(C.setCustomValidity(Uo(K)?"":K||""),C.reportValidity())},T={},N=rb(i),A=Yd(i),O=N||A,U=(S||nb(i))&&Wt(i.value)&&Wt(b)||qp(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,z=o3.bind(null,x,n,T),ie=(K,te,W,re=hi.maxLength,H=hi.minLength)=>{const J=K?te:W;T[x]={type:K?re:H,message:J,ref:i,...z(K?re:H,J)}};if(o?!Array.isArray(b)||!b.length:l&&(!O&&(U||Fn(b))||Uo(b)&&!b||A&&!i3(s).isValid||N&&!s3(s).isValid)){const{value:K,message:te}=lp(l)?{value:!!l,message:l}:cl(l);if(K&&(T[x]={type:hi.required,message:te,ref:C,...z(hi.required,te)},!n))return R(te),T}if(!U&&(!Fn(m)||!Fn(p))){let K,te;const W=cl(p),re=cl(m);if(!Fn(b)&&!isNaN(b)){const H=i.valueAsNumber||b&&+b;Fn(W.value)||(K=H>W.value),Fn(re.value)||(te=H<re.value)}else{const H=i.valueAsDate||new Date(b),J=Q=>new Date(new Date().toDateString()+" "+Q),G=i.type=="time",Z=i.type=="week";Ko(W.value)&&b&&(K=G?J(b)>J(W.value):Z?b>W.value:H>new Date(W.value)),Ko(re.value)&&b&&(te=G?J(b)<J(re.value):Z?b<re.value:H<new Date(re.value))}if((K||te)&&(ie(!!K,W.message,re.message,hi.max,hi.min),!n))return R(T[x].message),T}if((u||f)&&!U&&(Ko(b)||o&&Array.isArray(b))){const K=cl(u),te=cl(f),W=!Fn(K.value)&&b.length>+K.value,re=!Fn(te.value)&&b.length<+te.value;if((W||re)&&(ie(W,K.message,te.message),!n))return R(T[x].message),T}if(g&&!U&&Ko(b)){const{value:K,message:te}=cl(g);if(Qp(K)&&!b.match(K)&&(T[x]={type:hi.pattern,message:te,ref:i,...z(hi.pattern,te)},!n))return R(te),T}if(y){if(ws(y)){const K=await y(b,t),te=D2(K,C);if(te&&(T[x]={...te,...z(hi.validate,te.message)},!n))return R(te.message),T}else if(an(y)){let K={};for(const te in y){if(!Fr(K)&&!n)break;const W=D2(await y[te](b,t),C,te);W&&(K={...W,...z(te,W.message)},R(W.message),n&&(T[x]=K))}if(!Fr(K)&&(T[x]={ref:C,...K},!n))return T}}return R(!0),T};function HY(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Wt(e)?r++:e[t[r++]];return e}function KY(e){for(const t in e)if(e.hasOwnProperty(t)&&!Wt(e[t]))return!1;return!0}function mn(e,t){const n=Array.isArray(t)?t:tb(t)?[t]:r3(t),r=n.length===1?e:HY(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(an(r)&&Fr(r)||Array.isArray(r)&&KY(r))&&mn(e,n.slice(0,-1)),e}function z0(){let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}}var Jp=e=>Fn(e)||!XT(e);function va(e,t){if(Jp(e)||Jp(t))return e===t;if(Pl(e)&&Pl(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const s=t[o];if(Pl(i)&&Pl(s)||an(i)&&an(s)||Array.isArray(i)&&Array.isArray(s)?!va(i,s):i!==s)return!1}}return!0}var a3=e=>e.type==="select-multiple",GY=e=>rb(e)||Yd(e),U0=e=>qp(e)&&e.isConnected,l3=e=>{for(const t in e)if(ws(e[t]))return!0;return!1};function em(e,t={}){const n=Array.isArray(e);if(an(e)||n)for(const r in e)Array.isArray(e[r])||an(e[r])&&!l3(e[r])?(t[r]=Array.isArray(e[r])?[]:{},em(e[r],t[r])):Fn(e[r])||(t[r]=!0);return t}function c3(e,t,n){const r=Array.isArray(e);if(an(e)||r)for(const o in e)Array.isArray(e[o])||an(e[o])&&!l3(e[o])?Wt(t)||Jp(n[o])?n[o]=Array.isArray(e[o])?em(e[o],[]):{...em(e[o])}:c3(e[o],Fn(t)?{}:t[o],n[o]):n[o]=!va(e[o],t[o]);return n}var V0=(e,t)=>c3(e,t,em(t)),u3=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Wt(e)?e:t?e===""?NaN:e&&+e:n&&Ko(e)?new Date(e):r?r(e):e;function W0(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return nb(t)?t.files:rb(t)?s3(e.refs).value:a3(t)?[...t.selectedOptions].map(({value:n})=>n):Yd(t)?i3(e.refs).value:u3(Wt(t.value)?e.ref.value:t.value,e)}var YY=(e,t,n,r)=>{const o={};for(const i of e){const s=ye(t,i);s&&wt(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},du=e=>Wt(e)?e:Qp(e)?e.source:an(e)?Qp(e.value)?e.value.source:e.value:e,XY=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function L2(e,t,n){const r=ye(e,n);if(r||tb(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=ye(t,i),l=ye(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(l&&l.type)return{name:i,error:l};o.pop()}return{name:n}}var ZY=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,qY=(e,t)=>!Xd(ye(e,t)).length&&mn(e,t);const QY={mode:So.onSubmit,reValidateMode:So.onChange,shouldFocusError:!0};function JY(e={},t){let n={...QY,...e},r={submitCount:0,isDirty:!1,isLoading:ws(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},i=an(n.defaultValues)||an(n.values)?po(n.defaultValues||n.values)||{}:{},s=n.shouldUnregister?{}:po(i),l={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const p={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:z0(),array:z0(),state:z0()},y=e.resetOptions&&e.resetOptions.keepDirtyValues,x=T2(n.mode),S=T2(n.reValidateMode),E=n.criteriaMode===So.all,_=D=>X=>{clearTimeout(m),m=setTimeout(D,X)},b=async D=>{if(p.isValid||D){const X=n.resolver?Fr((await U()).errors):await ie(o,!0);X!==r.isValid&&g.state.next({isValid:X})}},C=D=>p.isValidating&&g.state.next({isValidating:D}),R=(D,X=[],ee,Se,pe=!0,he=!0)=>{if(Se&&ee){if(l.action=!0,he&&Array.isArray(ye(o,D))){const Pe=ee(ye(o,D),Se.argA,Se.argB);pe&&wt(o,D,Pe)}if(he&&Array.isArray(ye(r.errors,D))){const Pe=ee(ye(r.errors,D),Se.argA,Se.argB);pe&&wt(r.errors,D,Pe),qY(r.errors,D)}if(p.touchedFields&&he&&Array.isArray(ye(r.touchedFields,D))){const Pe=ee(ye(r.touchedFields,D),Se.argA,Se.argB);pe&&wt(r.touchedFields,D,Pe)}p.dirtyFields&&(r.dirtyFields=V0(i,s)),g.state.next({name:D,isDirty:te(D,X),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else wt(s,D,X)},T=(D,X)=>{wt(r.errors,D,X),g.state.next({errors:r.errors})},N=(D,X,ee,Se)=>{const pe=ye(o,D);if(pe){const he=ye(s,D,Wt(ee)?ye(i,D):ee);Wt(he)||Se&&Se.defaultChecked||X?wt(s,D,X?he:W0(pe._f)):H(D,he),l.mount&&b()}},A=(D,X,ee,Se,pe)=>{let he=!1,Pe=!1;const dt={name:D};if(!ee||Se){p.isDirty&&(Pe=r.isDirty,r.isDirty=dt.isDirty=te(),he=Pe!==dt.isDirty);const gt=va(ye(i,D),X);Pe=ye(r.dirtyFields,D),gt?mn(r.dirtyFields,D):wt(r.dirtyFields,D,!0),dt.dirtyFields=r.dirtyFields,he=he||p.dirtyFields&&Pe!==!gt}if(ee){const gt=ye(r.touchedFields,D);gt||(wt(r.touchedFields,D,ee),dt.touchedFields=r.touchedFields,he=he||p.touchedFields&&gt!==ee)}return he&&pe&&g.state.next(dt),he?dt:{}},O=(D,X,ee,Se)=>{const pe=ye(r.errors,D),he=p.isValid&&Uo(X)&&r.isValid!==X;if(e.delayError&&ee?(f=_(()=>T(D,ee)),f(e.delayError)):(clearTimeout(m),f=null,ee?wt(r.errors,D,ee):mn(r.errors,D)),(ee?!va(pe,ee):pe)||!Fr(Se)||he){const Pe={...Se,...he&&Uo(X)?{isValid:X}:{},errors:r.errors,name:D};r={...r,...Pe},g.state.next(Pe)}C(!1)},U=async D=>n.resolver(s,n.context,YY(D||u.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),z=async D=>{const{errors:X}=await U(D);if(D)for(const ee of D){const Se=ye(X,ee);Se?wt(r.errors,ee,Se):mn(r.errors,ee)}else r.errors=X;return X},ie=async(D,X,ee={valid:!0})=>{for(const Se in D){const pe=D[Se];if(pe){const{_f:he,...Pe}=pe;if(he){const dt=u.array.has(he.name),gt=await I2(pe,s,E,n.shouldUseNativeValidation&&!X,dt);if(gt[he.name]&&(ee.valid=!1,X))break;!X&&(ye(gt,he.name)?dt?WY(r.errors,gt,he.name):wt(r.errors,he.name,gt[he.name]):mn(r.errors,he.name))}Pe&&await ie(Pe,X,ee)}}return ee.valid},K=()=>{for(const D of u.unMount){const X=ye(o,D);X&&(X._f.refs?X._f.refs.every(ee=>!U0(ee)):!U0(X._f.ref))&&me(D)}u.unMount=new Set},te=(D,X)=>(D&&X&&wt(s,D,X),!va(L(),i)),W=(D,X,ee)=>n3(D,u,{...l.mount?s:Wt(X)?i:Ko(D)?{[D]:X}:X},ee,X),re=D=>Xd(ye(l.mount?s:i,D,e.shouldUnregister?ye(i,D,[]):[])),H=(D,X,ee={})=>{const Se=ye(o,D);let pe=X;if(Se){const he=Se._f;he&&(!he.disabled&&wt(s,D,u3(X,he)),pe=qp(he.ref)&&Fn(X)?"":X,a3(he.ref)?[...he.ref.options].forEach(Pe=>Pe.selected=pe.includes(Pe.value)):he.refs?Yd(he.ref)?he.refs.length>1?he.refs.forEach(Pe=>(!Pe.defaultChecked||!Pe.disabled)&&(Pe.checked=Array.isArray(pe)?!!pe.find(dt=>dt===Pe.value):pe===Pe.value)):he.refs[0]&&(he.refs[0].checked=!!pe):he.refs.forEach(Pe=>Pe.checked=Pe.value===pe):nb(he.ref)?he.ref.value="":(he.ref.value=pe,he.ref.type||g.values.next({name:D,values:{...s}})))}(ee.shouldDirty||ee.shouldTouch)&&A(D,pe,ee.shouldTouch,ee.shouldDirty,!0),ee.shouldValidate&&le(D)},J=(D,X,ee)=>{for(const Se in X){const pe=X[Se],he=`${D}.${Se}`,Pe=ye(o,he);(u.array.has(D)||!Jp(pe)||Pe&&!Pe._f)&&!Pl(pe)?J(he,pe,ee):H(he,pe,ee)}},G=(D,X,ee={})=>{const Se=ye(o,D),pe=u.array.has(D),he=po(X);wt(s,D,he),pe?(g.array.next({name:D,values:{...s}}),(p.isDirty||p.dirtyFields)&&ee.shouldDirty&&g.state.next({name:D,dirtyFields:V0(i,s),isDirty:te(D,he)})):Se&&!Se._f&&!Fn(he)?J(D,he,ee):H(D,he,ee),A2(D,u)&&g.state.next({...r}),g.values.next({name:D,values:{...s}}),!l.mount&&t()},Z=async D=>{const X=D.target;let ee=X.name,Se=!0;const pe=ye(o,ee),he=()=>X.type?W0(pe._f):ZT(D),Pe=dt=>{Se=Number.isNaN(dt)||dt===ye(s,ee,dt)};if(pe){let dt,gt;const Mn=he(),On=D.type===Zp.BLUR||D.type===Zp.FOCUS_OUT,ji=!XY(pe._f)&&!n.resolver&&!ye(r.errors,ee)&&!pe._f.deps||ZY(On,ye(r.touchedFields,ee),r.isSubmitted,S,x),Cr=A2(ee,u,On);wt(s,ee,Mn),On?(pe._f.onBlur&&pe._f.onBlur(D),f&&f(0)):pe._f.onChange&&pe._f.onChange(D);const $r=A(ee,Mn,On,!1),Ks=!Fr($r)||Cr;if(!On&&g.values.next({name:ee,type:D.type,values:{...s}}),ji)return p.isValid&&b(),Ks&&g.state.next({name:ee,...Cr?{}:$r});if(!On&&Cr&&g.state.next({...r}),C(!0),n.resolver){const{errors:ri}=await U([ee]);if(Pe(Mn),Se){const Fi=L2(r.errors,o,ee),or=L2(ri,o,Fi.name||ee);dt=or.error,ee=or.name,gt=Fr(ri)}}else dt=(await I2(pe,s,E,n.shouldUseNativeValidation))[ee],Pe(Mn),Se&&(dt?gt=!1:p.isValid&&(gt=await ie(o,!0)));Se&&(pe._f.deps&&le(pe._f.deps),O(ee,gt,dt,$r))}},Q=(D,X)=>{if(ye(r.errors,X)&&D.focus)return D.focus(),1},le=async(D,X={})=>{let ee,Se;const pe=sp(D);if(C(!0),n.resolver){const he=await z(Wt(D)?D:pe);ee=Fr(he),Se=D?!pe.some(Pe=>ye(he,Pe)):ee}else D?(Se=(await Promise.all(pe.map(async he=>{const Pe=ye(o,he);return await ie(Pe&&Pe._f?{[he]:Pe}:Pe)}))).every(Boolean),!(!Se&&!r.isValid)&&b()):Se=ee=await ie(o);return g.state.next({...!Ko(D)||p.isValid&&ee!==r.isValid?{}:{name:D},...n.resolver||!D?{isValid:ee}:{},errors:r.errors,isValidating:!1}),X.shouldFocus&&!Se&&ap(o,Q,D?pe:u.mount),Se},L=D=>{const X={...i,...l.mount?s:{}};return Wt(D)?X:Ko(D)?ye(X,D):D.map(ee=>ye(X,ee))},ue=(D,X)=>({invalid:!!ye((X||r).errors,D),isDirty:!!ye((X||r).dirtyFields,D),isTouched:!!ye((X||r).touchedFields,D),error:ye((X||r).errors,D)}),Ne=D=>{D&&sp(D).forEach(X=>mn(r.errors,X)),g.state.next({errors:D?r.errors:{}})},Ke=(D,X,ee)=>{const Se=(ye(o,D,{_f:{}})._f||{}).ref;wt(r.errors,D,{...X,ref:Se}),g.state.next({name:D,errors:r.errors,isValid:!1}),ee&&ee.shouldFocus&&Se&&Se.focus&&Se.focus()},Me=(D,X)=>ws(D)?g.values.subscribe({next:ee=>D(W(void 0,X),ee)}):W(D,X,!0),me=(D,X={})=>{for(const ee of D?sp(D):u.mount)u.mount.delete(ee),u.array.delete(ee),X.keepValue||(mn(o,ee),mn(s,ee)),!X.keepError&&mn(r.errors,ee),!X.keepDirty&&mn(r.dirtyFields,ee),!X.keepTouched&&mn(r.touchedFields,ee),!n.shouldUnregister&&!X.keepDefaultValue&&mn(i,ee);g.values.next({values:{...s}}),g.state.next({...r,...X.keepDirty?{isDirty:te()}:{}}),!X.keepIsValid&&b()},be=({disabled:D,name:X,field:ee,fields:Se,value:pe})=>{if(Uo(D)){const he=D?void 0:Wt(pe)?W0(ee?ee._f:ye(Se,X)._f):pe;wt(s,X,he),A(X,he,!1,!1,!0)}},Ee=(D,X={})=>{let ee=ye(o,D);const Se=Uo(X.disabled);return wt(o,D,{...ee||{},_f:{...ee&&ee._f?ee._f:{ref:{name:D}},name:D,mount:!0,...X}}),u.mount.add(D),ee?be({field:ee,disabled:X.disabled,name:D}):N(D,!0,X.value),{...Se?{disabled:X.disabled}:{},...n.progressive?{required:!!X.required,min:du(X.min),max:du(X.max),minLength:du(X.minLength),maxLength:du(X.maxLength),pattern:du(X.pattern)}:{},name:D,onChange:Z,onBlur:Z,ref:pe=>{if(pe){Ee(D,X),ee=ye(o,D);const he=Wt(pe.value)&&pe.querySelectorAll&&pe.querySelectorAll("input,select,textarea")[0]||pe,Pe=GY(he),dt=ee._f.refs||[];if(Pe?dt.find(gt=>gt===he):he===ee._f.ref)return;wt(o,D,{_f:{...ee._f,...Pe?{refs:[...dt.filter(U0),he,...Array.isArray(ye(i,D))?[{}]:[]],ref:{type:he.type,name:D}}:{ref:he}}}),N(D,!1,void 0,he)}else ee=ye(o,D,{}),ee._f&&(ee._f.mount=!1),(n.shouldUnregister||X.shouldUnregister)&&!(qT(u.array,D)&&l.action)&&u.unMount.add(D)}}},Oe=()=>n.shouldFocusError&&ap(o,Q,u.mount),Ie=D=>{Uo(D)&&(g.state.next({disabled:D}),ap(o,X=>{X.disabled=D},0,!1))},ze=(D,X)=>async ee=>{ee&&(ee.preventDefault&&ee.preventDefault(),ee.persist&&ee.persist());let Se=po(s);if(g.state.next({isSubmitting:!0}),n.resolver){const{errors:pe,values:he}=await U();r.errors=pe,Se=he}else await ie(o);mn(r.errors,"root"),Fr(r.errors)?(g.state.next({errors:{}}),await D(Se,ee)):(X&&await X({...r.errors},ee),Oe(),setTimeout(Oe)),g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fr(r.errors),submitCount:r.submitCount+1,errors:r.errors})},ht=(D,X={})=>{ye(o,D)&&(Wt(X.defaultValue)?G(D,ye(i,D)):(G(D,X.defaultValue),wt(i,D,X.defaultValue)),X.keepTouched||mn(r.touchedFields,D),X.keepDirty||(mn(r.dirtyFields,D),r.isDirty=X.defaultValue?te(D,ye(i,D)):te()),X.keepError||(mn(r.errors,D),p.isValid&&b()),g.state.next({...r}))},st=(D,X={})=>{const ee=D?po(D):i,Se=po(ee),pe=D&&!Fr(D)?Se:i;if(X.keepDefaultValues||(i=ee),!X.keepValues){if(X.keepDirtyValues||y)for(const he of u.mount)ye(r.dirtyFields,he)?wt(pe,he,ye(s,he)):G(he,ye(pe,he));else{if(Jx&&Wt(D))for(const he of u.mount){const Pe=ye(o,he);if(Pe&&Pe._f){const dt=Array.isArray(Pe._f.refs)?Pe._f.refs[0]:Pe._f.ref;if(qp(dt)){const gt=dt.closest("form");if(gt){gt.reset();break}}}}o={}}s=e.shouldUnregister?X.keepDefaultValues?po(i):{}:po(pe),g.array.next({values:{...pe}}),g.values.next({values:{...pe}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!p.isValid||!!X.keepIsValid,l.watch=!!e.shouldUnregister,g.state.next({submitCount:X.keepSubmitCount?r.submitCount:0,isDirty:X.keepDirty?r.isDirty:!!(X.keepDefaultValues&&!va(D,i)),isSubmitted:X.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:X.keepDirtyValues?r.dirtyFields:X.keepDefaultValues&&D?V0(i,D):{},touchedFields:X.keepTouched?r.touchedFields:{},errors:X.keepErrors?r.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Yt=(D,X)=>st(ws(D)?D(s):D,X);return{control:{register:Ee,unregister:me,getFieldState:ue,handleSubmit:ze,setError:Ke,_executeSchema:U,_getWatch:W,_getDirty:te,_updateValid:b,_removeUnmounted:K,_updateFieldArray:R,_updateDisabledField:be,_getFieldArray:re,_reset:st,_resetDefaultValues:()=>ws(n.defaultValues)&&n.defaultValues().then(D=>{Yt(D,n.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:D=>{r={...r,...D}},_disableForm:Ie,_subjects:g,_proxyFormState:p,get _fields(){return o},get _formValues(){return s},get _state(){return l},set _state(D){l=D},get _defaultValues(){return i},get _names(){return u},set _names(D){u=D},get _formState(){return r},set _formState(D){r=D},get _options(){return n},set _options(D){n={...n,...D}}},trigger:le,register:Ee,handleSubmit:ze,watch:Me,setValue:G,getValues:L,reset:Yt,resetField:ht,clearErrors:Ne,unregister:me,setError:Ke,setFocus:(D,X={})=>{const ee=ye(o,D),Se=ee&&ee._f;if(Se){const pe=Se.refs?Se.refs[0]:Se.ref;pe.focus&&(pe.focus(),X.shouldSelect&&pe.select())}},getFieldState:ue}}function eX(e={}){const t=Be.useRef(),n=Be.useRef(),[r,o]=Be.useState({isDirty:!1,isValidating:!1,isLoading:ws(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:ws(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...JY(e,()=>o(s=>({...s}))),formState:r});const i=t.current.control;return i._options=e,eb({subject:i._subjects.state,next:s=>{e3(s,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),Be.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Be.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==r.isDirty&&i._subjects.state.next({isDirty:s})}},[i,r.isDirty]),Be.useEffect(()=>{e.values&&!va(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values):i._resetDefaultValues()},[e.values,i]),Be.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=JT(r,i),t.current}var j2=function(e,t,n){if(e&&"reportValidity"in e){var r=ye(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},d3=function(e,t){var n=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?j2(i.ref,o,e):i.refs&&i.refs.forEach(function(s){return j2(s,o,e)})};for(var r in t.fields)n(r)},tX=function(e,t){t.shouldUseNativeValidation&&d3(e,t);var n={};for(var r in e){var o=ye(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(rX(t.names||Object.keys(e),r)){var s=Object.assign({},nX(ye(n,r)));wt(s,"root",i),wt(n,r,s)}else wt(n,r,i)}return n},nX=function(e){return Array.isArray(e)?e.filter(Boolean):[]},rX=function(e,t){return e.some(function(n){return n.startsWith(t+".")})},oX=function(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[s]={message:l.message,type:l.code}}else n[s]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(m){return m.errors.forEach(function(p){return e.push(p)})}),t){var u=n[s].types,f=u&&u[r.code];n[s]=o3(s,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n},iX=function(e,t,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve(function(s,l){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(f){return i.shouldUseNativeValidation&&d3({},i),{errors:{},values:n.raw?r:f}})}catch(f){return l(f)}return u&&u.then?u.then(void 0,l):u}(0,function(s){if(function(l){return l.errors!=null}(s))return{values:{},errors:tX(oX(s.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}}},mt;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},e.getValidEnumValues=o=>{const i=e.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),s={};for(const l of i)s[l]=o[l];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(const s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(mt||(mt={}));var F2;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(F2||(F2={}));const _e=mt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),da=e=>{switch(typeof e){case"undefined":return _e.undefined;case"string":return _e.string;case"number":return isNaN(e)?_e.nan:_e.number;case"boolean":return _e.boolean;case"function":return _e.function;case"bigint":return _e.bigint;case"symbol":return _e.symbol;case"object":return Array.isArray(e)?_e.array:e===null?_e.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?_e.promise:typeof Map<"u"&&e instanceof Map?_e.map:typeof Set<"u"&&e instanceof Set?_e.set:typeof Date<"u"&&e instanceof Date?_e.date:_e.object;default:return _e.unknown}},ge=mt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Xo extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let l=r,u=0;for(;u<s.path.length;){const f=s.path[u];u===s.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(n(s))):l[f]=l[f]||{_errors:[]},l=l[f],u++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,mt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Xo.create=e=>new Xo(e);const tm=(e,t)=>{let n;switch(e.code){case ge.invalid_type:e.received===_e.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,mt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${mt.joinValues(e.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${mt.joinValues(e.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${mt.joinValues(e.options)}, received '${e.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:mt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ge.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ge.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=t.defaultError,mt.assertNever(e)}return{message:n}};let sX=tm;function M1(){return sX}const O1=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i};let l="";const u=r.filter(f=>!!f).slice().reverse();for(const f of u)l=f(s,{data:t,defaultError:l}).message;return{...o,path:i,message:o.message||l}};function Re(e,t){const n=O1({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,M1(),tm].filter(r=>!!r)});e.common.issues.push(n)}class zn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return Ze;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return zn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Ze;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:t.value,value:r}}}const Ze=Object.freeze({status:"aborted"}),aX=e=>({status:"dirty",value:e}),nr=e=>({status:"valid",value:e}),B2=e=>e.status==="aborted",z2=e=>e.status==="dirty",nm=e=>e.status==="valid",N1=e=>typeof Promise<"u"&&e instanceof Promise;var De;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(De||(De={}));class ei{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const U2=(e,t)=>{if(nm(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Xo(e.common.issues);return this._error=n,this._error}}};function Xe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,l)=>s.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:r??l.defaultError}:{message:n??l.defaultError},description:o}}class rt{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return da(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:da(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new zn,ctx:{common:t.parent.common,data:t.data,parsedType:da(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(N1(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:da(t)},i=this._parseSync({data:t,path:o.path,parent:o});return U2(o,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:da(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(N1(o)?o:Promise.resolve(o));return U2(r,i)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=t(o),l=()=>i.addIssue({code:ge.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Mi({schema:this,typeName:Ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ps.create(this,this._def)}nullable(){return yc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zo.create(this,this._def)}promise(){return md.create(this,this._def)}or(t){return im.create([this,t],this._def)}and(t){return sm.create(this,t,this._def)}transform(t){return new Mi({...Xe(this._def),schema:this,typeName:Ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new dm({...Xe(this._def),innerType:this,defaultValue:n,typeName:Ve.ZodDefault})}brand(){return new wX({typeName:Ve.ZodBranded,type:this,...Xe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new z1({...Xe(this._def),innerType:this,catchValue:n,typeName:Ve.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return gg.create(this,t)}readonly(){return V1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const lX=/^c[^\s-]{8,}$/i,cX=/^[a-z][a-z0-9]*$/,uX=/^[0-9A-HJKMNP-TV-Z]{26}$/,dX=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fX=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hX="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let H0;const pX=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,mX=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,gX=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function vX(e,t){return!!((t==="v4"||!t)&&pX.test(e)||(t==="v6"||!t)&&mX.test(e))}class xi extends rt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==_e.string){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_type,expected:_e.string,received:i.parsedType}),Ze}const r=new zn;let o;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=t.data.length>i.value,l=t.data.length<i.value;(s||l)&&(o=this._getOrReturnCtx(t,o),s?Re(o,{code:ge.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Re(o,{code:ge.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")fX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"email",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")H0||(H0=new RegExp(hX,"u")),H0.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"emoji",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")dX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"uuid",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")lX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"cuid",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")cX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"cuid2",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")uX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"ulid",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),Re(o,{validation:"url",code:ge.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"regex",code:ge.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?gX(i).test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?vX(t.data,i.version)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"ip",code:ge.invalid_string,message:i.message}),r.dirty()):mt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:ge.invalid_string,...De.errToObj(r)})}_addCheck(t){return new xi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...De.errToObj(t)})}url(t){return this._addCheck({kind:"url",...De.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...De.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...De.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...De.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...De.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...De.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...De.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...De.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...De.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...De.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...De.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...De.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...De.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...De.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...De.errToObj(n)})}nonempty(t){return this.min(1,De.errToObj(t))}trim(){return new xi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}xi.create=e=>{var t;return new xi({checks:[],typeName:Ve.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};function yX(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}class mc extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==_e.number){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_type,expected:_e.number,received:i.parsedType}),Ze}let r;const o=new zn;for(const i of this._def.checks)i.kind==="int"?mt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?yX(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.not_finite,message:i.message}),o.dirty()):mt.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,De.toString(n))}gt(t,n){return this.setLimit("min",t,!1,De.toString(n))}lte(t,n){return this.setLimit("max",t,!0,De.toString(n))}lt(t,n){return this.setLimit("max",t,!1,De.toString(n))}setLimit(t,n,r,o){return new mc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:De.toString(o)}]})}_addCheck(t){return new mc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:De.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:De.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:De.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:De.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:De.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&mt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}mc.create=e=>new mc({checks:[],typeName:Ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class gc extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==_e.bigint){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_type,expected:_e.bigint,received:i.parsedType}),Ze}let r;const o=new zn;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):mt.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,De.toString(n))}gt(t,n){return this.setLimit("min",t,!1,De.toString(n))}lte(t,n){return this.setLimit("max",t,!0,De.toString(n))}lt(t,n){return this.setLimit("max",t,!1,De.toString(n))}setLimit(t,n,r,o){return new gc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:De.toString(o)}]})}_addCheck(t){return new gc({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:De.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}gc.create=e=>{var t;return new gc({checks:[],typeName:Ve.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};class D1 extends rt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==_e.boolean){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.boolean,received:r.parsedType}),Ze}return nr(t.data)}}D1.create=e=>new D1({typeName:Ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class pd extends rt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==_e.date){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_type,expected:_e.date,received:i.parsedType}),Ze}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_date}),Ze}const r=new zn;let o;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):mt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new pd({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:De.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:De.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}pd.create=e=>new pd({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ve.ZodDate,...Xe(e)});class I1 extends rt{_parse(t){if(this._getType(t)!==_e.symbol){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.symbol,received:r.parsedType}),Ze}return nr(t.data)}}I1.create=e=>new I1({typeName:Ve.ZodSymbol,...Xe(e)});class rm extends rt{_parse(t){if(this._getType(t)!==_e.undefined){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.undefined,received:r.parsedType}),Ze}return nr(t.data)}}rm.create=e=>new rm({typeName:Ve.ZodUndefined,...Xe(e)});class om extends rt{_parse(t){if(this._getType(t)!==_e.null){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.null,received:r.parsedType}),Ze}return nr(t.data)}}om.create=e=>new om({typeName:Ve.ZodNull,...Xe(e)});class L1 extends rt{constructor(){super(...arguments),this._any=!0}_parse(t){return nr(t.data)}}L1.create=e=>new L1({typeName:Ve.ZodAny,...Xe(e)});class Ll extends rt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return nr(t.data)}}Ll.create=e=>new Ll({typeName:Ve.ZodUnknown,...Xe(e)});class Is extends rt{_parse(t){const n=this._getOrReturnCtx(t);return Re(n,{code:ge.invalid_type,expected:_e.never,received:n.parsedType}),Ze}}Is.create=e=>new Is({typeName:Ve.ZodNever,...Xe(e)});class j1 extends rt{_parse(t){if(this._getType(t)!==_e.undefined){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.void,received:r.parsedType}),Ze}return nr(t.data)}}j1.create=e=>new j1({typeName:Ve.ZodVoid,...Xe(e)});class Zo extends rt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==_e.array)return Re(n,{code:ge.invalid_type,expected:_e.array,received:n.parsedType}),Ze;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,l=n.data.length<o.exactLength.value;(s||l)&&(Re(n,{code:s?ge.too_big:ge.too_small,minimum:l?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(Re(n,{code:ge.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(Re(n,{code:ge.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,l)=>o.type._parseAsync(new ei(n,s,n.path,l)))).then(s=>zn.mergeArray(r,s));const i=[...n.data].map((s,l)=>o.type._parseSync(new ei(n,s,n.path,l)));return zn.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new Zo({...this._def,minLength:{value:t,message:De.toString(n)}})}max(t,n){return new Zo({...this._def,maxLength:{value:t,message:De.toString(n)}})}length(t,n){return new Zo({...this._def,exactLength:{value:t,message:De.toString(n)}})}nonempty(t){return this.min(1,t)}}Zo.create=(e,t)=>new Zo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ve.ZodArray,...Xe(t)});function pl(e){if(e instanceof Ut){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ps.create(pl(r))}return new Ut({...e._def,shape:()=>t})}else return e instanceof Zo?new Zo({...e._def,type:pl(e.element)}):e instanceof Ps?Ps.create(pl(e.unwrap())):e instanceof yc?yc.create(pl(e.unwrap())):e instanceof Ai?Ai.create(e.items.map(t=>pl(t))):e}class Ut extends rt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=mt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==_e.object){const f=this._getOrReturnCtx(t);return Re(f,{code:ge.invalid_type,expected:_e.object,received:f.parsedType}),Ze}const{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Is&&this._def.unknownKeys==="strip"))for(const f in o.data)s.includes(f)||l.push(f);const u=[];for(const f of s){const m=i[f],p=o.data[f];u.push({key:{status:"valid",value:f},value:m._parse(new ei(o,p,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof Is){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of l)u.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}});else if(f==="strict")l.length>0&&(Re(o,{code:ge.unrecognized_keys,keys:l}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of l){const p=o.data[m];u.push({key:{status:"valid",value:m},value:f._parse(new ei(o,p,o.path,m)),alwaysSet:m in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of u){const p=await m.key;f.push({key:p,value:await m.value,alwaysSet:m.alwaysSet})}return f}).then(f=>zn.mergeObjectSync(r,f)):zn.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return De.errToObj,new Ut({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,l;const u=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(l=De.errToObj(t).message)!==null&&l!==void 0?l:u}:{message:u}}}:{}})}strip(){return new Ut({...this._def,unknownKeys:"strip"})}passthrough(){return new Ut({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ut({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ut({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ut({...this._def,catchall:t})}pick(t){const n={};return mt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Ut({...this._def,shape:()=>n})}omit(t){const n={};return mt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Ut({...this._def,shape:()=>n})}deepPartial(){return pl(this)}partial(t){const n={};return mt.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new Ut({...this._def,shape:()=>n})}required(t){const n={};return mt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ps;)i=i._def.innerType;n[r]=i}}),new Ut({...this._def,shape:()=>n})}keyof(){return f3(mt.objectKeys(this.shape))}}Ut.create=(e,t)=>new Ut({shape:()=>e,unknownKeys:"strip",catchall:Is.create(),typeName:Ve.ZodObject,...Xe(t)});Ut.strictCreate=(e,t)=>new Ut({shape:()=>e,unknownKeys:"strict",catchall:Is.create(),typeName:Ve.ZodObject,...Xe(t)});Ut.lazycreate=(e,t)=>new Ut({shape:e,unknownKeys:"strip",catchall:Is.create(),typeName:Ve.ZodObject,...Xe(t)});class im extends rt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const s=i.map(l=>new Xo(l.ctx.common.issues));return Re(n,{code:ge.invalid_union,unionErrors:s}),Ze}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const u of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=u._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&s.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=s.map(u=>new Xo(u));return Re(n,{code:ge.invalid_union,unionErrors:l}),Ze}}get options(){return this._def.options}}im.create=(e,t)=>new im({options:e,typeName:Ve.ZodUnion,...Xe(t)});const cp=e=>e instanceof lm?cp(e.schema):e instanceof Mi?cp(e.innerType()):e instanceof cm?[e.value]:e instanceof La?e.options:e instanceof um?Object.keys(e.enum):e instanceof dm?cp(e._def.innerType):e instanceof rm?[void 0]:e instanceof om?[null]:null;class ob extends rt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.object)return Re(n,{code:ge.invalid_type,expected:_e.object,received:n.parsedType}),Ze;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Re(n,{code:ge.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const i of n){const s=cp(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of s){if(o.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);o.set(l,i)}}return new ob({typeName:Ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Xe(r)})}}function F1(e,t){const n=da(e),r=da(t);if(e===t)return{valid:!0,data:e};if(n===_e.object&&r===_e.object){const o=mt.objectKeys(t),i=mt.objectKeys(e).filter(l=>o.indexOf(l)!==-1),s={...e,...t};for(const l of i){const u=F1(e[l],t[l]);if(!u.valid)return{valid:!1};s[l]=u.data}return{valid:!0,data:s}}else if(n===_e.array&&r===_e.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let i=0;i<e.length;i++){const s=e[i],l=t[i],u=F1(s,l);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return n===_e.date&&r===_e.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class sm extends rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(i,s)=>{if(B2(i)||B2(s))return Ze;const l=F1(i.value,s.value);return l.valid?((z2(i)||z2(s))&&n.dirty(),{status:n.value,value:l.data}):(Re(r,{code:ge.invalid_intersection_types}),Ze)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}sm.create=(e,t,n)=>new sm({left:e,right:t,typeName:Ve.ZodIntersection,...Xe(n)});class Ai extends rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.array)return Re(r,{code:ge.invalid_type,expected:_e.array,received:r.parsedType}),Ze;if(r.data.length<this._def.items.length)return Re(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ze;!this._def.rest&&r.data.length>this._def.items.length&&(Re(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new ei(r,s,r.path,l)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>zn.mergeArray(n,s)):zn.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new Ai({...this._def,rest:t})}}Ai.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ai({items:e,typeName:Ve.ZodTuple,rest:null,...Xe(t)})};class am extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.object)return Re(r,{code:ge.invalid_type,expected:_e.object,received:r.parsedType}),Ze;const o=[],i=this._def.keyType,s=this._def.valueType;for(const l in r.data)o.push({key:i._parse(new ei(r,l,r.path,l)),value:s._parse(new ei(r,r.data[l],r.path,l))});return r.common.async?zn.mergeObjectAsync(n,o):zn.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof rt?new am({keyType:t,valueType:n,typeName:Ve.ZodRecord,...Xe(r)}):new am({keyType:xi.create(),valueType:t,typeName:Ve.ZodRecord,...Xe(n)})}}class B1 extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.map)return Re(r,{code:ge.invalid_type,expected:_e.map,received:r.parsedType}),Ze;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([l,u],f)=>({key:o._parse(new ei(r,l,r.path,[f,"key"])),value:i._parse(new ei(r,u,r.path,[f,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of s){const f=await u.key,m=await u.value;if(f.status==="aborted"||m.status==="aborted")return Ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),l.set(f.value,m.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of s){const f=u.key,m=u.value;if(f.status==="aborted"||m.status==="aborted")return Ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),l.set(f.value,m.value)}return{status:n.value,value:l}}}}B1.create=(e,t,n)=>new B1({valueType:t,keyType:e,typeName:Ve.ZodMap,...Xe(n)});class vc extends rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.set)return Re(r,{code:ge.invalid_type,expected:_e.set,received:r.parsedType}),Ze;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(Re(r,{code:ge.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(Re(r,{code:ge.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(u){const f=new Set;for(const m of u){if(m.status==="aborted")return Ze;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const l=[...r.data.values()].map((u,f)=>i._parse(new ei(r,u,r.path,f)));return r.common.async?Promise.all(l).then(u=>s(u)):s(l)}min(t,n){return new vc({...this._def,minSize:{value:t,message:De.toString(n)}})}max(t,n){return new vc({...this._def,maxSize:{value:t,message:De.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}vc.create=(e,t)=>new vc({valueType:e,minSize:null,maxSize:null,typeName:Ve.ZodSet,...Xe(t)});class ju extends rt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.function)return Re(n,{code:ge.invalid_type,expected:_e.function,received:n.parsedType}),Ze;function r(l,u){return O1({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,M1(),tm].filter(f=>!!f),issueData:{code:ge.invalid_arguments,argumentsError:u}})}function o(l,u){return O1({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,M1(),tm].filter(f=>!!f),issueData:{code:ge.invalid_return_type,returnTypeError:u}})}const i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof md){const l=this;return nr(async function(...u){const f=new Xo([]),m=await l._def.args.parseAsync(u,i).catch(y=>{throw f.addIssue(r(u,y)),f}),p=await Reflect.apply(s,this,m);return await l._def.returns._def.type.parseAsync(p,i).catch(y=>{throw f.addIssue(o(p,y)),f})})}else{const l=this;return nr(function(...u){const f=l._def.args.safeParse(u,i);if(!f.success)throw new Xo([r(u,f.error)]);const m=Reflect.apply(s,this,f.data),p=l._def.returns.safeParse(m,i);if(!p.success)throw new Xo([o(m,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ju({...this._def,args:Ai.create(t).rest(Ll.create())})}returns(t){return new ju({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ju({args:t||Ai.create([]).rest(Ll.create()),returns:n||Ll.create(),typeName:Ve.ZodFunction,...Xe(r)})}}class lm extends rt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}lm.create=(e,t)=>new lm({getter:e,typeName:Ve.ZodLazy,...Xe(t)});class cm extends rt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Re(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),Ze}return{status:"valid",value:t.data}}get value(){return this._def.value}}cm.create=(e,t)=>new cm({value:e,typeName:Ve.ZodLiteral,...Xe(t)});function f3(e,t){return new La({values:e,typeName:Ve.ZodEnum,...Xe(t)})}class La extends rt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Re(n,{expected:mt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),Ze}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Re(n,{received:n.data,code:ge.invalid_enum_value,options:r}),Ze}return nr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return La.create(t)}exclude(t){return La.create(this.options.filter(n=>!t.includes(n)))}}La.create=f3;class um extends rt{_parse(t){const n=mt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==_e.string&&r.parsedType!==_e.number){const o=mt.objectValues(n);return Re(r,{expected:mt.joinValues(o),received:r.parsedType,code:ge.invalid_type}),Ze}if(n.indexOf(t.data)===-1){const o=mt.objectValues(n);return Re(r,{received:r.data,code:ge.invalid_enum_value,options:o}),Ze}return nr(t.data)}get enum(){return this._def.values}}um.create=(e,t)=>new um({values:e,typeName:Ve.ZodNativeEnum,...Xe(t)});class md extends rt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.promise&&n.common.async===!1)return Re(n,{code:ge.invalid_type,expected:_e.promise,received:n.parsedType}),Ze;const r=n.parsedType===_e.promise?n.data:Promise.resolve(n.data);return nr(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}md.create=(e,t)=>new md({type:e,typeName:Ve.ZodPromise,...Xe(t)});class Mi extends rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{Re(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(l=>this._def.schema._parseAsync({data:l,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){const s=l=>{const u=o.refinement(l,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?Ze:(l.status==="dirty"&&n.dirty(),s(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?Ze:(l.status==="dirty"&&n.dirty(),s(l.value).then(()=>({status:n.value,value:l.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!nm(s))return s;const l=o.transform(s.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>nm(s)?Promise.resolve(o.transform(s.value,i)).then(l=>({status:n.value,value:l})):s);mt.assertNever(o)}}Mi.create=(e,t,n)=>new Mi({schema:e,typeName:Ve.ZodEffects,effect:t,...Xe(n)});Mi.createWithPreprocess=(e,t,n)=>new Mi({schema:t,effect:{type:"preprocess",transform:e},typeName:Ve.ZodEffects,...Xe(n)});class Ps extends rt{_parse(t){return this._getType(t)===_e.undefined?nr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ps.create=(e,t)=>new Ps({innerType:e,typeName:Ve.ZodOptional,...Xe(t)});class yc extends rt{_parse(t){return this._getType(t)===_e.null?nr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}yc.create=(e,t)=>new yc({innerType:e,typeName:Ve.ZodNullable,...Xe(t)});class dm extends rt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===_e.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}dm.create=(e,t)=>new dm({innerType:e,typeName:Ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Xe(t)});class z1 extends rt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return N1(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Xo(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Xo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}z1.create=(e,t)=>new z1({innerType:e,typeName:Ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Xe(t)});class U1 extends rt{_parse(t){if(this._getType(t)!==_e.nan){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.nan,received:r.parsedType}),Ze}return{status:"valid",value:t.data}}}U1.create=e=>new U1({typeName:Ve.ZodNaN,...Xe(e)});class wX extends rt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class gg extends rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ze:i.status==="dirty"?(n.dirty(),aX(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ze:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new gg({in:t,out:n,typeName:Ve.ZodPipeline})}}class V1 extends rt{_parse(t){const n=this._def.innerType._parse(t);return nm(n)&&(n.value=Object.freeze(n.value)),n}}V1.create=(e,t)=>new V1({innerType:e,typeName:Ve.ZodReadonly,...Xe(t)});Ut.lazycreate;var Ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ve||(Ve={}));const fu=xi.create;mc.create;U1.create;gc.create;const hu=D1.create;pd.create;I1.create;rm.create;om.create;L1.create;Ll.create;Is.create;j1.create;Zo.create;const xX=Ut.create;Ut.strictCreate;im.create;ob.create;sm.create;Ai.create;am.create;B1.create;vc.create;ju.create;lm.create;cm.create;La.create;um.create;md.create;Mi.create;Ps.create;yc.create;Mi.createWithPreprocess;gg.create;const W1="horizontal",bX=["horizontal","vertical"],h3=d.forwardRef((e,t)=>{const{decorative:n,orientation:r=W1,...o}=e,i=p3(r)?r:W1,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return d.createElement(Ae.div,Y({"data-orientation":i},l,o,{ref:t}))});h3.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!p3(r)?new Error(SX(o,n)):null}};function SX(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
- horizontal
- vertical
Defaulting to \`${W1}\`.`}function p3(e){return bX.includes(e)}const m3=h3,Xt=d.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>v.jsx(m3,{ref:o,decorative:n,orientation:t,className:xe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Xt.displayName=m3.displayName;const _X=d.forwardRef((e,t)=>d.createElement(Ae.label,Y({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),g3=_X,EX=zm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ib=d.forwardRef(({className:e,disabled:t,...n},r)=>v.jsx(g3,{ref:r,className:xe(EX(),e,t?"opacity-50":"","select-none"),...n}));ib.displayName=g3.displayName;const CX=FY,v3=d.createContext({}),ul=({...e})=>v.jsx(v3.Provider,{value:{name:e.name},children:v.jsx(VY,{...e})}),vg=()=>{const e=d.useContext(v3),t=d.useContext(y3),{getFieldState:n,formState:r}=mg(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},y3=d.createContext({}),sa=d.forwardRef(({className:e,...t},n)=>{const r=d.useId();return v.jsx(y3.Provider,{value:{id:r},children:v.jsx("div",{ref:n,className:xe("space-y-2",e),...t})})});sa.displayName="FormItem";const aa=d.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=vg();return v.jsx(ib,{ref:n,className:xe(r&&"text-destructive","text-sm",e),htmlFor:o,...t})});aa.displayName="FormLabel";const la=d.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=vg();return v.jsx(Qo,{ref:t,id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...e})});la.displayName="FormControl";const ca=d.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=vg();return v.jsx("p",{ref:n,id:r,className:xe("text-[0.8rem] text-muted-foreground",e),...t})});ca.displayName="FormDescription";const $X=d.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:i}=vg(),s=o?String(o==null?void 0:o.message):t;return s?v.jsx("p",{ref:r,id:i,className:xe("text-[0.8rem] font-medium text-destructive",e),...n,children:s}):null});$X.displayName="FormMessage";const w3="Switch",[RX,Rte]=An(w3),[kX,PX]=RX(w3),TX=d.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:l,value:u="on",onCheckedChange:f,...m}=e,[p,g]=d.useState(null),y=We(t,b=>g(b)),x=d.useRef(!1),S=p?!!p.closest("form"):!0,[E=!1,_]=no({prop:o,defaultProp:i,onChange:f});return d.createElement(kX,{scope:n,checked:E,disabled:l},d.createElement(Ae.button,Y({type:"button",role:"switch","aria-checked":E,"aria-required":s,"data-state":x3(E),"data-disabled":l?"":void 0,disabled:l,value:u},m,{ref:y,onClick:fe(e.onClick,b=>{_(C=>!C),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})})),S&&d.createElement(OX,{control:p,bubbles:!x.current,name:r,value:u,checked:E,required:s,disabled:l,style:{transform:"translateX(-100%)"}}))}),AX="SwitchThumb",MX=d.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=PX(AX,n);return d.createElement(Ae.span,Y({"data-state":x3(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),OX=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=d.useRef(null),s=Xx(n),l=Cx(t);return d.useEffect(()=>{const u=i.current,f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(s!==n&&p){const g=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(g)}},[s,n,r]),d.createElement("input",Y({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function x3(e){return e?"checked":"unchecked"}const b3=TX,NX=MX,Br=d.forwardRef(({className:e,...t},n)=>v.jsx(b3,{className:xe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),tabIndex:-1,...t,ref:n,children:v.jsx(NX,{className:xe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Br.displayName=b3.displayName;const DX="AlertDialog",[IX,kte]=An(DX,[bP]),Vs=bP(),LX=e=>{const{__scopeAlertDialog:t,...n}=e,r=Vs(t);return d.createElement(Mx,Y({},r,n,{modal:!0}))},jX=e=>{const{__scopeAlertDialog:t,...n}=e,r=Vs(t);return d.createElement(Ox,Y({},r,n))},FX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Vs(n);return d.createElement(zd,Y({},o,r,{ref:t}))}),S3="AlertDialogContent",[BX,zX]=IX(S3),UX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=Vs(n),s=d.useRef(null),l=We(t,s),u=d.useRef(null);return d.createElement(wW,{contentName:S3,titleName:VX,docsSlug:"alert-dialog"},d.createElement(BX,{scope:n,cancelRef:u},d.createElement(Ud,Y({role:"alertdialog"},i,o,{ref:l,onOpenAutoFocus:fe(o.onOpenAutoFocus,f=>{var m;f.preventDefault(),(m=u.current)===null||m===void 0||m.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault()}),d.createElement(mx,null,r),!1)))}),VX="AlertDialogTitle",WX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Vs(n);return d.createElement(Vd,Y({},o,r,{ref:t}))}),HX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Vs(n);return d.createElement(Wd,Y({},o,r,{ref:t}))}),KX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Vs(n);return d.createElement(Nx,Y({},o,r,{ref:t}))}),GX="AlertDialogCancel",YX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=zX(GX,n),i=Vs(n),s=We(t,o);return d.createElement(Nx,Y({},i,r,{ref:s}))}),XX=LX,ZX=jX,_3=FX,E3=UX,C3=KX,$3=YX,R3=WX,k3=HX,qX=XX,QX=ZX,P3=d.forwardRef(({className:e,...t},n)=>v.jsx(_3,{className:xe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));P3.displayName=_3.displayName;const T3=d.forwardRef(({className:e,...t},n)=>v.jsxs(QX,{children:[v.jsx(P3,{}),v.jsx(E3,{ref:n,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));T3.displayName=E3.displayName;const A3=({className:e,...t})=>v.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});A3.displayName="AlertDialogHeader";const JX=d.forwardRef(({className:e,...t},n)=>v.jsx(R3,{ref:n,className:xe("text-lg font-semibold",e),...t}));JX.displayName=R3.displayName;const eZ=d.forwardRef(({className:e,...t},n)=>v.jsx(k3,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));eZ.displayName=k3.displayName;const tZ=d.forwardRef(({className:e,...t},n)=>v.jsx(C3,{ref:n,className:xe(Tx(),e),...t}));tZ.displayName=C3.displayName;const nZ=d.forwardRef(({className:e,...t},n)=>v.jsx($3,{ref:n,className:xe(Tx({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));nZ.displayName=$3.displayName;const rZ=xX({enableFileManager:hu(),inputDirectory:fu(),outputDirectory:fu(),enableDownloadMask:hu(),enableManualInpainting:hu(),enableUploadMask:hu(),enableAutoExtractPrompt:hu(),removeBGModel:fu(),realesrganModel:fu(),interactiveSegModel:fu()}),M3="General",H1="Model",O3="Plugins",oZ=[H1,M3,O3];function iZ(){const[e,t]=lP(!1),[n,r]=d.useState(H1),[o,i,s,l,u,f]=xt(H=>[H.updateAppState,H.settings,H.updateSettings,H.fileManagerState,H.setModel,H.setServerConfig]),{toast:m}=Ld(),[p,g]=d.useState(i.model),[y,x]=d.useState([]),S=y.length>0;d.useEffect(()=>{g(i.model)},[i.model]);const{data:E,status:_,refetch:b}=IL({queryKey:["serverConfig"],queryFn:$k}),C=eX({resolver:iX(rZ),defaultValues:{enableDownloadMask:i.enableDownloadMask,enableManualInpainting:i.enableManualInpainting,enableUploadMask:i.enableUploadMask,enableAutoExtractPrompt:i.enableAutoExtractPrompt,inputDirectory:l.inputDirectory,outputDirectory:l.outputDirectory,removeBGModel:E==null?void 0:E.removeBGModel,realesrganModel:E==null?void 0:E.realesrganModel,interactiveSegModel:E==null?void 0:E.interactiveSegModel}});d.useEffect(()=>{E&&(f(E),C.setValue("removeBGModel",E.removeBGModel),C.setValue("realesrganModel",E.realesrganModel),C.setValue("interactiveSegModel",E.interactiveSegModel))},[C,E]);async function R(H){s({enableDownloadMask:H.enableDownloadMask,enableManualInpainting:H.enableManualInpainting,enableUploadMask:H.enableUploadMask,enableAutoExtractPrompt:H.enableAutoExtractPrompt});const J=p.name!==i.model.name,G=(E==null?void 0:E.removeBGModel)!==H.removeBGModel&&A,Z=(E==null?void 0:E.realesrganModel)!==H.realesrganModel&&O,Q=(E==null?void 0:E.interactiveSegModel)!==H.interactiveSegModel&&U;if(J||G||Z||Q){const L=[];if(J&&L.push(`Switching model from ${i.model.name} to ${p.name}`),G&&L.push(`Switching RemoveBG model from ${E==null?void 0:E.removeBGModel} to ${H.removeBGModel}`),Z&&L.push(`Switching RealESRGAN model from ${E==null?void 0:E.realesrganModel} to ${H.realesrganModel}`),Q&&L.push(`Switching ${No.InteractiveSeg} model from ${E==null?void 0:E.interactiveSegModel} to ${H.interactiveSegModel}`),x(L),o({disableShortCuts:!0}),J)try{const ue=await KF(p.name);m({title:`Switch to ${ue.name} success`}),u(p)}catch(ue){m({variant:"destructive",title:`Switch to ${p.name} failed: ${ue}`}),g(i.model)}if(G)try{const ue=await E0(No.RemoveBG,H.removeBGModel);if(ue.status!==200)throw new Error(ue.statusText)}catch(ue){m({variant:"destructive",title:`Switch RemoveBG model to ${H.removeBGModel} failed: ${ue}`})}if(Z)try{const ue=await E0(No.RealESRGAN,H.realesrganModel);if(ue.status!==200)throw new Error(ue.statusText)}catch(ue){m({variant:"destructive",title:`Switch RealESRGAN model to ${H.realesrganModel} failed: ${ue}`})}if(Q)try{const ue=await E0(No.InteractiveSeg,H.interactiveSegModel);if(ue.status!==200)throw new Error(ue.statusText)}catch(ue){m({variant:"destructive",title:`Switch ${No.InteractiveSeg} model to ${H.interactiveSegModel} failed: ${ue}`})}x([]),o({disableShortCuts:!1}),b()}}if(Xn("s",()=>{t(),e&&R(C.getValues())},[e,C,p,E]),_!=="success")return v.jsx(v.Fragment,{});const T=E.modelInfos,N=E.plugins,A=N.some(H=>H.name===No.RemoveBG),O=N.some(H=>H.name===No.RealESRGAN),U=N.some(H=>H.name===No.InteractiveSeg);function z(H){t(),H||R(C.getValues())}function ie(H){g(H)}function K(H){return T?T.filter(J=>H.includes(J.model_type)).map(J=>v.jsxs("div",{onClick:()=>ie(J),className:"px-2",children:[v.jsx("div",{className:xe([J.name===p.name?"bg-muted":"hover:bg-muted","rounded-md px-2 py-2","cursor-default"]),children:v.jsx("div",{className:"text-base",children:J.name})}),v.jsx(Xt,{className:"my-1"})]},J.name)):v.jsx("div",{children:"Please download model first"})}function te(){let H=ms;for(let J of T)if(p.name===J.name){H=J.model_type,H===hC&&(H=gh),H===pC&&(H=vh);break}return v.jsxs("div",{className:"flex flex-col gap-4 w-[510px]",children:[v.jsxs("div",{className:"flex flex-col gap-4 rounded-md",children:[v.jsx("div",{className:"font-medium",children:"Current Model"}),v.jsx("div",{children:p.name})]}),v.jsx(Xt,{}),v.jsxs("div",{className:"space-y-4 rounded-md",children:[v.jsx("div",{className:"flex gap-1 items-center justify-start",children:v.jsx("div",{className:"font-medium",children:"Available models"})}),v.jsxs(gT,{defaultValue:H,children:[v.jsxs(Yx,{children:[v.jsx(ys,{value:ms,children:"Inpaint"}),v.jsx(ys,{value:gh,children:"Stable Diffusion"}),v.jsx(ys,{value:vh,children:"Stable Diffusion Inpaint"}),v.jsx(ys,{value:y0,children:"Other Diffusion"})]}),v.jsxs(pg,{className:"h-[240px] w-full mt-2 outline-none border rounded-lg",children:[v.jsx(_u,{value:ms,children:K([ms])}),v.jsx(_u,{value:gh,children:K([gh,hC])}),v.jsx(_u,{value:vh,children:K([vh,pC])}),v.jsx(_u,{value:y0,children:K([y0])})]})]})]})]})}function W(){return v.jsxs("div",{className:"space-y-4 w-[510px]",children:[v.jsx(ul,{control:C.control,name:"enableManualInpainting",render:({field:H})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Enable manual inpainting"}),v.jsx(ca,{children:"For erase model, click a button to trigger inpainting after draw mask."})]}),v.jsx(la,{children:v.jsx(Br,{checked:H.value,onCheckedChange:H.onChange})})]})}),v.jsx(Xt,{}),v.jsx(ul,{control:C.control,name:"enableDownloadMask",render:({field:H})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Enable download mask"}),v.jsx(ca,{children:"Also download the mask after save the inpainting result."})]}),v.jsx(la,{children:v.jsx(Br,{checked:H.value,onCheckedChange:H.onChange})})]})}),v.jsx(Xt,{}),v.jsx(ul,{control:C.control,name:"enableAutoExtractPrompt",render:({field:H})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Enable auto extract prompt"}),v.jsx(ca,{children:"Automatically extract prompt/negativate prompt from the image meta."})]}),v.jsx(la,{children:v.jsx(Br,{checked:H.value,onCheckedChange:H.onChange})})]})})]})}function re(){return v.jsxs("div",{className:"space-y-4 w-[510px]",children:[v.jsx(ul,{control:C.control,name:"removeBGModel",render:({field:H})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Remove Background"}),v.jsx(ca,{children:"Remove background model"})]}),v.jsxs(xo,{onValueChange:H.onChange,defaultValue:H.value,disabled:!A,children:[v.jsx(la,{children:v.jsx(Hr,{className:"w-auto",children:v.jsx(bo,{placeholder:"Select removebg model"})})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:E==null?void 0:E.removeBGModels.map(J=>v.jsx(Gr,{value:J,children:J},J))})})]})]})}),v.jsx(Xt,{}),v.jsx(ul,{control:C.control,name:"realesrganModel",render:({field:H})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"RealESRGAN"}),v.jsx(ca,{children:"RealESRGAN Model"})]}),v.jsxs(xo,{onValueChange:H.onChange,defaultValue:H.value,disabled:!O,children:[v.jsx(la,{children:v.jsx(Hr,{className:"w-auto",children:v.jsx(bo,{placeholder:"Select RealESRGAN model"})})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:E==null?void 0:E.realesrganModels.map(J=>v.jsx(Gr,{value:J,children:J},J))})})]})]})}),v.jsx(Xt,{}),v.jsx(ul,{control:C.control,name:"interactiveSegModel",render:({field:H})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Interactive Segmentation"}),v.jsx(ca,{children:"Interactive Segmentation Model"})]}),v.jsxs(xo,{onValueChange:H.onChange,defaultValue:H.value,disabled:!U,children:[v.jsx(la,{children:v.jsx(Hr,{className:"w-auto",children:v.jsx(bo,{placeholder:"Select interactive segmentation model"})})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:E==null?void 0:E.interactiveSegModels.map(J=>v.jsx(Gr,{value:J,children:J},J))})})]})]})})]})}return v.jsxs(v.Fragment,{children:[v.jsx(qX,{open:S,children:v.jsx(T3,{children:v.jsx(A3,{children:v.jsxs("div",{className:"flex flex-col justify-center items-center gap-4",children:[v.jsxs("div",{role:"status",children:[v.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-primary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[v.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),v.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),v.jsx("span",{className:"sr-only",children:"Loading..."})]}),y?v.jsx("div",{className:"flex flex-col",children:y.map((H,J)=>v.jsx("div",{children:H},J))}):v.jsx(v.Fragment,{})]})})})}),v.jsxs(sg,{open:e,onOpenChange:z,children:[v.jsx(Dx,{asChild:!0,children:v.jsx(yn,{tooltip:"Settings",children:v.jsx(fV,{})})}),v.jsxs(Hd,{className:"max-w-3xl h-[600px]",onOpenAutoFocus:H=>H.preventDefault(),children:[v.jsx(Kd,{children:"Settings"}),v.jsx(Xt,{}),v.jsxs("div",{className:"flex flex-row space-x-8 h-full",children:[v.jsx("div",{className:"flex flex-col space-y-1",children:oZ.map(H=>v.jsx(wn,{variant:"ghost",onClick:()=>r(H),className:xe(n===H?"bg-muted ":"hover:bg-muted","justify-start"),children:H},H))}),v.jsx(Xt,{orientation:"vertical"}),v.jsx(CX,{...C,children:v.jsx("div",{className:"flex w-full justify-center",children:v.jsxs("form",{onSubmit:C.handleSubmit(R),children:[n===H1?te():v.jsx(v.Fragment,{}),n===M3?W():v.jsx(v.Fragment,{}),n===O3?re():v.jsx(v.Fragment,{}),v.jsx("div",{className:"absolute right-10 bottom-6",children:v.jsx(wn,{onClick:()=>z(!1),children:"Ok"})})]})})})]})]})]})]})}const sZ="/assets/kofi_button_black-XI_Dr2zg.png";function aZ(){return v.jsxs(sg,{children:[v.jsx(Dx,{asChild:!0,children:v.jsx(yn,{tooltip:"Buy me a coffee",children:v.jsx(tV,{})})}),v.jsxs(Hd,{children:[v.jsx(Kd,{children:"Buy me a coffee"}),v.jsx(RP,{className:"mb-8",children:"Hi, if you found my project is useful, please conside buy me a coffee to support my work. Thanks!"}),v.jsx("div",{className:"w-full flex items-center justify-center",children:v.jsx("a",{href:"https://ko-fi.com/Z8Z1CZJGY",target:"_blank",rel:"noreferrer",children:v.jsx("img",{src:sZ,className:"h-[32px]"})})})]})]})}const lZ=()=>{const[e,t,n,r,o,i,s,l,u,f,m,p,g,y,x]=xt(O=>[O.file,O.customMask,O.isInpainting,O.serverConfig,O.runMannually(),O.settings.enableUploadMask,O.settings.model,O.setFile,O.setCustomFile,O.runInpainting,O.showPrevMask,O.hidePrevMask,O.imageHeight,O.imageWidth,O.handleFileManagerMaskSelect]),{toast:S}=Ld(),[E,_]=Lx(t),[b,C]=d.useState(!1),R=()=>{f()},T=()=>{m()},N=()=>{p()},A=async(O,U)=>{try{if(O===YT){const z=await XF(O,U);x(z)}else{const z=await YF(O,U);l(z)}}catch(z){S({variant:"destructive",description:z.message?z.message:z.toString()});return}};return v.jsxs("header",{className:"h-[60px] px-6 py-4 absolute top-[0] flex justify-between items-center w-full z-20 border-b backdrop-filter backdrop-blur-md bg-background/70",children:[v.jsxs("div",{className:"flex items-center gap-1",children:[r.enableFileManager?v.jsx(IY,{photoWidth:512,onPhotoClick:A}):v.jsx(v.Fragment,{}),v.jsx(w1,{disabled:n,tooltip:"Upload image",onFileUpload:O=>{l(O)},children:v.jsx(aV,{})}),v.jsxs("div",{className:xe(["flex items-center gap-1",e&&i?"visible":"hidden"]),children:[v.jsx(w1,{disabled:n,tooltip:"Upload custom mask",onFileUpload:async O=>{let U=null;try{U=await bj(O)}catch(z){S({variant:"destructive",description:z.message?z.message:z.toString()});return}if(U.naturalHeight!==g||U.naturalWidth!==y){S({variant:"destructive",description:`The size of the mask must same as image: ${y}x${g}`});return}u(O),o||f()},children:v.jsx(aP,{})}),t?v.jsxs(QW,{open:b,children:[v.jsx(JW,{className:"btn-primary side-panel-trigger",onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),style:{visibility:t?"visible":"hidden",outline:"none"},onClick:()=>{},children:v.jsx(yn,{tooltip:"Run custom mask",children:v.jsx(gB,{})})}),v.jsx(UP,{children:_?v.jsx("img",{src:E.src,alt:"Custom mask"}):v.jsx(v.Fragment,{})})]}):v.jsx(v.Fragment,{})]}),e&&!s.need_prompt?v.jsx(yn,{disabled:n,tooltip:"Rerun previous mask",onClick:R,onMouseEnter:T,onMouseLeave:N,children:v.jsx(dV,{})}):v.jsx(v.Fragment,{})]}),s.need_prompt?v.jsx(EH,{}):v.jsx(v.Fragment,{}),v.jsxs("div",{className:"flex gap-1",children:[v.jsx(aZ,{}),v.jsx(jW,{}),r.disableModelSwitch?v.jsx(v.Fragment,{}):v.jsx(iZ,{})]})]})};var Zr=function(e,t){return Number(e.toFixed(t))},cZ=function(e,t){return typeof e=="number"?e:t},Ot=function(e,t,n){n&&typeof n=="function"&&n(e,t)},uZ=function(e){return-Math.cos(e*Math.PI)/2+.5},dZ=function(e){return e},fZ=function(e){return e*e},hZ=function(e){return e*(2-e)},pZ=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},mZ=function(e){return e*e*e},gZ=function(e){return--e*e*e+1},vZ=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},yZ=function(e){return e*e*e*e},wZ=function(e){return 1- --e*e*e*e},xZ=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},bZ=function(e){return e*e*e*e*e},SZ=function(e){return 1+--e*e*e*e*e},_Z=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},N3={easeOut:uZ,linear:dZ,easeInQuad:fZ,easeOutQuad:hZ,easeInOutQuad:pZ,easeInCubic:mZ,easeOutCubic:gZ,easeInOutCubic:vZ,easeInQuart:yZ,easeOutQuart:wZ,easeInOutQuart:xZ,easeInQuint:bZ,easeOutQuint:SZ,easeInOutQuint:_Z},D3=function(e){typeof e=="number"&&cancelAnimationFrame(e)},Vo=function(e){e.mounted&&(D3(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function I3(e,t,n,r){if(e.mounted){var o=new Date().getTime(),i=1;Vo(e),e.animation=function(){if(!e.mounted)return D3(e.animation);var s=new Date().getTime()-o,l=s/n,u=N3[t],f=u(l);s>=n?(r(i),e.animation=null):e.animation&&(r(f),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function EZ(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function Ws(e,t,n,r){var o=EZ(t);if(!(!e.mounted||!o)){var i=e.setTransformState,s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY,m=t.scale-l,p=t.positionX-u,g=t.positionY-f;n===0?i(t.scale,t.positionX,t.positionY):I3(e,r,n,function(y){var x=l+m*y,S=u+p*y,E=f+g*y;i(x,S,E)})}}function CZ(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth,s=t.offsetHeight,l=i*n,u=s*n,f=r-l,m=o-u;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:l,newDiffWidth:f,newContentHeight:u,newDiffHeight:m}}var $Z=function(e,t,n,r,o,i,s){var l=e>t?n*(s?1:.5):0,u=r>o?i*(s?1:.5):0,f=e-t-l,m=l,p=r-o-u,g=u;return{minPositionX:f,maxPositionX:m,minPositionY:p,maxPositionY:g}},sb=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var i=CZ(n,r,t),s=i.wrapperWidth,l=i.wrapperHeight,u=i.newContentWidth,f=i.newDiffWidth,m=i.newContentHeight,p=i.newDiffHeight,g=$Z(s,u,f,l,m,p,!!o);return g},K1=function(e,t,n,r){return r?e<t?Zr(t,2):e>n?Zr(n,2):Zr(e,2):Zr(e,2)},wc=function(e,t){var n=sb(e,t);return e.bounds=n,n};function yg(e,t,n,r,o,i,s){var l=n.minPositionX,u=n.minPositionY,f=n.maxPositionX,m=n.maxPositionY,p=0,g=0;s&&(p=o,g=i);var y=K1(e,l-p,f+p,r),x=K1(t,u-g,m+g,r);return{x:y,y:x}}function wg(e,t,n,r,o,i){var s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY,m=r-l;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:u,y:f};var p=u-t*m,g=f-n*m,y=yg(p,g,o,i,0,0,null);return y}function Zd(e,t,n,r,o){var i=o?r:0,s=t-i;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=s?s:e}var V2=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,s=o==null?void 0:o.contains(i),l=r&&i&&s;if(!l)return!1;var u=xg(i,n);return!u},W2=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,o=r.panning.disabled,i=t&&n&&!o;return!!i},RZ=function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,s=t.clientY;e.startCoords={x:i-r,y:s-o}},kZ=function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;e.isPanning=!0;var s=n.length===1;if(s){var l=n[0].clientX,u=n[0].clientY;e.startCoords={x:l-o,y:u-i}}};function PZ(e){var t=e.transformState,n=t.positionX,r=t.positionY,o=t.scale,i=e.setup,s=i.disabled,l=i.limitToBounds,u=i.centerZoomedOut,f=e.wrapperComponent;if(!(s||!f||!e.bounds)){var m=e.bounds,p=m.maxPositionX,g=m.minPositionX,y=m.maxPositionY,x=m.minPositionY,S=n>p||n<g,E=r>y||r<x,_=n>p?f.offsetWidth:e.setup.minPositionX||0,b=r>y?f.offsetHeight:e.setup.minPositionY||0,C=wg(e,_,b,o,e.bounds,l||u),R=C.x,T=C.y;return{scale:o,positionX:S?R:n,positionY:E?T:r}}}function TZ(e,t,n,r,o){var i=e.setup.limitToBounds,s=e.wrapperComponent,l=e.bounds,u=e.transformState,f=u.scale,m=u.positionX,p=u.positionY;if(!(s===null||l===null||t===m&&n===p)){var g=yg(t,n,l,i,r,o,s),y=g.x,x=g.y;e.setTransformState(f,y,x)}}var AZ=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,s=i.lockAxisX,l=i.lockAxisY,u=o.positionX,f=o.positionY;if(!r)return{x:u,y:f};var m=t-r.x,p=n-r.y,g=s?u:m,y=l?f:p;return{x:g,y}},fm=function(e,t){var n=e.setup,r=e.transformState,o=r.scale,i=n.minScale,s=n.disablePadding;return t>0&&o>=i&&!s?t:0},MZ=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale,s=o.disabled,l=!s||i>1||!r||t;return!!l},OZ=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,s=o.velocityAnimation,l=e.transformState.scale,u=s.disabled,f=!u||l>1||!i||t;return!(!f||!n||!r)};function NZ(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}function H2(e,t,n,r,o,i,s,l,u,f){if(o){if(t>s&&n>s){var m=s+(e-s)*f;return m>u?u:m<s?s:m}if(t<i&&n<i){var m=i+(e-i)*f;return m<l?l:m>i?i:m}}return r?t:K1(e,i,s,o)}function DZ(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function IZ(e,t){var n=MZ(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,s=e.wrapperComponent,l=i.velocityAnimation.equalToMove,u=Date.now();if(r&&o&&s){var f=DZ(s,l),m=t.x-r.x,p=t.y-r.y,g=m/f,y=p/f,x=u-o,S=m*m+p*p,E=Math.sqrt(S)/x;e.velocity={velocityX:g,velocityY:y,total:E}}e.lastMousePosition=t,e.velocityTime=u}}function LZ(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=OZ(e);if(!(!i||!t||!n||!o)){var s=t.velocityX,l=t.velocityY,u=t.total,f=n.maxPositionX,m=n.minPositionX,p=n.maxPositionY,g=n.minPositionY,y=r.limitToBounds,x=r.alignmentAnimation,S=r.zoomAnimation,E=r.panning,_=E.lockAxisY,b=E.lockAxisX,C=S.animationType,R=x.sizeX,T=x.sizeY,N=x.velocityAlignmentTime,A=N,O=NZ(e,u),U=Math.max(O,A),z=fm(e,R),ie=fm(e,T),K=z*o.offsetWidth/100,te=ie*o.offsetHeight/100,W=f+K,re=m-K,H=p+te,J=g-te,G=e.transformState,Z=new Date().getTime();I3(e,C,U,function(Q){var le=e.transformState,L=le.scale,ue=le.positionX,Ne=le.positionY,Ke=new Date().getTime()-Z,Me=Ke/A,me=N3[x.animationType],be=1-me(Math.min(1,Me)),Ee=1-Q,Oe=ue+s*Ee,Ie=Ne+l*Ee,ze=H2(Oe,G.positionX,ue,b,y,m,f,re,W,be),ht=H2(Ie,G.positionY,Ne,_,y,g,p,J,H,be);(ue!==Oe||Ne!==Ie)&&e.setTransformState(L,ze,ht)})}}function K2(e,t){var n=e.transformState.scale;Vo(e),wc(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?kZ(e,t):RZ(e,t)}function L3(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,s=o.sizeX,l=o.sizeY,u=o.animationTime,f=o.animationType,m=i||t<r||!s&&!l;if(!m){var p=PZ(e);p&&Ws(e,p,u,f)}}function G2(e,t,n){var r=e.startCoords,o=e.setup,i=o.alignmentAnimation,s=i.sizeX,l=i.sizeY;if(r){var u=AZ(e,t,n),f=u.x,m=u.y,p=fm(e,s),g=fm(e,l);IZ(e,{x:f,y:m}),TZ(e,f,m,p,g)}}function jZ(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var i=r==null?void 0:r.getBoundingClientRect(),s=o==null?void 0:o.getBoundingClientRect(),l=(i==null?void 0:i.width)||0,u=(i==null?void 0:i.height)||0,f=(s==null?void 0:s.width)||0,m=(s==null?void 0:s.height)||0,p=l<f||u<m,g=!t&&n&&(n==null?void 0:n.total)>.1&&p;g?LZ(e):L3(e)}}function ab(e,t,n,r){var o=e.setup,i=o.minScale,s=o.maxScale,l=o.limitToBounds,u=Zd(Zr(t,2),i,s,0,!1),f=wc(e,u),m=wg(e,n,r,u,f,l),p=m.x,g=m.y;return{scale:u,positionX:p,positionY:g}}function j3(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,s=i.minScale,l=i.limitToBounds,u=i.zoomAnimation,f=u.disabled,m=u.animationTime,p=u.animationType,g=f||r>=s;if((r>=1||l)&&L3(e),!(g||!o||!e.mounted)){var y=t||o.offsetWidth/2,x=n||o.offsetHeight/2,S=ab(e,s,y,x);S&&Ws(e,S,m,p)}}var Ts=function(){return Ts=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ts.apply(this,arguments)};function Y2(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var kh={previousScale:1,scale:1,positionX:0,positionY:0},pu={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!1,smooth:!0,wheel:{step:.2,disabled:!1,smoothStep:.001,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},F3=function(e){var t,n,r,o;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:kh.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:kh.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:kh.positionX,positionY:(o=e.initialPositionY)!==null&&o!==void 0?o:kh.positionY}},X2=function(e){var t=Ts({},pu);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",o=typeof pu[n]<"u";if(o&&r){var i=Object.prototype.toString.call(pu[n]),s=i==="[object Object]",l=i==="[object Array]";s?t[n]=Ts(Ts({},pu[n]),e[n]):l?t[n]=Y2(Y2([],pu[n],!0),e[n],!0):t[n]=e[n]}}),t},B3=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,s=i.maxScale,l=i.minScale,u=i.zoomAnimation,f=i.smooth,m=u.size;if(!o)throw new Error("Wrapper is not mounted");var p=f?r*Math.exp(t*n):r+t*n,g=Zd(Zr(p,3),l,s,m,!1);return g};function z3(e,t,n,r,o){var i=e.wrapperComponent,s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY;if(!i)return console.error("No WrapperComponent found");var m=i.offsetWidth,p=i.offsetHeight,g=(m/2-u)/l,y=(p/2-f)/l,x=B3(e,t,n),S=ab(e,x,g,y);if(!S)return console.error("Error during zoom event. New transformation state was not calculated.");Ws(e,S,r,o)}function U3(e,t,n,r){var o=e.setup,i=e.wrapperComponent,s=o.limitToBounds,l=F3(e.props),u=e.transformState,f=u.scale,m=u.positionX,p=u.positionY;if(i){var g=sb(e,l.scale),y=yg(l.positionX,l.positionY,g,s,0,0,i),x={scale:l.scale,positionX:y.x,positionY:y.y};f===l.scale&&m===l.positionX&&p===l.positionY||(r==null||r(),Ws(e,x,t,n))}}function FZ(e,t,n,r){var o=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),l=i.x*r.scale,u=i.y*r.scale;return{x:(o.x-s.x+l)/r.scale,y:(o.y-s.y+u)/r.scale}}function BZ(e,t,n){var r=e.wrapperComponent,o=e.contentComponent,i=e.transformState,s=e.setup,l=s.limitToBounds,u=s.minScale,f=s.maxScale;if(!r||!o)return i;var m=r.getBoundingClientRect(),p=t.getBoundingClientRect(),g=FZ(t,r,o,i),y=g.x,x=g.y,S=p.width/i.scale,E=p.height/i.scale,_=r.offsetWidth/S,b=r.offsetHeight/E,C=Zd(n||Math.min(_,b),u,f,0,!1),R=(m.width-S*C)/2,T=(m.height-E*C)/2,N=(m.left-y)*C+R,A=(m.top-x)*C+T,O=sb(e,C),U=yg(N,A,O,l,0,0,r),z=U.x,ie=U.y;return{positionX:z,positionY:ie,scale:C}}var zZ=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),z3(e,1,t,n,r)}},UZ=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),z3(e,-1,t,n,r)}},VZ=function(e){return function(t,n,r,o,i){o===void 0&&(o=300),i===void 0&&(i="easeOut");var s=e.transformState,l=s.positionX,u=s.positionY,f=s.scale,m=e.wrapperComponent,p=e.contentComponent,g=e.setup.disabled;if(!(g||!m||!p)){var y={positionX:Number.isNaN(t)?l:t,positionY:Number.isNaN(n)?u:n,scale:Number.isNaN(r)?f:r};Ws(e,y,o,i)}}},WZ=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),U3(e,t,n)}},HZ=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,s=e.contentComponent;if(i&&s){var l=V3(t||o.scale,i,s);Ws(e,l,n,r)}}},KZ=function(e){return function(t,n,r,o){r===void 0&&(r=600),o===void 0&&(o="easeOut"),Vo(e);var i=e.wrapperComponent,s=typeof t=="string"?document.getElementById(t):t;if(i&&s&&i.contains(s)){var l=BZ(e,s,n);Ws(e,l,r,o)}}},G1=function(e){return{instance:e,zoomIn:zZ(e),zoomOut:UZ(e),setTransform:VZ(e),resetTransform:WZ(e),centerView:HZ(e),zoomToElement:KZ(e)}},GZ=function(e){return{instance:e,state:e.transformState}},Et=function(e){var t={};return Object.assign(t,GZ(e)),Object.assign(t,G1(e)),t},K0=!1;function G0(){try{var e={get passive(){return K0=!0,!1}};return e}catch{return K0=!1,K0}}var xg=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(i){return i.toUpperCase()===n});if(r)return!0;var o=t.find(function(i){return e.classList.contains(i)});return!!o},Y1=function(e){e&&clearTimeout(e)},YZ=function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")},V3=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e,i=(t.offsetWidth-r)/2,s=(t.offsetHeight-o)/2;return{scale:e,positionX:i,positionY:s}};function XZ(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var ZZ=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,s=n.excluded,l=e.isInitialized,u=e.isPanning,f=t.target,m=l&&!u&&!r&&f;if(!m||o&&!t.ctrlKey||i&&t.ctrlKey)return!1;var p=xg(f,s);return!p},qZ=function(e){return e?e.deltaY<0?1:-1:0};function QZ(e,t){var n=qZ(e),r=cZ(t,n);return r}function W3(e,t,n){var r=t.getBoundingClientRect(),o=0,i=0;if("clientX"in e)o=(e.clientX-r.left)/n,i=(e.clientY-r.top)/n;else{var s=e.touches[0];o=(s.clientX-r.left)/n,i=(s.clientY-r.top)/n}return(Number.isNaN(o)||Number.isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var JZ=function(e,t,n,r,o){var i=e.transformState.scale,s=e.wrapperComponent,l=e.setup,u=l.maxScale,f=l.minScale,m=l.zoomAnimation,p=l.disablePadding,g=m.size,y=m.disabled;if(!s)throw new Error("Wrapper is not mounted");var x=i+t*n;if(o)return x;var S=r?!1:!y,E=Zd(Zr(x,3),f,u,g,S&&!p);return E},eq=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,s=o.minScale;return n?r<i||r>s||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},tq=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,s=t.target,l=i&&!r&&s;if(!l)return!1;var u=xg(s,o);return!u},nq=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,o=n&&!t&&r;return!!o},rq=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=Zr(o[0].clientX-r.left,5),s=Zr(o[0].clientY-r.top,5),l=Zr(o[1].clientX-r.left,5),u=Zr(o[1].clientY-r.top,5);return{x:(i+l)/2/t,y:(s+u)/2/t}},H3=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},oq=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=o.disablePadding,f=l.size,m=l.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var p=t/r,g=p*n;return Zd(Zr(g,2),s,i,f,!m&&!u)},iq=160,sq=100,aq=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Vo(e),Ot(Et(e),t,r),Ot(Et(e),t,o))},lq=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,s=e.setup,l=e.transformState,u=l.scale,f=s.limitToBounds,m=s.centerZoomedOut,p=s.zoomAnimation,g=s.wheel,y=s.disablePadding,x=s.smooth,S=p.size,E=p.disabled,_=g.step,b=g.smoothStep;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var C=QZ(t,null),R=x?b*Math.abs(t.deltaY):_,T=JZ(e,C,R,!t.ctrlKey);if(u!==T){var N=wc(e,T),A=W3(t,i,u),O=E||S===0||m||y,U=f&&O,z=wg(e,A.x,A.y,T,N,U),ie=z.x,K=z.y;e.previousWheelEvent=t,e.setTransformState(T,ie,K),Ot(Et(e),t,r),Ot(Et(e),t,o)}},cq=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Y1(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(j3(e,t.x,t.y),e.wheelAnimationTimer=null)},sq);var i=eq(e,t);i&&(Y1(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Ot(Et(e),t,r),Ot(Et(e),t,o))},iq))},uq=function(e,t){var n=H3(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Vo(e)},dq=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,s=i.limitToBounds,l=i.centerZoomedOut,u=i.zoomAnimation,f=u.disabled,m=u.size;if(!(r===null||!n)){var p=rq(t,o,n);if(!(!Number.isFinite(p.x)||!Number.isFinite(p.y))){var g=H3(t),y=oq(e,g);if(y!==o){var x=wc(e,y),S=f||m===0||l,E=s&&S,_=wg(e,p.x,p.y,y,x,E),b=_.x,C=_.y;e.pinchMidpoint=p,e.lastDistance=g,e.setTransformState(y,b,C)}}}},fq=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,j3(e,t==null?void 0:t.x,t==null?void 0:t.y)},K3=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;Y1(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,Ot(Et(e),t,n)},r)},hq=function(e,t){var n=e.props,r=n.onZoomStart,o=n.onZoom,i=e.setup.doubleClick,s=i.animationTime,l=i.animationType;Ot(Et(e),t,r),U3(e,s,l,function(){return Ot(Et(e),t,o)}),K3(e,t)};function pq(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,o=e.transformState,i=e.contentComponent,s=o.scale,l=e.props,u=l.onZoomStart,f=l.onZoom,m=n.doubleClick,p=m.disabled,g=m.mode,y=m.step,x=m.animationTime,S=m.animationType;if(!p&&!r){if(g==="reset")return hq(e,t);if(!i)return console.error("No ContentComponent found");var E=g==="zoomOut"?-1:1,_=B3(e,E,y);if(s!==_){Ot(Et(e),t,u);var b=W3(t,i,s),C=ab(e,_,b.x,b.y);if(!C)return console.error("Error during zoom event. New transformation state was not calculated.");Ot(Et(e),t,f),Ws(e,C,x,S),K3(e,t)}}}var mq=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,s=i.disabled,l=i.excluded,u=t.target,f=o==null?void 0:o.contains(u),m=n&&u&&f&&!s;if(!m)return!1;var p=xg(u,l);return!p},gq=function(){function e(t){var n=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){n.initializeWindowEvents()},this.unmount=function(){n.cleanupWindowEvents()},this.update=function(r){wc(n,n.transformState.scale),n.setup=X2(r)},this.initializeWindowEvents=function(){var r,o=G0(),i=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,s=i==null?void 0:i.defaultView;s==null||s.addEventListener("mousedown",n.onPanningStart,o),s==null||s.addEventListener("mousemove",n.onPanning,o),s==null||s.addEventListener("mouseup",n.onPanningStop,o),i==null||i.addEventListener("mouseleave",n.clearPanning,o),s==null||s.addEventListener("keyup",n.setKeyUnPressed,o),s==null||s.addEventListener("keydown",n.setKeyPressed,o)},this.cleanupWindowEvents=function(){var r,o,i=G0(),s=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,l=s==null?void 0:s.defaultView;l==null||l.removeEventListener("mousedown",n.onPanningStart,i),l==null||l.removeEventListener("mousemove",n.onPanning,i),l==null||l.removeEventListener("mouseup",n.onPanningStop,i),s==null||s.removeEventListener("mouseleave",n.clearPanning,i),l==null||l.removeEventListener("keyup",n.setKeyUnPressed,i),l==null||l.removeEventListener("keydown",n.setKeyPressed,i),document.removeEventListener("mouseleave",n.clearPanning,i),Vo(n),(o=n.observer)===null||o===void 0||o.disconnect()},this.handleInitializeWrapperEvents=function(r){var o=G0();r.addEventListener("wheel",n.onWheelZoom,o),r.addEventListener("dblclick",n.onDoubleClick,o),r.addEventListener("touchstart",n.onTouchPanningStart,o),r.addEventListener("touchmove",n.onTouchPanning,o),r.addEventListener("touchend",n.onTouchPanningStop,o)},this.handleInitialize=function(r){var o=n.setup.centerOnInit;n.applyTransformation(),n.onInitCallbacks.forEach(function(i){return i(Et(n))}),o&&(n.setCenter(),n.observer=new ResizeObserver(function(){var i;n.onInitCallbacks.forEach(function(s){return s(Et(n))}),n.setCenter(),(i=n.observer)===null||i===void 0||i.disconnect()}),n.observer.observe(r))},this.onWheelZoom=function(r){var o=n.setup.disabled;if(!o){var i=ZZ(n,r);if(i){var s=n.isPressingKeys(n.setup.wheel.activationKeys);s&&(aq(n,r),lq(n,r),cq(n,r))}}},this.onPanningStart=function(r){var o=n.setup.disabled,i=n.props.onPanningStart;if(!o){var s=V2(n,r);if(s){var l=n.isPressingKeys(n.setup.panning.activationKeys);l&&(r.button===0&&!n.setup.panning.allowLeftClickPan||r.button===1&&!n.setup.panning.allowMiddleClickPan||r.button===2&&!n.setup.panning.allowRightClickPan||(r.preventDefault(),r.stopPropagation(),Vo(n),K2(n,r),Ot(Et(n),r,i)))}}},this.onPanning=function(r){var o=n.setup.disabled,i=n.props.onPanning;if(!o){var s=W2(n);if(s){var l=n.isPressingKeys(n.setup.panning.activationKeys);l&&(r.preventDefault(),r.stopPropagation(),G2(n,r.clientX,r.clientY),Ot(Et(n),r,i))}}},this.onPanningStop=function(r){var o=n.props.onPanningStop;n.isPanning&&(jZ(n),Ot(Et(n),r,o))},this.onPinchStart=function(r){var o=n.setup.disabled,i=n.props,s=i.onPinchingStart,l=i.onZoomStart;if(!o){var u=tq(n,r);u&&(uq(n,r),Vo(n),Ot(Et(n),r,s),Ot(Et(n),r,l))}},this.onPinch=function(r){var o=n.setup.disabled,i=n.props,s=i.onPinching,l=i.onZoom;if(!o){var u=nq(n);u&&(r.preventDefault(),r.stopPropagation(),dq(n,r),Ot(Et(n),r,s),Ot(Et(n),r,l))}},this.onPinchStop=function(r){var o=n.props,i=o.onPinchingStop,s=o.onZoomStop;n.pinchStartScale&&(fq(n),Ot(Et(n),r,i),Ot(Et(n),r,s))},this.onTouchPanningStart=function(r){var o=n.setup.disabled,i=n.props.onPanningStart;if(!o){var s=V2(n,r);if(s){var l=n.lastTouch&&+new Date-n.lastTouch<200;if(l&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Vo(n);var u=r.touches,f=u.length===1,m=u.length===2;f&&(Vo(n),K2(n,r),Ot(Et(n),r,i)),m&&n.onPinchStart(r)}}}},this.onTouchPanning=function(r){var o=n.setup.disabled,i=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(o)return;var s=W2(n);if(!s)return;r.preventDefault(),r.stopPropagation();var l=r.touches[0];G2(n,l.clientX,l.clientY),Ot(Et(n),r,i)}else r.touches.length>1&&n.onPinch(r)},this.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},this.onDoubleClick=function(r){var o=n.setup.disabled;if(!o){var i=mq(n,r);i&&pq(n,r)}},this.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},this.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},this.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},this.isPressingKeys=function(r){return r.length?!!r.find(function(o){return n.pressedKeys[o]}):!0},this.setTransformState=function(r,o,i){var s=n.props.onTransformed;if(!Number.isNaN(r)&&!Number.isNaN(o)&&!Number.isNaN(i)){r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=o,n.transformState.positionY=i,n.applyTransformation();var l=Et(n);n.onChangeCallbacks.forEach(function(u){return u(l)}),Ot(l,{scale:r,positionX:o,positionY:i},s)}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=V3(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},this.handleTransformStyles=function(r,o,i){return n.props.customTransform?n.props.customTransform(r,o,i):YZ(r,o,i)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,o=r.scale,i=r.positionX,s=r.positionY,l=n.handleTransformStyles(i,s,o);n.contentComponent.style.transform=l}},this.getContext=function(){return Et(n)},this.onChange=function(r){return n.onChangeCallbacks.has(r)||n.onChangeCallbacks.add(r),function(){n.onChangeCallbacks.delete(r)}},this.onInit=function(r){return n.onInitCallbacks.has(r)||n.onInitCallbacks.add(r),function(){n.onInitCallbacks.delete(r)}},this.init=function(r,o){n.cleanupWindowEvents(),n.wrapperComponent=r,n.contentComponent=o,wc(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(o),n.initializeWindowEvents(),n.isInitialized=!0;var i=Et(n);Ot(i,void 0,n.props.onInit)},this.props=t,this.setup=X2(this.props),this.transformState=F3(this.props)}return e}(),lb=Be.createContext(null),vq=function(e,t){return typeof e=="function"?e(t):e},yq=Be.forwardRef(function(e,t){var n=d.useRef(new gq(e)).current,r=vq(e.children,G1(n));return d.useImperativeHandle(t,function(){return G1(n)},[n]),d.useEffect(function(){n.update(e)},[n,e]),Be.createElement(lb.Provider,{value:n},r)});Be.forwardRef(function(e,t){var n=d.useRef(null),r=d.useContext(lb);return d.useEffect(function(){return r.onChange(function(o){if(n.current){var i=0,s=0;n.current.style.transform=r.handleTransformStyles(i,s,1/o.instance.transformState.scale)}})},[r]),Be.createElement("div",Ts({},e,{ref:XZ([n,t])}))});function wq(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var xq=`.transform-component-module_wrapper__SPB86 {
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__FBWxo {
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__FBWxo img {
pointer-events: none;
}
`,Z2={wrapper:"transform-component-module_wrapper__SPB86",content:"transform-component-module_content__FBWxo"};wq(xq);var bq=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,i=o===void 0?"":o,s=e.wrapperStyle,l=e.contentStyle,u=e.wrapperProps,f=u===void 0?{}:u,m=e.contentProps,p=m===void 0?{}:m,g=d.useContext(lb),y=g.init,x=g.cleanupWindowEvents,S=d.useRef(null),E=d.useRef(null);return d.useEffect(function(){var _=S.current,b=E.current;return _!==null&&b!==null&&y&&(y==null||y(_,b)),function(){x==null||x()}},[]),Be.createElement("div",Ts({},f,{ref:S,className:"react-transform-wrapper ".concat(Z2.wrapper," ").concat(r),style:s}),Be.createElement("div",Ts({},p,{ref:E,className:"react-transform-component ".concat(Z2.content," ").concat(i),style:l}),t))};const G3=["PageUp","PageDown"],Y3=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],X3={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},qd="Slider",[X1,Sq,_q]=Gd(qd),[Z3,Pte]=An(qd,[_q]),[Eq,bg]=Z3(qd),Cq=d.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:s="horizontal",disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:f=[r],value:m,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:y=!1,...x}=e,[S,E]=d.useState(null),_=We(t,W=>E(W)),b=d.useRef(new Set),C=d.useRef(0),R=s==="horizontal",T=S?!!S.closest("form"):!0,N=R?$q:Rq,[A=[],O]=no({prop:m,defaultProp:f,onChange:W=>{var re;(re=[...b.current][C.current])===null||re===void 0||re.focus(),p(W)}}),U=d.useRef(A);function z(W){const re=Iq(A,W);te(W,re)}function ie(W){te(W,C.current)}function K(){const W=U.current[C.current];A[C.current]!==W&&g(A)}function te(W,re,{commit:H}={commit:!1}){const J=Bq(i),G=zq(Math.round((W-r)/i)*i+r,J),Z=hd(G,[r,o]);O((Q=[])=>{const le=Nq(Q,Z,re);if(Fq(le,u*i)){C.current=le.indexOf(Z);const L=String(le)!==String(Q);return L&&H&&g(le),L?le:Q}else return Q})}return d.createElement(Eq,{scope:e.__scopeSlider,disabled:l,min:r,max:o,valueIndexToChangeRef:C,thumbs:b.current,values:A,orientation:s},d.createElement(X1.Provider,{scope:e.__scopeSlider},d.createElement(X1.Slot,{scope:e.__scopeSlider},d.createElement(N,Y({"aria-disabled":l,"data-disabled":l?"":void 0},x,{ref:_,onPointerDown:fe(x.onPointerDown,()=>{l||(U.current=A)}),min:r,max:o,inverted:y,onSlideStart:l?void 0:z,onSlideMove:l?void 0:ie,onSlideEnd:l?void 0:K,onHomeKeyDown:()=>!l&&te(r,0,{commit:!0}),onEndKeyDown:()=>!l&&te(o,A.length-1,{commit:!0}),onStepKeyDown:({event:W,direction:re})=>{if(!l){const G=G3.includes(W.key)||W.shiftKey&&Y3.includes(W.key)?10:1,Z=C.current,Q=A[Z],le=i*G*re;te(Q+le,Z,{commit:!0})}}})))),T&&A.map((W,re)=>d.createElement(Oq,{key:re,name:n?n+(A.length>1?"[]":""):void 0,value:W})))}),[q3,Q3]=Z3(qd,{startEdge:"left",endEdge:"right",size:"width",direction:1}),$q=d.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:s,onSlideMove:l,onSlideEnd:u,onStepKeyDown:f,...m}=e,[p,g]=d.useState(null),y=We(t,C=>g(C)),x=d.useRef(),S=Mc(o),E=S==="ltr",_=E&&!i||!E&&i;function b(C){const R=x.current||p.getBoundingClientRect(),T=[0,R.width],A=cb(T,_?[n,r]:[r,n]);return x.current=R,A(C-R.left)}return d.createElement(q3,{scope:e.__scopeSlider,startEdge:_?"left":"right",endEdge:_?"right":"left",direction:_?1:-1,size:"width"},d.createElement(J3,Y({dir:S,"data-orientation":"horizontal"},m,{ref:y,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const R=b(C.clientX);s==null||s(R)},onSlideMove:C=>{const R=b(C.clientX);l==null||l(R)},onSlideEnd:()=>{x.current=void 0,u==null||u()},onStepKeyDown:C=>{const T=X3[_?"from-left":"from-right"].includes(C.key);f==null||f({event:C,direction:T?-1:1})}})))}),Rq=d.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:s,onSlideEnd:l,onStepKeyDown:u,...f}=e,m=d.useRef(null),p=We(t,m),g=d.useRef(),y=!o;function x(S){const E=g.current||m.current.getBoundingClientRect(),_=[0,E.height],C=cb(_,y?[r,n]:[n,r]);return g.current=E,C(S-E.top)}return d.createElement(q3,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1},d.createElement(J3,Y({"data-orientation":"vertical"},f,{ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const E=x(S.clientY);i==null||i(E)},onSlideMove:S=>{const E=x(S.clientY);s==null||s(E)},onSlideEnd:()=>{g.current=void 0,l==null||l()},onStepKeyDown:S=>{const _=X3[y?"from-bottom":"from-top"].includes(S.key);u==null||u({event:S,direction:_?-1:1})}})))}),J3=d.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:s,onEndKeyDown:l,onStepKeyDown:u,...f}=e,m=bg(qd,n);return d.createElement(Ae.span,Y({},f,{ref:t,onKeyDown:fe(e.onKeyDown,p=>{p.key==="Home"?(s(p),p.preventDefault()):p.key==="End"?(l(p),p.preventDefault()):G3.concat(Y3).includes(p.key)&&(u(p),p.preventDefault())}),onPointerDown:fe(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),m.thumbs.has(g)?g.focus():r(p)}),onPointerMove:fe(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&o(p)}),onPointerUp:fe(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),i(p))})}))}),kq="SliderTrack",Pq=d.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=bg(kq,n);return d.createElement(Ae.span,Y({"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation},r,{ref:t}))}),q2="SliderRange",Tq=d.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=bg(q2,n),i=Q3(q2,n),s=d.useRef(null),l=We(t,s),u=o.values.length,f=o.values.map(g=>eA(g,o.min,o.max)),m=u>1?Math.min(...f):0,p=100-Math.max(...f);return d.createElement(Ae.span,Y({"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0},r,{ref:l,style:{...e.style,[i.startEdge]:m+"%",[i.endEdge]:p+"%"}}))}),Q2="SliderThumb",Aq=d.forwardRef((e,t)=>{const n=Sq(e.__scopeSlider),[r,o]=d.useState(null),i=We(t,l=>o(l)),s=d.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return d.createElement(Mq,Y({},e,{ref:i,index:s}))}),Mq=d.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,...o}=e,i=bg(Q2,n),s=Q3(Q2,n),[l,u]=d.useState(null),f=We(t,E=>u(E)),m=Cx(l),p=i.values[r],g=p===void 0?0:eA(p,i.min,i.max),y=Dq(r,i.values.length),x=m==null?void 0:m[s.size],S=x?Lq(x,g,s.direction):0;return d.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]),d.createElement("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${g}% + ${S}px)`}},d.createElement(X1.ItemSlot,{scope:e.__scopeSlider},d.createElement(Ae.span,Y({role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":i.min,"aria-valuenow":p,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0},o,{ref:f,style:p===void 0?{display:"none"}:e.style,onFocus:fe(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})}))))}),Oq=e=>{const{value:t,...n}=e,r=d.useRef(null),o=Xx(t);return d.useEffect(()=>{const i=r.current,s=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(s,"value").set;if(o!==t&&u){const f=new Event("input",{bubbles:!0});u.call(i,t),i.dispatchEvent(f)}},[o,t]),d.createElement("input",Y({style:{display:"none"}},n,{ref:r,defaultValue:t}))};function Nq(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function eA(e,t,n){const i=100/(n-t)*(e-t);return hd(i,[0,100])}function Dq(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Iq(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function Lq(e,t,n){const r=e/2,i=cb([0,50],[0,r]);return(r-i(t)*n)*n}function jq(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Fq(e,t){if(t>0){const n=jq(e);return Math.min(...n)>=t}return!0}function cb(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Bq(e){return(String(e).split(".")[1]||"").length}function zq(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const tA=Cq,Uq=Pq,Vq=Tq,Wq=Aq,zr=d.forwardRef(({className:e,...t},n)=>v.jsxs(tA,{ref:n,className:xe("relative flex w-full touch-none select-none items-center",e),tabIndex:-1,...t,children:[v.jsx(Uq,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",children:v.jsx(Vq,{className:"absolute h-full bg-primary data-[disabled]:cursor-not-allowed "})}),v.jsx(Wq,{tabIndex:-1,className:"block h-4 w-4 rounded-full border border-primary/60 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[disabled]:cursor-not-allowed"})]}));zr.displayName=tA.displayName;const dl={capture:!0,passive:!1},Hq=2,J2=(e,t,n,r,o,i)=>{if(e!==n&&t===r){if(e<0)return[0,r];if(e+t>i)return[i-r,r]}else{if(t<o)return e===n?[e,o]:[e+t-o,o];if(e<0)return[0,e+t];if(e+t>i)return[e,i-e]}return[e,t]},Kq=e=>{const{minHeight:t,minWidth:n,maxHeight:r,maxWidth:o,scale:i,show:s}=e,[l,u,f,m,{x:p,y:g,width:y,height:x},S,E,_,b,C,R]=xt(Q=>[Q.imageWidth,Q.imageHeight,Q.isInpainting,Q.isSD(),Q.cropperState,Q.setCropperX,Q.setCropperY,Q.setCropperWidth,Q.setCropperHeight,Q.isCropperExtenderResizing,Q.setIsCropperExtenderResizing]),[T,N]=d.useState(!1);d.useEffect(()=>{S(Math.round((o-512)/2)),E(Math.round((r-512)/2))},[r,o,l,u]);const[A,O]=d.useState({initX:0,initY:0,initHeight:0,initWidth:0,startResizeX:0,startResizeY:0,ord:"top"}),U=()=>{},z=(Q,le)=>J2(Q,le,p,y,n,o),ie=(Q,le)=>J2(Q,le,g,x,t,r),K=Q=>{if(f)return;const le=Q.clientX,L=Q.clientY,ue=Math.round((L-A.startResizeY)/i),Ne=Math.round((le-A.startResizeX)/i),Ke=()=>{const Ee=A.initHeight-ue,Oe=A.initY+ue,[Ie,ze]=ie(Oe,Ee);b(ze),E(Ie)},Me=()=>{const Ee=A.initHeight+ue,[Oe,Ie]=ie(A.initY,Ee);b(Ie),E(Oe)},me=()=>{const Ee=A.initWidth-Ne,Oe=A.initX+Ne,[Ie,ze]=z(Oe,Ee);_(ze),S(Ie)},be=()=>{const Ee=A.initWidth+Ne,[Oe,Ie]=z(A.initX,Ee);_(Ie),S(Oe)};if(C)switch(A.ord){case"topleft":{Ke(),me();break}case"topright":{Ke(),be();break}case"bottomleft":{Me(),me();break}case"bottomright":{Me(),be();break}case"top":{Ke();break}case"right":{be();break}case"bottom":{Me();break}case"left":{me();break}}if(T){const Ee=A.initX+Ne,Oe=A.initY+ue,[Ie,ze]=z(Ee,A.initWidth),[ht,st]=ie(Oe,A.initHeight);_(ze),b(st),S(Ie),E(ht)}},te=()=>{C&&R(!1),T&&N(!1)};d.useEffect(()=>{if(C||T)return document.addEventListener("pointermove",K,dl),document.addEventListener("pointerup",te,dl),document.addEventListener("pointercancel",te,dl),()=>{document.removeEventListener("pointermove",K,dl),document.removeEventListener("pointerup",te,dl),document.removeEventListener("pointercancel",te,dl)}},[C,T,y,x,A]);const W=Q=>{const{ord:le}=Q.target.dataset;le&&(R(!0),O({initX:p,initY:g,initHeight:x,initWidth:y,startResizeX:Q.clientX,startResizeY:Q.clientY,ord:le}))},re=(Q,le,L)=>{const Ke="w-[12px] h-[12px] z-[4] absolute content-[''] block border-2 border-primary borde pointer-events-auto hover:bg-primary";let Me="0",me="0",be=L,Ee="-6px";return L===""&&(Ee="50%",le==="left"||le==="right"?(be="top",me="-50%"):(be="left",Me="-50%")),v.jsx("div",{className:xe(Ke,Q),style:{[le]:-6,[be]:Ee,transform:`translate(${Me}, ${me}) scale(${1/i})`},"data-ord":le+L,"aria-label":le+L,tabIndex:-1,role:"button"})},H=()=>v.jsxs("div",{onFocus:U,onPointerDown:W,className:"absolute top-0 h-full w-full",children:[v.jsx("div",{className:"absolute pointer-events-auto top-0 left-0 w-full cursor-ns-resize h-[12px] mt-[-6px]","data-ord":"top"}),v.jsx("div",{className:"absolute pointer-events-auto top-0 right-0 h-full cursor-ew-resize w-[12px] mr-[-6px]","data-ord":"right"}),v.jsx("div",{className:"absolute pointer-events-auto bottom-0 left-0 w-full cursor-ns-resize h-[12px] mb-[-6px]","data-ord":"bottom"}),v.jsx("div",{className:"absolute pointer-events-auto top-0 left-0 h-full cursor-ew-resize w-[12px] ml-[-6px]","data-ord":"left"}),re("cursor-nw-resize","top","left"),re("cursor-ne-resize","top","right"),re("cursor-sw-resize","bottom","left"),re("cursor-se-resize","bottom","right"),re("cursor-ns-resize","top",""),re("cursor-ns-resize","bottom",""),re("cursor-ew-resize","left",""),re("cursor-ew-resize","right","")]}),J=Q=>{N(!0),O({initX:p,initY:g,initHeight:x,initWidth:y,startResizeX:Q.clientX,startResizeY:Q.clientY,ord:""})},G=()=>v.jsxs("div",{className:lx("border absolute pointer-events-auto px-2 py-1 rounded-full hover:cursor-move bg-background","origin-top-left top-0 left-0"),style:{transform:`scale(${1/i*.8})`},onPointerDown:J,children:[y," x ",x]}),Z=()=>v.jsx("div",{className:"outline-dashed outline-primary",style:{height:x,width:y,outlineWidth:`${Hq/i*1.3}px`}});return s===!1||!m?null:v.jsx("div",{className:"absolute h-full w-full overflow-hidden pointer-events-none z-[2]",children:v.jsxs("div",{className:"relative pointer-events-none z-[2] [box-shadow:0_0_0_9999px_rgba(0,_0,_0,_0.5)]",style:{height:x,width:y,left:p,top:g},children:[Z(),G(),H()]})})},Gq=()=>{const[e,t,n]=xt(r=>[r.interactiveSegState,r.resetInteractiveSegState,r.handleInteractiveSegAccept]);return e.isInteractiveSeg?v.jsxs("div",{className:"z-10 absolute top-[68px] rounded-xl border-solid border p-[8px] left-1/2 translate-x-[-50%] flex justify-center items-center gap-[8px] bg-background",children:[v.jsx(wn,{onClick:()=>{t()},size:"sm",variant:"secondary",children:"Cancel"}),v.jsx(wn,{size:"sm",onClick:()=>{n()},children:"Accept"})]}):null},Yq=e=>{const{x:t,y:n,positive:r}=e,o=r?"bg-[rgba(21,_215,_121,_0.936)] outline-[rgba(98,255,179,0.31)]":"bg-[rgba(237,_49,_55,_0.942)] outline-[rgba(255,89,95,0.31)]";return v.jsx("div",{className:`absolute h-[10px] w-[10px] rounded-[50%] ${o} outline-8 outline`,style:{left:t,top:n,transform:"translate(-50%, -50%)"}})},Xq=()=>{const e=xt(t=>t.interactiveSegState.clicks);return v.jsx("div",{className:"absolute h-full w-full overflow-hidden pointer-events-none",children:e.map(t=>v.jsx(Yq,{x:t[0],y:t[1],positive:t[2]===1},t[3]))})},Zq=()=>v.jsx("div",{children:v.jsx(Gq,{})}),fl={capture:!0,passive:!1},qq=2,e$=(e,t,n,r)=>t<r?e===n?[e,r]:[e+t-r,r]:[e,t],Qq=e=>{const{minHeight:t,minWidth:n,scale:r,show:o}=e,[i,s,l,u,{x:f,y:m,width:p,height:g},y,x,S,E,_,b,C]=xt(J=>[J.isInpainting,J.imageHeight,J.imageWidth,J.isSD(),J.extenderState,J.setExtenderX,J.setExtenderY,J.setExtenderWidth,J.setExtenderHeight,J.settings.extenderDirection,J.isCropperExtenderResizing,J.setIsCropperExtenderResizing]),[R,T]=d.useState({initX:0,initY:0,initHeight:0,initWidth:0,startResizeX:0,startResizeY:0,ord:"top"}),N=()=>{},A=(J,G)=>e$(J,G,f,n),O=(J,G)=>e$(J,G,m,t),U=J=>{if(i)return;const G=J.clientX,Z=J.clientY,Q=Math.round((Z-R.startResizeY)/r),le=Math.round((G-R.startResizeX)/r),L=()=>{const Me=R.initHeight-Q,me=R.initY+Q;let be=me,Ee=Me;if(_===jn.xy)be>0&&(be=0,Ee=R.initHeight-Math.abs(R.initY));else{const Oe=O(me,Me);be=Oe[0],Ee=Oe[1]}E(Ee),x(be)},ue=()=>{const Me=R.initHeight+Q;let[me,be]=O(R.initY,Me);_===jn.xy&&be<Math.abs(me)+s&&(be=Math.abs(me)+s),E(be),x(me)},Ne=()=>{const Me=R.initWidth-le,me=R.initX+le;let be=me,Ee=Me;if(_===jn.xy)be>0&&(be=0,Ee=R.initWidth-Math.abs(R.initX));else{const Oe=A(me,Me);be=Oe[0],Ee=Oe[1]}S(Ee),y(be)},Ke=()=>{const Me=R.initWidth+le;let[me,be]=A(R.initX,Me);_===jn.xy&&be<Math.abs(me)+l&&(be=Math.abs(me)+l),S(be),y(me)};if(b)switch(R.ord){case"topleft":{L(),Ne();break}case"topright":{L(),Ke();break}case"bottomleft":{ue(),Ne();break}case"bottomright":{ue(),Ke();break}case"top":{L();break}case"right":{Ke();break}case"bottom":{ue();break}case"left":{Ne();break}}},z=()=>{b&&C(!1)};d.useEffect(()=>{if(b)return document.addEventListener("pointermove",U,fl),document.addEventListener("pointerup",z,fl),document.addEventListener("pointercancel",z,fl),()=>{document.removeEventListener("pointermove",U,fl),document.removeEventListener("pointerup",z,fl),document.removeEventListener("pointercancel",z,fl)}},[b,p,g,R]);const ie=J=>{const{ord:G}=J.target.dataset;G&&(C(!0),T({initX:f,initY:m,initHeight:g,initWidth:p,startResizeX:J.clientX,startResizeY:J.clientY,ord:G}))},K=(J,G,Z)=>{const L="w-[12px] h-[12px] z-[4] absolute content-[''] block border-2 border-primary borde pointer-events-auto hover:bg-primary";let ue="0",Ne="0",Ke=Z,Me="-6px";return Z===""&&(Me="50%",G==="left"||G==="right"?(Ke="top",Ne="-50%"):(Ke="left",ue="-50%")),v.jsx("div",{className:xe(L,J),style:{[G]:-6,[Ke]:Me,transform:`translate(${ue}, ${Ne}) scale(${1/r})`},"data-ord":G+Z,"aria-label":G+Z,tabIndex:-1,role:"button"})},te=()=>v.jsxs("div",{onFocus:N,onPointerDown:ie,className:"absolute top-0 h-full w-full",children:[[jn.y,jn.xy].includes(_)?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"absolute pointer-events-auto top-0 left-0 w-full cursor-ns-resize h-[12px] mt-[-6px]","data-ord":"top"}),v.jsx("div",{className:"absolute pointer-events-auto bottom-0 left-0 w-full cursor-ns-resize h-[12px] mb-[-6px]","data-ord":"bottom"}),K("cursor-ns-resize","top",""),K("cursor-ns-resize","bottom","")]}):v.jsx(v.Fragment,{}),[jn.x,jn.xy].includes(_)?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"absolute pointer-events-auto top-0 right-0 h-full cursor-ew-resize w-[12px] mr-[-6px]","data-ord":"right"}),v.jsx("div",{className:"absolute pointer-events-auto top-0 left-0 h-full cursor-ew-resize w-[12px] ml-[-6px]","data-ord":"left"}),K("cursor-ew-resize","left",""),K("cursor-ew-resize","right","")]}):v.jsx(v.Fragment,{}),_===jn.xy?v.jsxs(v.Fragment,{children:[K("cursor-nw-resize","top","left"),K("cursor-ne-resize","top","right"),K("cursor-sw-resize","bottom","left"),K("cursor-se-resize","bottom","right")]}):v.jsx(v.Fragment,{})]}),W=J=>{T({initX:f,initY:m,initHeight:g,initWidth:p,startResizeX:J.clientX,startResizeY:J.clientY,ord:""})},re=()=>v.jsxs("div",{className:lx("border absolute pointer-events-auto px-2 py-1 rounded-full bg-background","origin-top-left top-0 left-0"),style:{transform:`scale(${1/r*.8})`},onPointerDown:W,children:[p," x ",g]}),H=()=>v.jsx("div",{className:xe("outline-dashed outline-primary"),style:{height:g,width:p,outlineWidth:`${qq/r*1.3}px`}});return o===!1||!u?null:v.jsx("div",{className:"absolute h-full w-full pointer-events-none z-[2]",children:v.jsxs("div",{className:"relative pointer-events-none z-[2] [box-shadow:0_0_0_9999px_rgba(0,_0,_0,_0.5)]",style:{height:g,width:p,left:f,top:m},children:[H(),re(),te()]})})},Jq=200,mu=300;function eQ(e){const{file:t}=e,{toast:n}=Ld(),[r,o,i,s,l,u,f,m,p,g,y,x,S,E,_,b,C,R,T,N,A,O,U,z]=xt(V=>[V.disableShortCuts,V.windowSize,V.isInpainting,V.imageWidth,V.imageHeight,V.settings,V.serverConfig.enableAutoSaving,V.setImageSize,V.setBaseBrushSize,V.interactiveSegState,V.updateInteractiveSegState,V.handleCanvasMouseDown,V.handleCanvasMouseMove,V.undo,V.redo,V.undoDisabled(),V.redoDisabled(),V.getIsProcessing(),V.updateAppState,V.runMannually(),V.runInpainting,V.isCropperExtenderResizing,V.decreaseBaseBrushSize,V.increaseBaseBrushSize]),ie=xt(V=>V.editorState.baseBrushSize),K=xt(V=>V.getBrushSize()),te=xt(V=>V.editorState.renders),W=xt(V=>V.editorState.extraMasks),re=xt(V=>V.editorState.temporaryMasks),H=xt(V=>V.editorState.lineGroups),J=xt(V=>V.editorState.curLineGroup),[G,Z]=d.useState(!1),[Q,le]=Lx(t),[L,ue]=d.useState(),[Ne,Ke]=d.useState(),[{x:Me,y:me},be]=d.useState({x:-1,y:-1}),[Ee,Oe]=d.useState(!1),[Ie,ze]=d.useState(!1),[ht,st]=d.useState(!1),[Yt,rr]=d.useState(1),[en,Li]=d.useState(!1),[D,X]=d.useState(1),ee=o.width/2,Se=o.height/2,pe=d.useRef(null),[he,Pe]=d.useState(!1),[dt,gt]=d.useState(!1),[Mn,On]=d.useState(0),[ji,Cr]=d.useState(!1),$r=d.useCallback(()=>J.length!==0,[J]);d.useEffect(()=>{if(!Ne||!le||s===0||l===0)return;const V=te.length===0?Q:te[te.length-1];Ne.canvas.width=s,Ne.canvas.height=l,Ne.clearRect(0,0,Ne.canvas.width,Ne.canvas.height),Ne.drawImage(V,0,0,s,l)},[te,Q,le,Ne,l,s]),d.useEffect(()=>{!L||!le||s===0||l===0||(L.canvas.width=s,L.canvas.height=l,L.clearRect(0,0,L.canvas.width,L.canvas.height),re.forEach(V=>{L.drawImage(V,0,0,s,l)}),W.forEach(V=>{L.drawImage(V,0,0,s,l)}),g.isInteractiveSeg&&g.tmpInteractiveSegMask&&L.drawImage(g.tmpInteractiveSegMask,0,0,s,l),ok(L,J))},[re,W,le,g,L,J,l,s]);const Ks=d.useCallback(async()=>{let V=t;if(te.length>0){const Ue=te[te.length-1];V=await Du(Ue.currentSrc,t.name,t.type)}return V},[t,te]),ri=()=>te.length!==0,Fi=d.useCallback(()=>{let V=512,Ue=512;return le?(te.length===0?(V=Q.naturalWidth,Ue=Q.naturalHeight):te.length!==0&&(V=te[te.length-1].width,Ue=te[te.length-1].height),[V,Ue]):[V,Ue]},[Q,le,te]);d.useEffect(()=>{var lf;if(!le)return;const[V,Ue]=Fi();(V!==s||Ue!==l)&&m(V,Ue);const at=o.width/V,oo=(o.height-Jq)/Ue;let ln=1;(at<1||oo<1)&&(ln=Math.min(at,oo)),X(ln),rr(ln),console.log(`[on file load] image size: ${V}x${Ue}, scale: ${ln}, initialCentered: ${he}`),L!=null&&L.canvas&&(console.log("[on file load] set canvas size"),V!=L.canvas.width&&(L.canvas.width=V),Ue!=L.canvas.height&&(L.canvas.height=Ue)),he||((lf=pe.current)==null||lf.centerView(ln,1),console.log("[on file load] centerView"),Pe(!0))},[pe,l,s,Q,le,o,he,Fi]),d.useEffect(()=>{var V;console.log("[useEffect] centerView"),(V=pe==null?void 0:pe.current)==null||V.centerView(D,1)},[l,s,pe,D]);const or=d.useCallback(()=>{if(!D||!o)return;const V=pe.current;if(!V)return;const Ue=(o.width-s*D)/2,at=(o.height-l*D)/2;V.setTransform(Ue,at,D,200,"easeOutQuad"),V.instance.transformState.scale&&(V.instance.transformState.scale=D),rr(D),Li(!1)},[pe,o,l,s,o.height,D]);d.useEffect(()=>(window.addEventListener("resize",()=>{or()}),()=>{window.removeEventListener("resize",()=>{or()})}),[o,or]),Xn("Escape",()=>{R||(dt?gt(!1):or())},[dt,i,or]);const kg=V=>{const Ue=V.nativeEvent;be({x:Ue.pageX,y:Ue.pageY})},ef=V=>{R||g.isInteractiveSeg||ht||dt&&J.length!==0&&S(w0(V))},Pg=async V=>{T({isPluginRunning:!0});const Ue=await Ks();try{const at=await Rk(!0,No.InteractiveSeg,Ue,void 0,V),{blob:oo}=at,ln=new Image;ln.onload=()=>{y({tmpInteractiveSegMask:ln})},ln.src=oo}catch(at){n({variant:"destructive",description:at.message?at.message:at.toString()})}T({isPluginRunning:!1})},tf=V=>{if(bC(V)){st(!1);return}!$r()||g.isInteractiveSeg||ht||!Q.src||!(L!=null&&L.canvas)||i||dt&&(N?gt(!1):A())},Dc=V=>{if(g.isInteractiveSeg){const Ue=w0(V),at=[...g.clicks];xC(V)?at.push([Ue.x,Ue.y,0,at.length]):at.push([Ue.x,Ue.y,1,at.length]),Pg(at),y({clicks:at})}},nf=V=>{if(!(R||g.isInteractiveSeg||ht||!le||!(L!=null&&L.canvas))&&!xC(V)){if(bC(V)){st(!0);return}gt(!0),x(w0(V))}},rf=V=>{V.preventDefault(),E()};Xn("meta+z,ctrl+z",rf);const of=V=>{V.preventDefault(),_()};Xn("shift+ctrl+z,shift+meta+z",of),j0("Tab",V=>{V==null||V.preventDefault(),V==null||V.stopPropagation(),ri()&&Z(()=>(window.setTimeout(()=>{On(100)},10),!0))},V=>{V==null||V.preventDefault(),V==null||V.stopPropagation(),ri()&&(window.setTimeout(()=>{On(0)},10),window.setTimeout(()=>{Z(!1)},mu))});const sf=d.useCallback(async()=>{if(t===void 0)return;if(f&&te.length>0){try{await qF(te[te.length-1],t.name,t.type),n({description:"Save image success"})}catch(at){n({variant:"destructive",title:"Uh oh! Something went wrong.",description:at.message?at.message:at.toString()})}return}const V=t.name.replace(/(\.[\w\d_-]+)$/i,"_cleanup$1"),Ue=te[te.length-1];if($j(Ue.currentSrc,V),u.enableDownloadMask){let at=t.name.replace(/(\.[\w\d_-]+)$/i,"_mask$1");at=at.replace(/\.[^/.]+$/,".jpg");const oo=Zh(s,l,H),ln=document.createElement("a");ln.download=at,ln.href=oo.toDataURL("image/jpeg"),ln.click()}},[t,f,te,u,l,s,H]);Xn("meta+s,ctrl+s",sf);const Va=V=>{V!==Ee&&!ht&&!O&&Oe(V)},Tg=d.useCallback(()=>{if(R)return"default";if(ht)return"grab";if(Ee)return"none"},[Ee,ht,R]);Xn("[",()=>{U()},[U]),Xn("]",()=>{z()},[z]),Xn("shift+r",()=>{N&&$r()&&A()},[N,A,$r]),Xn("ctrl+c,meta+c",async()=>{await Sj()&&te.length>0&&L!=null&&L.canvas&&(await Cj(L==null?void 0:L.canvas),n({title:"Copy inpainting result to clipboard"}))},[te,L]),j0(" ",V=>{r||(V==null||V.preventDefault(),V==null||V.stopPropagation(),Oe(!1),st(!0))},V=>{r||(V==null||V.preventDefault(),V==null||V.stopPropagation(),Oe(!0),st(!1))}),d.useEffect(()=>{const V=at=>{at.key===vC&&Cr(!1)},Ue=()=>{Cr(!1)};return window.addEventListener("keyup",V),window.addEventListener("blur",Ue),()=>{window.removeEventListener("keyup",V),window.removeEventListener("blur",Ue)}},[]),j0(vC,V=>{r||(V==null||V.preventDefault(),V==null||V.stopPropagation(),Cr(!0))},V=>{r||(V==null||V.preventDefault(),V==null||V.stopPropagation(),Cr(!1))});const Ic=()=>{var Ue,at,oo,ln;let V=D;return((at=(Ue=pe.current)==null?void 0:Ue.instance)==null?void 0:at.transformState.scale)!==void 0&&(V=(ln=(oo=pe.current)==null?void 0:oo.instance)==null?void 0:ln.transformState.scale),V},af=(V,Ue)=>{const at=Ic();return{width:`${K*at}px`,height:`${K*at}px`,left:`${V}px`,top:`${Ue}px`,transform:"translate(-50%, -50%)"}},Wa=V=>v.jsx("div",{className:"absolute rounded-[50%] border-[1px] border-[solid] border-[#ffcc00] pointer-events-none bg-[#ffcc00bb]",style:V}),Ag=V=>{p(V),Ie||(ze(!0),window.setTimeout(()=>{ze(!1)},1e4))},Lc=()=>v.jsx("div",{className:"absolute h-[20px] w-[20px] pointer-events-none rounded-[50%] bg-[rgba(21,_215,_121,_0.936)] [box-shadow:0_0_0_0_rgba(21,_215,_121,_0.936)] animate-pulse",style:{left:`${Me}px`,top:`${me}px`,transform:"translate(-50%, -50%)"},children:v.jsx(vK,{})}),Mg=()=>v.jsx(yq,{ref:V=>{V&&(pe.current=V)},panning:{disabled:!ht,velocityDisabled:!0},wheel:{step:.05,wheelDisabled:ji},centerZoomedOut:!0,alignmentAnimation:{disabled:!0},centerOnInit:!0,limitToBounds:!1,doubleClick:{disabled:!0},initialScale:D,minScale:D*.3,onPanning:()=>{en||Li(!0)},onZoom:V=>{rr(V.state.scale)},children:v.jsxs(bq,{contentStyle:{visibility:he?"visible":"hidden"},children:[v.jsxs("div",{className:"grid [grid-template-areas:'editor-content'] gap-y-4",children:[v.jsx("canvas",{className:"[grid-area:editor-content]",style:{clipPath:`inset(0 ${Mn}% 0 0)`,transition:`clip-path ${mu}ms`},ref:V=>{if(V&&!Ne){const Ue=V.getContext("2d");Ue&&Ke(Ue)}}}),v.jsx("canvas",{className:xe("[grid-area:editor-content]",R?"pointer-events-none animate-pulse duration-600":""),style:{cursor:Tg(),clipPath:`inset(0 ${Mn}% 0 0)`,transition:`clip-path ${mu}ms`},onContextMenu:V=>{V.preventDefault()},onMouseOver:()=>{Va(!0),ze(!1)},onFocus:()=>Va(!0),onMouseLeave:()=>Va(!1),onMouseDown:nf,onMouseUp:Dc,onMouseMove:ef,onTouchStart:nf,onTouchEnd:Dc,onTouchMove:ef,ref:V=>{if(V&&!L){const Ue=V.getContext("2d");Ue&&ue(Ue)}}}),v.jsx("div",{className:"[grid-area:editor-content] pointer-events-none grid [grid-template-areas:'original-image-content']",style:{width:`${s}px`,height:`${l}px`},children:G&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"[grid-area:original-image-content] z-10 bg-primary h-full w-[6px] justify-self-end",style:{marginRight:`${Mn}%`,transition:`margin-right ${mu}ms`}}),v.jsx("img",{className:"[grid-area:original-image-content]",src:Q.src,alt:"original",style:{width:`${s}px`,height:`${l}px`}})]})})]}),v.jsx(Kq,{maxHeight:l,maxWidth:s,minHeight:Math.min(512,l),minWidth:Math.min(512,s),scale:Ic(),show:u.showCropper}),v.jsx(Qq,{minHeight:Math.min(512,l),minWidth:Math.min(512,s),scale:Ic(),show:u.showExtender}),g.isInteractiveSeg?v.jsx(Xq,{}):v.jsx(v.Fragment,{})]})}),Og=V=>{if(!ji)return;const{deltaY:Ue}=V;Ue>0?z():Ue<0&&U()};return v.jsxs("div",{className:"flex w-screen h-screen justify-center items-center","aria-hidden":"true",onMouseMove:kg,onMouseUp:tf,onWheel:Og,children:[Mg(),Ee&&!i&&!ht&&(g.isInteractiveSeg?Lc():Wa(af(Me,me))),Ie&&Wa(af(ee,Se)),v.jsxs("div",{className:"fixed flex bottom-5 border px-4 py-2 rounded-[3rem] gap-8 items-center justify-center backdrop-filter backdrop-blur-md bg-background/70",children:[v.jsx(zr,{className:"w-48",defaultValue:[50],min:pj,max:nk,step:1,tabIndex:-1,value:[ie],onValueChange:V=>Ag(V[0]),onClick:()=>ze(!1)}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(yn,{tooltip:"Reset zoom & pan",disabled:Yt===D&&en===!1,onClick:or,children:v.jsx(oV,{})}),v.jsx(yn,{tooltip:"Undo",onClick:rf,disabled:b,children:v.jsx(hV,{})}),v.jsx(yn,{tooltip:"Redo",onClick:of,disabled:C,children:v.jsx(uV,{})}),v.jsx(yn,{tooltip:"Show original image",onPointerDown:V=>{V.preventDefault(),Z(()=>(window.setTimeout(()=>{On(100)},10),!0))},onPointerUp:()=>{window.setTimeout(()=>{On(0)},10),window.setTimeout(()=>{Z(!1)},mu)},disabled:te.length===0,children:v.jsx(iV,{})}),v.jsx(yn,{tooltip:"Save Image",disabled:!te.length,onClick:sf,children:v.jsx(nV,{})}),u.enableManualInpainting&&u.model.model_type==="inpaint"?v.jsx(yn,{tooltip:"Run Inpainting",disabled:R||!$r()&&W.length===0,onClick:()=>{A()},children:v.jsx(rV,{})}):v.jsx(v.Fragment,{})]})]})]})}const tQ=()=>{const[e,t]=xt(n=>[n.imageWidth,n.imageHeight]);return!e||!t?null:v.jsxs("div",{className:"border rounded-lg px-2 py-[6px] z-10 bg-background",children:[e,"x",t]})},Z1=["Enter"," "],nQ=["ArrowDown","PageUp","Home"],nA=["ArrowUp","PageDown","End"],rQ=[...nQ,...nA],oQ={ltr:[...Z1,"ArrowRight"],rtl:[...Z1,"ArrowLeft"]},iQ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sg="Menu",[gd,sQ,aQ]=Gd(Sg),[Ua,rA]=An(Sg,[aQ,zs,lg]),_g=zs(),oA=lg(),[iA,Hs]=Ua(Sg),[lQ,Qd]=Ua(Sg),cQ=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,l=_g(t),[u,f]=d.useState(null),m=d.useRef(!1),p=Lt(i),g=Mc(o);return d.useEffect(()=>{const y=()=>{m.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>m.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),d.createElement(Fd,l,d.createElement(iA,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:f},d.createElement(lQ,{scope:t,onClose:d.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:s},r)))},sA=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=_g(n);return d.createElement(Zm,Y({},o,r,{ref:t}))}),aA="MenuPortal",[uQ,lA]=Ua(aA,{forceMount:void 0}),dQ=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Hs(aA,t);return d.createElement(uQ,{scope:t,forceMount:n},d.createElement(Sn,{present:n||i.open},d.createElement(Bd,{asChild:!0,container:o},r)))},Co="MenuContent",[fQ,ub]=Ua(Co),hQ=d.forwardRef((e,t)=>{const n=lA(Co,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Hs(Co,e.__scopeMenu),s=Qd(Co,e.__scopeMenu);return d.createElement(gd.Provider,{scope:e.__scopeMenu},d.createElement(Sn,{present:r||i.open},d.createElement(gd.Slot,{scope:e.__scopeMenu},s.modal?d.createElement(pQ,Y({},o,{ref:t})):d.createElement(mQ,Y({},o,{ref:t})))))}),pQ=d.forwardRef((e,t)=>{const n=Hs(Co,e.__scopeMenu),r=d.useRef(null),o=We(t,r);return d.useEffect(()=>{const i=r.current;if(i)return ig(i)},[]),d.createElement(db,Y({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:fe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),mQ=d.forwardRef((e,t)=>{const n=Hs(Co,e.__scopeMenu);return d.createElement(db,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),db=d.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:y,disableOutsideScroll:x,...S}=e,E=Hs(Co,n),_=Qd(Co,n),b=_g(n),C=oA(n),R=sQ(n),[T,N]=d.useState(null),A=d.useRef(null),O=We(t,A,E.onContentChange),U=d.useRef(0),z=d.useRef(""),ie=d.useRef(0),K=d.useRef(null),te=d.useRef("right"),W=d.useRef(0),re=x?og:d.Fragment,H=x?{as:Qo,allowPinchZoom:!0}:void 0,J=Z=>{var Q,le;const L=z.current+Z,ue=R().filter(Ee=>!Ee.disabled),Ne=document.activeElement,Ke=(Q=ue.find(Ee=>Ee.ref.current===Ne))===null||Q===void 0?void 0:Q.textValue,Me=ue.map(Ee=>Ee.textValue),me=MQ(Me,L,Ke),be=(le=ue.find(Ee=>Ee.textValue===me))===null||le===void 0?void 0:le.ref.current;(function Ee(Oe){z.current=Oe,window.clearTimeout(U.current),Oe!==""&&(U.current=window.setTimeout(()=>Ee(""),1e3))})(L),be&&setTimeout(()=>be.focus())};d.useEffect(()=>()=>window.clearTimeout(U.current),[]),ng();const G=d.useCallback(Z=>{var Q,le;return te.current===((Q=K.current)===null||Q===void 0?void 0:Q.side)&&NQ(Z,(le=K.current)===null||le===void 0?void 0:le.area)},[]);return d.createElement(fQ,{scope:n,searchRef:z,onItemEnter:d.useCallback(Z=>{G(Z)&&Z.preventDefault()},[G]),onItemLeave:d.useCallback(Z=>{var Q;G(Z)||((Q=A.current)===null||Q===void 0||Q.focus(),N(null))},[G]),onTriggerLeave:d.useCallback(Z=>{G(Z)&&Z.preventDefault()},[G]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:d.useCallback(Z=>{K.current=Z},[])},d.createElement(re,H,d.createElement(tg,{asChild:!0,trapped:o,onMountAutoFocus:fe(i,Z=>{var Q;Z.preventDefault(),(Q=A.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:s},d.createElement(Rc,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:y},d.createElement(aT,Y({asChild:!0},C,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:N,onEntryFocus:fe(u,Z=>{_.isUsingKeyboardRef.current||Z.preventDefault()})}),d.createElement(qm,Y({role:"menu","aria-orientation":"vertical","data-state":pA(E.open),"data-radix-menu-content":"",dir:_.dir},b,S,{ref:O,style:{outline:"none",...S.style},onKeyDown:fe(S.onKeyDown,Z=>{const le=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,L=Z.ctrlKey||Z.altKey||Z.metaKey,ue=Z.key.length===1;le&&(Z.key==="Tab"&&Z.preventDefault(),!L&&ue&&J(Z.key));const Ne=A.current;if(Z.target!==Ne||!rQ.includes(Z.key))return;Z.preventDefault();const Me=R().filter(me=>!me.disabled).map(me=>me.ref.current);nA.includes(Z.key)&&Me.reverse(),TQ(Me)}),onBlur:fe(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(U.current),z.current="")}),onPointerMove:fe(e.onPointerMove,vd(Z=>{const Q=Z.target,le=W.current!==Z.clientX;if(Z.currentTarget.contains(Q)&&le){const L=Z.clientX>W.current?"right":"left";te.current=L,W.current=Z.clientX}}))})))))))}),gQ=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.createElement(Ae.div,Y({},r,{ref:t}))}),q1="MenuItem",t$="menu.itemSelect",fb=d.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=d.useRef(null),s=Qd(q1,e.__scopeMenu),l=ub(q1,e.__scopeMenu),u=We(t,i),f=d.useRef(!1),m=()=>{const p=i.current;if(!n&&p){const g=new CustomEvent(t$,{bubbles:!0,cancelable:!0});p.addEventListener(t$,y=>r==null?void 0:r(y),{once:!0}),yx(p,g),g.defaultPrevented?f.current=!1:s.onClose()}};return d.createElement(cA,Y({},o,{ref:u,disabled:n,onClick:fe(e.onClick,m),onPointerDown:p=>{var g;(g=e.onPointerDown)===null||g===void 0||g.call(e,p),f.current=!0},onPointerUp:fe(e.onPointerUp,p=>{var g;f.current||(g=p.currentTarget)===null||g===void 0||g.click()}),onKeyDown:fe(e.onKeyDown,p=>{const g=l.searchRef.current!=="";n||g&&p.key===" "||Z1.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})}))}),cA=d.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=ub(q1,n),l=oA(n),u=d.useRef(null),f=We(t,u),[m,p]=d.useState(!1),[g,y]=d.useState("");return d.useEffect(()=>{const x=u.current;if(x){var S;y(((S=x.textContent)!==null&&S!==void 0?S:"").trim())}},[i.children]),d.createElement(gd.ItemSlot,{scope:n,disabled:r,textValue:o??g},d.createElement(lT,Y({asChild:!0},l,{focusable:!r}),d.createElement(Ae.div,Y({role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:f,onPointerMove:fe(e.onPointerMove,vd(x=>{r?s.onItemLeave(x):(s.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus())})),onPointerLeave:fe(e.onPointerLeave,vd(x=>s.onItemLeave(x))),onFocus:fe(e.onFocus,()=>p(!0)),onBlur:fe(e.onBlur,()=>p(!1))}))))}),vQ=d.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return d.createElement(dA,{scope:e.__scopeMenu,checked:n},d.createElement(fb,Y({role:"menuitemcheckbox","aria-checked":hm(n)?"mixed":n},o,{ref:t,"data-state":hb(n),onSelect:fe(o.onSelect,()=>r==null?void 0:r(hm(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),yQ="MenuRadioGroup",[Tte,wQ]=Ua(yQ,{value:void 0,onValueChange:()=>{}}),xQ="MenuRadioItem",bQ=d.forwardRef((e,t)=>{const{value:n,...r}=e,o=wQ(xQ,e.__scopeMenu),i=n===o.value;return d.createElement(dA,{scope:e.__scopeMenu,checked:i},d.createElement(fb,Y({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":hb(i),onSelect:fe(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),uA="MenuItemIndicator",[dA,SQ]=Ua(uA,{checked:!1}),_Q=d.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=SQ(uA,n);return d.createElement(Sn,{present:r||hm(i.checked)||i.checked===!0},d.createElement(Ae.span,Y({},o,{ref:t,"data-state":hb(i.checked)})))}),EQ=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.createElement(Ae.div,Y({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),fA="MenuSub",[CQ,hA]=Ua(fA),$Q=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=Hs(fA,t),s=_g(t),[l,u]=d.useState(null),[f,m]=d.useState(null),p=Lt(o);return d.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),d.createElement(Fd,s,d.createElement(iA,{scope:t,open:r,onOpenChange:p,content:f,onContentChange:m},d.createElement(CQ,{scope:t,contentId:tr(),triggerId:tr(),trigger:l,onTriggerChange:u},n)))},Ph="MenuSubTrigger",RQ=d.forwardRef((e,t)=>{const n=Hs(Ph,e.__scopeMenu),r=Qd(Ph,e.__scopeMenu),o=hA(Ph,e.__scopeMenu),i=ub(Ph,e.__scopeMenu),s=d.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=i,f={__scopeMenu:e.__scopeMenu},m=d.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return d.useEffect(()=>m,[m]),d.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),u(null)}},[l,u]),d.createElement(sA,Y({asChild:!0},f),d.createElement(cA,Y({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":pA(n.open)},e,{ref:Bm(t,o.onTriggerChange),onClick:p=>{var g;(g=e.onClick)===null||g===void 0||g.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:fe(e.onPointerMove,vd(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:fe(e.onPointerLeave,vd(p=>{var g;m();const y=(g=n.content)===null||g===void 0?void 0:g.getBoundingClientRect();if(y){var x;const S=(x=n.content)===null||x===void 0?void 0:x.dataset.side,E=S==="right",_=E?-5:5,b=y[E?"left":"right"],C=y[E?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+_,y:p.clientY},{x:b,y:y.top},{x:C,y:y.top},{x:C,y:y.bottom},{x:b,y:y.bottom}],side:S}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:fe(e.onKeyDown,p=>{const g=i.searchRef.current!=="";if(!(e.disabled||g&&p.key===" ")&&oQ[r.dir].includes(p.key)){var y;n.onOpenChange(!0),(y=n.content)===null||y===void 0||y.focus(),p.preventDefault()}})})))}),kQ="MenuSubContent",PQ=d.forwardRef((e,t)=>{const n=lA(Co,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Hs(Co,e.__scopeMenu),s=Qd(Co,e.__scopeMenu),l=hA(kQ,e.__scopeMenu),u=d.useRef(null),f=We(t,u);return d.createElement(gd.Provider,{scope:e.__scopeMenu},d.createElement(Sn,{present:r||i.open},d.createElement(gd.Slot,{scope:e.__scopeMenu},d.createElement(db,Y({id:l.contentId,"aria-labelledby":l.triggerId},o,{ref:f,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;s.isUsingKeyboardRef.current&&((p=u.current)===null||p===void 0||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:fe(e.onFocusOutside,m=>{m.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:fe(e.onEscapeKeyDown,m=>{s.onClose(),m.preventDefault()}),onKeyDown:fe(e.onKeyDown,m=>{const p=m.currentTarget.contains(m.target),g=iQ[s.dir].includes(m.key);if(p&&g){var y;i.onOpenChange(!1),(y=l.trigger)===null||y===void 0||y.focus(),m.preventDefault()}})})))))});function pA(e){return e?"open":"closed"}function hm(e){return e==="indeterminate"}function hb(e){return hm(e)?"indeterminate":e?"checked":"unchecked"}function TQ(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function AQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function MQ(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=AQ(e,Math.max(i,0));o.length===1&&(s=s.filter(f=>f!==n));const u=s.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function OQ(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i].x,u=t[i].y,f=t[s].x,m=t[s].y;u>r!=m>r&&n<(f-l)*(r-u)/(m-u)+l&&(o=!o)}return o}function NQ(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return OQ(n,t)}function vd(e){return t=>t.pointerType==="mouse"?e(t):void 0}const DQ=cQ,IQ=sA,LQ=dQ,jQ=hQ,FQ=gQ,BQ=fb,zQ=vQ,UQ=bQ,VQ=_Q,WQ=EQ,HQ=$Q,KQ=RQ,GQ=PQ,mA="DropdownMenu",[YQ,Ate]=An(mA,[rA]),Er=rA(),[XQ,gA]=YQ(mA),ZQ=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,u=Er(t),f=d.useRef(null),[m=!1,p]=no({prop:o,defaultProp:i,onChange:s});return d.createElement(XQ,{scope:t,triggerId:tr(),triggerRef:f,contentId:tr(),open:m,onOpenChange:p,onOpenToggle:d.useCallback(()=>p(g=>!g),[p]),modal:l},d.createElement(DQ,Y({},u,{open:m,onOpenChange:p,dir:r,modal:l}),n))},qQ="DropdownMenuTrigger",QQ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=gA(qQ,n),s=Er(n);return d.createElement(IQ,Y({asChild:!0},s),d.createElement(Ae.button,Y({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Bm(t,i.triggerRef),onPointerDown:fe(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:fe(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})))}),JQ=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Er(t);return d.createElement(LQ,Y({},r,n))},eJ="DropdownMenuContent",tJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=gA(eJ,n),i=Er(n),s=d.useRef(!1);return d.createElement(jQ,Y({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:fe(e.onCloseAutoFocus,l=>{var u;s.current||(u=o.triggerRef.current)===null||u===void 0||u.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:fe(e.onInteractOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,m=u.button===2||f;(!o.modal||m)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),nJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(FQ,Y({},o,r,{ref:t}))}),rJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(BQ,Y({},o,r,{ref:t}))}),oJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(zQ,Y({},o,r,{ref:t}))}),iJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(UQ,Y({},o,r,{ref:t}))}),sJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(VQ,Y({},o,r,{ref:t}))}),aJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(WQ,Y({},o,r,{ref:t}))}),lJ=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,s=Er(t),[l=!1,u]=no({prop:r,defaultProp:i,onChange:o});return d.createElement(HQ,Y({},s,{open:l,onOpenChange:u}),n)},cJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(KQ,Y({},o,r,{ref:t}))}),uJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(GQ,Y({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),dJ=ZQ,fJ=QQ,hJ=JQ,vA=tJ,yA=nJ,wA=rJ,xA=oJ,bA=iJ,SA=sJ,_A=aJ,pJ=lJ,EA=cJ,CA=uJ,mJ=dJ,gJ=fJ,n$=pJ,Q1=d.forwardRef(({className:e,inset:t,children:n,...r},o)=>v.jsxs(EA,{ref:o,className:xe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r,children:[n,v.jsx(aB,{className:"ml-auto h-4 w-4"})]}));Q1.displayName=EA.displayName;const J1=d.forwardRef(({className:e,...t},n)=>v.jsx(CA,{ref:n,className:xe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));J1.displayName=CA.displayName;const $A=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(hJ,{children:v.jsx(vA,{ref:r,sideOffset:t,className:xe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onCloseAutoFocus:o=>o.preventDefault(),...n})}));$A.displayName=vA.displayName;const ml=d.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(wA,{ref:r,className:xe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ml.displayName=wA.displayName;const vJ=d.forwardRef(({className:e,children:t,checked:n,...r},o)=>v.jsxs(xA,{ref:o,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(SA,{children:v.jsx(kk,{className:"h-4 w-4"})})}),t]}));vJ.displayName=xA.displayName;const yJ=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(bA,{ref:r,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(SA,{children:v.jsx(fB,{className:"h-4 w-4 fill-current"})})}),t]}));yJ.displayName=bA.displayName;const wJ=d.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(yA,{ref:r,className:xe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));wJ.displayName=yA.displayName;const xJ=d.forwardRef(({className:e,...t},n)=>v.jsx(_A,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));xJ.displayName=_A.displayName;const r$={RemoveBG:{IconClass:t2,showName:"RemoveBG"},AnimeSeg:{IconClass:t2,showName:"Anime Segmentation"},RealESRGAN:{IconClass:sP,showName:"RealESRGAN"},GFPGAN:{IconClass:n2,showName:"GFPGAN"},RestoreFormer:{IconClass:n2,showName:"RestoreFormer"},InteractiveSeg:{IconClass:cV,showName:"Interactive Segmentation"}},bJ=()=>{const[e,t,n,r,o]=xt(m=>[m.file,m.serverConfig.plugins,m.isPluginRunning,m.updateInteractiveSegState,m.runRenderablePlugin]),i=!e;if(t.length===0)return null;const s=(m,p)=>{p==="InteractiveSeg"?r({isInteractiveSeg:!0}):o(m,p)},l=()=>v.jsxs(n$,{children:[v.jsx(Q1,{disabled:i,children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx(sP,{}),"RealESRGAN"]})}),v.jsxs(J1,{children:[v.jsx(ml,{onClick:()=>o(!1,"RealESRGAN",{upscale:2}),children:"upscale 2x"}),v.jsx(ml,{onClick:()=>o(!1,"RealESRGAN",{upscale:4}),children:"upscale 4x"})]})]},"RealESRGAN"),u=m=>{const{IconClass:p,showName:g}=r$[m.name];return v.jsxs(n$,{children:[v.jsx(Q1,{disabled:i,children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx(p,{className:"p-1"}),g]})}),v.jsxs(J1,{children:[v.jsx(ml,{onClick:()=>s(!1,m.name),children:"Remove Background"}),v.jsx(ml,{onClick:()=>s(!0,m.name),children:"Generate Mask"})]})]},m.name)},f=()=>t.map(m=>{const{IconClass:p,showName:g}=r$[m.name];return m.name==="RealESRGAN"?l():m.name==="RemoveBG"||m.name==="AnimeSeg"?u(m):v.jsx(ml,{onClick:()=>s(!1,m.name),disabled:i,children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx(p,{className:"p-1"}),g]})},m.name)});return v.jsxs(mJ,{modal:!1,children:[v.jsx(gJ,{className:"border rounded-lg z-10 bg-background outline-none",tabIndex:-1,children:v.jsx(wn,{variant:"ghost",size:"icon",asChild:!0,className:"p-1.5",children:n?v.jsx("div",{role:"status",children:v.jsxs("svg",{"aria-hidden":"true",className:"w-5 h-5 animate-spin fill-primary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[v.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),v.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})}):v.jsx(QU,{strokeWidth:1})})}),v.jsx($A,{side:"bottom",align:"start",children:f()})]})},SJ=Mx,_J=kP,EJ=Ox,RA=d.forwardRef(({className:e,...t},n)=>v.jsx(zd,{className:xe("fixed inset-0 bg-background/80 backdrop-blur-sm data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));RA.displayName=zd.displayName;const CJ=zm("fixed gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-300",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),kA=d.forwardRef(({side:e="right",className:t,children:n,...r},o)=>v.jsxs(EJ,{children:[v.jsx(RA,{}),v.jsx(Ud,{ref:o,className:xe(CJ({side:e}),t),...r,children:n})]}));kA.displayName=Ud.displayName;const PA=({className:e,...t})=>v.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});PA.displayName="SheetHeader";const $J=d.forwardRef(({className:e,...t},n)=>v.jsx(Vd,{ref:n,className:xe("text-lg font-semibold text-foreground",e),...t}));$J.displayName=Vd.displayName;const RJ=d.forwardRef(({className:e,...t},n)=>v.jsx(Wd,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));RJ.displayName=Wd.displayName;const St=({children:e})=>v.jsx("div",{className:"flex justify-between items-center pr-4",children:e}),zt=({text:e,toolTip:t="",url:n,htmlFor:r,disabled:o=!1,className:i=""})=>v.jsxs(oP,{children:[v.jsx(iP,{asChild:!0,children:v.jsx(ib,{htmlFor:r||e.toLowerCase().replace(" ","-"),className:xe("font-medium min-w-[65px]",i),disabled:o,children:e})}),t||n?v.jsxs(Px,{className:"flex flex-col max-w-xs text-sm",side:"left",children:[v.jsx("p",{children:t}),n?v.jsx(wn,{variant:"link",className:"justify-end",children:v.jsx("a",{href:n,target:"_blank",children:"More info"})}):v.jsx(v.Fragment,{})]}):v.jsx(v.Fragment,{})]}),kJ=()=>{const[e,t]=xt(n=>[n.settings,n.updateSettings]);return v.jsxs("div",{className:"flex flex-col gap-4 mt-4",children:[v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx(zt,{htmlFor:"steps",text:"Steps",toolTip:"The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."}),v.jsxs(St,{children:[v.jsx(zr,{className:"w-[180px]",defaultValue:[30],min:1,max:100,step:1,value:[Math.floor(e.ldmSteps)],onValueChange:n=>t({ldmSteps:n[0]})}),v.jsx(fo,{id:"steps",className:"w-[50px] rounded-full",numberValue:e.ldmSteps,allowFloat:!1,onNumberValueChange:n=>{t({ldmSteps:n})}})]})]}),v.jsxs(St,{children:[v.jsx(zt,{text:"Sampler"}),v.jsxs(xo,{value:e.ldmSampler,onValueChange:n=>{t({ldmSampler:n})},children:[v.jsx(Hr,{className:"w-[100px]",children:v.jsx(bo,{placeholder:"Select sampler"})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:Object.values(ix).map(n=>v.jsx(Gr,{value:n,children:n},n))})})]})]})]})},Th=({text:e,onClick:t})=>{const[n]=xt(r=>[r.settings.showExtender]);return v.jsx(wn,{variant:"outline",className:"p-1 h-8",disabled:!n,onClick:t,children:v.jsx("div",{className:"flex items-center gap-1",children:e})})},PJ=()=>{const[e,t,n,r,o,i,s,l,u,f,m,p,g,y,x]=xt(L=>[L.serverConfig.samplers,L.settings,L.paintByExampleFile,L.getIsProcessing(),L.updateSettings,L.runInpainting,L.updateAppState,L.updateExtenderByBuiltIn,L.updateExtenderDirection,L.adjustMask,L.clearMask,L.updateEnablePowerPaintV2,L.updateEnableBrushNet,L.updateEnableControlnet,L.updateLCMLora]),[S,E]=Lx(n),_=d.useRef(null);VP(_,()=>{_!=null&&_.current&&_.current.blur()});const b=L=>{L.key==="Enter"&&L.ctrlKey&&t.prompt.length!==0&&i()},C=()=>v.jsxs(St,{children:[v.jsx(zt,{text:"Cropper",toolTip:"Inpainting on part of image, improve inference speed and reduce memory usage."}),v.jsx(Br,{id:"cropper",checked:t.showCropper,onCheckedChange:L=>{o({showCropper:L}),L&&o({showExtender:!1})}})]}),R=()=>{if(!t.model.support_brushnet)return null;let L="BrushNet is a plug-and-play image inpainting model works on any SD1.5 base models.";return v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs(St,{children:[v.jsx(zt,{text:"BrushNet",url:"https://github.com/TencentARC/BrushNet",toolTip:L}),v.jsx(Br,{id:"brushnet",checked:t.enableBrushNet,onCheckedChange:ue=>{g(ue)}})]}),v.jsxs(St,{children:[v.jsx(zr,{defaultValue:[100],className:"w-[180px]",min:1,max:100,step:1,disabled:!t.enableBrushNet,value:[Math.floor(t.brushnetConditioningScale*100)],onValueChange:ue=>o({brushnetConditioningScale:ue[0]/100})}),v.jsx(fo,{id:"brushnet-weight",className:"w-[50px] rounded-full",numberValue:t.brushnetConditioningScale,allowFloat:!0,onNumberValueChange:ue=>{o({brushnetConditioningScale:ue})}})]}),v.jsx(St,{children:v.jsxs(xo,{defaultValue:t.brushnetMethod,value:t.brushnetMethod,onValueChange:ue=>{o({brushnetMethod:ue})},disabled:!t.enableBrushNet,children:[v.jsx(Hr,{children:v.jsx(bo,{placeholder:"Select brushnet model"})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:Object.values(t.model.brushnets).map(ue=>v.jsx(Gr,{value:ue,children:ue.split("/")[1]},ue))})})]})})]}),v.jsx(Xt,{})]})},T=()=>{if(!t.model.support_controlnet)return null;let L="Using an additional conditioning image to control how an image is generated";return v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs(St,{children:[v.jsx(zt,{text:"ControlNet",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inpaint#controlnet",toolTip:L}),v.jsx(Br,{id:"controlnet",checked:t.enableControlnet,onCheckedChange:ue=>{y(ue)}})]}),v.jsx("div",{className:"flex flex-col gap-1",children:v.jsxs(St,{children:[v.jsx(zr,{className:"w-[180px]",defaultValue:[100],min:1,max:100,step:1,disabled:!t.enableControlnet,value:[Math.floor(t.controlnetConditioningScale*100)],onValueChange:ue=>o({controlnetConditioningScale:ue[0]/100})}),v.jsx(fo,{id:"controlnet-weight",className:"w-[50px] rounded-full",disabled:!t.enableControlnet,numberValue:t.controlnetConditioningScale,allowFloat:!0,onNumberValueChange:ue=>{o({controlnetConditioningScale:ue})}})]})}),v.jsx(St,{children:v.jsxs(xo,{defaultValue:t.controlnetMethod,value:t.controlnetMethod,onValueChange:ue=>{o({controlnetMethod:ue})},disabled:!t.enableControlnet,children:[v.jsx(Hr,{children:v.jsx(bo,{placeholder:"Select control method"})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:Object.values(t.model.controlnets).map(ue=>v.jsx(Gr,{value:ue,children:ue.split("/")[1]},ue))})})]})})]}),v.jsx(Xt,{})]})},N=()=>{if(!t.model.support_lcm_lora)return null;let L="Enable quality image generation in typically 2-8 steps. Suggest disabling guidance_scale by setting it to 0. You can also try values between 1.0 and 2.0. When LCM Lora is enabled, LCMSampler will be used automatically.";return v.jsxs(v.Fragment,{children:[v.jsxs(St,{children:[v.jsx(zt,{text:"LCM LoRA",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inference_with_lcm_lora",toolTip:L}),v.jsx(Br,{id:"lcm-lora",checked:t.enableLCMLora,onCheckedChange:ue=>{x(ue)}})]}),v.jsx(Xt,{})]})},A=()=>t.model.need_prompt?v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx(zt,{text:"Negative prompt",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inpaint#negative-prompt",toolTip:"Negative prompt guides the model away from generating certain things in an image"}),v.jsx("div",{className:"pl-2 pr-4",children:v.jsx(Ux,{ref:_,rows:4,onKeyUp:b,className:"max-h-[8rem] overflow-y-auto mb-2",placeholder:"",id:"negative-prompt",value:t.negativePrompt,onInput:L=>{L.preventDefault(),L.stopPropagation();const ue=L.target;o({negativePrompt:ue.value})}})})]}):null,O=()=>t.model.name!==rk?null:v.jsxs("div",{children:[v.jsxs(St,{children:[v.jsx(zt,{text:"Example Image",toolTip:"An example image to guide image generation."}),v.jsx(w1,{tooltip:"Upload example image",onFileUpload:L=>{s({paintByExampleFile:L})},children:v.jsx(aP,{})})]}),E?v.jsx("div",{className:"flex justify-center items-center",children:v.jsx("img",{src:S.src,alt:"example",className:"max-w-[200px] max-h-[200px] m-3"})}):v.jsx(v.Fragment,{}),v.jsx(wn,{variant:"default",className:"w-full",disabled:r||!E,onClick:()=>{i()},children:"Paint"})]}),U=()=>t.model.name!==mj?null:v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx(zt,{text:"Image guidance scale",toolTip:"Push the generated image towards the inital image. Higher image guidance scale encourages generated images that are closely linked to the source image, usually at the expense of lower image quality.",url:"https://huggingface.co/docs/diffusers/main/en/api/pipelines/pix2pix"}),v.jsxs(St,{children:[v.jsx(zr,{className:"w-[180px]",defaultValue:[150],min:100,max:1e3,step:1,value:[Math.floor(t.p2pImageGuidanceScale*100)],onValueChange:L=>o({p2pImageGuidanceScale:L[0]/100})}),v.jsx(fo,{id:"image-guidance-scale",className:"w-[50px] rounded-full",numberValue:t.p2pImageGuidanceScale,allowFloat:!0,onNumberValueChange:L=>{o({p2pImageGuidanceScale:L})}})]})]}),z=()=>{if(!t.model.support_strength)return null;let L="Strength is a measure of how much noise is added to the base image, which influences how similar the output is to the base image. Higher value means more noise and more different from the base image";return v.jsxs(St,{children:[v.jsx(zt,{text:"Strength",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inpaint#strength",toolTip:L}),v.jsxs("div",{className:"flex gap-4",children:[v.jsx(zr,{className:"w-[120px]",defaultValue:[100],min:10,max:100,step:1,value:[Math.floor(t.sdStrength*100)],onValueChange:ue=>o({sdStrength:ue[0]/100})}),v.jsx(fo,{id:"strength",className:"w-[50px] rounded-full",numberValue:t.sdStrength,allowFloat:!0,onNumberValueChange:ue=>{o({sdStrength:ue})}})]})]})},ie=()=>t.model.support_outpainting?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs(St,{children:[v.jsx(zt,{text:"Extender",toolTip:"Perform outpainting on images to expand it's content."}),v.jsx(Br,{id:"extender",checked:t.showExtender,onCheckedChange:L=>{o({showExtender:L}),L&&o({showCropper:!1})}})]}),v.jsxs(St,{children:[v.jsxs(xo,{defaultValue:t.extenderDirection,value:t.extenderDirection,onValueChange:L=>{u(L)},children:[v.jsx(Hr,{className:"w-[65px] h-7",disabled:!t.showExtender,children:v.jsx(bo,{placeholder:"Select axis"})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:Object.values(jn).map(L=>v.jsx(Gr,{value:L,children:L},L))})})]}),v.jsxs("div",{className:"flex gap-1 justify-center mt-0",children:[v.jsx(Th,{text:"1.25x",onClick:()=>l(t.extenderDirection,1.25)}),v.jsx(Th,{text:"1.5x",onClick:()=>l(t.extenderDirection,1.5)}),v.jsx(Th,{text:"1.75x",onClick:()=>l(t.extenderDirection,1.75)}),v.jsx(Th,{text:"2.0x",onClick:()=>l(t.extenderDirection,2)})]})]})]}),v.jsx(Xt,{})]}):null,K=()=>v.jsxs(St,{children:[v.jsx(zt,{text:"Task",toolTip:"PowerPaint task. When using extender, image-outpainting task will be auto used. For object-removal and image-outpainting, it is recommended to set the guidance_scale at 10 or above."}),v.jsxs(xo,{defaultValue:t.powerpaintTask,value:t.powerpaintTask,onValueChange:L=>{o({powerpaintTask:L})},disabled:t.showExtender,children:[v.jsx(Hr,{className:"w-[130px]",children:v.jsx(bo,{placeholder:"Select task"})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:[ma.text_guided,ma.object_remove,ma.context_aware,ma.shape_guided].map(L=>v.jsx(Gr,{value:L,children:L},L))})})]})]}),te=()=>t.model.name!==gj?null:v.jsxs(v.Fragment,{children:[K(),v.jsx(Xt,{})]}),W=()=>t.model.support_powerpaint_v2===!1?null:v.jsxs(v.Fragment,{children:[v.jsxs(St,{children:[v.jsx(zt,{text:"PowerPaint V2",toolTip:"PowerPaint is a plug-and-play image inpainting model works on any SD1.5 base models."}),v.jsx(Br,{id:"powerpaint-v2",checked:t.enablePowerPaintV2,onCheckedChange:L=>{p(L)}})]}),K(),v.jsx(Xt,{})]}),re=()=>v.jsxs(St,{children:[v.jsx(zt,{htmlFor:"steps",text:"Steps",toolTip:"The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."}),v.jsxs("div",{className:"flex gap-4",children:[v.jsx(zr,{className:"w-[120px]",defaultValue:[30],min:1,max:100,step:1,value:[Math.floor(t.sdSteps)],onValueChange:L=>o({sdSteps:L[0]})}),v.jsx(fo,{id:"steps",className:"w-[50px] rounded-full",numberValue:t.sdSteps,allowFloat:!1,onNumberValueChange:L=>{o({sdSteps:L})}})]})]}),H=()=>v.jsxs(St,{children:[v.jsx(zt,{text:"Guidance",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inpaint#guidance-scale",toolTip:"Guidance scale affects how aligned the text prompt and generated image are. Higher value means the prompt and generated image are closely aligned, so the output is a stricter interpretation of the prompt"}),v.jsxs("div",{className:"flex gap-4",children:[v.jsx(zr,{className:"w-[120px]",defaultValue:[750],min:0,max:1500,step:1,value:[Math.floor(t.sdGuidanceScale*100)],onValueChange:L=>o({sdGuidanceScale:L[0]/100})}),v.jsx(fo,{id:"guid",className:"w-[50px] rounded-full",numberValue:t.sdGuidanceScale,allowFloat:!0,onNumberValueChange:L=>{o({sdGuidanceScale:L})}})]})]}),J=()=>t.model.name===vj?null:v.jsxs(St,{children:[v.jsx(zt,{text:"Sampler"}),v.jsxs(xo,{defaultValue:t.sdSampler,value:t.sdSampler,onValueChange:L=>{o({sdSampler:L})},children:[v.jsx(Hr,{className:"w-[175px] text-xs",children:v.jsx(bo,{placeholder:"Select sampler"})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:e.map(L=>v.jsx(Gr,{value:L,className:"text-xs",children:L},L))})})]})]}),G=()=>v.jsxs(St,{children:[v.jsx(zt,{text:"Seed",toolTip:"Using same parameters and a fixed seed can generate same result image."}),v.jsxs("div",{className:"flex gap-2 justify-center items-center",children:[v.jsx(Br,{id:"seed",checked:t.seedFixed,onCheckedChange:L=>{o({seedFixed:L})}}),v.jsx(fo,{id:"seed",className:"w-[110px]",disabled:!t.seedFixed,numberValue:t.seed,allowFloat:!1,onNumberValueChange:L=>{o({seed:L})}})]})]}),Z=()=>v.jsxs(v.Fragment,{children:[v.jsxs(St,{children:[v.jsx(zt,{text:"Mask blur",toolTip:"How much to blur the mask before processing, in pixels. Make the generated inpainting boundaries appear more natural."}),v.jsxs("div",{className:"flex gap-4",children:[v.jsx(zr,{className:"w-[120px]",defaultValue:[t.sdMaskBlur],min:0,max:96,step:1,value:[Math.floor(t.sdMaskBlur)],onValueChange:L=>o({sdMaskBlur:L[0]})}),v.jsx(fo,{id:"mask-blur",className:"w-[50px] rounded-full",numberValue:t.sdMaskBlur,allowFloat:!1,onNumberValueChange:L=>{o({sdMaskBlur:L})}})]})]}),v.jsx(Xt,{})]}),Q=()=>v.jsxs(v.Fragment,{children:[v.jsxs(St,{children:[v.jsx(zt,{text:"Match histograms",toolTip:"Match the inpainting result histogram to the source image histogram",url:"https://github.com/Sanster/lama-cleaner/pull/143#issuecomment-1325859307"}),v.jsx(Br,{id:"match-histograms",checked:t.sdMatchHistograms,onCheckedChange:L=>{o({sdMatchHistograms:L})}})]}),v.jsx(Xt,{})]}),le=()=>v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs(St,{children:[v.jsx(zt,{htmlFor:"adjustMaskKernelSize",text:"Mask OP",toolTip:"Expand or shrink mask. Using the slider to adjust the kernel size for dilation or erosion."}),v.jsxs("div",{className:"flex gap-4",children:[v.jsx(zr,{className:"w-[120px]",defaultValue:[12],min:1,max:100,step:1,value:[Math.floor(t.adjustMaskKernelSize)],onValueChange:L=>o({adjustMaskKernelSize:L[0]})}),v.jsx(fo,{id:"adjustMaskKernelSize",className:"w-[50px] rounded-full",numberValue:t.adjustMaskKernelSize,allowFloat:!1,onNumberValueChange:L=>{o({adjustMaskKernelSize:L})}})]})]}),v.jsxs(St,{children:[v.jsx(wn,{variant:"outline",className:"p-1 h-8",onClick:()=>f("expand"),disabled:r,children:v.jsx("div",{className:"flex items-center gap-1 select-none",children:"Expand"})}),v.jsx(wn,{variant:"outline",className:"p-1 h-8",onClick:()=>f("shrink"),disabled:r,children:v.jsx("div",{className:"flex items-center gap-1 select-none",children:"Shrink"})}),v.jsx(wn,{variant:"outline",className:"p-1 h-8",onClick:()=>f("reverse"),disabled:r,children:v.jsx("div",{className:"flex items-center gap-1 select-none",children:"Reverse"})}),v.jsx(wn,{variant:"outline",className:"p-1 h-8 justify-self-end",onClick:m,disabled:r,children:v.jsx("div",{className:"flex items-center gap-1 select-none",children:"Clear"})})]})]}),v.jsx(Xt,{})]});return v.jsxs("div",{className:"flex flex-col gap-[14px] mt-4",children:[C(),ie(),Z(),le(),Q(),te(),re(),H(),U(),z(),J(),G(),A(),v.jsx(Xt,{}),R(),W(),T(),N(),O()]})},TJ=()=>{const[e,t]=xt(n=>[n.settings,n.updateSettings]);return v.jsxs("div",{className:"flex flex-col gap-4 mt-4",children:[v.jsxs(St,{children:[v.jsx(zt,{text:"CV2 Flag",url:"https://docs.opencv.org/4.8.0/d7/d8b/group__photo__inpaint.html#gga8002a65f5a3328fbf15df81b842d3c3ca892824c38e258feb5e72f308a358d52e"}),v.jsxs(xo,{value:e.cv2Flag,onValueChange:n=>{t({cv2Flag:n})},children:[v.jsx(Hr,{className:"w-[160px]",children:v.jsx(bo,{placeholder:"Select flag"})}),v.jsx(Kr,{align:"end",children:v.jsx(zo,{children:Object.values(sx).map(n=>v.jsx(Gr,{value:n,children:n},n))})})]})]}),v.jsx(zt,{text:"CV2 Radius",url:"https://docs.opencv.org/4.8.0/d7/d8b/group__photo__inpaint.html#gga8002a65f5a3328fbf15df81b842d3c3ca892824c38e258feb5e72f308a358d52e"}),v.jsxs(St,{children:[v.jsx(zr,{className:"w-[180px]",defaultValue:[5],min:1,max:100,step:1,value:[Math.floor(e.cv2Radius)],onValueChange:n=>t({cv2Radius:n[0]})}),v.jsx(fo,{id:"cv2-radius",className:"w-[50px] rounded-full",numberValue:e.cv2Radius,allowFloat:!1,onNumberValueChange:n=>{t({cv2Radius:n})}})]})]})},AJ=()=>{const[e,t]=xt(i=>[i.settings,i.windowSize]),[n,r]=zx(!0);if(Xn("c",()=>{r()}),e.model.name!==mC&&e.model.name!==gC&&e.model.model_type===ms)return null;const o=()=>e.model.name===mC?v.jsx(kJ,{}):e.model.name===gC?v.jsx(TJ,{}):v.jsx(PJ,{});return v.jsxs(SJ,{open:n,modal:!1,children:[v.jsx(_J,{tabIndex:-1,className:"z-10 outline-none absolute top-[68px] right-6 rounded-lg border bg-background",hidden:n,children:v.jsx(wn,{variant:"ghost",size:"icon",asChild:!0,className:"p-1.5",onClick:r,children:v.jsx(JU,{strokeWidth:1})})}),v.jsxs(kA,{side:"right",className:"min-w-[286px] max-w-full mt-[60px] outline-none pl-3 pr-1",onOpenAutoFocus:i=>i.preventDefault(),onPointerDownOutside:i=>i.preventDefault(),children:[v.jsxs(PA,{children:[v.jsxs(St,{children:[v.jsx("div",{className:"overflow-hidden mr-8",children:e.model.name.split("/")[e.model.name.split("/").length-1]}),v.jsx(wn,{variant:"ghost",size:"icon",className:"border h-6 w-6",onClick:r,children:v.jsx(eV,{strokeWidth:1})})]}),v.jsx(Xt,{})]}),v.jsx(pg,{style:{height:t.height-160},children:o()})]})]})},ti=Object.create(null);ti.open="0";ti.close="1";ti.ping="2";ti.pong="3";ti.message="4";ti.upgrade="5";ti.noop="6";const up=Object.create(null);Object.keys(ti).forEach(e=>{up[ti[e]]=e});const ew={type:"error",data:"parser error"},TA=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",AA=typeof ArrayBuffer=="function",MA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,pb=({type:e,data:t},n,r)=>TA&&t instanceof Blob?n?r(t):o$(t,r):AA&&(t instanceof ArrayBuffer||MA(t))?n?r(t):o$(new Blob([t]),r):r(ti[e]+(t||"")),o$=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function i$(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Y0;function MJ(e,t){if(TA&&e.data instanceof Blob)return e.data.arrayBuffer().then(i$).then(t);if(AA&&(e.data instanceof ArrayBuffer||MA(e.data)))return t(i$(e.data));pb(e,!1,n=>{Y0||(Y0=new TextEncoder),t(Y0.encode(n))})}const s$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Eu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<s$.length;e++)Eu[s$.charCodeAt(e)]=e;const OJ=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,l,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(r=0;r<n;r+=4)i=Eu[e.charCodeAt(r)],s=Eu[e.charCodeAt(r+1)],l=Eu[e.charCodeAt(r+2)],u=Eu[e.charCodeAt(r+3)],m[o++]=i<<2|s>>4,m[o++]=(s&15)<<4|l>>2,m[o++]=(l&3)<<6|u&63;return f},NJ=typeof ArrayBuffer=="function",mb=(e,t)=>{if(typeof e!="string")return{type:"message",data:OA(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:DJ(e.substring(1),t)}:up[n]?e.length>1?{type:up[n],data:e.substring(1)}:{type:up[n]}:ew},DJ=(e,t)=>{if(NJ){const n=OJ(e);return OA(n,t)}else return{base64:!0,data:e}},OA=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},NA="",IJ=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{pb(i,!1,l=>{r[s]=l,++o===n&&t(r.join(NA))})})},LJ=(e,t)=>{const n=e.split(NA),r=[];for(let o=0;o<n.length;o++){const i=mb(n[o],t);if(r.push(i),i.type==="error")break}return r};function jJ(){return new TransformStream({transform(e,t){MJ(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let X0;function Ah(e){return e.reduce((t,n)=>t+n.length,0)}function Mh(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function FJ(e,t){X0||(X0=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,l){for(n.push(s);;){if(r===0){if(Ah(n)<1)break;const u=Mh(n,1);i=(u[0]&128)===128,o=u[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Ah(n)<2)break;const u=Mh(n,2);o=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Ah(n)<8)break;const u=Mh(n,8),f=new DataView(u.buffer,u.byteOffset,u.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){l.enqueue(ew);break}o=m*Math.pow(2,32)+f.getUint32(4),r=3}else{if(Ah(n)<o)break;const u=Mh(n,o);l.enqueue(mb(i?u:X0.decode(u),t)),r=0}if(o===0||o>e){l.enqueue(ew);break}}}})}const DA=4;function qt(e){if(e)return BJ(e)}function BJ(e){for(var t in qt.prototype)e[t]=qt.prototype[t];return e}qt.prototype.on=qt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};qt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};qt.prototype.off=qt.prototype.removeListener=qt.prototype.removeAllListeners=qt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this};qt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this};qt.prototype.emitReserved=qt.prototype.emit;qt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};qt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Wr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function IA(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const zJ=Wr.setTimeout,UJ=Wr.clearTimeout;function Eg(e,t){t.useNativeTimers?(e.setTimeoutFn=zJ.bind(Wr),e.clearTimeoutFn=UJ.bind(Wr)):(e.setTimeoutFn=Wr.setTimeout.bind(Wr),e.clearTimeoutFn=Wr.clearTimeout.bind(Wr))}const VJ=1.33;function WJ(e){return typeof e=="string"?HJ(e):Math.ceil((e.byteLength||e.size)*VJ)}function HJ(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function KJ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function GJ(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class YJ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class gb extends qt{constructor(t){super(),this.writable=!1,Eg(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new YJ(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=mb(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=KJ(t);return n.length?"?"+n:""}}const LA="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),tw=64,XJ={};let a$=0,Oh=0,l$;function c$(e){let t="";do t=LA[e%tw]+t,e=Math.floor(e/tw);while(e>0);return t}function jA(){const e=c$(+new Date);return e!==l$?(a$=0,l$=e):e+"."+c$(a$++)}for(;Oh<tw;Oh++)XJ[LA[Oh]]=Oh;let FA=!1;try{FA=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ZJ=FA;function BA(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||ZJ))return new XMLHttpRequest}catch{}if(!t)try{return new Wr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function qJ(){}const QJ=function(){return new BA({xdomain:!1}).responseType!=null}();class JJ extends gb{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let o=location.port;o||(o=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||o!==t.port}const n=t&&t.forceBase64;this.supportsBinary=QJ&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};LJ(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,IJ(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=jA()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new qo(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class qo extends qt{constructor(t,n){super(),Eg(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=IA(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new BA(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this.opts.extraHeaders[o])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this.opts.cookieJar)===null||o===void 0||o.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(o){this.setTimeoutFn(()=>{this.onError(o)},0);return}typeof document<"u"&&(this.index=qo.requestsCount++,qo.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=qJ,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete qo.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}qo.requestsCount=0;qo.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",u$);else if(typeof addEventListener=="function"){const e="onpagehide"in Wr?"pagehide":"unload";addEventListener(e,u$,!1)}}function u$(){for(let e in qo.requests)qo.requests.hasOwnProperty(e)&&qo.requests[e].abort()}const vb=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Nh=Wr.WebSocket||Wr.MozWebSocket,d$=!0,eee="arraybuffer",f$=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class tee extends gb{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=f$?{}:IA(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=d$&&!f$?n?new Nh(t,n):new Nh(t):new Nh(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;pb(r,this.supportsBinary,i=>{const s={};try{d$&&this.ws.send(i)}catch{}o&&vb(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=jA()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Nh}}class nee extends gb{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=FJ(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=jJ();o.readable.pipeTo(t.writable),this.writer=o.writable.getWriter();const i=()=>{r.read().then(({done:l,value:u})=>{l||(this.onPacket(u),i())}).catch(l=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this.writer.write(r).then(()=>{o&&vb(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const ree={websocket:tee,webtransport:nee,polling:JJ},oee=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,iee=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function nw(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=oee.exec(e||""),i={},s=14;for(;s--;)i[iee[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=see(i,i.path),i.queryKey=aee(i,i.query),i}function see(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function aee(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}let zA=class gl extends qt{constructor(t,n={}){super(),this.binaryType=eee,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=nw(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=nw(n.host).host),Eg(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=GJ(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=DA,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new ree[t](r)}open(){let t;if(this.opts.rememberUpgrade&&gl.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;gl.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;gl.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function i(){r||(r=!0,m(),n.close(),n=null)}const s=p=>{const g=new Error("probe error: "+p);g.transport=n.name,i(),this.emitReserved("upgradeError",g)};function l(){s("transport closed")}function u(){s("socket closed")}function f(p){n&&p.name!==n.name&&i()}const m=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",l),this.off("close",u),this.off("upgrading",f)};n.once("open",o),n.once("error",s),n.once("close",l),this.once("close",u),this.once("upgrading",f),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",gl.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=WJ(o)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){gl.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const o=t.length;for(;r<o;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};zA.protocol=DA;function lee(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=nw(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const cee=typeof ArrayBuffer=="function",uee=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,UA=Object.prototype.toString,dee=typeof Blob=="function"||typeof Blob<"u"&&UA.call(Blob)==="[object BlobConstructor]",fee=typeof File=="function"||typeof File<"u"&&UA.call(File)==="[object FileConstructor]";function yb(e){return cee&&(e instanceof ArrayBuffer||uee(e))||dee&&e instanceof Blob||fee&&e instanceof File}function dp(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(dp(e[n]))return!0;return!1}if(yb(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return dp(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&dp(e[n]))return!0;return!1}function hee(e){const t=[],n=e.data,r=e;return r.data=rw(n,t),r.attachments=t.length,{packet:r,buffers:t}}function rw(e,t){if(!e)return e;if(yb(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=rw(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=rw(e[r],t));return n}return e}function pee(e,t){return e.data=ow(e.data,t),delete e.attachments,e}function ow(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ow(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ow(e[n],t));return e}const mee=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],gee=5;var ct;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(ct||(ct={}));class vee{constructor(t){this.replacer=t}encode(t){return(t.type===ct.EVENT||t.type===ct.ACK)&&dp(t)?this.encodeAsBinary({type:t.type===ct.EVENT?ct.BINARY_EVENT:ct.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ct.BINARY_EVENT||t.type===ct.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=hee(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function h$(e){return Object.prototype.toString.call(e)==="[object Object]"}class wb extends qt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===ct.BINARY_EVENT;r||n.type===ct.BINARY_ACK?(n.type=r?ct.EVENT:ct.ACK,this.reconstructor=new yee(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(yb(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(ct[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ct.BINARY_EVENT||r.type===ct.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(wb.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case ct.CONNECT:return h$(n);case ct.DISCONNECT:return n===void 0;case ct.CONNECT_ERROR:return typeof n=="string"||h$(n);case ct.EVENT:case ct.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&mee.indexOf(n[0])===-1);case ct.ACK:case ct.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class yee{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=pee(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const wee=Object.freeze(Object.defineProperty({__proto__:null,Decoder:wb,Encoder:vee,get PacketType(){return ct},protocol:gee},Symbol.toStringTag,{value:"Module"}));function vo(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const xee=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class VA extends qt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[vo(t,"open",this.onopen.bind(this)),vo(t,"packet",this.onpacket.bind(this)),vo(t,"error",this.onerror.bind(this)),vo(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(xee.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:ct.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,l=n.pop();this._registerAckCallback(s,l),r.id=s}const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!o||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},o);this.acks[t]=(...s)=>{this.io.clearTimeoutFn(i),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((o,i)=>{n.push((s,l)=>r?s?i(s):o(l):o(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ct.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ct.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ct.EVENT:case ct.BINARY_EVENT:this.onevent(t);break;case ct.ACK:case ct.BINARY_ACK:this.onack(t);break;case ct.DISCONNECT:this.ondisconnect();break;case ct.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:ct.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ct.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Nc(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Nc.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Nc.prototype.reset=function(){this.attempts=0};Nc.prototype.setMin=function(e){this.ms=e};Nc.prototype.setMax=function(e){this.max=e};Nc.prototype.setJitter=function(e){this.jitter=e};class iw extends qt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Eg(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Nc({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||wee;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new zA(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=vo(n,"open",function(){r.onopen(),t&&t()}),i=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},s=vo(n,"error",i);if(this._timeout!==!1){const l=this._timeout,u=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},l);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(vo(t,"ping",this.onping.bind(this)),vo(t,"data",this.ondata.bind(this)),vo(t,"error",this.onerror.bind(this)),vo(t,"close",this.onclose.bind(this)),vo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){vb(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new VA(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const gu={};function fp(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=lee(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=gu[o]&&i in gu[o].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let u;return l?u=new iw(r,t):(gu[o]||(gu[o]=new iw(r,t)),u=gu[o]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(fp,{Manager:iw,Socket:VA,io:fp,connect:fp});const WA="Progress",Cg=100,[bee,Mte]=An(WA),[See,_ee]=bee(WA),HA=d.forwardRef((e,t)=>{const{__scopeProgress:n,value:r,max:o,getValueLabel:i=$ee,...s}=e,l=sw(o)?o:Cg,u=GA(r,l)?r:null,f=pm(u)?i(u,l):void 0;return d.createElement(See,{scope:n,value:u,max:l},d.createElement(Ae.div,Y({"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":pm(u)?u:void 0,"aria-valuetext":f,role:"progressbar","data-state":KA(u,l),"data-value":u??void 0,"data-max":l},s,{ref:t})))});HA.propTypes={max(e,t,n){const r=e[t],o=String(r);return r&&!sw(r)?new Error(Ree(o,n)):null},value(e,t,n){const r=e[t],o=String(r),i=sw(e.max)?e.max:Cg;return r!=null&&!GA(r,i)?new Error(kee(o,n)):null}};const Eee="ProgressIndicator",Cee=d.forwardRef((e,t)=>{var n;const{__scopeProgress:r,...o}=e,i=_ee(Eee,r);return d.createElement(Ae.div,Y({"data-state":KA(i.value,i.max),"data-value":(n=i.value)!==null&&n!==void 0?n:void 0,"data-max":i.max},o,{ref:t}))});function $ee(e,t){return`${Math.round(e/t*100)}%`}function KA(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function pm(e){return typeof e=="number"}function sw(e){return pm(e)&&!isNaN(e)&&e>0}function GA(e,t){return pm(e)&&!isNaN(e)&&e<=t&&e>=0}function Ree(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Cg}\`.`}function kee(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${Cg} if no \`max\` prop is set)
- \`null\` if the progress is indeterminate.
Defaulting to \`null\`.`}const YA=HA,Pee=Cee,XA=d.forwardRef(({className:e,value:t,...n},r)=>v.jsx(YA,{ref:r,className:xe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:v.jsx(Pee,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));XA.displayName=YA.displayName;const Tee="",Ji=fp(Tee),Aee=()=>{const[e,t,n]=xt(u=>[u.settings,u.isInpainting,u.isSD()]),[r,o]=d.useState(!1),[i,s]=d.useState(0),l=Math.min(Math.round(i/e.sdSteps*100),100);return d.useEffect(()=>(Ji.on("connect",()=>{o(!0)}),Ji.on("disconnect",()=>{o(!1)}),Ji.on("diffusion_progress",u=>{u&&s(u.step+1)}),Ji.on("diffusion_finish",()=>{s(0)}),()=>{Ji.off("connect"),Ji.off("disconnect"),Ji.off("diffusion_progress"),Ji.off("diffusion_finish")}),[]),v.jsxs("div",{className:"z-10 fixed bg-background w-[220px] left-1/2 -translate-x-1/2 top-[68px] h-[32px] flex justify-center items-center gap-[18px] border-[1px] border-[solid] rounded-[14px] pl-[8px] pr-[8px]",style:{visibility:r&&t&&n?"visible":"hidden"},children:[v.jsx(XA,{value:l}),v.jsxs("div",{className:"w-[45px] flex justify-center font-nums",children:[l,"%"]})]})},Mee=()=>{const[e,t]=xt(n=>[n.file,n.updateSettings]);return d.useEffect(()=>{(async()=>{const r=await GF();t({model:r})})()},[]),v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex gap-3 absolute top-[68px] left-[24px] items-center",children:[v.jsx(bJ,{}),v.jsx(tQ,{})]}),v.jsx(Zq,{}),v.jsx(Aee,{}),v.jsx(AJ,{}),e?v.jsx(eQ,{file:e}):v.jsx(v.Fragment,{})]})},Oee=()=>{const[e,t]=d.useState(window.innerWidth),n=d.useCallback(()=>{t(window.innerWidth)},[]);if(d.useEffect(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)})),e<768)return"mobile";if(e>=768&&e<1224)return"tablet";if(e>=1224)return"desktop"};function Nee(e){const{onSelection:t}=e,[n]=d.useState(`file-upload-${Math.random().toString()}`),r=Oee();function o(i){if(!(!i||!i.type.match("image.*")))try{if(i.size>20*1024*1024)throw new Error("file too large");t(i)}catch(l){alert(`error: ${l.message}`)}}return v.jsx("div",{className:"absolute flex w-screen h-screen justify-center items-center pointer-events-none",children:v.jsx("label",{htmlFor:n,className:"grid bg-background border-[2px] border-[dashed] rounded-lg min-w-[600px] hover:bg-primary hover:text-primary-foreground pointer-events-auto",children:v.jsxs("div",{className:"grid p-16 w-full h-full",onDragOver:i=>{i.stopPropagation(),i.preventDefault()},children:[v.jsx("input",{className:"hidden",id:n,name:n,type:"file",onChange:i=>{var l;const s=(l=i.currentTarget.files)==null?void 0:l[0];s&&o(s)},accept:"image/png, image/jpeg"}),v.jsx("p",{className:"text-center",children:r==="desktop"?"Click here or drag an image file":"Tap here to load your picture"})]})})})}const ZA="ToastProvider",[xb,Dee,Iee]=Gd("Toast"),[qA,Ote]=An("Toast",[Iee]),[Lee,$g]=qA(ZA),QA=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[l,u]=d.useState(null),[f,m]=d.useState(0),p=d.useRef(!1),g=d.useRef(!1);return d.createElement(xb.Provider,{scope:t},d.createElement(Lee,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:f,viewport:l,onViewportChange:u,onToastAdd:d.useCallback(()=>m(y=>y+1),[]),onToastRemove:d.useCallback(()=>m(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g},s))};QA.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${ZA}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const jee="ToastViewport",Fee=["F8"],aw="toast.viewportPause",lw="toast.viewportResume",Bee=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Fee,label:o="Notifications ({hotkey})",...i}=e,s=$g(jee,n),l=Dee(n),u=d.useRef(null),f=d.useRef(null),m=d.useRef(null),p=d.useRef(null),g=We(t,p,s.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=s.toastCount>0;d.useEffect(()=>{const E=_=>{var b;r.every(R=>_[R]||_.code===R)&&((b=p.current)===null||b===void 0||b.focus())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[r]),d.useEffect(()=>{const E=u.current,_=p.current;if(x&&E&&_){const b=()=>{if(!s.isClosePausedRef.current){const N=new CustomEvent(aw);_.dispatchEvent(N),s.isClosePausedRef.current=!0}},C=()=>{if(s.isClosePausedRef.current){const N=new CustomEvent(lw);_.dispatchEvent(N),s.isClosePausedRef.current=!1}},R=N=>{!E.contains(N.relatedTarget)&&C()},T=()=>{E.contains(document.activeElement)||C()};return E.addEventListener("focusin",b),E.addEventListener("focusout",R),E.addEventListener("pointermove",b),E.addEventListener("pointerleave",T),window.addEventListener("blur",b),window.addEventListener("focus",C),()=>{E.removeEventListener("focusin",b),E.removeEventListener("focusout",R),E.removeEventListener("pointermove",b),E.removeEventListener("pointerleave",T),window.removeEventListener("blur",b),window.removeEventListener("focus",C)}}},[x,s.isClosePausedRef]);const S=d.useCallback(({tabbingDirection:E})=>{const b=l().map(C=>{const R=C.ref.current,T=[R,...nte(R)];return E==="forwards"?T:T.reverse()});return(E==="forwards"?b.reverse():b).flat()},[l]);return d.useEffect(()=>{const E=p.current;if(E){const _=b=>{const C=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!C){const O=document.activeElement,U=b.shiftKey;if(b.target===E&&U){var T;(T=f.current)===null||T===void 0||T.focus();return}const K=S({tabbingDirection:U?"backwards":"forwards"}),te=K.findIndex(W=>W===O);if(Z0(K.slice(te+1)))b.preventDefault();else{var N,A;U?(N=f.current)===null||N===void 0||N.focus():(A=m.current)===null||A===void 0||A.focus()}}};return E.addEventListener("keydown",_),()=>E.removeEventListener("keydown",_)}},[l,S]),d.createElement(Tz,{ref:u,role:"region","aria-label":o.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:x?void 0:"none"}},x&&d.createElement(p$,{ref:f,onFocusFromOutsideViewport:()=>{const E=S({tabbingDirection:"forwards"});Z0(E)}}),d.createElement(xb.Slot,{scope:n},d.createElement(Ae.ol,Y({tabIndex:-1},i,{ref:g}))),x&&d.createElement(p$,{ref:m,onFocusFromOutsideViewport:()=>{const E=S({tabbingDirection:"backwards"});Z0(E)}}))}),zee="ToastFocusProxy",p$=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=$g(zee,n);return d.createElement(Qm,Y({"aria-hidden":!0,tabIndex:0},o,{ref:t,style:{position:"fixed"},onFocus:s=>{var l;const u=s.relatedTarget;!((l=i.viewport)!==null&&l!==void 0&&l.contains(u))&&r()}}))}),Rg="Toast",Uee="toast.swipeStart",Vee="toast.swipeMove",Wee="toast.swipeCancel",Hee="toast.swipeEnd",Kee=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[l=!0,u]=no({prop:r,defaultProp:o,onChange:i});return d.createElement(Sn,{present:n||l},d.createElement(JA,Y({open:l},s,{ref:t,onClose:()=>u(!1),onPause:Lt(e.onPause),onResume:Lt(e.onResume),onSwipeStart:fe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:fe(e.onSwipeMove,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:fe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:fe(e.onSwipeEnd,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),u(!1)})})))}),[Gee,Yee]=qA(Rg,{onClose(){}}),JA=d.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:f,onSwipeStart:m,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:y,...x}=e,S=$g(Rg,n),[E,_]=d.useState(null),b=We(t,W=>_(W)),C=d.useRef(null),R=d.useRef(null),T=o||S.duration,N=d.useRef(0),A=d.useRef(T),O=d.useRef(0),{onToastAdd:U,onToastRemove:z}=S,ie=Lt(()=>{var W;(E==null?void 0:E.contains(document.activeElement))&&((W=S.viewport)===null||W===void 0||W.focus()),s()}),K=d.useCallback(W=>{!W||W===1/0||(window.clearTimeout(O.current),N.current=new Date().getTime(),O.current=window.setTimeout(ie,W))},[ie]);d.useEffect(()=>{const W=S.viewport;if(W){const re=()=>{K(A.current),f==null||f()},H=()=>{const J=new Date().getTime()-N.current;A.current=A.current-J,window.clearTimeout(O.current),u==null||u()};return W.addEventListener(aw,H),W.addEventListener(lw,re),()=>{W.removeEventListener(aw,H),W.removeEventListener(lw,re)}}},[S.viewport,T,u,f,K]),d.useEffect(()=>{i&&!S.isClosePausedRef.current&&K(T)},[i,T,S.isClosePausedRef,K]),d.useEffect(()=>(U(),()=>z()),[U,z]);const te=d.useMemo(()=>E?rM(E):null,[E]);return S.viewport?d.createElement(d.Fragment,null,te&&d.createElement(Xee,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0},te),d.createElement(Gee,{scope:n,onClose:ie},Bs.createPortal(d.createElement(xb.ItemSlot,{scope:n},d.createElement(Pz,{asChild:!0,onEscapeKeyDown:fe(l,()=>{S.isFocusedToastEscapeKeyDownRef.current||ie(),S.isFocusedToastEscapeKeyDownRef.current=!1})},d.createElement(Ae.li,Y({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":S.swipeDirection},x,{ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:fe(e.onKeyDown,W=>{W.key==="Escape"&&(l==null||l(W.nativeEvent),W.nativeEvent.defaultPrevented||(S.isFocusedToastEscapeKeyDownRef.current=!0,ie()))}),onPointerDown:fe(e.onPointerDown,W=>{W.button===0&&(C.current={x:W.clientX,y:W.clientY})}),onPointerMove:fe(e.onPointerMove,W=>{if(!C.current)return;const re=W.clientX-C.current.x,H=W.clientY-C.current.y,J=!!R.current,G=["left","right"].includes(S.swipeDirection),Z=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,Q=G?Z(0,re):0,le=G?0:Z(0,H),L=W.pointerType==="touch"?10:2,ue={x:Q,y:le},Ne={originalEvent:W,delta:ue};J?(R.current=ue,Dh(Vee,p,Ne,{discrete:!1})):m$(ue,S.swipeDirection,L)?(R.current=ue,Dh(Uee,m,Ne,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(re)>L||Math.abs(H)>L)&&(C.current=null)}),onPointerUp:fe(e.onPointerUp,W=>{const re=R.current,H=W.target;if(H.hasPointerCapture(W.pointerId)&&H.releasePointerCapture(W.pointerId),R.current=null,C.current=null,re){const J=W.currentTarget,G={originalEvent:W,delta:re};m$(re,S.swipeDirection,S.swipeThreshold)?Dh(Hee,y,G,{discrete:!0}):Dh(Wee,g,G,{discrete:!0}),J.addEventListener("click",Z=>Z.preventDefault(),{once:!0})}})})))),S.viewport))):null});JA.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${Rg}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const Xee=e=>{const{__scopeToast:t,children:n,...r}=e,o=$g(Rg,t),[i,s]=d.useState(!1),[l,u]=d.useState(!1);return ete(()=>s(!0)),d.useEffect(()=>{const f=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(f)},[]),l?null:d.createElement(Bd,{asChild:!0},d.createElement(Qm,r,i&&d.createElement(d.Fragment,null,o.label," ",n)))},Zee=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.createElement(Ae.div,Y({},r,{ref:t}))}),qee=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.createElement(Ae.div,Y({},r,{ref:t}))}),Qee="ToastAction",eM=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n?d.createElement(nM,{altText:n,asChild:!0},d.createElement(tM,Y({},r,{ref:t}))):null});eM.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${Qee}\``)}};const Jee="ToastClose",tM=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Yee(Jee,n);return d.createElement(nM,{asChild:!0},d.createElement(Ae.button,Y({type:"button"},r,{ref:t,onClick:fe(e.onClick,o.onClose)})))}),nM=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return d.createElement(Ae.div,Y({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0},o,{ref:t}))});function rM(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),tte(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...rM(r))}}),t}function Dh(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?yx(o,i):o.dispatchEvent(i)}const m$=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function ete(e=()=>{}){const t=Lt(e);Tn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function tte(e){return e.nodeType===e.ELEMENT_NODE}function nte(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Z0(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}const rte=QA,oM=Bee,iM=Kee,sM=Zee,aM=qee,lM=eM,cM=tM,ote=rte,uM=d.forwardRef(({className:e,...t},n)=>v.jsx(oM,{ref:n,className:xe("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),tabIndex:-1,...t}));uM.displayName=oM.displayName;const ite=zm("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),dM=d.forwardRef(({className:e,variant:t,...n},r)=>v.jsx(iM,{ref:r,className:xe(ite({variant:t}),e),tabIndex:-1,...n}));dM.displayName=iM.displayName;const ste=d.forwardRef(({className:e,...t},n)=>v.jsx(lM,{ref:n,className:xe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),tabIndex:-1,...t}));ste.displayName=lM.displayName;const fM=d.forwardRef(({className:e,...t},n)=>v.jsx(cM,{ref:n,className:xe("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",tabIndex:-1,...t,children:v.jsx(Pk,{className:"h-4 w-4"})}));fM.displayName=cM.displayName;const hM=d.forwardRef(({className:e,...t},n)=>v.jsx(sM,{ref:n,className:xe("text-sm font-semibold [&+div]:text-xs",e),tabIndex:-1,...t}));hM.displayName=sM.displayName;const pM=d.forwardRef(({className:e,...t},n)=>v.jsx(aM,{ref:n,className:xe("text-sm opacity-90",e),...t,tabIndex:-1}));pM.displayName=aM.displayName;function ate(){const{toasts:e}=Ld();return v.jsxs(ote,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return v.jsxs(dM,{...i,children:[v.jsxs("div",{className:"grid gap-1",children:[n&&v.jsx(hM,{children:n}),r&&v.jsx(pM,{children:r})]}),o,v.jsx(fM,{})]},t)}),v.jsx(uM,{})]})}const lte=["image/jpeg","image/png","image/webp","image/bmp","image/tiff"];function cte(){const[e,t,n,r]=xt(g=>[g.file,g.updateAppState,g.setServerConfig,g.setFile]),o=eB(),i=_H();d.useEffect(()=>{o&&r(o)},[o,r]),d.useEffect(()=>{t({windowSize:i})},[i]),d.useEffect(()=>{(async()=>{const y=await $k();n(y),y.isDesktop&&wj()})()},[]);const s=d.useRef(0),l=d.useCallback(g=>{g.preventDefault(),g.stopPropagation()},[]),u=d.useCallback(g=>{g.preventDefault(),g.stopPropagation(),s.current+=1},[]),f=d.useCallback(g=>{g.preventDefault(),g.stopPropagation(),s.current-=1,s.current>0},[]),m=d.useCallback(g=>{if(g.preventDefault(),g.stopPropagation(),g.dataTransfer.files&&g.dataTransfer.files.length>0){if(!(g.dataTransfer.files.length>1)){const y=g.dataTransfer.files[0],x=y.type;lte.includes(x)&&r(y)}g.dataTransfer.clearData()}},[]),p=d.useCallback(g=>{if(!g.clipboardData)return;const y=g.clipboardData.items,x=[].slice.call(y).filter(_=>_.type.indexOf("image")!==-1);if(x.length===0)return;g.preventDefault(),g.stopPropagation();const E=x[0].getAsFile();E&&r(E)},[]);return d.useEffect(()=>(window.addEventListener("dragenter",u),window.addEventListener("dragleave",f),window.addEventListener("dragover",l),window.addEventListener("drop",m),window.addEventListener("paste",p),function(){window.removeEventListener("dragenter",u),window.removeEventListener("dragleave",f),window.removeEventListener("dragover",l),window.removeEventListener("drop",m),window.removeEventListener("paste",p)})),v.jsxs("main",{className:"flex min-h-screen flex-col items-center justify-between w-full bg-[radial-gradient(circle_at_1px_1px,_#8e8e8e8e_1px,_transparent_0)] [background-size:20px_20px] bg-repeat",children:[v.jsx(ate,{}),v.jsx(lZ,{}),v.jsx(Mee,{}),e?v.jsx(v.Fragment,{}):v.jsx(Nee,{onSelection:async g=>{r(g)}})]})}const mm=["light","dark"],bb="(prefers-color-scheme: dark)",ute=typeof window>"u",mM=d.createContext(void 0),dte=e=>d.useContext(mM)?Be.createElement(d.Fragment,null,e.children):Be.createElement(hte,e),fte=["light","dark"],hte=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:i=fte,defaultTheme:s=n?"system":"light",attribute:l="data-theme",value:u,children:f,nonce:m})=>{const[p,g]=d.useState(()=>g$(o,s)),[y,x]=d.useState(()=>g$(o)),S=u?Object.values(u):i,E=d.useCallback(R=>{let T=R;if(!T)return;R==="system"&&n&&(T=v$());const N=u?u[T]:T,A=t?mte():null,O=document.documentElement;if(l==="class"?(O.classList.remove(...S),N&&O.classList.add(N)):N?O.setAttribute(l,N):O.removeAttribute(l),r){const U=mm.includes(s)?s:null,z=mm.includes(T)?T:U;O.style.colorScheme=z}A==null||A()},[]),_=d.useCallback(R=>{g(R);try{localStorage.setItem(o,R)}catch{}},[e]),b=d.useCallback(R=>{const T=v$(R);x(T),p==="system"&&n&&!e&&E("system")},[p,e]);d.useEffect(()=>{const R=window.matchMedia(bb);return R.addListener(b),b(R),()=>R.removeListener(b)},[b]),d.useEffect(()=>{const R=T=>{T.key===o&&_(T.newValue||s)};return window.addEventListener("storage",R),()=>window.removeEventListener("storage",R)},[_]),d.useEffect(()=>{E(e??p)},[e,p]);const C=d.useMemo(()=>({theme:p,setTheme:_,forcedTheme:e,resolvedTheme:p==="system"?y:p,themes:n?[...i,"system"]:i,systemTheme:n?y:void 0}),[p,_,e,y,n,i]);return Be.createElement(mM.Provider,{value:C},Be.createElement(pte,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:o,themes:i,defaultTheme:s,attribute:l,value:u,children:f,attrs:S,nonce:m}),f)},pte=d.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:s,attrs:l,nonce:u})=>{const f=i==="system",m=n==="class"?`var d=document.documentElement,c=d.classList;c.remove(${l.map(x=>`'${x}'`).join(",")});`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=o?mm.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",g=(x,S=!1,E=!0)=>{const _=s?s[x]:x,b=S?x+"|| ''":`'${_}'`;let C="";return o&&E&&!S&&mm.includes(x)&&(C+=`d.style.colorScheme = '${x}';`),n==="class"?C+=S||_?`c.add(${b})`:"null":_&&(C+=`d[s](n,${b})`),C},y=e?`!function(){${m}${g(e)}}()`:r?`!function(){try{${m}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${bb}',m=window.matchMedia(t);if(m.media!==t||m.matches){${g("dark")}}else{${g("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${g(s?"x[e]":"e",!0)}}${f?"":"else{"+g(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${m}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${g(s?"x[e]":"e",!0)}}else{${g(i,!1,!1)};}${p}}catch(t){}}();`;return Be.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:y}})},()=>!0),g$=(e,t)=>{if(ute)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},mte=()=>{const e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},v$=e=>(e||(e=window.matchMedia(bb)),e.matches?"dark":"light"),gte=new yL;q0.createRoot(document.getElementById("root")).render(v.jsx(Be.StrictMode,{children:v.jsx(_L,{client:gte,children:v.jsx(dte,{defaultTheme:"dark",disableTransitionOnChange:!0,children:v.jsx(XU,{children:v.jsx(cte,{})})})})}));