!function(){var e=["__cssMap","__cssVars","__breakpoints"],t=["theme","css","__css","sx"],n=["baseStyle"],r=["styleConfig"],o=["as","viewBox","color","focusable","children","className","__css"],i=["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"],a=["transitionEnd","transition"],s=["root"],l=["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"],u=["ease","times","yoyo","flip","loop"],c=["transitionEnd","transition"],d=["transition","transitionEnd"],f=["transition","transitionEnd"],h=["willChange"],p=["transition","transitionEnd"],v=["in","unmountOnExit","animateOpacity","startingHeight","endingHeight","style","className","transition","transitionEnd"],g=["unmountOnExit","in","className","transition","transitionEnd","delay"],m=["unmountOnExit","in","reverse","initialScale","className","transition","transitionEnd","delay"],y=["direction","style","unmountOnExit","in","className","transition","transitionEnd","delay","motionProps"],b=["unmountOnExit","in","reverse","className","offsetX","offsetY","transition","transitionEnd","delay"],w=["onChange","defaultIndex","index","allowMultiple","allowToggle"],k=["isDisabled","isFocusable","id"],x=["htmlProps"],S=["className","motionProps"],C=["children","reduceMotion"],_=["htmlProps","descendants"],E=["label","thickness","speed","emptyColor","className"],P=["status","addRole"],L=["htmlWidth","htmlHeight","alt"],O=["fallbackSrc","fallback","src","srcSet","align","fit","loading","ignoreFallback","crossOrigin","fallbackStrategy","referrerPolicy"],A=["children","className"],M=["label","placement","spacing","children","className","__css"],T=["isDisabled","isLoading","isActive","children","leftIcon","rightIcon","loadingText","iconSpacing","type","spinner","spinnerPlacement","className","as"],I=["size","colorScheme","variant","className","spacing","isAttached","isDisabled"],R=["icon","children","isRound","aria-label"],N=["id","isRequired","isInvalid","isDisabled","isReadOnly"],D=["getRootProps","htmlProps"],z=["isDisabled","isInvalid","isReadOnly","isRequired"],j=["id","disabled","readOnly","required","isRequired","isInvalid","isReadOnly","isDisabled","onFocus","onBlur"],B=["className","children","requiredIndicator","optionalIndicator"],F=["isIndeterminate","isChecked"],H=["defaultChecked","isChecked","isFocusable","onChange","isIndeterminate","name","value","tabIndex","aria-label","aria-labelledby","aria-invalid"],V=["spacing","className","children","iconColor","iconSize","icon","isChecked","isDisabled","onChange","inputProps"],W=["children","isDisabled","__css"],U=["htmlSize"],G=["children","className"],q=["placement"],Y=["placement"],Z=["className"],X=["className"],$=["ratio","children","className"],K=["className"],Q=["size","centerContent"],J=["size"],ee=["axis"],te=["className"],ne=["className","centerContent"],re=["borderLeftWidth","borderBottomWidth","borderTopWidth","borderRightWidth","borderWidth","borderStyle","borderColor"],oe=["className","orientation","__css"],ie=["direction","align","justify","wrap","basis","grow","shrink"],ae=["templateAreas","gap","rowGap","columnGap","column","row","autoFlow","autoRows","templateRows","autoColumns","templateColumns"],se=["area","colSpan","colStart","colEnd","rowEnd","rowSpan","rowStart"],le=["className"],ue=["className"],ce=["className","isExternal"],de=["isExternal","target","rel","className"],fe=["className"],he=["children","styleType","stylePosition","spacing"],pe=["as"],ve=["as"],ge=["columns","spacingX","spacingY","spacing","minChildWidth"],me=["isInline","direction","align","justify","spacing","wrap","children","divider","className","shouldWrapChildren"],ye=["className","align","decoration","casing"],be=["spacing","spacingX","spacingY","children","justify","direction","align","className","shouldWrapChildren"],we=["className"],ke=["ref","isDisabled","isFocusable","clickOnEnter","clickOnSpace","onMouseDown","onMouseUp","onClick","onKeyDown","onKeyUp","tabIndex","onMouseOver","onMouseLeave"],xe=["size","shadowColor","bg","style"],Se=["containerRef"],Ce=["className"],_e=["onClick","className"],Ee=["preset","motionProps"],Pe=["className","children","containerProps","motionProps"],Le=["className"],Oe=["className"],Ae=["className","transition","motionProps"],Me=["leastDestructiveRef"],Te=["className","children","motionProps","containerProps"],Ie=["focusInputOnChange","clampValueOnBlur","keepWithinRange","min","max","step","isReadOnly","isDisabled","isRequired","isInvalid","pattern","inputMode","allowMouseWheel","id","onChange","precision","name","aria-describedby","aria-label","aria-labelledby","onFocus","onBlur","onInvalid","getAriaValueText","isValidCharacter","format","parse"],Re=["htmlProps"],Ne=["closeOnBlur","closeOnEsc","initialFocusRef","id","returnFocusOnClose","autoFocus","arrowSize","arrowShadowColor","trigger","openDelay","closeDelay","isLazy","lazyBehavior","computePositionOnMount"],De=["children"],ze=["variants"],je=["rootProps","motionProps"],Be=["size","isIndeterminate"],Fe=["size","max","min","valueText","getValueText","value","capIsRound","children","thickness","color","trackColor","isIndeterminate"],He=["min","max","value","isIndeterminate","role"],Ve=["value","min","max","hasStripe","isAnimated","children","borderRadius","isIndeterminate","aria-label","aria-labelledby","title","role"],We=["children","placeholder","className"],Ue=["rootProps","placeholder","icon","color","height","h","minH","minHeight","iconColor","iconSize"],Ge=["children"],qe=["min","max","onChange","value","defaultValue","isReversed","direction","orientation","id","isDisabled","isReadOnly","onChangeStart","onChangeEnd","step","getAriaValueText","aria-valuetext","aria-label","aria-labelledby","name","focusThumbOnChange","minStepsBetweenThumbs"],Ye=["index"],Ze=["value"],Xe=["index"],$e=["getRootProps"],Ke=["min","max","onChange","value","defaultValue","isReversed","direction","orientation","id","isDisabled","isReadOnly","onChangeStart","onChangeEnd","step","getAriaValueText","aria-valuetext","aria-label","aria-labelledby","name","focusThumbOnChange"],Qe=["getInputProps","getRootProps"],Je=["spacing","children"],et=["defaultIndex","onChange","index","isManual","isLazy","lazyBehavior","orientation","direction"],tt=["isDisabled","isFocusable"],nt=["children"],rt=["children","className"],ot=["htmlProps","descendants"],it=["isFitted"],at=["className","rows"],st=["openDelay","closeDelay","closeOnClick","closeOnMouseDown","closeOnScroll","closeOnPointerDown","closeOnEsc","onOpen","onClose","placement","id","isOpen","defaultIsOpen","arrowSize","arrowShadowColor","arrowPadding","modifiers","isDisabled","gutter","offset","direction"],lt=["children","label","shouldWrapChildren","aria-label","hasArrow","bg","portalProps","background","backgroundColor","bgColor","motionProps"],ut=["children","theme","toastOptions"],ct=["boundingBox","generationMode"],dt=["tooltip","styleClass","tooltipProps","asCheckbox","isChecked"],ft=["children","tooltip","tooltipProps","styleClass"],ht=["triggerComponent","children","styleClass","hasArrow"],pt=["label","labelFontSize","styleClass","isDisabled","showStepper","width","textAlign","isInvalid","value","onChange","min","max","isInteger","formControlProps","formLabelProps","numberInputFieldProps","numberInputStepperProps","tooltipProps"],vt=["label","isDisabled","validValues","tooltip","tooltipProps","size","fontSize","styleClass"],gt=["label","styleClass"],mt=["label","value","min","max","step","onChange","width","tooltipSuffix","withSliderMarks","sliderMarkLeftOffset","sliderMarkRightOffset","withInput","isInteger","inputWidth","inputReadOnly","withReset","hideTooltip","isCompact","handleReset","isResetDisabled","isSliderDisabled","isInputDisabled","styleClass","sliderFormControlProps","sliderFormLabelProps","sliderMarkProps","sliderTrackProps","sliderThumbProps","sliderNumberInputProps","sliderNumberInputFieldProps","sliderNumberInputStepperProps","sliderTooltipProps","sliderIAIIconButtonProps"],yt=["scope","children"],bt=["children"],wt=["children"],kt=["asChild"],xt=["scope","children"],St=["disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss"],Ct=["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"],_t=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"],Et=["strategy"],Pt=["mainAxis","crossAxis","limiter"],Lt=["__scopePopper","virtualRef"],Ot=["__scopePopper","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions"],At=["__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopId","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus"],Mt=["__scopeRovingFocusGroup","focusable","active"],Tt=["__scopeMenu"],It=["forceMount"],Rt=["__scopeMenu","loop","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","disableOutsideScroll"],Nt=["disabled","onSelect"],Dt=["__scopeMenu","disabled","textValue"],zt=["__scopeContextMenu"],jt=["__scopeContextMenu"],Bt=["__scopeContextMenu"],Ft=["label","isDisabled","width","formControlProps","formLabelProps","styleClass"],Ht=["label","styleClass","isDisabled","fontSize","width","size","isInvalid"],Vt=["iconButton"],Wt=["styleClass"];function Ut(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ut=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var i=t&&t.prototype instanceof f?t:f,a=Object.create(i.prototype),s=new _(o||[]);return r(a,"_invoke",{value:k(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(L){return{type:"throw",arg:L}}}e.wrap=u;var d={};function f(){}function h(){}function p(){}var v={};l(v,i,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(E([])));m&&m!==t&&n.call(m,i)&&(v=m);var y=p.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(r,i,a,s){var l=c(e[r],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==kn(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,s)}))}s(l.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function k(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return P()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=c(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,d;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function E(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function Gt(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(u){return void n(u)}s.done?t(l):Promise.resolve(l).then(r,o)}function qt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Gt(i,r,o,a,s,"next",e)}function s(e){Gt(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Yt(){return Yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=Zt(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Yt.apply(this,arguments)}function Zt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=nn(e)););return e}function Xt(e){var t="function"==typeof Map?new Map:void 0;return Xt=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return $t(e,arguments,nn(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),vn(r,e)},Xt(e)}function $t(e,t,n){return $t=tn()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&vn(o,n.prototype),o},$t.apply(null,arguments)}function Kt(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function Qt(e){var t=tn();return function(){var n,r=nn(e);if(t){var o=nn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Jt(this,n)}}function Jt(e,t){if(t&&("object"===kn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return en(e)}function en(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tn(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function nn(e){return nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nn(e)}function rn(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function un(e){for(var t=1;t]+)>/g,(function(e,t){var n=i[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var a=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=kn(e[e.length-1])&&(e=[].slice.call(e)).push(r(e,a)),o.apply(this,e)}))}return e[Symbol.replace].call(this,n,o)},hn.apply(this,arguments)}function pn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vn(e,t)}function vn(e,t){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vn(e,t)}function gn(e,t,n){return(t=mn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mn(e){var t=function(e,t){if("object"!==kn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==kn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===kn(t)?t:String(t)}function yn(e,t){return wn(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,o=c}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||Sn(e,t)||bn()}function bn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function wn(e){if(Array.isArray(e))return e}function kn(e){return kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kn(e)}function xn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Sn(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Sn(e,t){if(e){if("string"==typeof e)return Cn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cn(e,t):void 0}}function Cn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n:nth-child(1).chakra-text{grid-area:status;width:100%;display:flex;justify-content:center}#root .app-content .site-header .site-header-right-side>:nth-child(2){grid-area:sampler;display:flex;justify-content:center;align-items:center}#root .app-content .site-header .site-header-right-side>:nth-child(2) select{width:185px;margin-top:10px}#root .app-content .site-header .site-header-right-side>:nth-child(2) .chakra-select__icon-wrapper{right:10px}#root .app-content .site-header .site-header-right-side>:nth-child(2) .chakra-select__icon-wrapper svg{margin-top:10px}#root .app-content .site-header .site-header-right-side>:nth-child(3){grid-area:btn1}#root .app-content .site-header .site-header-right-side>:nth-child(4){grid-area:btn2}#root .app-content .site-header .site-header-right-side>:nth-child(6){grid-area:btn3}#root .app-content .site-header .site-header-right-side>:nth-child(7){grid-area:btn4}#root .app-content .site-header .site-header-right-side>:nth-child(8){grid-area:btn5}#root .app-content .site-header .site-header-right-side>:nth-child(9){grid-area:btn6}#root .app-content .app-tabs{position:fixed;display:flex;flex-direction:column;row-gap:15px;max-width:100%;overflow:hidden;margin-top:120px}#root .app-content .app-tabs .app-tabs-list{display:flex;justify-content:space-between}#root .app-content .app-tabs .app-tabs-panels{overflow:hidden;overflow-y:scroll}#root .app-content .app-tabs .app-tabs-panels .workarea-main{display:grid;grid-template-areas:"workarea" "options" "gallery";row-gap:15px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .parameters-panel-wrapper{grid-area:options;width:100%;max-width:100%;height:inherit;overflow:inherit;padding:0 10px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .parameters-panel-wrapper .main-settings-row,#root .app-content .app-tabs .app-tabs-panels .workarea-main .parameters-panel-wrapper .advanced-parameters-item{max-width:100%}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper{grid-area:workarea}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .workarea-split-view{display:flex;flex-direction:column}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .current-image-options{column-gap:3px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .text-to-image-area{padding:0}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .current-image-preview{height:430px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .image-upload-button{row-gap:10px;padding:5px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .image-upload-button svg{width:2rem;height:2rem;margin-top:10px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .inpainting-settings{display:flex;flex-wrap:wrap;row-gap:10px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .inpainting-canvas-area .konvajs-content{height:400px!important}#root .app-content .app-tabs .app-tabs-panels .workarea-main .image-gallery-wrapper{grid-area:gallery;min-height:400px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .image-gallery-wrapper .image-gallery-popup{width:100%!important;max-width:100%!important}}svg{fill:var(--svg-color)}.App{display:grid;width:100vw;height:100vh;background-color:var(--background-color)}.app-content{display:grid;row-gap:1rem;padding:1rem;grid-auto-rows:min-content auto;width:calc(100vw + -0px);height:calc(100vh - .3rem)}.site-header{display:grid;grid-template-columns:auto max-content}.site-header-left-side{display:flex;align-items:center;column-gap:.7rem;padding-left:.5rem}.site-header-left-side img{width:32px;height:32px}.site-header-right-side{display:flex;align-items:center;column-gap:.5rem}.site-header-right-side .lang-select-btn[data-selected=true],.site-header-right-side .lang-select-btn[data-selected=true]:hover{background-color:var(--accent-color)}.status{font-size:.8rem;font-weight:700}.status-good{color:var(--status-good-color);text-shadow:0 0 10px var(--status-good-glow)}.status-bad{color:var(--status-bad-color);text-shadow:0 0 10px var(--status-bad-glow)}.status-working{color:var(--status-working-color);text-shadow:0 0 10px var(--status-working-glow)}.settings-modal{max-height:36rem;font-family:Inter}.settings-modal .settings-modal-content{display:grid;row-gap:2rem;overflow-y:scroll}.settings-modal .settings-modal-header{font-weight:700}.settings-modal .settings-modal-items{display:grid;row-gap:.5rem}.settings-modal .settings-modal-items .settings-modal-item{display:grid;grid-auto-flow:column;background-color:var(--background-color);padding:.4rem 1rem;border-radius:.5rem;align-items:center;width:100%}.settings-modal .settings-modal-reset{display:grid;row-gap:1rem}.settings-modal .settings-modal-reset button{min-width:100%;min-height:100%;background-color:var(--destructive-color)!important}.settings-modal .settings-modal-reset button:hover{background-color:var(--destructive-color-hover)}.settings-modal .settings-modal-reset button:disabled{background-color:var(--btn-base-color)}.settings-modal .settings-modal-reset button:disabled:hover{background-color:var(--btn-base-color)}.settings-modal .settings-modal-reset button svg{width:20px;height:20px;color:var(--btn-svg-color)}.add-model-modal{display:flex}.add-model-modal-body{display:flex;flex-direction:column;row-gap:1rem;padding-bottom:2rem}.add-model-form{display:flex;flex-direction:column;row-gap:.5rem}.hotkeys-modal{width:36rem;max-width:36rem;display:grid;padding:1rem;row-gap:1rem;font-family:Inter}.hotkeys-modal h1{font-size:1.2rem;font-weight:700}.hotkeys-modal h2{font-weight:700}.hotkeys-modal-button{display:flex;align-items:center;justify-content:space-between}.hotkeys-modal-items{max-height:36rem;overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.hotkeys-modal-items::-webkit-scrollbar{display:none}.hotkeys-modal-items .chakra-accordion{display:grid;row-gap:.5rem}.hotkeys-modal-items .chakra-accordion__item{border:none;border-radius:.3rem;background-color:var(--tab-hover-color)}.hotkeys-modal-items button{border-radius:.3rem}.hotkeys-modal-items button[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:.3rem}.hotkey-modal-category{display:grid;row-gap:.5rem}.hotkey-modal-item{display:grid;grid-template-columns:auto max-content;justify-content:space-between;align-items:center;background-color:var(--background-color);padding:.5rem 1rem;border-radius:.3rem}.hotkey-modal-item .hotkey-info{display:grid}.hotkey-modal-item .hotkey-info .hotkey-title{font-weight:700}.hotkey-modal-item .hotkey-info .hotkey-description{font-size:.9rem;color:var(--text-color-secondary)}.hotkey-modal-item .hotkey-key{font-size:.8rem;font-weight:700;background-color:var(--background-color-light);padding:.2rem .5rem;border-radius:.3rem}.console{width:100vw;display:flex;flex-direction:column;background:var(--console-bg-color);overflow:auto;direction:column;font-family:monospace;padding:0 1rem 1rem 3rem;border-top-width:.3rem;border-color:var(--resizeable-handle-border-color)}.console .console-info-color{color:var(--error-level-info)}.console .console-warning-color{color:var(--error-level-warning)}.console .console-error-color{color:var(--status-bad-color)}.console .console-entry{display:flex;column-gap:.5rem}.console .console-entry .console-timestamp{font-weight:semibold}.console .console-entry .console-message{word-break:break-all}.console-toggle-icon-button{background:var(--console-icon-button-bg-color);position:fixed;left:.5rem;bottom:.5rem;z-index:10000}.console-toggle-icon-button:hover{background:var(--console-icon-button-bg-color-hover)}.console-toggle-icon-button[data-error-seen=true],.console-toggle-icon-button[data-error-seen=true]:hover{background:var(--status-bad-color)}.console-autoscroll-icon-button{background:var(--console-icon-button-bg-color);position:fixed;left:.5rem;bottom:3rem;z-index:10000}.console-autoscroll-icon-button:hover{background:var(--console-icon-button-bg-color-hover)}.console-autoscroll-icon-button[data-autoscroll-enabled=true]{background:var(--accent-color)}.console-autoscroll-icon-button[data-autoscroll-enabled=true]:hover{background:var(--accent-color-hover)}.progress-bar{background-color:var(--root-bg-color);height:.3rem;z-index:99}.progress-bar div{background-color:var(--progress-bar-color)}.progress-bar div[data-indeterminate]{background-color:unset;background-image:linear-gradient(to right,transparent 0%,var(--progress-bar-color) 50%,transparent 100%)}.prompt-bar{display:grid;row-gap:1rem}.prompt-bar input,.prompt-bar textarea{background-color:var(--prompt-bg-color);font-size:1rem;border:2px solid var(--border-color)}.prompt-bar input:hover,.prompt-bar textarea:hover{border:2px solid var(--border-color-light)}.prompt-bar input:focus-visible,.prompt-bar textarea:focus-visible{border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.prompt-bar input[aria-invalid=true],.prompt-bar textarea[aria-invalid=true]{border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.prompt-bar input:disabled,.prompt-bar textarea:disabled{border:2px solid var(--border-color);box-shadow:none}.prompt-bar textarea{min-height:10rem}.process-buttons{display:flex;column-gap:.5rem}.invoke-btn{flex-grow:1;width:100%;min-width:100%;min-height:100%;background-color:var(--accent-color)!important}.invoke-btn:hover{background-color:var(--accent-color-hover)}.invoke-btn:disabled{background-color:var(--btn-base-color)}.invoke-btn:disabled:hover{background-color:var(--btn-base-color)}.invoke-btn svg{width:16px;height:16px;color:var(--btn-svg-color)}.cancel-btn{min-width:3rem;min-height:100%;background-color:var(--destructive-color)!important}.cancel-btn:hover{background-color:var(--destructive-color-hover)}.cancel-btn:disabled{background-color:var(--btn-base-color)}.cancel-btn:disabled:hover{background-color:var(--btn-base-color)}.cancel-btn svg{width:20px;height:20px;color:var(--btn-svg-color)}.loopback-btn[data-as-checkbox=true]{background-color:var(--btn-btn-base-color);border:3px solid var(--btn-btn-base-color)}.loopback-btn[data-as-checkbox=true] svg{fill:var(--text-color)}.loopback-btn[data-as-checkbox=true]:hover{background-color:var(--btn-btn-base-color);border-color:var(--btn-checkbox-border-hover)}.loopback-btn[data-as-checkbox=true]:hover svg{fill:var(--text-color)}.loopback-btn[data-as-checkbox=true][data-selected=true]{border-color:var(--accent-color);background-color:var(--btn-btn-base-color)}.loopback-btn[data-as-checkbox=true][data-selected=true] svg{fill:var(--text-color)}.loopback-btn[data-as-checkbox=true][data-selected=true]:hover{border-color:var(--accent-color);background-color:var(--btn-btn-base-color)}.loopback-btn[data-as-checkbox=true][data-selected=true]:hover svg{fill:var(--text-color)}.main-settings,.main-settings-list{display:grid;row-gap:1rem}.main-settings-row{display:grid;grid-template-columns:repeat(3,auto);column-gap:.5rem;max-width:22.5rem}.main-settings-block{border-radius:.5rem;display:grid!important;grid-template-columns:auto!important;row-gap:.5rem}.main-settings-block .invokeai__number-input-form-label,.main-settings-block .invokeai__select-label{font-weight:700;font-size:.9rem!important}.main-settings-block .invokeai__select-label{margin:0}.advanced-parameters{padding-top:.5rem;display:grid;row-gap:.5rem}.advanced-parameters-item{display:grid;max-width:22.5rem;border:none;border-top:0px;border-radius:.4rem;background-color:var(--tab-panel-bg)}.advanced-parameters-item[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:0 0 .4rem .4rem}.advanced-parameters-panel{background-color:var(--tab-panel-bg);border-radius:0 0 .4rem .4rem;padding:1rem}.advanced-parameters-panel button{background-color:var(--btn-base-color)}.advanced-parameters-panel button:hover{background-color:var(--btn-base-color-hover)}.advanced-parameters-panel button:disabled:hover{background-color:var(--btn-base-color)}.advanced-parameters-header{border-radius:.4rem;font-weight:700}.advanced-parameters-header[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:.4rem .4rem 0 0}.advanced-parameters-header:hover{background-color:var(--tab-hover-color)}.upscale-settings{display:grid;grid-template-columns:auto 1fr;column-gap:1rem}.inpainting-bounding-box-settings{display:flex;flex-direction:column;border-radius:.4rem;border:2px solid var(--tab-color)}.inpainting-bounding-box-header{background-color:var(--tab-color);display:flex;flex-direction:row;justify-content:space-between;padding:.5rem 1rem;border-radius:.3rem .3rem 0 0;align-items:center}.inpainting-bounding-box-header button{width:.5rem;height:1.2rem;background:none}.inpainting-bounding-box-header button:hover{background:none}.inpainting-bounding-box-settings-items{padding:1rem;display:flex;flex-direction:column;row-gap:1rem}.inpainting-bounding-box-settings-items .inpainting-bounding-box-reset-icon-btn{background-color:var(--btn-base-color)}.inpainting-bounding-box-settings-items .inpainting-bounding-box-reset-icon-btn:hover{background-color:var(--btn-base-color-hover)}.inpainting-bounding-box-dimensions-slider-numberinput{display:grid;grid-template-columns:repeat(3,auto);column-gap:1rem}.inpainting-bounding-box-darken{width:max-content}.current-image-area{display:flex;flex-direction:column;height:100%;row-gap:1rem;background-color:var(--background-color-secondary);border-radius:.5rem}.current-image-preview{position:relative;justify-content:center;align-items:center;display:flex;width:100%;height:100%}.current-image-preview img{border-radius:.5rem;object-fit:contain;max-width:100%;max-height:100%;height:auto;position:absolute}.current-image-metadata{grid-area:current-image-preview}.current-image-next-prev-buttons{grid-area:current-image-content;display:flex;justify-content:space-between;z-index:1;height:100%;width:100%;pointer-events:none}.next-prev-button-trigger-area{width:7rem;height:100%;width:15%;display:grid;align-items:center;pointer-events:auto}.next-prev-button-trigger-area.prev-button-trigger-area{justify-content:flex-start}.next-prev-button-trigger-area.next-button-trigger-area{justify-content:flex-end}.next-prev-button{font-size:4rem;fill:var(--white);filter:drop-shadow(0 0 1rem var(--text-color-secondary));opacity:70%}.current-image-display-placeholder{background-color:var(--background-color-secondary);display:grid;display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:.5rem}.current-image-display-placeholder svg{width:10rem;height:10rem;color:var(--svg-color)}.current-image-options{width:100%;display:flex;justify-content:center;align-items:center;column-gap:.5em}.current-image-options .current-image-send-to-popover,.current-image-options .current-image-postprocessing-popover{display:flex;flex-direction:column;row-gap:.5rem;max-width:25rem}.current-image-options .current-image-send-to-popover .invokeai__button{place-content:start}.current-image-options .chakra-popover__popper{z-index:11}.current-image-options .delete-image-btn{background-color:var(--btn-base-color)}.current-image-options .delete-image-btn svg{fill:var(--btn-delete-image)}.image-gallery-wrapper-enter{transform:translate(150%)}.image-gallery-wrapper-enter-active{transform:translate(0);transition:all .12s ease-out}.image-gallery-wrapper-exit{transform:translate(0)}.image-gallery-wrapper-exit-active{transform:translate(150%);transition:all .12s ease-out}.image-gallery-wrapper[data-pinned=false]{position:fixed;height:100vh;top:0;right:0}.image-gallery-wrapper[data-pinned=false] .image-gallery-popup{border-radius:0;box-shadow:0 0 1rem var(--text-color-a3)}.image-gallery-wrapper[data-pinned=false] .image-gallery-popup .image-gallery-container{max-height:calc(100vh + 4.7rem)}.image-gallery-wrapper .image-gallery-popup{background-color:var(--background-color-secondary);padding:1rem;display:flex;flex-direction:column;row-gap:1rem;border-radius:.5rem;border-left-width:.3rem;border-color:var(--tab-list-text-inactive)}.image-gallery-wrapper .image-gallery-popup[data-resize-alert=true]{border-color:var(--status-bad-color)}.image-gallery-wrapper .image-gallery-popup .image-gallery-header{display:flex;align-items:center;column-gap:.5rem;justify-content:space-between}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-header-right-icons{display:flex;flex-direction:row;column-gap:.5rem}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-icon-btn{background-color:var(--btn-load-more)}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-icon-btn:hover{background-color:var(--btn-load-more-hover)}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-settings-popover{display:flex;flex-direction:column;row-gap:.5rem}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-settings-popover div{display:flex;column-gap:.5rem;align-items:center;justify-content:space-between}.image-gallery-wrapper .image-gallery-popup .image-gallery-header h1{font-weight:700}.image-gallery-wrapper .image-gallery-popup .image-gallery-container{display:flex;flex-direction:column;max-height:calc(100vh - (70px + 7rem));overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.image-gallery-wrapper .image-gallery-popup .image-gallery-container::-webkit-scrollbar{display:none}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-container-placeholder{display:flex;flex-direction:column;row-gap:.5rem;background-color:var(--background-color);border-radius:.5rem;place-items:center;padding:2rem;text-align:center}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-container-placeholder p{color:var(--subtext-color-bright);font-family:Inter}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-container-placeholder svg{width:4rem;height:4rem;color:var(--svg-color)}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-load-more-btn{background-color:var(--btn-load-more);font-size:.85rem;padding:.5rem;margin-top:1rem}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-load-more-btn:disabled:hover{background-color:var(--btn-load-more)}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-load-more-btn:hover{background-color:var(--btn-load-more-hover)}.image-gallery-category-btn-group{width:max-content;column-gap:0;justify-content:stretch}.image-gallery-category-btn-group button{background-color:var(--btn-base-color);flex-grow:1}.image-gallery-category-btn-group button:hover{background-color:var(--btn-base-color-hover)}.image-gallery-category-btn-group button[data-selected=true]{background-color:var(--accent-color)}.image-gallery-category-btn-group button[data-selected=true]:hover{background-color:var(--accent-color-hover)}.image-gallery{display:grid;grid-gap:.5rem}.image-gallery .hoverable-image{padding:.5rem;position:relative}.image-gallery .hoverable-image:before{content:"";display:block;padding-bottom:100%}.image-gallery .hoverable-image .hoverable-image-image{position:absolute;max-width:100%;top:50%;left:50%;transform:translate(-50%,-50%)}.hoverable-image{display:flex;justify-content:center;transition:transform .2s ease-out}.hoverable-image:hover{cursor:pointer;border-radius:.5rem;z-index:2}.hoverable-image .hoverable-image-image{width:100%;height:100%;max-width:100%;max-height:100%}.hoverable-image .hoverable-image-delete-button{position:absolute;top:.25rem;right:.25rem}.hoverable-image .hoverable-image-content{display:flex;position:absolute;top:0;left:0;width:100%;height:100%;align-items:center;justify-content:center}.hoverable-image .hoverable-image-content .hoverable-image-check{fill:var(--status-good-color)}.hoverable-image .hoverable-image-icons{position:absolute;bottom:-2rem;display:grid;width:min-content;grid-template-columns:repeat(2,max-content);border-radius:.4rem;background-color:var(--background-color-secondary);padding:.2rem;gap:.2rem;grid-auto-rows:max-content}.hoverable-image .hoverable-image-icons button{width:12px;height:12px;border-radius:.2rem;padding:10px 0;flex-shrink:2}.hoverable-image .hoverable-image-icons button svg{width:12px;height:12px}.hoverable-image-context-menu{z-index:15;padding:.4rem;border-radius:.25rem;background-color:var(--context-menu-bg-color);box-shadow:var(--context-menu-box-shadow)}.hoverable-image-context-menu [role=menuitem]{font-size:.8rem;line-height:1rem;border-radius:3px;display:flex;align-items:center;height:1.75rem;padding:0 .5rem;position:relative;user-select:none;cursor:pointer;outline:none}.hoverable-image-context-menu [role=menuitem][data-disabled]{color:gray;pointer-events:none;cursor:not-allowed}.hoverable-image-context-menu [role=menuitem][data-warning]{color:var(--status-bad-color)}.hoverable-image-context-menu [role=menuitem][data-highlighted]{background-color:var(--context-menu-bg-color-hover)}.image-metadata-viewer{position:absolute;top:0;width:100%;border-radius:.5rem;padding:1rem;background-color:var(--metadata-bg-color);overflow:scroll;max-height:calc(100vh - (70px + 5.4rem));height:100%;z-index:10}.image-json-viewer{border-radius:.5rem;margin:0 .5rem 1rem;padding:1rem;overflow-x:scroll;word-break:break-all;background-color:var(--metadata-json-bg-color)}.lightbox-container{width:100%;height:100%;color:var(--text-color);overflow:hidden;position:absolute;left:0;top:0;background-color:var(--background-color-secondary);z-index:30;animation:popIn .3s ease-in}.lightbox-container .image-gallery-wrapper{max-height:100%!important}.lightbox-container .image-gallery-wrapper .image-gallery-container{max-height:calc(100vh - 5rem)}.lightbox-container .current-image-options{z-index:2;position:absolute;top:1rem}.lightbox-container .image-metadata-viewer{left:0;max-height:100%}.lightbox-close-btn{z-index:3;position:absolute;left:1rem;top:1rem;background-color:var(--btn-base-color)}.lightbox-close-btn:hover{background-color:var(--btn-base-color-hover)}.lightbox-close-btn:disabled:hover{background-color:var(--btn-base-color)}.lightbox-display-container{display:flex;flex-direction:row}.lightbox-preview-wrapper{overflow:hidden;background-color:var(--background-color-secondary);display:grid;grid-template-columns:auto max-content;place-items:center;width:100vw;height:100vh}.lightbox-preview-wrapper .current-image-next-prev-buttons{position:absolute}.lightbox-preview-wrapper .lightbox-image{grid-area:lightbox-content;border-radius:.5rem}.lightbox-preview-wrapper .lightbox-image-options{position:absolute;z-index:2;left:1rem;top:4.5rem;user-select:none;border-radius:.5rem;display:flex;flex-direction:column;row-gap:.5rem}@keyframes popIn{0%{opacity:0;filter:blur(100)}to{opacity:1;filter:blur(0)}}.app-tabs{display:grid;grid-template-columns:min-content auto;column-gap:1rem;height:calc(100vh - (70px + 1rem))}.app-tabs-list{display:grid;row-gap:.3rem;grid-auto-rows:min-content;color:var(--tab-list-text-inactive)}.app-tabs-list button{font-size:.85rem;padding:.5rem}.app-tabs-list button:hover{background-color:var(--tab-hover-color);border-radius:.3rem}.app-tabs-list button svg{width:24px;height:24px}.app-tabs-list button[aria-selected=true]{background-color:var(--tab-list-bg);color:var(--tab-list-text);font-weight:700;border-radius:.3rem;border:none}.app-tabs-panels .app-tabs-panel{padding:0;height:100%}.workarea-wrapper{position:relative;width:100%;height:100%}.workarea-wrapper .workarea-main{display:flex;column-gap:1rem;height:100%}.workarea-wrapper .workarea-main .workarea-children-wrapper{position:relative;width:100%;height:100%}.workarea-wrapper .workarea-main .workarea-split-view{width:100%;height:100%;display:grid;grid-template-columns:1fr 1fr;background-color:var(--background-color-secondary);border-radius:.5rem}.workarea-wrapper .workarea-main .workarea-split-view .workarea-split-view-left{padding-right:.5rem}.workarea-wrapper .workarea-main .workarea-split-view .workarea-split-view-right{padding-left:.5rem}.workarea-wrapper .workarea-main .workarea-single-view{width:100%;height:100%;background-color:var(--background-color-secondary);border-radius:.5rem}.workarea-wrapper .workarea-main .workarea-split-view-left,.workarea-wrapper .workarea-main .workarea-split-view-right{display:flex;flex-direction:column;height:100%;width:100%;row-gap:1rem;background-color:var(--background-color-secondary);border-radius:.5rem;padding:1rem}.workarea-split-button{position:absolute;cursor:pointer;padding:.5rem;top:0;right:0}.workarea-split-button[data-selected=true]{top:0;right:0}.workarea-split-button[data-selected=true] svg{opacity:1}.workarea-split-button svg{opacity:.5}.parameters-panel-wrapper-enter{transform:translate(-150%)}.parameters-panel-wrapper-enter-active{transform:translate(0);transition:all .12s ease-out}.parameters-panel-wrapper-exit{transform:translate(0)}.parameters-panel-wrapper-exit-active{transform:translate(-150%);transition:all .12s ease-out}.parameters-panel-wrapper{background-color:var(--background-color);height:calc(100vh - (70px + 1rem));width:22.5rem;max-width:22.5rem;flex-shrink:0;position:relative;overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.parameters-panel-wrapper::-webkit-scrollbar{display:none}.parameters-panel-wrapper .parameters-panel{display:flex;flex-direction:column;row-gap:1rem;height:100%;-ms-overflow-style:none;scrollbar-width:none;background-color:var(--background-color)}.parameters-panel-wrapper .parameters-panel::-webkit-scrollbar{display:none}.parameters-panel-wrapper[data-pinned=false]{z-index:20;position:fixed;top:0;left:0;filter:var(--floating-panel-drop-shadow);width:24.5rem;max-width:24.5rem;height:100%}.parameters-panel-wrapper[data-pinned=false] .parameters-panel-margin{margin:1rem}.parameters-panel-wrapper .parameters-panel-pin-button{position:absolute;cursor:pointer;padding:.5rem;top:1rem;right:1rem;z-index:20}.parameters-panel-wrapper .parameters-panel-pin-button[data-selected=true]{top:0;right:0}.parameters-panel-wrapper .parameters-panel-pin-button svg{opacity:.5}.invoke-ai-logo-wrapper{display:flex;align-items:center;column-gap:.7rem;padding-left:.5rem;padding-top:.3rem}.invoke-ai-logo-wrapper img{width:32px;height:32px}.invoke-ai-logo-wrapper h1{font-size:1.4rem}.text-to-image-area{padding:1rem;height:100%}.image-to-image-area{display:flex;flex-direction:column;row-gap:1rem;width:100%;height:100%}.image-to-image-strength-main-option{display:flex;row-gap:.5rem!important}.image-to-image-strength-main-option .invokeai__slider-component-label{color:var(--text-color-secondary);font-size:.9rem!important}.init-image-preview-header{display:flex;align-items:center;justify-content:space-between;width:100%}.init-image-preview-header h2{font-weight:700;font-size:.9rem}.init-image-preview{position:relative;height:100%;width:100%;display:flex;align-items:center;justify-content:center}.init-image-preview img{border-radius:.5rem;object-fit:contain;position:absolute}.image-to-image-current-image-display{position:relative}.floating-show-hide-button{position:absolute;top:50%;transform:translateY(-50%);z-index:20;padding:0;background-color:red!important;min-width:2rem;min-height:12rem;background-color:var(--btn-btn-base-color)!important}.floating-show-hide-button.left{left:0;border-radius:0 .5rem .5rem 0}.floating-show-hide-button.right{right:0;border-radius:.5rem 0 0 .5rem}.floating-show-hide-button:hover{background-color:var(--btn-btn-base-color-hover)}.floating-show-hide-button:disabled{background-color:var(--btn-base-color)}.floating-show-hide-button:disabled:hover{background-color:var(--btn-base-color)}.floating-show-hide-button svg{width:20px;height:20px;color:var(--btn-svg-color)}.show-hide-button-options{position:absolute;transform:translateY(-50%);z-index:20;min-width:2rem;top:50%;left:calc(42px + 2rem);border-radius:0 .5rem .5rem 0;display:flex;flex-direction:column;row-gap:.5rem}.show-hide-button-options button{border-radius:0 .3rem .3rem 0}.show-hide-button-gallery{padding-left:.75rem;padding-right:.75rem;background-color:var(--background-color)!important}.inpainting-main-area{display:flex;flex-direction:column;align-items:center;row-gap:1rem;width:100%;height:100%}.inpainting-main-area .inpainting-settings{display:flex;align-items:center;column-gap:.5rem}.inpainting-main-area .inpainting-settings svg{transform:scale(.9)}.inpainting-main-area .inpainting-settings .inpainting-buttons-group{display:flex;align-items:center;column-gap:.5rem}.inpainting-main-area .inpainting-settings .inpainting-button-dropdown{display:flex;flex-direction:column;row-gap:.5rem}.inpainting-main-area .inpainting-settings .inpainting-color-picker{margin-left:1rem}.inpainting-main-area .inpainting-settings .inpainting-brush-options{display:flex;align-items:center;column-gap:1rem}.inpainting-canvas-area{display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:1rem;width:100%;height:100%}.inpainting-canvas-spiner{display:flex;align-items:center;width:100%;height:100%}.inpainting-canvas-container{display:flex;position:relative;height:100%;width:100%;border-radius:.5rem}.inpainting-canvas-wrapper{position:relative}.inpainting-canvas-stage{outline:none;border-radius:.5rem;box-shadow:0 0 0 1px var(--border-color-light);overflow:hidden}.inpainting-canvas-stage canvas{outline:none;border-radius:.5rem}.inpainting-options-btn{min-height:2rem}.canvas-status-text{position:absolute;top:0;left:0;background-color:var(--background-color);opacity:.65;display:flex;flex-direction:column;font-size:.8rem;padding:.25rem;min-width:12rem;border-radius:.25rem;margin:.25rem;pointer-events:none}.invokeai__number-input-form-control{display:flex;align-items:center;column-gap:1rem}.invokeai__number-input-form-control .invokeai__number-input-form-label{color:var(--text-color-secondary)}.invokeai__number-input-form-control .invokeai__number-input-form-label[data-focus]+.invokeai__number-input-root{outline:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.invokeai__number-input-form-control .invokeai__number-input-form-label[aria-invalid=true]+.invokeai__number-input-root{outline:none;border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.invokeai__number-input-form-control .invokeai__number-input-root{height:2rem;display:grid;grid-template-columns:auto max-content;column-gap:.5rem;align-items:center;background-color:var(--background-color-secondary);border:2px solid var(--border-color);border-radius:.3rem}.invokeai__number-input-form-control .invokeai__number-input-field{border:none;font-weight:700;width:100%;height:auto;font-size:.9rem;padding:0 .5rem}.invokeai__number-input-form-control .invokeai__number-input-field:focus{outline:none;box-shadow:none}.invokeai__number-input-form-control .invokeai__number-input-field:disabled{opacity:.2}.invokeai__number-input-form-control .invokeai__number-input-stepper{display:grid;padding-right:.5rem}.invokeai__number-input-form-control .invokeai__number-input-stepper .invokeai__number-input-stepper-button{border:none;padding:0 .5rem;margin:0 -.5rem}.invokeai__number-input-form-control .invokeai__number-input-stepper .invokeai__number-input-stepper-button svg{width:10px;height:10px}.input{display:grid;grid-template-columns:max-content auto;column-gap:1rem;align-items:center}.input .input-label{color:var(--text-color-secondary)}.input .input-entry{background-color:var(--background-color-secondary);border:2px solid var(--border-color);border-radius:.2rem;font-weight:700}.input .input-entry:focus{outline:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.input .input-entry:disabled{opacity:.2}.input .input-entry[aria-invalid=true]{outline:none;border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.invokeai__icon-button{background:var(--btn-base-color);cursor:pointer}.invokeai__icon-button:hover{background-color:var(--btn-base-color-hover)}.invokeai__icon-button[data-selected=true]{background-color:var(--accent-color)}.invokeai__icon-button[data-selected=true]:hover{background-color:var(--accent-color-hover)}.invokeai__icon-button[disabled]{cursor:not-allowed}.invokeai__icon-button[data-variant=link],.invokeai__icon-button[data-variant=link]:hover{background:none}.invokeai__icon-button[data-as-checkbox=true]{background-color:var(--btn-base-color);border:3px solid var(--btn-base-color)}.invokeai__icon-button[data-as-checkbox=true] svg{fill:var(--text-color)}.invokeai__icon-button[data-as-checkbox=true]:hover{background-color:var(--btn-base-color);border-color:var(--btn-checkbox-border-hover)}.invokeai__icon-button[data-as-checkbox=true]:hover svg{fill:var(--text-color)}.invokeai__icon-button[data-as-checkbox=true][data-selected=true]{border-color:var(--accent-color)}.invokeai__icon-button[data-as-checkbox=true][data-selected=true] svg{fill:var(--accent-color-hover)}.invokeai__icon-button[data-as-checkbox=true][data-selected=true]:hover svg{fill:var(--accent-color-hover)}.invokeai__icon-button[data-alert=true]{animation-name:pulseColor;animation-duration:1s;animation-timing-function:ease-in-out;animation-iteration-count:infinite}.invokeai__icon-button[data-alert=true]:hover{animation:none;background-color:var(--accent-color-hover)}@keyframes pulseColor{0%{background-color:var(--accent-color)}50%{background-color:var(--accent-color-dim)}to{background-color:var(--accent-color)}}.invokeai__button{background-color:var(--btn-base-color);place-content:center}.invokeai__button:hover{background-color:var(--btn-base-color-hover)}.invokeai__switch-form-control .invokeai__switch-form-label{color:var(--text-color-secondary)}.invokeai__switch-form-control .invokeai__switch-root span{background-color:var(--switch-bg-color)}.invokeai__switch-form-control .invokeai__switch-root span span{background-color:var(--white)}.invokeai__switch-form-control .invokeai__switch-root[data-checked] span{background:var(--switch-bg-active-color)}.invokeai__switch-form-control .invokeai__switch-root[data-checked] span span{background-color:var(--white)}.invokeai__select{display:flex;column-gap:1rem;align-items:center}.invokeai__select .invokeai__select-label{color:var(--text-color-secondary)}.invokeai__select .invokeai__select-picker{border:2px solid var(--border-color);background-color:var(--background-color-secondary);font-weight:700;font-size:.9rem;height:2rem;border-radius:.2rem}.invokeai__select .invokeai__select-picker:focus{outline:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.invokeai__select .invokeai__select-option{background-color:var(--background-color-secondary);color:var(--text-color-secondary)}.invokeai__slider-component{padding-bottom:.5rem;border-radius:.5rem}.invokeai__slider-component .invokeai__slider-component-label{min-width:max-content;margin:0;font-weight:700;font-size:.9rem;color:var(--text-color-secondary)}.invokeai__slider-component .invokeai__slider_track{background-color:var(--tab-color)}.invokeai__slider-component .invokeai__slider_track-filled{background-color:var(--slider-color)}.invokeai__slider-component .invokeai__slider-thumb{width:4px}.invokeai__slider-component .invokeai__slider-mark{font-size:.75rem;font-weight:700;color:var(--slider-mark-color);margin-top:.3rem}.invokeai__slider-component .invokeai__slider-number-input{border:none;font-size:.9rem;font-weight:700;height:2rem;background-color:var(--background-color-secondary);border:2px solid var(--border-color)}.invokeai__slider-component .invokeai__slider-number-input:focus{outline:none;box-shadow:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.invokeai__slider-component .invokeai__slider-number-input:disabled{opacity:.2}.invokeai__slider-component .invokeai__slider-number-stepper{border:none}.invokeai__slider-component[data-markers=true] .invokeai__slider_container{margin-top:-1rem}.invokeai__checkbox .chakra-checkbox__label{margin-top:1px;color:var(--text-color-secondary);font-size:.9rem}.invokeai__checkbox .chakra-checkbox__control{width:1rem;height:1rem;border:none;border-radius:.2rem;background-color:var(--input-checkbox-bg)}.invokeai__checkbox .chakra-checkbox__control svg{width:.6rem;height:.6rem;stroke-width:3px}.invokeai__checkbox .chakra-checkbox__control[data-checked]{color:var(--text-color);background-color:var(--input-checkbox-checked-bg)}.invokeai__popover-content{min-width:unset;width:unset;padding:1rem;border-radius:.5rem;background-color:var(--background-color);border:2px solid var(--border-color)}.invokeai__popover-content .invokeai__popover-arrow{background-color:var(--background-color)!important}.invokeai__color-picker .react-colorful__hue-pointer,.invokeai__color-picker .react-colorful__saturation-pointer{width:1.5rem;height:1.5rem;border-color:var(--white)}.dropzone-container{position:absolute;top:0;left:0;width:100vw;height:100vh;z-index:999;backdrop-filter:blur(20px)}.dropzone-container .dropzone-overlay{opacity:.5;width:100%;height:100%;display:flex;flex-direction:column;row-gap:1rem;align-items:center;justify-content:center;background-color:var(--background-color)}.dropzone-container .dropzone-overlay.is-drag-accept{box-shadow:inset 0 0 20rem 1rem var(--accent-color)}.dropzone-container .dropzone-overlay.is-drag-reject{box-shadow:inset 0 0 20rem 1rem var(--status-bad-color)}.dropzone-container .dropzone-overlay.is-handling-upload{box-shadow:inset 0 0 20rem 1rem var(--status-working-color)}.image-uploader-button-outer{width:100%;height:100%;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:.5rem;color:var(--tab-list-text-inactive);background-color:var(--background-color)}.image-uploader-button-outer:hover{background-color:var(--background-color-light)}.image-upload-button-inner{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.image-upload-button{display:flex;flex-direction:column;row-gap:2rem;align-items:center;justify-content:center;text-align:center}.image-upload-button svg{width:4rem;height:4rem}.image-upload-button h2{font-size:1.2rem}.work-in-progress{display:grid;width:100%;height:calc(100vh - (70px + 1rem));grid-auto-rows:max-content;background-color:var(--background-color-secondary);border-radius:.4rem;place-content:center;place-items:center;row-gap:1rem}.work-in-progress h1{font-size:2rem;font-weight:700}.work-in-progress p{text-align:center;max-width:50rem;color:var(--subtext-color-bright)}.guide-popover-arrow{background-color:var(--tab-panel-bg);box-shadow:none}.guide-popover-content{background-color:var(--background-color-secondary);border:none}.guide-popover-guide-content{background:var(--tab-panel-bg);border:2px solid var(--tab-hover-color);border-radius:.4rem;padding:.75rem 1rem;display:grid;grid-template-rows:repeat(auto-fill,1fr);grid-row-gap:.5rem;justify-content:space-between}.modal{background-color:var(--background-color-secondary);color:var(--text-color);font-family:Inter}.modal-close-btn{background-color:var(--btn-base-color)}.modal-close-btn:hover{background-color:var(--btn-base-color-hover)}.modal-close-btn:disabled:hover{background-color:var(--btn-base-color)}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{-ms-overflow-style:none;scrollbar-width:none;background-color:var(--root-bg-color);overflow:hidden}html::-webkit-scrollbar,body::-webkit-scrollbar{display:none}#root{background-color:var(--root-bg-color);color:var(--text-color);font-family:Inter,Arial,Helvetica,sans-serif}\n',document.head.appendChild($t),{execute:function(){var $t,Jt,tn,rn,ln,fn,vn,mn,bn,wn,Sn,Cn,_n,En,Pn,Ln,On,An,Mn,Tn,In,Rn,Nn,Dn,zn,jn,Bn,Fn,Hn,Vn,Wn,Un,Gn,qn,Yn,Zn,Xn,$n,Kn,Qn,Jn,er,tr,nr,rr;function or(e,t){for(var n=function(){var n=t[r];if("string"!=typeof n&&!Array.isArray(n)){var o=function(t){if("default"!==t&&!(t in e)){var r=Object.getOwnPropertyDescriptor(n,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}};for(var i in n)o(i)}},r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.preventTransition,n=void 0===t||t,r={setDataset:function(e){var t=n?r.preventTransition():void 0;document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e,null==t||t()},setClassName:function(e){document.body.classList.add(e?lo:so),document.body.classList.remove(e?so:lo)},query:function(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme:function(e){var t;return(null!==(t=r.query().matches)&&void 0!==t?t:"dark"===e)?"dark":"light"},addListener:function(e){var t=r.query(),n=function(t){e(t.matches?"dark":"light")};return"function"==typeof t.addListener?t.addListener(n):t.addEventListener("change",n),function(){"function"==typeof t.removeListener?t.removeListener(n):t.removeEventListener("change",n)}},preventTransition:function(){var 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),function(){window.getComputedStyle(document.body),requestAnimationFrame((function(){requestAnimationFrame((function(){document.head.removeChild(e)}))}))}}};return r}({preventTransition:s})}),[s]),y=m.getSystemTheme,b=m.setClassName,w=m.setDataset,k=m.addListener,x="system"!==a||f?f:v,S=cr.useCallback((function(e){var t="system"===e?y():e;h(t),b("dark"===t),w(t),u.set(t)}),[u,y,b,w]);oo((function(){"system"===a&&g(y())}),[]),cr.useEffect((function(){var e=u.get();S(e||("system"!==a?c:"system"))}),[u,c,a,S]);var C=cr.useCallback((function(){S("dark"===x?"light":"dark")}),[x,S]);cr.useEffect((function(){if(i)return k(S)}),[i,k,S]);var _=cr.useMemo((function(){return{colorMode:null!=t?t:x,toggleColorMode:t?fo:C,setColorMode:t?fo:S,forced:void 0!==t}}),[x,C,S,t]);return qr.createElement(io.Provider,{value:_},n)}po.displayName="ColorModeProvider";var vo={},go={get exports(){return vo},set exports(e){vo=e}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Function]",a="[object Object]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[o]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[i]=u["[object Map]"]=u["[object Number]"]=u[a]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==kn(ir)&&ir&&ir.Object===Object&&ir,d="object"==("undefined"==typeof self?"undefined":kn(self))&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),h=t&&!t.nodeType&&t,p=h&&e&&!e.nodeType&&e,v=p&&p.exports===h,g=v&&c.process,m=function(){try{var e=p&&p.require&&p.require("util").types;return e||g&&g.binding&&g.binding("util")}catch(Dhe){}}(),y=m&&m.isTypedArray;function b(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var w,k=Array.prototype,x=Function.prototype,S=Object.prototype,C=f["__core-js_shared__"],_=x.toString,E=S.hasOwnProperty,P=(w=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",L=S.toString,O=_.call(Object),A=RegExp("^"+_.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?f.Buffer:void 0,T=f.Symbol,I=f.Uint8Array,R=M?M.allocUnsafe:void 0,N=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object),D=Object.create,z=S.propertyIsEnumerable,j=k.splice,B=T?T.toStringTag:void 0,F=function(){try{var e=fe(Object,"defineProperty");return e({},"",{}),e}catch(Dhe){}}(),H=M?M.isBuffer:void 0,V=Math.max,W=Date.now,U=fe(f,"Map"),G=fe(Object,"create"),q=function(){function e(){}return function(t){if(!Pe(t))return{};if(D)return D(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},Z.prototype.set=function(e,t){var n=this.__data__,r=ee(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},X.prototype.clear=function(){this.size=0,this.__data__={hash:new Y,map:new(U||Z),string:new Y}},X.prototype.delete=function(e){var t=de(this,e).delete(e);return this.size-=t?1:0,t},X.prototype.get=function(e){return de(this,e).get(e)},X.prototype.has=function(e){return de(this,e).has(e)},X.prototype.set=function(e,t){var n=de(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},$.prototype.clear=function(){this.__data__=new Z,this.size=0},$.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$.prototype.get=function(e){return this.__data__.get(e)},$.prototype.has=function(e){return this.__data__.has(e)},$.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Z){var r=n.__data__;if(!U||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new X(r)}return n.set(e,t),this.size=n.size,this};var ne,re=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[ne?a:++r];if(!1===t(o[s],s,o))break}return e};function oe(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":B&&B in Object(e)?function(e){var t=E.call(e,B),n=e[B];try{e[B]=void 0;var r=!0}catch(Dhe){}var o=L.call(e);r&&(t?e[B]=n:delete e[B]);return o}(e):function(e){return L.call(e)}(e)}function ie(e){return Le(e)&&oe(e)==o}function ae(e){return!(!Pe(e)||(t=e,P&&P in t))&&(_e(e)?A:s).test(function(e){if(null!=e){try{return _.call(e)}catch(Dhe){}try{return e+""}catch(Dhe){}}return""}(e));var t}function se(e){if(!Pe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=pe(e),n=[];for(var r in e)("constructor"!=r||!t&&E.call(e,r))&&n.push(r);return n}function le(e,t,n,r,o){e!==t&&re(t,(function(i,s){if(o||(o=new $),Pe(i))!function(e,t,n,r,o,i,s){var l=ve(e,n),u=ve(t,n),c=s.get(u);if(c)return void Q(e,n,c);var d=i?i(l,u,n+"",e,t,s):void 0,f=void 0===d;if(f){var h=xe(u),p=!h&&Ce(u),v=!h&&!p&&Oe(u);d=u,h||p||v?xe(l)?d=l:!function(e){return Le(e)&&Se(e)}(l)?p?(f=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=R?R(n):new e.constructor(n);return e.copy(r),r}(u,!0)):v?(f=!1,g=u,m=!0?(y=g.buffer,b=new y.constructor(y.byteLength),new I(b).set(new I(y)),b):g.buffer,d=new g.constructor(m,g.byteOffset,g.length)):d=[]:d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n-1&&e%1==0&&e0){if(++me>=800)return arguments[0]}else me=0;return ge.apply(void 0,arguments)});function we(e,t){return e===t||e!=e&&t!=t}var ke=ie(function(){return arguments}())?ie:function(e){return Le(e)&&E.call(e,"callee")&&!z.call(e,"callee")},xe=Array.isArray;function Se(e){return null!=e&&Ee(e.length)&&!_e(e)}var Ce=H||function(){return!1};function _e(e){if(!Pe(e))return!1;var t=oe(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ee(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function Pe(e){var t=kn(e);return null!=e&&("object"==t||"function"==t)}function Le(e){return null!=e&&"object"==kn(e)}var Oe=y?function(e){return function(t){return e(t)}}(y):function(e){return Le(e)&&Ee(e.length)&&!!u[oe(e)]};function Ae(e){return Se(e)?K(e,!0):se(e)}var Me,Te=(Me=function(e,t,n,r){le(e,t,n,r)},ue((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Me.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!Pe(n))return!1;var r=kn(t);return!!("number"==r?Se(n)&&he(t,n.length):"string"==r&&t in n)&&we(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n1?t-1:0),r=1;r :not(style) ~ :not(style)",Mo=gn({},Ao,{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}),To=gn({},Ao,{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}),Io={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},Ro=new Set(Object.values(Io)),No=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Do=function(e){return e.trim()};var zo=function(e){return"string"==typeof e&&e.includes("(")&&e.includes(")")};var jo=function(e){return function(t){return"".concat(e,"(").concat(t,")")}},Bo={filter:function(e){return"auto"!==e?e:Po},backdropFilter:function(e){return"auto"!==e?e:Lo},ring:function(e){return function(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}(Bo.px(e))},bgClip:function(e){return"text"===e?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform:function(e){return"auto"===e?["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))"].concat(Eo).join(" "):"auto-gpu"===e?["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)"].concat(Eo).join(" "):e},vh:function(e){return"$100vh"===e?"var(--chakra-vh)":e},px:function(e){if(null==e)return e;var t=function(e){var t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}(e);return t.unitless||"number"==typeof e?"".concat(e,"px"):e},fraction:function(e){return"number"!=typeof e||e>1?e:"".concat(100*e,"%")},float:function(e,t){return"rtl"===t.direction?{left:"right",right:"left"}[e]:e},degree:function(e){if(function(e){return/^var\(--.+\)$/.test(e)}(e)||null==e)return e;var t="string"==typeof e&&!e.endsWith("deg");return"number"==typeof e||t?"".concat(e,"deg"):e},gradient:function(e,t){return function(e,t){var n,r;if(null==e||No.has(e))return e;var o=null!==(n=null==(r=hn(/(^[a-z-A-Z]+)\(((.*))\)/g,{type:1,values:2}).exec(e))?void 0:r.groups)&&void 0!==n?n:{},i=o.type,a=o.values;if(!i||!a)return e;var s=i.includes("-gradient")?i:"".concat(i,"-gradient"),l=dn(a.split(",").map(Do).filter(Boolean)),u=l[0],c=l.slice(1);if(0===(null==c?void 0:c.length))return e;var d=u in Io?Io[u]:u;c.unshift(d);var f=c.map((function(e){if(Ro.has(e))return e;var n=e.indexOf(" "),r=yn(-1!==n?[e.substr(0,n),e.substr(n+1)]:[e],2),o=r[0],i=r[1],a=zo(i)?i:i&&i.split(" "),s="colors.".concat(o),l=s in t.__cssMap?t.__cssMap[s].varRef:o;return a?[l].concat(cn(Array.isArray(a)?a:[a])).join(" "):l}));return"".concat(s,"(").concat(f.join(", "),")")}(e,null!=t?t:{})},blur:jo("blur"),opacity:jo("opacity"),brightness:jo("brightness"),contrast:jo("contrast"),dropShadow:jo("drop-shadow"),grayscale:jo("grayscale"),hueRotate:jo("hue-rotate"),invert:jo("invert"),saturate:jo("saturate"),sepia:jo("sepia"),bgImage:function(e){return null==e||zo(e)||No.has(e)?e:"url(".concat(e,")")},outline:function(e){var t="0"===String(e)||"none"===String(e);return null!==e&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection:function(e){var t,n=null!==(t=Oo[e])&&void 0!==t?t:{},r=n.space,o=n.divide,i={flexDirection:e};return r&&(i[r]=1),o&&(i[o]=1),i}},Fo={borderWidths:_o("borderWidths"),borderStyles:_o("borderStyles"),colors:_o("colors"),borders:_o("borders"),radii:_o("radii",Bo.px),space:_o("space",Co(Bo.vh,Bo.px)),spaceT:_o("space",Co(Bo.vh,Bo.px)),degreeT:function(e){return{property:e,transform:Bo.degree}},prop:function(e,t,n){return un({property:e,scale:t},t&&{transform:So({scale:t,transform:n})})},propT:function(e,t){return{property:e,transform:t}},sizes:_o("sizes",Co(Bo.vh,Bo.px)),sizesT:_o("sizes",Co(Bo.vh,Bo.fraction)),shadows:_o("shadows"),logical:function(e){var t,n,r,o=e.property,i=e.scale,a=e.transform;return{scale:i,property:(t=o,n=t.rtl,r=t.ltr,function(e){return"rtl"===e.direction?n:r}),transform:i?So({scale:i,compose:a}):a}},blur:_o("blur",Bo.blur)},Ho={background:Fo.colors("background"),backgroundColor:Fo.colors("backgroundColor"),backgroundImage:Fo.propT("backgroundImage",Bo.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Bo.bgClip},bgSize:Fo.prop("backgroundSize"),bgPosition:Fo.prop("backgroundPosition"),bg:Fo.colors("background"),bgColor:Fo.colors("backgroundColor"),bgPos:Fo.prop("backgroundPosition"),bgRepeat:Fo.prop("backgroundRepeat"),bgAttachment:Fo.prop("backgroundAttachment"),bgGradient:Fo.propT("backgroundImage",Bo.gradient),bgClip:{transform:Bo.bgClip}};Object.assign(Ho,{bgImage:Ho.backgroundImage,bgImg:Ho.backgroundImage});var Vo={border:Fo.borders("border"),borderWidth:Fo.borderWidths("borderWidth"),borderStyle:Fo.borderStyles("borderStyle"),borderColor:Fo.colors("borderColor"),borderRadius:Fo.radii("borderRadius"),borderTop:Fo.borders("borderTop"),borderBlockStart:Fo.borders("borderBlockStart"),borderTopLeftRadius:Fo.radii("borderTopLeftRadius"),borderStartStartRadius:Fo.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:Fo.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:Fo.radii("borderTopRightRadius"),borderStartEndRadius:Fo.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:Fo.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:Fo.borders("borderRight"),borderInlineEnd:Fo.borders("borderInlineEnd"),borderBottom:Fo.borders("borderBottom"),borderBlockEnd:Fo.borders("borderBlockEnd"),borderBottomLeftRadius:Fo.radii("borderBottomLeftRadius"),borderBottomRightRadius:Fo.radii("borderBottomRightRadius"),borderLeft:Fo.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:Fo.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:Fo.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:Fo.borders(["borderLeft","borderRight"]),borderInline:Fo.borders("borderInline"),borderY:Fo.borders(["borderTop","borderBottom"]),borderBlock:Fo.borders("borderBlock"),borderTopWidth:Fo.borderWidths("borderTopWidth"),borderBlockStartWidth:Fo.borderWidths("borderBlockStartWidth"),borderTopColor:Fo.colors("borderTopColor"),borderBlockStartColor:Fo.colors("borderBlockStartColor"),borderTopStyle:Fo.borderStyles("borderTopStyle"),borderBlockStartStyle:Fo.borderStyles("borderBlockStartStyle"),borderBottomWidth:Fo.borderWidths("borderBottomWidth"),borderBlockEndWidth:Fo.borderWidths("borderBlockEndWidth"),borderBottomColor:Fo.colors("borderBottomColor"),borderBlockEndColor:Fo.colors("borderBlockEndColor"),borderBottomStyle:Fo.borderStyles("borderBottomStyle"),borderBlockEndStyle:Fo.borderStyles("borderBlockEndStyle"),borderLeftWidth:Fo.borderWidths("borderLeftWidth"),borderInlineStartWidth:Fo.borderWidths("borderInlineStartWidth"),borderLeftColor:Fo.colors("borderLeftColor"),borderInlineStartColor:Fo.colors("borderInlineStartColor"),borderLeftStyle:Fo.borderStyles("borderLeftStyle"),borderInlineStartStyle:Fo.borderStyles("borderInlineStartStyle"),borderRightWidth:Fo.borderWidths("borderRightWidth"),borderInlineEndWidth:Fo.borderWidths("borderInlineEndWidth"),borderRightColor:Fo.colors("borderRightColor"),borderInlineEndColor:Fo.colors("borderInlineEndColor"),borderRightStyle:Fo.borderStyles("borderRightStyle"),borderInlineEndStyle:Fo.borderStyles("borderInlineEndStyle"),borderTopRadius:Fo.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:Fo.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:Fo.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:Fo.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Vo,{rounded:Vo.borderRadius,roundedTop:Vo.borderTopRadius,roundedTopLeft:Vo.borderTopLeftRadius,roundedTopRight:Vo.borderTopRightRadius,roundedTopStart:Vo.borderStartStartRadius,roundedTopEnd:Vo.borderStartEndRadius,roundedBottom:Vo.borderBottomRadius,roundedBottomLeft:Vo.borderBottomLeftRadius,roundedBottomRight:Vo.borderBottomRightRadius,roundedBottomStart:Vo.borderEndStartRadius,roundedBottomEnd:Vo.borderEndEndRadius,roundedLeft:Vo.borderLeftRadius,roundedRight:Vo.borderRightRadius,roundedStart:Vo.borderInlineStartRadius,roundedEnd:Vo.borderInlineEndRadius,borderStart:Vo.borderInlineStart,borderEnd:Vo.borderInlineEnd,borderTopStartRadius:Vo.borderStartStartRadius,borderTopEndRadius:Vo.borderStartEndRadius,borderBottomStartRadius:Vo.borderEndStartRadius,borderBottomEndRadius:Vo.borderEndEndRadius,borderStartRadius:Vo.borderInlineStartRadius,borderEndRadius:Vo.borderInlineEndRadius,borderStartWidth:Vo.borderInlineStartWidth,borderEndWidth:Vo.borderInlineEndWidth,borderStartColor:Vo.borderInlineStartColor,borderEndColor:Vo.borderInlineEndColor,borderStartStyle:Vo.borderInlineStartStyle,borderEndStyle:Vo.borderInlineEndStyle});var Wo={color:Fo.colors("color"),textColor:Fo.colors("color"),fill:Fo.colors("fill"),stroke:Fo.colors("stroke")},Uo={boxShadow:Fo.shadows("boxShadow"),mixBlendMode:!0,blendMode:Fo.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:Fo.prop("backgroundBlendMode"),opacity:!0};Object.assign(Uo,{shadow:Uo.boxShadow});var Go={filter:{transform:Bo.filter},blur:Fo.blur("--chakra-blur"),brightness:Fo.propT("--chakra-brightness",Bo.brightness),contrast:Fo.propT("--chakra-contrast",Bo.contrast),hueRotate:Fo.degreeT("--chakra-hue-rotate"),invert:Fo.propT("--chakra-invert",Bo.invert),saturate:Fo.propT("--chakra-saturate",Bo.saturate),dropShadow:Fo.propT("--chakra-drop-shadow",Bo.dropShadow),backdropFilter:{transform:Bo.backdropFilter},backdropBlur:Fo.blur("--chakra-backdrop-blur"),backdropBrightness:Fo.propT("--chakra-backdrop-brightness",Bo.brightness),backdropContrast:Fo.propT("--chakra-backdrop-contrast",Bo.contrast),backdropHueRotate:Fo.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:Fo.propT("--chakra-backdrop-invert",Bo.invert),backdropSaturate:Fo.propT("--chakra-backdrop-saturate",Bo.saturate)},qo={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Bo.flexDirection},experimental_spaceX:{static:Mo,transform:So({scale:"space",transform:function(e){return null!==e?{"--chakra-space-x":e}:null}})},experimental_spaceY:{static:To,transform:So({scale:"space",transform:function(e){return null!=e?{"--chakra-space-y":e}:null}})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:Fo.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:Fo.space("gap"),rowGap:Fo.space("rowGap"),columnGap:Fo.space("columnGap")};Object.assign(qo,{flexDir:qo.flexDirection});var Yo={gridGap:Fo.space("gridGap"),gridColumnGap:Fo.space("gridColumnGap"),gridRowGap:Fo.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},Zo={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Bo.outline},outlineOffset:!0,outlineColor:Fo.colors("outlineColor")},Xo={width:Fo.sizesT("width"),inlineSize:Fo.sizesT("inlineSize"),height:Fo.sizes("height"),blockSize:Fo.sizes("blockSize"),boxSize:Fo.sizes(["width","height"]),minWidth:Fo.sizes("minWidth"),minInlineSize:Fo.sizes("minInlineSize"),minHeight:Fo.sizes("minHeight"),minBlockSize:Fo.sizes("minBlockSize"),maxWidth:Fo.sizes("maxWidth"),maxInlineSize:Fo.sizes("maxInlineSize"),maxHeight:Fo.sizes("maxHeight"),maxBlockSize:Fo.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:Fo.propT("float",Bo.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Xo,{w:Xo.width,h:Xo.height,minW:Xo.minWidth,maxW:Xo.maxWidth,minH:Xo.minHeight,maxH:Xo.maxHeight,overscroll:Xo.overscrollBehavior,overscrollX:Xo.overscrollBehaviorX,overscrollY:Xo.overscrollBehaviorY});var $o={listStyleType:!0,listStylePosition:!0,listStylePos:Fo.prop("listStylePosition"),listStyleImage:!0,listStyleImg:Fo.prop("listStyleImage")};var Ko=function(e){var t=new WeakMap;return function(n,r,o,i){if(void 0===n)return e(n,r,o);t.has(n)||t.set(n,new Map);var a=t.get(n);if(a.has(r))return a.get(r);var s=e(n,r,o,i);return a.set(r,s),s}}((function(e,t,n,r){var o="string"==typeof t?t.split("."):[t];for(r=0;r1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(/\s+/g,t)}(e.toString());return function(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}(function(e){if(e.includes("\\."))return e;var t=!Number.isInteger(parseFloat(e.toString()));return t?e.replace(".","\\."):e}(t))}function bi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return[t,e].filter(Boolean).join("-")}function wi(e,t){return"var(".concat(e).concat(t?", ".concat(t):"",")")}function ki(e,t,n){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return yi("--".concat(bi(e,t)))}(e,n);return{variable:r,reference:wi(r,t)}}function xi(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function Si(e){if(null==e)return e;var t=function(e){var t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}(e);return t.unitless||"number"==typeof e?"".concat(e,"px"):e}var Ci=function(e,t){return parseInt(e[1],10)>parseInt(t[1],10)?1:-1},_i=function(e){return Object.fromEntries(Object.entries(e).sort(Ci))};function Ei(e){var t=_i(e);return Object.assign(Object.values(t),t)}function Pi(e){var t;if(!e)return e;var n=(e=null!==(t=Si(e))&&void 0!==t?t:e).endsWith("px")?-1:-.0625;return"number"==typeof e?"".concat(e+n):e.replace(/([0-9]+\.?[0-9]*)/,(function(e){return"".concat(parseFloat(e)+n)}))}function Li(e,t){var n=["@media screen"];return e&&n.push("and","(min-width: ".concat(Si(e),")")),t&&n.push("and","(max-width: ".concat(Si(t),")")),n.join(" ")}function Oi(e){var t;if(!e)return null;e.base=null!==(t=e.base)&&void 0!==t?t:"0px";var n=Ei(e),r=Object.entries(e).sort(Ci).map((function(e,t,n){var r,o=yn(e,2),i=o[0],a=o[1],s=yn(null!==(r=n[t+1])&&void 0!==r?r:[],2)[1];return s=parseFloat(s)>0?Pi(s):void 0,{_minW:Pi(a),breakpoint:i,minW:a,maxW:s,maxWQuery:Li(null,s),minWQuery:Li(a),minMaxQuery:Li(a,s)}})),o=function(e){var t=Object.keys(_i(e));return new Set(t)}(e),i=Array.from(o.values());return{keys:o,normalized:n,isResponsive:function(e){var t=Object.keys(e);return t.length>0&&t.every((function(e){return o.has(e)}))},asObject:_i(e),asArray:Ei(e),details:r,media:[null].concat(cn(n.map((function(e){return Li(e)})).slice(1))),toArrayValue:function(e){if(!yo(e))throw new Error("toArrayValue: value must be an object");for(var t=i.map((function(t){var n;return null!==(n=e[t])&&void 0!==n?n:null}));null===xi(t);)t.pop();return t},toObjectValue:function(e){if(!Array.isArray(e))throw new Error("toObjectValue: value must be an array");return e.reduce((function(e,t,n){var r=i[n];return null!=r&&null!=t&&(e[r]=t),e}),{})}}}var Ai=function(e,t){return"".concat(e,":hover ").concat(t,", ").concat(e,"[data-hover] ").concat(t)},Mi=function(e,t){return"".concat(e,":focus ").concat(t,", ").concat(e,"[data-focus] ").concat(t)},Ti=function(e,t){return"".concat(e,":focus-visible ").concat(t)},Ii=function(e,t){return"".concat(e,":focus-within ").concat(t)},Ri=function(e,t){return"".concat(e,":active ").concat(t,", ").concat(e,"[data-active] ").concat(t)},Ni=function(e,t){return"".concat(e,":disabled ").concat(t,", ").concat(e,"[data-disabled] ").concat(t)},Di=function(e,t){return"".concat(e,":invalid ").concat(t,", ").concat(e,"[data-invalid] ").concat(t)},zi=function(e,t){return"".concat(e,":checked ").concat(t,", ").concat(e,"[data-checked] ").concat(t)},ji=function(e,t){return"".concat(e,":placeholder-shown ").concat(t)},Bi=function(e){return Hi((function(t){return e(t,"&")}),"[role=group]","[data-group]",".group")},Fi=function(e){return Hi((function(t){return e(t,"~ &")}),"[data-peer]",".peer")},Hi=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:1/0;return(yo(e)||Array.isArray(e))&&t?Object.entries(e).reduce((function(e,n){var r=yn(n,2),o=r[0],i=r[1];return yo(i)||Array.isArray(i)?Object.entries(Zi(i,t-1)).forEach((function(t){var n=yn(t,2),r=n[0],i=n[1];e["".concat(o,".").concat(r)]=i})):e[o]=i,e}),{}):e}function Xi(t){var n,r=function(t){return t.__cssMap,t.__cssVars,t.__breakpoints,sn(t,e)}(t),o=Yi(r),i=function(e){return e.semanticTokens}(r),a=function(e){var t,n,r=e.tokens,o=e.semanticTokens,i=Object.entries(null!==(t=Zi(r))&&void 0!==t?t:{}).map((function(e){var t=yn(e,2);return[t[0],{isSemantic:!1,value:t[1]}]})),a=Object.entries(null!==(n=Zi(o,1))&&void 0!==n?n:{}).map((function(e){var t=yn(e,2);return[t[0],{isSemantic:!0,value:t[1]}]}));return Object.fromEntries([].concat(cn(i),cn(a)))}({tokens:o,semanticTokens:i}),s=Gi(a,{cssVarPrefix:null==(n=r.config)?void 0:n.cssVarPrefix}),l=s.cssMap,u=s.cssVars;return Object.assign(r,{__cssVars:un(un({},{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"}),u),__cssMap:l,__breakpoints:Oi(r.breakpoints)}),r}var $i=mo({},Ho,Vo,Wo,qo,Xo,Go,ri,Zo,Yo,ti,ni,Uo,oi,ui,li,ii,ai,$o,si),Ki=Object.assign({},oi,Xo,qo,Yo,ni),Qi=Object.keys(Ki),Ji=[].concat(cn(Object.keys($i)),Wi),ea=un(un({},$i),Vi),ta=function(e){return e in ea},na=function(e){return function(t){if(!t.__breakpoints)return e;var n=t.__breakpoints,r=n.isResponsive,o=n.toArrayValue,i=n.media,a={};for(var s in e){var l=bo(e[s],t);if(null!=l)if(l=yo(l)&&r(l)?o(l):l,Array.isArray(l))for(var u=l.slice(0,i.length).length,c=0;c1&&void 0!==arguments[1]&&arguments[1],s=bo(t,i),l=na(s)(i),u={};for(var c in l){var d,f=bo(l[c],i);c in o&&(c=o[c]),ra(c,f)&&(f=oa(i,f));var h=n[c];if(!0===h&&(h={property:c}),yo(f)){var p;u[c]=null!==(p=u[c])&&void 0!==p?p:{},u[c]=mo({},u[c],e(f,!0))}else{var v=null!==(d=null==(r=null==h?void 0:h.transform)?void 0:r.call(h,f,i,s))&&void 0!==d?d:f;v=(null==h?void 0:h.processResult)?e(v,!0):v;var g=bo(null==h?void 0:h.property,i);if(!a&&(null==h?void 0:h.static)){var m=bo(h.static,i);u=mo({},u,m)}if(g&&Array.isArray(g)){var y,b=xn(g);try{for(b.s();!(y=b.n()).done;){u[y.value]=v}}catch(w){b.e(w)}finally{b.f()}}else g?"&"===g&&yo(v)?u=mo({},u,v):u[g]=v:yo(v)?u=mo({},u,v):u[c]=v}}return u}}({theme:t,pseudos:Vi,configs:$i});return n(e)}};function aa(e){return{definePartsStyle:function(e){return e},defineMultiStyleConfig:function(t){return un({parts:e},t)}}}function sa(e){var t=e.__breakpoints;return function(e,n,r,o){var i,a;if(t){var s={},l=function(e,t){return Array.isArray(e)?e:yo(e)?t(e):null!=e?[e]:void 0}(r,t.toArrayValue);if(!l)return s;for(var u=l.length,c=1===u,d=!!e.parts,f=function(){var r=t.details[h],u=t.details[function(e,t){for(var n=t+1;n1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(a){o.e(a)}finally{o.f()}return r}(e,["styleConfig","size","variant","colorScheme"])}var ca=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ca(Ra,--Ta):0,Aa--,10===Ia&&(Aa=1,Oa--),Ia}function ja(){return Ia=Ta2||Va(Ia)>3?"":" "}function Ya(e,t){for(;--t&&ja()&&!(Ia<48||Ia>102||Ia>57&&Ia<65||Ia>70&&Ia<97););return Ha(e,Fa()+(t<6&&32==Ba()&&32==ja()))}function Za(e){for(;ja();)switch(Ia){case e:return Ta;case 34:case 39:34!==e&&39!==e&&Za(Ia);break;case 40:41===e&&Za(e);break;case 92:ja()}return Ta}function Xa(e,t){for(;ja()&&e+Ia!==57&&(e+Ia!==84||47!==Ba()););return"/*"+Ha(t,Ta-1)+"*"+ba(47===e?e:ja())}function $a(e){for(;!Va(Ba());)ja();return Ha(e,Ta)}function Ka(e){return Ua(Qa("",null,null,null,[""],e=Wa(e),0,[0],e))}function Qa(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,d=a,f=0,h=0,p=0,v=1,g=1,m=1,y=0,b="",w=o,k=i,x=r,S=b;g;)switch(p=y,y=ja()){case 40:if(108!=p&&58==Ca(S,d-1)){-1!=Sa(S+=xa(Ga(y),"&","&\f"),"&\f")&&(m=-1);break}case 34:case 39:case 91:S+=Ga(y);break;case 9:case 10:case 13:case 32:S+=qa(p);break;case 92:S+=Ya(Fa()-1,7);continue;case 47:switch(Ba()){case 42:case 47:La(es(Xa(ja(),Fa()),t,n),l);break;default:S+="/"}break;case 123*v:s[u++]=Ea(S)*m;case 125*v:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+c:h>0&&Ea(S)-d&&La(h>32?ts(S+";",r,n,d-1):ts(xa(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(La(x=Ja(S,t,n,u,c,o,s,b,w=[],k=[],d),i),123===y)if(0===c)Qa(S,t,x,x,w,i,d,s,k);else switch(99===f&&110===Ca(S,3)?100:f){case 100:case 109:case 115:Qa(e,x,x,r&&La(Ja(e,x,x,0,0,o,s,b,o,w=[],d),k),o,k,d,s,r?w:k);break;default:Qa(S,x,x,x,[""],k,0,s,k)}}u=c=h=0,v=m=1,b=S="",d=a;break;case 58:d=1+Ea(S),h=p;default:if(v<1)if(123==y)--v;else if(125==y&&0==v++&&125==za())continue;switch(S+=ba(y),y*v){case 38:m=c>0?1:(S+="\f",-1);break;case 44:s[u++]=(Ea(S)-1)*m,m=1;break;case 64:45===Ba()&&(S+=Ga(ja())),f=Ba(),c=d=Ea(b=S+=$a(Fa())),y++;break;case 45:45===p&&2==Ea(S)&&(v=0)}}return i}function Ja(e,t,n,r,o,i,a,s,l,u,c){for(var d=o-1,f=0===o?i:[""],h=Pa(f),p=0,v=0,g=0;p0?f[m]+" "+y:xa(y,/&\f/g,f[m])))&&(l[g++]=b);return Na(e,t,n,0===o?va:s,l,u,c)}function es(e,t,n){return Na(e,t,n,pa,ba(Ia),_a(e,2,-2),0)}function ts(e,t,n,r){return Na(e,t,n,ga,_a(e,0,r),_a(e,r+1,-1),r)}function ns(e,t){for(var n="",r=Pa(e),o=0;o6)switch(Ca(e,t+1)){case 109:if(45!==Ca(e,t+4))break;case 102:return xa(e,/(.+:)(.+)-([^]+)/,"$1"+ha+"$2-$3$1"+fa+(108==Ca(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Sa(e,"stretch")?ds(xa(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Ca(e,t+1))break;case 6444:switch(Ca(e,Ea(e)-3-(~Sa(e,"!important")&&10))){case 107:return xa(e,":",":"+ha)+e;case 101:return xa(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ha+(45===Ca(e,14)?"inline-":"")+"box$3$1"+ha+"$2$3$1"+da+"$2box$3")+e}break;case 5936:switch(Ca(e,t+11)){case 114:return ha+e+da+xa(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ha+e+da+xa(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ha+e+da+xa(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ha+e+da+e+e}return e}var fs=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case ga:e.return=ds(e.value,e.length);break;case ma:return ns([Da(e,{value:xa(e.value,"@","@"+ha)})],r);case va:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ns([Da(e,{props:[xa(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ns([Da(e,{props:[xa(t,/:(plac\w+)/,":"+ha+"input-$1")]}),Da(e,{props:[xa(t,/:(plac\w+)/,":-moz-$1")]}),Da(e,{props:[xa(t,/:(plac\w+)/,da+"input-$1")]})],r)}return""}))}}],hs=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,o,i=e.stylisPlugins||fs,a={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:u,styles:o,next:Qs}},tl=!!Yr.useInsertionEffect&&Yr.useInsertionEffect,nl=tl||function(e){return e()},rl=tl||cr.useLayoutEffect,ol=cr.createContext("undefined"!=typeof HTMLElement?hs({key:"css"}):null),il=ol.Provider,al=function(e){return cr.forwardRef((function(t,n){var r=cr.useContext(ol);return e(t,r,n)}))},sl=cr.createContext({}),ll=os((function(e){return os((function(t){return function(e,t){return"function"==typeof t?t(e):ps({},e,t)}(e,t)}))})),ul=function(e){var t=cr.useContext(sl);return e.theme!==t&&(t=ll(t)(e.theme)),cr.createElement(sl.Provider,{value:t},e.children)},cl=al((function(e,t){var n=e.styles,r=el([n],void 0,cr.useContext(sl)),o=cr.useRef();return rl((function(){var e=t.key+"-global",n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),i=!1,a=document.querySelector('style[data-emotion="'+e+" "+r.name+'"]');return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),null!==a&&(i=!0,a.setAttribute("data-emotion",e),n.hydrate([a])),o.current=[n,i],function(){n.flush()}}),[t]),rl((function(){var e=o.current,n=e[0];if(e[1])e[1]=!1;else{if(void 0!==r.next&&Ws(t,r.next,!0),n.tags.length){var i=n.tags[n.tags.length-1].nextElementSibling;n.before=i,n.flush()}t.insert("",r,n,!1)}}),[t,r.name]),null}));function dl(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r96?jl:Bl},Hl=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Vl=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Vs(t,n,r),nl((function(){return Ws(t,n,r)})),null},Wl=function e(t,n){var r,o,i=t.__emotion_real===t,a=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var s=Hl(t,n,i),l=s||Fl(a),u=!l("as");return function(){var c=arguments,d=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&d.push("label:"+r+";"),null==c[0]||void 0===c[0].raw)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h1&&void 0!==arguments[1]?arguments[1]:{},n=!1;function r(){if(n)throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?");n=!0}function o(){r();for(var n=arguments.length,o=new Array(n),i=0;i1)&&(e=1),e}function bu(e){return e<=1?"".concat(100*Number(e),"%"):e}function wu(e){return 1===e.length?"0"+e:String(e)}function ku(e,t,n){e=gu(e,255),t=gu(t,255),n=gu(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=0,s=(r+o)/2;if(r===o)a=0,i=0;else{var l=r-o;switch(a=s>.5?l/(2-r-o):l/(r+o),r){case e:i=(t-n)/l+(t1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Su(e,t,n){e=gu(e,255),t=gu(t,255),n=gu(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,s=r-o,l=0===r?0:s/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/s+(t>16,g:(65280&e)>>8,b:255&e}}(t)),this.originalInput=t;var o=Ou(t);this.originalInput=t,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=n.format)&&void 0!==r?r:o.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255;return.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=yu(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var e=Su(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=Su(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=ku(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=ku(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),Cu(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,t,n,r,o){var i=[wu(Math.round(e).toString(16)),wu(Math.round(t).toString(16)),wu(Math.round(n).toString(16)),wu(_u(r))];return o&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*gu(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*gu(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+Cu(this.r,this.g,this.b,!1),t=0,n=Object.entries(Lu);t=0;return t||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=mu(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=mu(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=mu(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=mu(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var r=this.toRgb(),o=new e(t).toRgb(),i=n/100;return new e({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var r=this.toHsl(),o=360/n,i=[this];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(new e(r));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:o,v:i})),i=(i+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,o=[this],i=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(Du(e));return e.count=t,n}var r=function(e,t){var n=ju(function(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if("string"==typeof e){var n=Fu.find((function(t){return t.name===e}));if(n){var r=Bu(n);if(r.hueRange)return r.hueRange}var o=new Nu(e);if(o.isValid){var i=o.toHsv().h;return[i,i]}}return[0,360]}(e),t);n<0&&(n=360+n);return n}(e.hue,e.seed),o=function(e,t){if("monochrome"===t.hue)return 0;if("random"===t.luminosity)return ju([0,100],t.seed);var n=zu(e).saturationRange,r=n[0],o=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=o-10;break;case"light":o=55}return ju([r,o],t.seed)}(r,e),i=function(e,t,n){var r=function(e,t){for(var n=zu(e).lowerBounds,r=0;r=o&&t<=a){var l=(s-i)/(a-o);return l*t+(i-l*o)}}return 0}(e,t),o=100;switch(n.luminosity){case"dark":o=r+20;break;case"light":r=(o+r)/2;break;case"random":r=0,o=100}return ju([r,o],n.seed)}(r,o,e),a={h:r,s:o,v:i};return void 0!==e.alpha&&(a.a=e.alpha),new Nu(a)}function zu(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=Fu;t=r.hueRange[0]&&e<=r.hueRange[1])return r}throw Error("Color not found")}function ju(e,t){if(void 0===t)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0,o=(t=(9301*t+49297)%233280)/233280;return Math.floor(r+o*(n-r))}function Bu(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],o=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,o]}}var Fu=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];var Hu=function(e,t,n){var r=function(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;r0&&void 0!==arguments[0]?arguments[0]:"1rem",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(255, 255, 255, 0.15)";return{backgroundImage:"linear-gradient(\n 45deg,\n ".concat(t," 25%,\n transparent 25%,\n transparent 50%,\n ").concat(t," 50%,\n ").concat(t," 75%,\n transparent 75%,\n transparent\n )"),backgroundSize:"".concat(e," ").concat(e)}}function Gu(e){var t,n=Du().toHexString();return e&&(t=e,0!==Object.keys(t).length)?e.string&&e.colors?function(e,t){var n=0;if(0===e.length)return t[0];for(var r=0;r>8*o&255).toString(16)).substr(-2)}return r}(e.string):e.colors&&!e.string?function(e){return e[Math.floor(Math.random()*e.length)]}(e.colors):n:n}function qu(e,t){return function(n){return"dark"===n.colorMode?t:e}}function Yu(e){var t=e.orientation,n=e.vertical,r=e.horizontal;return t?"vertical"===t?n:r:{}}function Zu(e){return function(e){var t=kn(e);return null!=e&&("object"===t||"function"===t)&&!Array.isArray(e)}(e)&&e.reference?e.reference:String(e)}var Xu=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(/\s+/g,t)}(e.toString());return t.includes("\\.")?e:function(e){return!Number.isInteger(parseFloat(e.toString()))}(e)?t.replace(".","\\."):e}function rc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return[t,nc(e)].filter(Boolean).join("-")}function oc(e,t){return"var(".concat(nc(e)).concat(t?", ".concat(t):"",")")}function ic(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"--".concat(rc(e,t))}(e,null==t?void 0:t.prefix);return{variable:n,reference:oc(n,ac(null==t?void 0:t.fallback))}}function ac(e){return"string"==typeof e?e:null==e?void 0:e.reference}var sc=aa(Gl.keys),lc=sc.definePartsStyle,uc=(0,sc.defineMultiStyleConfig)({baseStyle:lc({container:{borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},button:{transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},panel:{pt:"2",px:"4",pb:"5"},icon:{fontSize:"1.25em"}})}),cc=aa(ql.keys),dc=cc.definePartsStyle,fc=cc.defineMultiStyleConfig,hc=ki("alert-fg"),pc=ki("alert-bg"),vc=dc({container:{bg:pc.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:hc.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:hc.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function gc(e){var t=e.theme,n=e.colorScheme,r=Wu("".concat(n,".200"),.16)(t);return{light:"colors.".concat(n,".100"),dark:r}}var mc=dc((function(e){var t,n,r=e.colorScheme,o=gc(e);return{container:(n={},gn(n,hc.variable,"colors.".concat(r,".500")),gn(n,pc.variable,o.light),gn(n,"_dark",(t={},gn(t,hc.variable,"colors.".concat(r,".200")),gn(t,pc.variable,o.dark),t)),n)}})),yc=dc((function(e){var t,n,r=e.colorScheme,o=gc(e);return{container:(n={},gn(n,hc.variable,"colors.".concat(r,".500")),gn(n,pc.variable,o.light),gn(n,"_dark",(t={},gn(t,hc.variable,"colors.".concat(r,".200")),gn(t,pc.variable,o.dark),t)),gn(n,"paddingStart","3"),gn(n,"borderStartWidth","4px"),gn(n,"borderStartColor",hc.reference),n)}})),bc=dc((function(e){var t,n,r=e.colorScheme,o=gc(e);return{container:(n={},gn(n,hc.variable,"colors.".concat(r,".500")),gn(n,pc.variable,o.light),gn(n,"_dark",(t={},gn(t,hc.variable,"colors.".concat(r,".200")),gn(t,pc.variable,o.dark),t)),gn(n,"pt","2"),gn(n,"borderTopWidth","4px"),gn(n,"borderTopColor",hc.reference),n)}})),wc=dc((function(e){var t,n,r=e.colorScheme;return{container:(n={},gn(n,hc.variable,"colors.white"),gn(n,pc.variable,"colors.".concat(r,".500")),gn(n,"_dark",(t={},gn(t,hc.variable,"colors.gray.900"),gn(t,pc.variable,"colors.".concat(r,".200")),t)),gn(n,"color",hc.reference),n)}})),kc=fc({baseStyle:vc,variants:{subtle:mc,"left-accent":yc,"top-accent":bc,solid:wc},defaultProps:{variant:"subtle",colorScheme:"blue"}}),xc={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Sc=un(un(un({},xc),{max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"}),{},{container:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px"}}),Cc=function(e){return"function"==typeof e};function _c(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r &:not(:last-of-type)":{marginEnd:"-1px"}},_c(qc,e))},Zc={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Xc=function(e){var t,n=e.colorScheme;if("gray"===n){var r=qu("gray.100","whiteAlpha.200")(e);return{bg:r,_hover:{bg:qu("gray.200","whiteAlpha.300")(e),_disabled:{bg:r}},_active:{bg:qu("gray.300","whiteAlpha.400")(e)}}}var o=null!==(t=Zc[n])&&void 0!==t?t:{},i=o.bg,a=void 0===i?"".concat(n,".500"):i,s=o.color,l=void 0===s?"white":s,u=o.hoverBg,c=void 0===u?"".concat(n,".600"):u,d=o.activeBg,f=void 0===d?"".concat(n,".700"):d,h=qu(a,"".concat(n,".200"))(e);return{bg:h,color:qu(l,"gray.800")(e),_hover:{bg:qu(c,"".concat(n,".300"))(e),_disabled:{bg:h}},_active:{bg:qu(f,"".concat(n,".400"))(e)}}},$c=function(e){var t=e.colorScheme;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:qu("".concat(t,".500"),"".concat(t,".200"))(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:qu("".concat(t,".700"),"".concat(t,".500"))(e)}}},Kc={baseStyle:{lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},variants:{ghost:qc,outline:Yc,solid:Xc,link:$c,unstyled:{bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"}},sizes:{lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},Qc=aa(vu.keys),Jc=Qc.definePartsStyle,ed=Qc.defineMultiStyleConfig,td=ki("card-bg"),nd=ki("card-padding"),rd=Jc({container:(tn={},gn(tn,td.variable,"chakra-body-bg"),gn(tn,"backgroundColor",td.reference),gn(tn,"color","chakra-body-text"),tn),body:{padding:nd.reference,flex:"1 1 0%"},header:{padding:nd.reference},footer:{padding:nd.reference}}),od={sm:Jc({container:gn({borderRadius:"base"},nd.variable,"space.3")}),md:Jc({container:gn({borderRadius:"md"},nd.variable,"space.5")}),lg:Jc({container:gn({borderRadius:"xl"},nd.variable,"space.7")})},id=ed({baseStyle:rd,variants:{elevated:Jc({container:{boxShadow:"base",_dark:gn({},td.variable,"colors.gray.700")}}),outline:Jc({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:Jc({container:gn({},td.variable,"colors.chakra-subtle-bg")}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},sizes:od,defaultProps:{variant:"elevated",size:"md"}}),ad=aa(Xl.keys),sd=ad.definePartsStyle,ld=ad.defineMultiStyleConfig,ud=ki("checkbox-size"),cd=function(e){var t=e.colorScheme;return{w:ud.reference,h:ud.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:qu("".concat(t,".500"),"".concat(t,".200"))(e),borderColor:qu("".concat(t,".500"),"".concat(t,".200"))(e),color:qu("white","gray.900")(e),_hover:{bg:qu("".concat(t,".600"),"".concat(t,".300"))(e),borderColor:qu("".concat(t,".600"),"".concat(t,".300"))(e)},_disabled:{borderColor:qu("gray.200","transparent")(e),bg:qu("gray.200","whiteAlpha.300")(e),color:qu("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:qu("".concat(t,".500"),"".concat(t,".200"))(e),borderColor:qu("".concat(t,".500"),"".concat(t,".200"))(e),color:qu("white","gray.900")(e)},_disabled:{bg:qu("gray.100","whiteAlpha.100")(e),borderColor:qu("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:qu("red.500","red.300")(e)}}},dd={_disabled:{cursor:"not-allowed"}},fd={userSelect:"none",_disabled:{opacity:.4}},hd={transitionProperty:"transform",transitionDuration:"normal"},pd=ld({baseStyle:sd((function(e){return{icon:hd,container:dd,control:_c(cd,e),label:fd}})),sizes:{sm:sd({control:gn({},ud.variable,"sizes.3"),label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:sd({control:gn({},ud.variable,"sizes.4"),label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:sd({control:gn({},ud.variable,"sizes.5"),label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},defaultProps:{size:"md",colorScheme:"blue"}}),vd=ic("close-button-size"),gd=ic("close-button-bg"),md={baseStyle:{w:[vd.reference],h:[vd.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:(rn={},gn(rn,gd.variable,"colors.blackAlpha.100"),gn(rn,"_dark",gn({},gd.variable,"colors.whiteAlpha.100")),rn),_active:(ln={},gn(ln,gd.variable,"colors.blackAlpha.200"),gn(ln,"_dark",gn({},gd.variable,"colors.whiteAlpha.200")),ln),_focusVisible:{boxShadow:"outline"},bg:gd.reference},sizes:{lg:(fn={},gn(fn,vd.variable,"sizes.10"),gn(fn,"fontSize","md"),fn),md:(vn={},gn(vn,vd.variable,"sizes.8"),gn(vn,"fontSize","xs"),vn),sm:(mn={},gn(mn,vd.variable,"sizes.6"),gn(mn,"fontSize","2xs"),mn)},defaultProps:{size:"md"}},yd={baseStyle:{fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},variants:Wc.variants,defaultProps:Wc.defaultProps},bd={baseStyle:{w:"100%",mx:"auto",maxW:"prose",px:"4"}},wd={baseStyle:{opacity:.6,borderColor:"inherit"},variants:{solid:{borderStyle:"solid"},dashed:{borderStyle:"dashed"}},defaultProps:{variant:"solid"}},kd=aa($l.keys),xd=kd.definePartsStyle,Sd=kd.defineMultiStyleConfig,Cd=ki("drawer-bg"),_d=ki("drawer-box-shadow");function Ed(e){return xd("full"===e?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Pd={bg:"blackAlpha.600",zIndex:"overlay"},Ld={display:"flex",zIndex:"modal",justifyContent:"center"},Od=function(e){var t,n;return un(un({},e.isFullHeight&&{height:"100vh"}),{},(gn(n={zIndex:"modal",maxH:"100vh",color:"inherit"},Cd.variable,"colors.white"),gn(n,_d.variable,"shadows.lg"),gn(n,"_dark",(gn(t={},Cd.variable,"colors.gray.700"),gn(t,_d.variable,"shadows.dark-lg"),t)),gn(n,"bg",Cd.reference),gn(n,"boxShadow",_d.reference),n))},Ad={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Md={position:"absolute",top:"2",insetEnd:"3"},Td={px:"6",py:"2",flex:"1",overflow:"auto"},Id={px:"6",py:"4"},Rd=Sd({baseStyle:xd((function(e){return{overlay:Pd,dialogContainer:Ld,dialog:_c(Od,e),header:Ad,closeButton:Md,body:Td,footer:Id}})),sizes:{xs:Ed("xs"),sm:Ed("md"),md:Ed("lg"),lg:Ed("2xl"),xl:Ed("4xl"),full:Ed("full")},defaultProps:{size:"xs"}}),Nd=aa(Kl.keys),Dd=Nd.definePartsStyle,zd=(0,Nd.defineMultiStyleConfig)({baseStyle:Dd({preview:{borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},input:{borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},textarea:{borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}}})}),jd=aa(Ql.keys),Bd=jd.definePartsStyle,Fd=jd.defineMultiStyleConfig,Hd=ki("form-control-color"),Vd=Fd({baseStyle:Bd({container:{width:"100%",position:"relative"},requiredIndicator:(gn(bn={marginStart:"1"},Hd.variable,"colors.red.500"),gn(bn,"_dark",gn({},Hd.variable,"colors.red.300")),gn(bn,"color",Hd.reference),bn),helperText:(gn(wn={mt:"2"},Hd.variable,"colors.gray.600"),gn(wn,"_dark",gn({},Hd.variable,"colors.whiteAlpha.600")),gn(wn,"color",Hd.reference),gn(wn,"lineHeight","normal"),gn(wn,"fontSize","sm"),wn)})}),Wd=aa(Jl.keys),Ud=Wd.definePartsStyle,Gd=Wd.defineMultiStyleConfig,qd=ki("form-error-color"),Yd=Gd({baseStyle:Ud({text:(gn(Sn={},qd.variable,"colors.red.500"),gn(Sn,"_dark",gn({},qd.variable,"colors.red.300")),gn(Sn,"color",qd.reference),gn(Sn,"mt","2"),gn(Sn,"fontSize","sm"),gn(Sn,"lineHeight","normal"),Sn),icon:(gn(Cn={marginEnd:"0.5em"},qd.variable,"colors.red.500"),gn(Cn,"_dark",gn({},qd.variable,"colors.red.300")),gn(Cn,"color",qd.reference),Cn)})}),Zd={baseStyle:{fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}}},Xd={baseStyle:{fontFamily:"heading",fontWeight:"bold"},sizes:{"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},defaultProps:{size:"xl"}},$d=aa(eu.keys),Kd=$d.definePartsStyle,Qd=$d.defineMultiStyleConfig,Jd=Kd({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),ef={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},tf={lg:Kd({field:ef.lg,addon:ef.lg}),md:Kd({field:ef.md,addon:ef.md}),sm:Kd({field:ef.sm,addon:ef.sm}),xs:Kd({field:ef.xs,addon:ef.xs})};function nf(e){var t=e.focusBorderColor,n=e.errorBorderColor;return{focusBorderColor:t||qu("blue.500","blue.300")(e),errorBorderColor:n||qu("red.500","red.300")(e)}}var rf=Kd((function(e){var t=e.theme,n=nf(e),r=n.focusBorderColor,o=n.errorBorderColor;return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:qu("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Hu(t,o),boxShadow:"0 0 0 1px ".concat(Hu(t,o))},_focusVisible:{zIndex:1,borderColor:Hu(t,r),boxShadow:"0 0 0 1px ".concat(Hu(t,r))}},addon:{border:"1px solid",borderColor:qu("inherit","whiteAlpha.50")(e),bg:qu("gray.100","whiteAlpha.300")(e)}}})),of=Kd((function(e){var t=e.theme,n=nf(e),r=n.focusBorderColor,o=n.errorBorderColor;return{field:{border:"2px solid",borderColor:"transparent",bg:qu("gray.100","whiteAlpha.50")(e),_hover:{bg:qu("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Hu(t,o)},_focusVisible:{bg:"transparent",borderColor:Hu(t,r)}},addon:{border:"2px solid",borderColor:"transparent",bg:qu("gray.100","whiteAlpha.50")(e)}}})),af=Kd((function(e){var t=e.theme,n=nf(e),r=n.focusBorderColor,o=n.errorBorderColor;return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Hu(t,o),boxShadow:"0px 1px 0px 0px ".concat(Hu(t,o))},_focusVisible:{borderColor:Hu(t,r),boxShadow:"0px 1px 0px 0px ".concat(Hu(t,r))}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}})),sf=Qd({baseStyle:Jd,sizes:tf,variants:{outline:rf,filled:of,flushed:af,unstyled:Kd({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}})},defaultProps:{size:"md",variant:"outline"}}),lf=ki("kbd-bg"),uf={baseStyle:(gn(_n={},lf.variable,"colors.gray.100"),gn(_n,"_dark",gn({},lf.variable,"colors.whiteAlpha.100")),gn(_n,"bg",lf.reference),gn(_n,"borderRadius","md"),gn(_n,"borderWidth","1px"),gn(_n,"borderBottomWidth","3px"),gn(_n,"fontSize","0.8em"),gn(_n,"fontWeight","bold"),gn(_n,"lineHeight","normal"),gn(_n,"px","0.4em"),gn(_n,"whiteSpace","nowrap"),_n)},cf={baseStyle:{transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}}},df=aa(tu.keys),ff=(0,df.defineMultiStyleConfig)({baseStyle:(0,df.definePartsStyle)({icon:{marginEnd:"2",display:"inline",verticalAlign:"text-bottom"}})}),hf=aa(nu.keys),pf=hf.defineMultiStyleConfig,vf=hf.definePartsStyle,gf=ki("menu-bg"),mf=ki("menu-shadow"),yf=pf({baseStyle:vf({button:{transitionProperty:"common",transitionDuration:"normal"},list:(gn(Pn={},gf.variable,"#fff"),gn(Pn,mf.variable,"shadows.sm"),gn(Pn,"_dark",(gn(En={},gf.variable,"colors.gray.700"),gn(En,mf.variable,"shadows.dark-lg"),En)),gn(Pn,"color","inherit"),gn(Pn,"minW","3xs"),gn(Pn,"py","2"),gn(Pn,"zIndex",1),gn(Pn,"borderRadius","md"),gn(Pn,"borderWidth","1px"),gn(Pn,"bg",gf.reference),gn(Pn,"boxShadow",mf.reference),Pn),item:{py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:(Ln={},gn(Ln,gf.variable,"colors.gray.100"),gn(Ln,"_dark",gn({},gf.variable,"colors.whiteAlpha.100")),Ln),_active:(On={},gn(On,gf.variable,"colors.gray.200"),gn(On,"_dark",gn({},gf.variable,"colors.whiteAlpha.200")),On),_expanded:(An={},gn(An,gf.variable,"colors.gray.100"),gn(An,"_dark",gn({},gf.variable,"colors.whiteAlpha.100")),An),_disabled:{opacity:.4,cursor:"not-allowed"},bg:gf.reference},groupTitle:{mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},command:{opacity:.6},divider:{border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6}})}),bf=aa(ru.keys),wf=bf.defineMultiStyleConfig,kf=bf.definePartsStyle,xf={bg:"blackAlpha.600",zIndex:"modal"},Sf=function(e){return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:e.isCentered?"center":"flex-start",overflow:"inside"===e.scrollBehavior?"hidden":"auto"}},Cf=function(e){var t=e.scrollBehavior;return{borderRadius:"md",bg:qu("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:"inside"===t?"calc(100% - 7.5rem)":void 0,boxShadow:qu("lg","dark-lg")(e)}},_f={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Ef={position:"absolute",top:"2",insetEnd:"3"},Pf=function(e){return{px:"6",py:"2",flex:"1",overflow:"inside"===e.scrollBehavior?"auto":void 0}},Lf={px:"6",py:"4"};function Of(e){return kf("full"===e?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var Af=wf({baseStyle:kf((function(e){return{overlay:xf,dialogContainer:_c(Sf,e),dialog:_c(Cf,e),header:_f,closeButton:Ef,body:_c(Pf,e),footer:Lf}})),sizes:{xs:Of("xs"),sm:Of("sm"),md:Of("md"),lg:Of("lg"),xl:Of("xl"),"2xl":Of("2xl"),"3xl":Of("3xl"),"4xl":Of("4xl"),"5xl":Of("5xl"),"6xl":Of("6xl"),full:Of("full")},defaultProps:{size:"md"}}),Mf={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},Tf=aa(ou.keys),If=Tf.defineMultiStyleConfig,Rf=Tf.definePartsStyle,Nf=ic("number-input-stepper-width"),Df=ic("number-input-input-padding"),zf=tc(Nf).add("0.5rem").toString(),jf=ic("number-input-bg"),Bf=ic("number-input-color"),Ff=ic("number-input-border-color"),Hf=(gn(Mn={},Nf.variable,"sizes.6"),gn(Mn,Df.variable,zf),Mn),Vf=function(e){var t,n;return null!==(t=null==(n=_c(sf.baseStyle,e))?void 0:n.field)&&void 0!==t?t:{}},Wf={width:Nf.reference},Uf=(gn(Rn={borderStart:"1px solid",borderStartColor:Ff.reference,color:Bf.reference,bg:jf.reference},Bf.variable,"colors.chakra-body-text"),gn(Rn,Ff.variable,"colors.chakra-border-color"),gn(Rn,"_dark",(gn(Tn={},Bf.variable,"colors.whiteAlpha.800"),gn(Tn,Ff.variable,"colors.whiteAlpha.300"),Tn)),gn(Rn,"_active",(gn(In={},jf.variable,"colors.gray.200"),gn(In,"_dark",gn({},jf.variable,"colors.whiteAlpha.300")),In)),gn(Rn,"_disabled",{opacity:.4,cursor:"not-allowed"}),Rn);function Gf(e){var t,n,r,o=null==(n=sf.sizes)?void 0:n[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},a=null!==(t=null==(r=o.field)?void 0:r.fontSize)&&void 0!==t?t:"md",s=Mf.fontSizes[a];return Rf({field:un(un({},o.field),{},{paddingInlineEnd:Df.reference,verticalAlign:"top"}),stepper:{fontSize:tc(s).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var qf,Yf,Zf,Xf,$f,Kf,Qf,Jf,eh,th,nh,rh,oh,ih,ah,sh,lh,uh=If({baseStyle:Rf((function(e){var t;return{root:Hf,field:null!==(t=_c(Vf,e))&&void 0!==t?t:{},stepperGroup:Wf,stepper:Uf}})),sizes:{xs:Gf("xs"),sm:Gf("sm"),md:Gf("md"),lg:Gf("lg")},variants:sf.variants,defaultProps:sf.defaultProps}),ch={baseStyle:un(un({},null==(qf=sf.baseStyle)?void 0:qf.field),{},{textAlign:"center"}),sizes:{lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},variants:{outline:function(e){var t,n,r;return null!==(t=null==(r=_c(null==(n=sf.variants)?void 0:n.outline,e))?void 0:r.field)&&void 0!==t?t:{}},flushed:function(e){var t,n,r;return null!==(t=null==(r=_c(null==(n=sf.variants)?void 0:n.flushed,e))?void 0:r.field)&&void 0!==t?t:{}},filled:function(e){var t,n,r;return null!==(t=null==(r=_c(null==(n=sf.variants)?void 0:n.filled,e))?void 0:r.field)&&void 0!==t?t:{}},unstyled:null!==(Nn=null==(Yf=sf.variants)?void 0:Yf.unstyled.field)&&void 0!==Nn?Nn:{}},defaultProps:sf.defaultProps},dh=aa(iu.keys),fh=dh.defineMultiStyleConfig,hh=dh.definePartsStyle,ph=ic("popper-bg"),vh=ic("popper-arrow-bg"),gh=ic("popper-arrow-shadow-color"),mh=fh({baseStyle:hh({popper:{zIndex:10},content:(gn(zn={},ph.variable,"colors.white"),gn(zn,"bg",ph.reference),gn(zn,vh.variable,ph.reference),gn(zn,gh.variable,"colors.gray.200"),gn(zn,"_dark",(gn(Dn={},ph.variable,"colors.gray.700"),gn(Dn,gh.variable,"colors.whiteAlpha.300"),Dn)),gn(zn,"width","xs"),gn(zn,"border","1px solid"),gn(zn,"borderColor","inherit"),gn(zn,"borderRadius","md"),gn(zn,"boxShadow","sm"),gn(zn,"zIndex","inherit"),gn(zn,"_focusVisible",{outline:0,boxShadow:"outline"}),zn),header:{px:3,py:2,borderBottomWidth:"1px"},body:{px:3,py:2},footer:{px:3,py:2,borderTopWidth:"1px"},closeButton:{position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2}})}),yh=aa(au.keys),bh=yh.defineMultiStyleConfig,wh=yh.definePartsStyle,kh=function(e){var t=e.colorScheme,n=e.theme,r=e.isIndeterminate,o=e.hasStripe,i=qu(Uu(),Uu("1rem","rgba(0,0,0,0.1)"))(e),a=qu("".concat(t,".500"),"".concat(t,".200"))(e),s="linear-gradient(\n to right,\n transparent 0%,\n ".concat(Hu(n,a)," 50%,\n transparent 100%\n )");return un(un({},!r&&o&&i),r?{bgImage:s}:{bgColor:a})},xh={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Sh=function(e){return{bg:qu("gray.100","whiteAlpha.300")(e)}},Ch=function(e){return un({transitionProperty:"common",transitionDuration:"slow"},kh(e))},_h=wh((function(e){return{label:xh,filledTrack:Ch(e),track:Sh(e)}})),Eh=bh({sizes:{xs:wh({track:{h:"1"}}),sm:wh({track:{h:"2"}}),md:wh({track:{h:"3"}}),lg:wh({track:{h:"4"}})},baseStyle:_h,defaultProps:{size:"md",colorScheme:"blue"}}),Ph=aa(su.keys),Lh=Ph.defineMultiStyleConfig,Oh=Ph.definePartsStyle,Ah=function(e){var t,n=null==(t=_c(pd.baseStyle,e))?void 0:t.control;return un(un({},n),{},{borderRadius:"full",_checked:un(un({},null==n?void 0:n._checked),{},{_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}})})},Mh=Lh({baseStyle:Oh((function(e){var t,n,r,o;return{label:null==(n=(t=pd).baseStyle)?void 0:n.call(t,e).label,container:null==(o=(r=pd).baseStyle)?void 0:o.call(r,e).container,control:Ah(e)}})),sizes:{md:Oh({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Oh({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Oh({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},defaultProps:{size:"md",colorScheme:"blue"}}),Th=aa(lu.keys),Ih=Th.defineMultiStyleConfig,Rh=Th.definePartsStyle,Nh=ki("select-bg"),Dh={paddingInlineEnd:"8"},zh=Ih({baseStyle:Rh({field:un(un({},null==(Zf=sf.baseStyle)?void 0:Zf.field),{},(gn(jn={appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Nh.reference},Nh.variable,"colors.white"),gn(jn,"_dark",gn({},Nh.variable,"colors.gray.700")),gn(jn,"> option, > optgroup",{bg:Nh.reference}),jn)),icon:{width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}}}),sizes:{lg:un(un({},null==(Xf=sf.sizes)?void 0:Xf.lg),{},{field:un(un({},null==($f=sf.sizes)?void 0:$f.lg.field),Dh)}),md:un(un({},null==(Kf=sf.sizes)?void 0:Kf.md),{},{field:un(un({},null==(Qf=sf.sizes)?void 0:Qf.md.field),Dh)}),sm:un(un({},null==(Jf=sf.sizes)?void 0:Jf.sm),{},{field:un(un({},null==(eh=sf.sizes)?void 0:eh.sm.field),Dh)}),xs:un(un({},null==(th=sf.sizes)?void 0:th.xs),{},{field:un(un({},null==(nh=sf.sizes)?void 0:nh.xs.field),Dh),icon:{insetEnd:"1"}})},variants:sf.variants,defaultProps:sf.defaultProps}),jh=ki("skeleton-start-color"),Bh=ki("skeleton-end-color"),Fh={baseStyle:(gn(Fn={},jh.variable,"colors.gray.100"),gn(Fn,Bh.variable,"colors.gray.400"),gn(Fn,"_dark",(gn(Bn={},jh.variable,"colors.gray.800"),gn(Bn,Bh.variable,"colors.gray.600"),Bn)),gn(Fn,"background",jh.reference),gn(Fn,"borderColor",Bh.reference),gn(Fn,"opacity",.7),gn(Fn,"borderRadius","sm"),Fn)},Hh=ki("skip-link-bg"),Vh={baseStyle:{borderRadius:"md",fontWeight:"semibold",_focusVisible:(Hn={boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6"},gn(Hn,Hh.variable,"colors.white"),gn(Hn,"_dark",gn({},Hh.variable,"colors.gray.700")),gn(Hn,"bg",Hh.reference),Hn)}},Wh=aa(uu.keys),Uh=Wh.defineMultiStyleConfig,Gh=Wh.definePartsStyle,qh=ki("slider-thumb-size"),Yh=ki("slider-track-size"),Zh=ki("slider-bg"),Xh=function(e){return un({display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"}},Yu({orientation:e.orientation,vertical:{h:"100%"},horizontal:{w:"100%"}}))},$h=function(e){var t,n;return un(un({},Yu({orientation:e.orientation,horizontal:{h:Yh.reference},vertical:{w:Yh.reference}})),{},(gn(n={overflow:"hidden",borderRadius:"sm"},Zh.variable,"colors.gray.200"),gn(n,"_dark",gn({},Zh.variable,"colors.whiteAlpha.200")),gn(n,"_disabled",(gn(t={},Zh.variable,"colors.gray.300"),gn(t,"_dark",gn({},Zh.variable,"colors.whiteAlpha.300")),t)),gn(n,"bg",Zh.reference),n))},Kh=function(e){return un(un({},Yu({orientation:e.orientation,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}})),{},{w:qh.reference,h:qh.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}})},Qh=function(e){var t,n=e.colorScheme;return gn(t={width:"inherit",height:"inherit"},Zh.variable,"colors.".concat(n,".500")),gn(t,"_dark",gn({},Zh.variable,"colors.".concat(n,".200"))),gn(t,"bg",Zh.reference),t},Jh=Uh({baseStyle:Gh((function(e){return{container:Xh(e),track:$h(e),thumb:Kh(e),filledTrack:Qh(e)}})),sizes:{lg:Gh({container:(Vn={},gn(Vn,qh.variable,"sizes.4"),gn(Vn,Yh.variable,"sizes.1"),Vn)}),md:Gh({container:(Wn={},gn(Wn,qh.variable,"sizes.3.5"),gn(Wn,Yh.variable,"sizes.1"),Wn)}),sm:Gh({container:(Un={},gn(Un,qh.variable,"sizes.2.5"),gn(Un,Yh.variable,"sizes.0.5"),Un)})},defaultProps:{size:"md",colorScheme:"blue"}}),ep=ic("spinner-size"),tp={baseStyle:{width:[ep.reference],height:[ep.reference]},sizes:{xs:gn({},ep.variable,"sizes.3"),sm:gn({},ep.variable,"sizes.4"),md:gn({},ep.variable,"sizes.6"),lg:gn({},ep.variable,"sizes.8"),xl:gn({},ep.variable,"sizes.12")},defaultProps:{size:"md"}},np=aa(cu.keys),rp=np.defineMultiStyleConfig,op=np.definePartsStyle,ip=rp({baseStyle:op({container:{},label:{fontWeight:"medium"},helpText:{opacity:.8,marginBottom:"2"},number:{verticalAlign:"baseline",fontWeight:"semibold"},icon:{marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"}}),sizes:{md:op({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},defaultProps:{size:"md"}}),ap=aa(du.keys),sp=ap.defineMultiStyleConfig,lp=ap.definePartsStyle,up=ic("switch-track-width"),cp=ic("switch-track-height"),dp=ic("switch-track-diff"),fp=tc.subtract(up,cp),hp=ic("switch-thumb-x"),pp=ic("switch-bg"),vp=function(e){var t,n,r=e.colorScheme;return gn(n={borderRadius:"full",p:"0.5",width:[up.reference],height:[cp.reference],transitionProperty:"common",transitionDuration:"fast"},pp.variable,"colors.gray.300"),gn(n,"_dark",gn({},pp.variable,"colors.whiteAlpha.400")),gn(n,"_focusVisible",{boxShadow:"outline"}),gn(n,"_disabled",{opacity:.4,cursor:"not-allowed"}),gn(n,"_checked",(gn(t={},pp.variable,"colors.".concat(r,".500")),gn(t,"_dark",gn({},pp.variable,"colors.".concat(r,".200"))),t)),gn(n,"bg",pp.reference),n},gp={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[cp.reference],height:[cp.reference],_checked:{transform:"translateX(".concat(hp.reference,")")}},mp=sp({baseStyle:lp((function(e){var t;return{container:(t={},gn(t,dp.variable,fp),gn(t,hp.variable,dp.reference),gn(t,"_rtl",gn({},hp.variable,tc(dp).negate().toString())),t),track:vp(e),thumb:gp}})),sizes:{sm:lp({container:(Gn={},gn(Gn,up.variable,"1.375rem"),gn(Gn,cp.variable,"sizes.3"),Gn)}),md:lp({container:(qn={},gn(qn,up.variable,"1.875rem"),gn(qn,cp.variable,"sizes.4"),qn)}),lg:lp({container:(Yn={},gn(Yn,up.variable,"2.875rem"),gn(Yn,cp.variable,"sizes.6"),Yn)})},defaultProps:{size:"md",colorScheme:"blue"}}),yp=aa(fu.keys),bp=yp.defineMultiStyleConfig,wp=yp.definePartsStyle,kp=wp({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),xp={"&[data-is-numeric=true]":{textAlign:"end"}},Sp=wp((function(e){var t=e.colorScheme;return{th:un({color:qu("gray.600","gray.400")(e),borderBottom:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},xp),td:un({borderBottom:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},xp),caption:{color:qu("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}})),Cp=wp((function(e){var t=e.colorScheme;return{th:un({color:qu("gray.600","gray.400")(e),borderBottom:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},xp),td:un({borderBottom:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},xp),caption:{color:qu("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},td:{background:qu("".concat(t,".100"),"".concat(t,".700"))(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}})),_p=bp({baseStyle:kp,variants:{simple:Sp,striped:Cp,unstyled:{}},sizes:{sm:wp({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:wp({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:wp({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Ep=ki("tabs-color"),Pp=ki("tabs-bg"),Lp=ki("tabs-border-color"),Op=aa(hu.keys),Ap=Op.defineMultiStyleConfig,Mp=Op.definePartsStyle,Tp=function(e){return{display:"vertical"===e.orientation?"flex":"block"}},Ip=function(e){return{flex:e.isFitted?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Rp=function(e){var t=e.align,n=void 0===t?"start":t,r=e.orientation;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[n],flexDirection:"vertical"===r?"column":"row"}},Np={p:4},Dp=Mp((function(e){return{root:Tp(e),tab:Ip(e),tablist:Rp(e),tabpanel:Np}})),zp={sm:Mp({tab:{py:1,px:4,fontSize:"sm"}}),md:Mp({tab:{fontSize:"md",py:2,px:4}}),lg:Mp({tab:{fontSize:"lg",py:3,px:4}})},jp=Mp((function(e){var t,n,r,o,i=e.colorScheme,a=e.orientation,s="vertical"===a?"borderStart":"borderBottom",l="vertical"===a?"marginStart":"marginBottom";return{tablist:(t={},gn(t,s,"2px solid"),gn(t,"borderColor","inherit"),t),tab:(o={},gn(o,s,"2px solid"),gn(o,"borderColor","transparent"),gn(o,l,"-2px"),gn(o,"_selected",(n={},gn(n,Ep.variable,"colors.".concat(i,".600")),gn(n,"_dark",gn({},Ep.variable,"colors.".concat(i,".300"))),gn(n,"borderColor","currentColor"),n)),gn(o,"_active",(r={},gn(r,Pp.variable,"colors.gray.200"),gn(r,"_dark",gn({},Pp.variable,"colors.whiteAlpha.300")),r)),gn(o,"_disabled",{_active:{bg:"none"}}),gn(o,"color",Ep.reference),gn(o,"bg",Pp.reference),o)}})),Bp=Mp((function(e){var t,n,r,o=e.colorScheme;return{tab:(r={borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px"},gn(r,Lp.reference,"transparent"),gn(r,"_selected",(n={},gn(n,Ep.variable,"colors.".concat(o,".600")),gn(n,Lp.variable,"colors.white"),gn(n,"_dark",(t={},gn(t,Ep.variable,"colors.".concat(o,".300")),gn(t,Lp.variable,"colors.gray.800"),t)),gn(n,"borderColor","inherit"),gn(n,"borderBottomColor",Lp.reference),n)),gn(r,"color",Ep.reference),r),tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}})),Fp=Mp((function(e){var t,n,r,o=e.colorScheme;return{tab:(r={border:"1px solid",borderColor:"inherit"},gn(r,Pp.variable,"colors.gray.50"),gn(r,"_dark",gn({},Pp.variable,"colors.whiteAlpha.50")),gn(r,"mb","-1px"),gn(r,"_notLast",{marginEnd:"-1px"}),gn(r,"_selected",(n={},gn(n,Pp.variable,"colors.white"),gn(n,Ep.variable,"colors.".concat(o,".600")),gn(n,"_dark",(t={},gn(t,Pp.variable,"colors.gray.800"),gn(t,Ep.variable,"colors.".concat(o,".300")),t)),gn(n,"borderColor","inherit"),gn(n,"borderTopColor","currentColor"),gn(n,"borderBottomColor","transparent"),n)),gn(r,"color",Ep.reference),gn(r,"bg",Pp.reference),r),tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}})),Hp=Mp((function(e){var t=e.colorScheme,n=e.theme;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:Hu(n,"".concat(t,".700")),bg:Hu(n,"".concat(t,".100"))}}}})),Vp=Mp((function(e){var t,n,r,o=e.colorScheme;return{tab:(r={borderRadius:"full",fontWeight:"semibold"},gn(r,Ep.variable,"colors.gray.600"),gn(r,"_dark",gn({},Ep.variable,"inherit")),gn(r,"_selected",(n={},gn(n,Ep.variable,"colors.white"),gn(n,Pp.variable,"colors.".concat(o,".600")),gn(n,"_dark",(t={},gn(t,Ep.variable,"colors.gray.800"),gn(t,Pp.variable,"colors.".concat(o,".300")),t)),n)),gn(r,"color",Ep.reference),gn(r,"bg",Pp.reference),r)}})),Wp=Ap({baseStyle:Dp,sizes:zp,variants:{line:jp,enclosed:Bp,"enclosed-colored":Fp,"soft-rounded":Hp,"solid-rounded":Vp,unstyled:Mp({})},defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),Up=aa(pu.keys),Gp=Up.defineMultiStyleConfig,qp=Up.definePartsStyle,Yp=qp({container:{fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},label:{lineHeight:1.2,overflow:"visible"},closeButton:{fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}}}),Zp={sm:qp({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:qp({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:qp({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},Xp=Gp({variants:{subtle:qp((function(e){var t;return{container:null==(t=Wc.variants)?void 0:t.subtle(e)}})),solid:qp((function(e){var t;return{container:null==(t=Wc.variants)?void 0:t.solid(e)}})),outline:qp((function(e){var t;return{container:null==(t=Wc.variants)?void 0:t.outline(e)}}))},baseStyle:Yp,sizes:Zp,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),$p=un(un({},null==(rh=sf.baseStyle)?void 0:rh.field),{},{paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"}),Kp={outline:function(e){var t,n;return null!==(t=null==(n=sf.variants)?void 0:n.outline(e).field)&&void 0!==t?t:{}},flushed:function(e){var t,n;return null!==(t=null==(n=sf.variants)?void 0:n.flushed(e).field)&&void 0!==t?t:{}},filled:function(e){var t,n;return null!==(t=null==(n=sf.variants)?void 0:n.filled(e).field)&&void 0!==t?t:{}},unstyled:null!==(Zn=null==(oh=sf.variants)?void 0:oh.unstyled.field)&&void 0!==Zn?Zn:{}},Qp={baseStyle:$p,sizes:{xs:null!==(Xn=null==(ih=sf.sizes)?void 0:ih.xs.field)&&void 0!==Xn?Xn:{},sm:null!==($n=null==(ah=sf.sizes)?void 0:ah.sm.field)&&void 0!==$n?$n:{},md:null!==(Kn=null==(sh=sf.sizes)?void 0:sh.md.field)&&void 0!==Kn?Kn:{},lg:null!==(Qn=null==(lh=sf.sizes)?void 0:lh.lg.field)&&void 0!==Qn?Qn:{}},variants:Kp,defaultProps:{size:"md",variant:"outline"}},Jp=ic("tooltip-bg"),ev=ic("tooltip-fg"),tv=ic("popper-arrow-bg"),nv=(gn(er={bg:Jp.reference,color:ev.reference},Jp.variable,"colors.gray.700"),gn(er,ev.variable,"colors.whiteAlpha.900"),gn(er,"_dark",(gn(Jn={},Jp.variable,"colors.gray.300"),gn(Jn,ev.variable,"colors.gray.900"),Jn)),gn(er,tv.variable,Jp.reference),gn(er,"px","2"),gn(er,"py","0.5"),gn(er,"borderRadius","sm"),gn(er,"fontWeight","medium"),gn(er,"fontSize","sm"),gn(er,"boxShadow","md"),gn(er,"maxW","xs"),gn(er,"zIndex","tooltip"),er),rv={Accordion:uc,Alert:kc,Avatar:Dc,Badge:Wc,Breadcrumb:Gc,Button:Kc,Checkbox:pd,CloseButton:md,Code:yd,Container:bd,Divider:wd,Drawer:Rd,Editable:zd,Form:Vd,FormError:Yd,FormLabel:Zd,Heading:Xd,Input:sf,Kbd:uf,Link:cf,List:ff,Menu:yf,Modal:Af,NumberInput:uh,PinInput:ch,Popover:mh,Progress:Eh,Radio:Mh,Select:zh,Skeleton:Fh,SkipLink:Vh,Slider:Jh,Spinner:tp,Stat:ip,Switch:mp,Table:_p,Tabs:Wp,Tag:Xp,Textarea:Qp,Tooltip:{baseStyle:nv},Card:id},ov={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},iv={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},av={property:{common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},easing:{"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},duration:{"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"}},sv=un(un({breakpoints:{base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},zIndices:{hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},radii:{none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},blur:{none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},colors:{transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}}},Mf),{},{sizes:Sc,shadows:iv,space:xc,borders:ov,transition:av}),lv=un(un({semanticTokens:{colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},direction:"ltr"},sv),{},{components:rv,styles:{global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},config:{useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"}}),uv="undefined"!=typeof Element,cv="function"==typeof Map,dv="function"==typeof Set,fv="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function hv(e,t){if(e===t)return!0;if(e&&t&&"object"==kn(e)&&"object"==kn(t)){if(e.constructor!==t.constructor)return!1;var n,r,o,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!hv(e[r],t[r]))return!1;return!0}if(cv&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!hv(r.value[1],t.get(r.value[0])))return!1;return!0}if(dv&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(fv&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(uv&&e instanceof Element)return!1;for(r=n;0!=r--;)if(("_owner"!==o[r]&&"__v"!==o[r]&&"__o"!==o[r]||!e.$$typeof)&&!hv(e[o[r]],t[o[r]]))return!1;return!0}return e!=e&&t!=t}var pv=function(e,t){try{return hv(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};function vv(){var e=cr.useContext(sl);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function gv(){var e=ao(),t=vv();return un(un({},e),{},{theme:t})}function mv(e){var t=e.cssVarsRoot,n=e.theme,r=e.children,o=cr.useMemo((function(){return Xi(n)}),[n]);return qr.createElement(ul,{theme:o},qr.createElement(yv,{root:t}),r)}function yv(e){var t=e.root,n=[void 0===t?":host, :root":t,"[data-theme]"].join(",");return qr.createElement(cl,{styles:function(e){return gn({},n,e.__cssVars)}})}function bv(){var e=ao().colorMode;return qr.createElement(cl,{styles:function(t){var n=Nl(Al(t,"styles.global"),{theme:t,colorMode:e});if(n){var r=ia(n)(t);return r}}})}!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.strict,n=void 0===t||t,r=e.errorMessage,o=void 0===r?"useContext: `context` is undefined. Seems you forgot to wrap component within the Provider":r,i=e.name,a=cr.createContext(void 0);function s(){var e,t=cr.useContext(a);if(!t&&n){var r=new Error(o);throw r.name="ContextError",null==Error.captureStackTrace||e.call(Error,r,s),r}return t}a.displayName=i,a.Provider}({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});var wv=new Set([].concat(cn(Ji),["textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"])),kv=new Set(["htmlWidth","htmlHeight","htmlSize"]);function xv(e){return kv.has(e)||!wv.has(e)}function Sv(e,r){var o=null!=r?r:{},i=o.baseStyle,a=sn(o,n);a.shouldForwardProp||(a.shouldForwardProp=xv);var s=function(e){var n=e.baseStyle;return function(e){e.theme;var r=e.css,o=e.__css,i=e.sx,a=Ml(sn(e,t),(function(e,t){return ta(t)})),s=Nl(n,e),l=Object.assign({},o,s,Tl(a),i),u=ia(l)(e.theme);return r?[u,r]:u}}({baseStyle:i}),l=Wl(e,a)(s);return qr.forwardRef((function(e,t){var n=ao(),r=n.colorMode,o=n.forced;return qr.createElement(l,un({ref:t,"data-theme":o?r:void 0},e))}))}function Cv(e){return cr.forwardRef(e)}function _v(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.styleConfig,i=sn(n,r),a=gv(),s=a.theme,l=a.colorMode,u=e?Al(s,"components.".concat(e)):void 0,c=o||u,d=mo({theme:s,colorMode:l},null!==(t=null==c?void 0:c.defaultProps)&&void 0!==t?t:{},Tl(Ol(i,["children"]))),f=cr.useRef({});if(c){var h=la(c),p=h(d),v=pv(f.current,p);v||(f.current=p)}return f.current}function Ev(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _v(e,t)}function Pv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _v(e,t)}var Lv=function(){var e=new Map;return new Proxy(Sv,{apply:function(e,t,n){return Sv.apply(void 0,cn(n))},get:function(t,n){return e.has(n)||e.set(n,Sv(n)),e.get(n)}})}();function Ov(e,t){return"".concat(e," returned `undefined`. Seems you forgot to wrap component within ").concat(t)}function Av(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.name,n=e.strict,r=void 0===n||n,o=e.hookName,i=void 0===o?"useContext":o,a=e.providerName,s=void 0===a?"Provider":a,l=e.errorMessage,u=cr.createContext(void 0);function c(){var e,t=cr.useContext(u);if(!t&&r){var n=new Error(null!=l?l:Ov(i,s));throw n.name="ContextError",null==(e=Error.captureStackTrace)||e.call(Error,n,c),n}return t}return u.displayName=t,[u.Provider,c,u]}function Mv(e,t){if(null!=e)if("function"!=typeof e)try{e.current=t}catch(n){throw new Error("Cannot assign value '".concat(t,"' to ref '").concat(e,"'"))}else e(t)}function Tv(){for(var e=arguments.length,t=new Array(e),n=0;n=t&&(r=0),r}function Dv(e,t,n){var r=e-1;return n&&r<0&&(r=t),r}var zv="undefined"!=typeof window?cr.useLayoutEffect:cr.useEffect,jv=on((function e(){var t=this;an(this,e),gn(this,"descendants",new Map),gn(this,"register",(function(e){if(null!=e)return function(e){return"object"==kn(e)&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}(e)?t.registerNode(e):function(n){t.registerNode(n,e)}})),gn(this,"unregister",(function(e){t.descendants.delete(e);var n=Rv(Array.from(t.descendants.keys()));t.assignIndex(n)})),gn(this,"destroy",(function(){t.descendants.clear()})),gn(this,"assignIndex",(function(e){t.descendants.forEach((function(t){var n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()}))})),gn(this,"count",(function(){return t.descendants.size})),gn(this,"enabledCount",(function(){return t.enabledValues().length})),gn(this,"values",(function(){return Array.from(t.descendants.values()).sort((function(e,t){return e.index-t.index}))})),gn(this,"enabledValues",(function(){return t.values().filter((function(e){return!e.disabled}))})),gn(this,"item",(function(e){if(0!==t.count())return t.values()[e]})),gn(this,"enabledItem",(function(e){if(0!==t.enabledCount())return t.enabledValues()[e]})),gn(this,"first",(function(){return t.item(0)})),gn(this,"firstEnabled",(function(){return t.enabledItem(0)})),gn(this,"last",(function(){return t.item(t.descendants.size-1)})),gn(this,"lastEnabled",(function(){var e=t.enabledValues().length-1;return t.enabledItem(e)})),gn(this,"indexOf",(function(e){var n,r;return e&&null!==(n=null==(r=t.descendants.get(e))?void 0:r.index)&&void 0!==n?n:-1})),gn(this,"enabledIndexOf",(function(e){return null==e?-1:t.enabledValues().findIndex((function(t){return t.node.isSameNode(e)}))})),gn(this,"next",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Nv(e,t.count(),n);return t.item(r)})),gn(this,"nextEnabled",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t.item(e);if(r){var o=t.enabledIndexOf(r.node),i=Nv(o,t.enabledCount(),n);return t.enabledItem(i)}})),gn(this,"prev",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Dv(e,t.count()-1,n);return t.item(r)})),gn(this,"prevEnabled",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t.item(e);if(r){var o=t.enabledIndexOf(r.node),i=Dv(o,t.enabledCount()-1,n);return t.enabledItem(i)}})),gn(this,"registerNode",(function(e,n){if(e&&!t.descendants.has(e)){var r=Rv(Array.from(t.descendants.keys()).concat(e));(null==n?void 0:n.disabled)&&(n.disabled=!!n.disabled);var o=un({node:e,index:-1},n);t.descendants.set(e,o),t.assignIndex(r)}}))}));var Bv=yn(Av({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"}),2),Fv=Bv[0],Hv=Bv[1];function Vv(){return[Fv,function(){return Hv()},function(){return e=cr.useRef(new jv),zv((function(){return function(){return e.current.destroy()}})),e.current;var e},function(e){return function(e){var t=Hv(),n=yn(cr.useState(-1),2),r=n[0],o=n[1],i=cr.useRef(null);zv((function(){return function(){i.current&&t.unregister(i.current)}}),[]),zv((function(){if(i.current){var e=Number(i.current.dataset.index);r==e||Number.isNaN(e)||o(e)}}));var a=e?t.register(e):t.register;return{descendants:t,index:r,enabledIndex:t.enabledIndexOf(i.current),register:Tv(a,i)}}(e)}]}var Wv=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:[],n=cr.useRef(e);return cr.useEffect((function(){n.current=e})),cr.useCallback((function(){for(var e,t,r=arguments.length,o=new Array(r),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return bg(e(t,n))}if("undefined"==typeof Proxy)return t;var n=new Map;return new Proxy(t,{get:function(e,r){return n.has(r)||n.set(r,t(r)),n.get(r)}})}var kg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function xg(e){return"string"==typeof e&&!e.includes("-")&&!!(kg.indexOf(e)>-1||/[A-Z]/.test(e))}var Sg={};var Cg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],_g=new Set(Cg);function Eg(e,t){var n=t.layout,r=t.layoutId;return _g.has(e)||e.startsWith("origin")||(n||void 0!==r)&&(!!Sg[e]||"opacity"===e)}var Pg=function(e){return!!(null==e?void 0:e.getVelocity)},Lg={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Og=function(e,t){return Cg.indexOf(e)-Cg.indexOf(t)};function Ag(e){return e.startsWith("--")}var Mg=function(e,t){return t&&"number"==typeof e?t.transform(e):e},Tg=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},Ig=function(e){return e%1?Number(e.toFixed(5)):e},Rg=/(-)?([\d]*\.?[\d])+/g,Ng=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Dg=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function zg(e){return"string"==typeof e}var jg={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},Bg=Object.assign(Object.assign({},jg),{transform:Tg(0,1)}),Fg=Object.assign(Object.assign({},jg),{default:1}),Hg=function(e){return{test:function(t){return zg(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return"".concat(t).concat(e)}}},Vg=Hg("deg"),Wg=Hg("%"),Ug=Hg("px"),Gg=Hg("vh"),qg=Hg("vw"),Yg=Object.assign(Object.assign({},Wg),{parse:function(e){return Wg.parse(e)/100},transform:function(e){return Wg.transform(100*e)}}),Zg=function(e,t){return function(n){return Boolean(zg(n)&&Dg.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},Xg=function(e,t,n){return function(r){var o;if(!zg(r))return r;var i=yn(r.match(Rg),4),a=i[0],s=i[1],l=i[2],u=i[3];return gn(o={},e,parseFloat(a)),gn(o,t,parseFloat(s)),gn(o,n,parseFloat(l)),gn(o,"alpha",void 0!==u?parseFloat(u):1),o}},$g={test:Zg("hsl","hue"),parse:Xg("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha,i=void 0===o?1:o;return"hsla("+Math.round(t)+", "+Wg.transform(Ig(n))+", "+Wg.transform(Ig(r))+", "+Ig(Bg.transform(i))+")"}},Kg=Tg(0,255),Qg=Object.assign(Object.assign({},jg),{transform:function(e){return Math.round(Kg(e))}}),Jg={test:Zg("rgb","red"),parse:Xg("red","green","blue"),transform:function(e){var t=e.red,n=e.green,r=e.blue,o=e.alpha,i=void 0===o?1:o;return"rgba("+Qg.transform(t)+", "+Qg.transform(n)+", "+Qg.transform(r)+", "+Ig(Bg.transform(i))+")"}};var em={test:Zg("#"),parse:function(e){var t="",n="",r="",o="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),o=e.substr(4,1),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Jg.transform},tm={test:function(e){return Jg.test(e)||em.test(e)||$g.test(e)},parse:function(e){return Jg.test(e)?Jg.parse(e):$g.test(e)?$g.parse(e):em.parse(e)},transform:function(e){return zg(e)?e:e.hasOwnProperty("red")?Jg.transform(e):$g.transform(e)}},nm="${c}",rm="${n}";function om(e){"number"==typeof e&&(e="".concat(e));var t=[],n=0,r=e.match(Ng);r&&(n=r.length,e=e.replace(Ng,nm),t.push.apply(t,cn(r.map(tm.parse))));var o=e.match(Rg);return o&&(e=e.replace(Rg,rm),t.push.apply(t,cn(o.map(jg.parse)))),{values:t,numColors:n,tokenised:e}}function im(e){return om(e).values}function am(e){var t=om(e),n=t.values,r=t.numColors,o=t.tokenised,i=n.length;return function(e){for(var t=o,n=0;n0},parse:im,createTransformer:am,getAnimatableNone:function(e){var t=im(e);return am(e)(t.map(sm))}},um=new Set(["brightness","contrast","saturate","opacity"]);function cm(e){var t=yn(e.slice(0,-1).split("("),2),n=t[0],r=t[1];if("drop-shadow"===n)return e;var o=yn(r.match(Rg)||[],1)[0];if(!o)return e;var i=r.replace(o,""),a=um.has(n)?1:0;return o!==r&&(a*=100),n+"("+a+i+")"}var dm=/([a-z-]*)\(.*?\)/g,fm=Object.assign(Object.assign({},lm),{getAnimatableNone:function(e){var t=e.match(dm);return t?t.map(cm).join(" "):e}}),hm=un(un({},jg),{},{transform:Math.round}),pm={borderWidth:Ug,borderTopWidth:Ug,borderRightWidth:Ug,borderBottomWidth:Ug,borderLeftWidth:Ug,borderRadius:Ug,radius:Ug,borderTopLeftRadius:Ug,borderTopRightRadius:Ug,borderBottomRightRadius:Ug,borderBottomLeftRadius:Ug,width:Ug,maxWidth:Ug,height:Ug,maxHeight:Ug,size:Ug,top:Ug,right:Ug,bottom:Ug,left:Ug,padding:Ug,paddingTop:Ug,paddingRight:Ug,paddingBottom:Ug,paddingLeft:Ug,margin:Ug,marginTop:Ug,marginRight:Ug,marginBottom:Ug,marginLeft:Ug,rotate:Vg,rotateX:Vg,rotateY:Vg,rotateZ:Vg,scale:Fg,scaleX:Fg,scaleY:Fg,scaleZ:Fg,skew:Vg,skewX:Vg,skewY:Vg,distance:Ug,translateX:Ug,translateY:Ug,translateZ:Ug,x:Ug,y:Ug,z:Ug,perspective:Ug,transformPerspective:Ug,opacity:Bg,originX:Yg,originY:Yg,originZ:Ug,zIndex:hm,fillOpacity:Bg,strokeOpacity:Bg,numOctaves:hm};function vm(e,t,n,r){var o=e.style,i=e.vars,a=e.transform,s=e.transformKeys,l=e.transformOrigin;s.length=0;var u=!1,c=!1,d=!0;for(var f in t){var h=t[f];if(Ag(f))i[f]=h;else{var p=pm[f],v=Mg(h,p);if(_g.has(f)){if(u=!0,a[f]=v,s.push(f),!d)continue;h!==(p.default||0)&&(d=!1)}else f.startsWith("origin")?(c=!0,l[f]=v):o[f]=v}}if(t.transform||(u||r?o.transform=function(e,t,n,r){var o=e.transform,i=e.transformKeys,a=t.enableHardwareAcceleration,s=void 0===a||a,l=t.allowTransformNone,u=void 0===l||l,c="";i.sort(Og);var d,f=xn(i);try{for(f.s();!(d=f.n()).done;){var h=d.value;c+="".concat(Lg[h]||h,"(").concat(o[h],") ")}}catch(p){f.e(p)}finally{f.f()}return s&&!o.z&&(c+="translateZ(0)"),c=c.trim(),r?c=r(o,n?"":c):u&&n&&(c="none"),c}(e,n,d,r):o.transform&&(o.transform="none")),c){var g=l.originX,m=void 0===g?"50%":g,y=l.originY,b=void 0===y?"50%":y,w=l.originZ,k=void 0===w?0:w;o.transformOrigin="".concat(m," ").concat(b," ").concat(k)}}var gm=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function mm(e,t,n){for(var r in t)Pg(t[r])||Eg(r,n)||(e[r]=t[r])}function ym(e,t,n){var r={};return mm(r,e.style||{},e),Object.assign(r,function(e,t,n){var r=e.transformTemplate;return cr.useMemo((function(){var e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return vm(e,t,{enableHardwareAcceleration:!n},r),Object.assign({},e.vars,e.style)}),[t])}(e,t,n)),e.transformValues?e.transformValues(r):r}function bm(e,t,n){var r={},o=ym(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-".concat("x"===e.drag?"y":"x")),r.style=o,r}var wm=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll"].concat(["whileInView","onViewportEnter","onViewportLeave","viewport"],["whileTap","onTap","onTapStart","onTapCancel"],["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],["onPan","onPanStart","onPanSessionStart","onPanEnd"]));function km(e){return wm.has(e)}var xm,Sm=function(e){return!km(e)};try{(xm=require("@emotion/is-prop-valid").default)&&(Sm=function(e){return e.startsWith("on")?!km(e):xm(e)})}catch(qf){}function Cm(e,t,n){var r={};for(var o in e)(Sm(o)||!0===n&&km(o)||!t&&!km(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function _m(e,t,n){return"string"==typeof e?e:Ug.transform(t+n*e)}var Em={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pm={offset:"strokeDashoffset",array:"strokeDasharray"};function Lm(e,t,n,r){var o=t.attrX,a=t.attrY,s=t.originX,l=t.originY,u=t.pathLength,c=t.pathSpacing,d=void 0===c?1:c,f=t.pathOffset,h=void 0===f?0:f;vm(e,sn(t,i),n,r),e.attrs=e.style,e.style={};var p=e.attrs,v=e.style,g=e.dimensions;p.transform&&(g&&(v.transform=p.transform),delete p.transform),g&&(void 0!==s||void 0!==l||v.transform)&&(v.transformOrigin=function(e,t,n){var r=_m(t,e.x,e.width),o=_m(n,e.y,e.height);return"".concat(r," ").concat(o)}(g,void 0!==s?s:.5,void 0!==l?l:.5)),void 0!==o&&(p.x=o),void 0!==a&&(p.y=a),void 0!==u&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];e.pathLength=1;var i=o?Em:Pm;e[i.offset]=Ug.transform(-r);var a=Ug.transform(t),s=Ug.transform(n);e[i.array]="".concat(a," ").concat(s)}(p,u,d,h,!1)}var Om=function(){return un(un({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{},{attrs:{}})};function Am(e,t){var n=cr.useMemo((function(){var n=Om();return Lm(n,t,{enableHardwareAcceleration:!1},e.transformTemplate),un(un({},n.attrs),{},{style:un({},n.style)})}),[t]);if(e.style){var r={};mm(r,e.style,e),n.style=un(un({},r),n.style)}return n}function Mm(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=function(t,n,r,o,i,a){var s=i.latestValues,l=(xg(t)?Am:bm)(n,s,a),u=un(un(un({},Cm(n,"string"==typeof t,e)),l),{},{ref:o});return r&&(u["data-projection-id"]=r),cr.createElement(t,u)};return t}var Tm=function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()};function Im(e,t,n,r){var o=t.style,i=t.vars;for(var a in Object.assign(e.style,o,r&&r.getProjectionStyles(n)),i)e.style.setProperty(a,i[a])}var Rm=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function Nm(e,t,n,r){for(var o in Im(e,t,void 0,r),t.attrs)e.setAttribute(Rm.has(o)?o:Tm(o),t.attrs[o])}function Dm(e){var t=e.style,n={};for(var r in t)(Pg(t[r])||Eg(r,e))&&(n[r]=t[r]);return n}function zm(e){var t=Dm(e);for(var n in e){if(Pg(e[n]))t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function jm(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),t}var Bm=function(e){return Array.isArray(e)},Fm=function(e){return Bm(e)?e[e.length-1]||0:e};function Hm(e){var t=Pg(e)?e.get():e;return function(e){return Boolean(e&&"object"===kn(e)&&e.mix&&e.toValue)}(t)?t.toValue():t}var Vm=function(e){return function(t,n){var r=cr.useContext($v),o=cr.useContext(Kv),i=function(){return function(e,t,n,r){var o=e.scrapeMotionValuesFromProps,i=e.createRenderState,a=e.onMount,s={latestValues:Wm(t,n,r,o),renderState:i()};return a&&(s.mount=function(e){return a(t,e,s)}),s}(e,t,r,o)};return n?i():fg(i)}};function Wm(e,t,n,r){var o={},i=r(e);for(var s in i)o[s]=Hm(i[s]);var l=e.initial,u=e.animate,c=ag(e),d=sg(e);t&&d&&!c&&!1!==e.inherit&&(void 0===l&&(l=t.initial),void 0===u&&(u=t.animate));var f=!!n&&!1===n.initial,h=(f=f||!1===l)?u:l;h&&"boolean"!=typeof h&&!og(h)&&(Array.isArray(h)?h:[h]).forEach((function(t){var n=jm(e,t);if(n){var r=n.transitionEnd,i=(n.transition,sn(n,a));for(var s in i){var l=i[s];if(Array.isArray(l))l=l[f?l.length-1:0];null!==l&&(o[s]=l)}for(var u in r)o[u]=r[u]}}));return o}var Um,Gm={useVisualState:Vm({scrapeMotionValuesFromProps:zm,createRenderState:Om,onMount:function(e,t,n){var r=n.renderState,o=n.latestValues;try{r.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(Dhe){r.dimensions={x:0,y:0,width:0,height:0}}Lm(r,o,{enableHardwareAcceleration:!1},e.transformTemplate),Nm(t,r)}})},qm={useVisualState:Vm({scrapeMotionValuesFromProps:Dm,createRenderState:gm})};function Ym(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!0};return e.addEventListener(t,n,r),function(){return e.removeEventListener(t,n)}}function Zm(e,t,n,r){cr.useEffect((function(){var o=e.current;if(n&&o)return Ym(o,t,n,r)}),[e,t,n,r])}function Xm(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function $m(e){return!!e.touches}function Km(e){return function(t){var n=t instanceof MouseEvent;(!n||n&&0===t.button)&&e(t)}}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"}(Um||(Um={}));var Qm={pageX:0,pageY:0};function Jm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page",n=e.touches[0]||e.changedTouches[0],r=n||Qm;return{x:r[t+"X"],y:r[t+"Y"]}}function ey(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return{x:e[t+"X"],y:e[t+"Y"]}}function ty(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return{point:$m(e)?Jm(e,t):ey(e,t)}}var ny=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t){return e(t,ty(t))};return t?Km(n):n},ry={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},oy={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function iy(e){return Qv&&null===window.onpointerdown?e:Qv&&null===window.ontouchstart?oy[e]:Qv&&null===window.onmousedown?ry[e]:e}function ay(e,t,n,r){return Ym(e,iy(t),ny(n,"pointerdown"===t),r)}function sy(e,t,n,r){return Zm(e,iy(t),n&&ny(n,"pointerdown"===t),r)}function ly(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var uy=ly("dragHorizontal"),cy=ly("dragVertical");function dy(e){var t=!1;if("y"===e)t=cy();else if("x"===e)t=uy();else{var n=uy(),r=cy();n&&r?t=function(){n(),r()}:(n&&n(),r&&r())}return t}function fy(){var e=dy(!0);return!e||(e(),!1)}function hy(e,t,n){return function(r,o){Xm(r)&&!fy()&&(e.animationState&&e.animationState.setActive(Um.Hover,t),n&&n(r,o))}}var py=function e(t,n){return!!n&&(t===n||e(t,n.parentElement))};function vy(e){return cr.useEffect((function(){return function(){return e()}}),[])}function gy(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0?-1:1)*((r-i)*a)/s}):(t=function(e){return Math.exp(-e*o)*((e-l)*o+1)-.001},n=function(e){return Math.exp(-e*o)*(o*o*(l-e))});var f=function(e,t,n){for(var r=n,o=1;o<12;o++)r-=e(r)/t(r);return r}(t,n,5/o);if(o*=1e3,isNaN(f))return{stiffness:100,damping:10,duration:o};var h=Math.pow(f,2)*c;return{stiffness:h,damping:2*d*Math.sqrt(c*h),duration:o}}function wy(e,t){return e*Math.sqrt(1-t*t)}var ky=["duration","bounce"],xy=["stiffness","damping","mass"];function Sy(e,t){return t.some((function(t){return void 0!==e[t]}))}function Cy(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,i=e.restSpeed,a=void 0===i?2:i,s=e.restDelta,l=gy(e,["from","to","restSpeed","restDelta"]),u={done:!1,value:n},c=function(e){var t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Sy(e,xy)&&Sy(e,ky)){var n=by(e);(t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(l),d=c.stiffness,f=c.damping,h=c.mass,p=c.velocity,v=c.duration,g=c.isResolvedFromDuration,m=_y,y=_y;function b(){var e=p?-p/1e3:0,t=o-n,r=f/(2*Math.sqrt(d*h)),i=Math.sqrt(d/h)/1e3;if(void 0===s&&(s=Math.min(Math.abs(o-n)/100,.4)),r<1){var a=wy(i,r);m=function(n){var s=Math.exp(-r*i*n);return o-s*((e+r*i*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},y=function(n){var o=Math.exp(-r*i*n);return r*i*o*(Math.sin(a*n)*(e+r*i*t)/a+t*Math.cos(a*n))-o*(Math.cos(a*n)*(e+r*i*t)-a*t*Math.sin(a*n))}}else if(1===r)m=function(n){return o-Math.exp(-i*n)*(t+(e+i*t)*n)};else{var l=i*Math.sqrt(r*r-1);m=function(n){var a=Math.exp(-r*i*n),s=Math.min(l*n,300);return o-a*((e+r*i*t)*Math.sinh(s)+l*t*Math.cosh(s))/l}}}return b(),{next:function(e){var t=m(e);if(g)u.done=e>=v;else{var n=1e3*y(e),r=Math.abs(n)<=a,i=Math.abs(o-t)<=s;u.done=r&&i}return u.value=u.done?o:t,u},flipTarget:function(){p=-p;var e=[o,n];n=e[0],o=e[1],b()}}}Cy.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var _y=function(e){return 0},Ey=function(e,t,n){var r=t-e;return 0===r?1:(n-e)/r},Py=function(e,t,n){return-n*e+n*t+e};function Ly(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Oy(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha;t/=360,r/=100;var i=0,a=0,s=0;if(n/=100){var l=r<.5?r*(1+n):r+n-r*n,u=2*r-l;i=Ly(u,l,t+1/3),a=Ly(u,l,t),s=Ly(u,l,t-1/3)}else i=a=s=r;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*s),alpha:o}}var Ay=function(e,t,n){var r=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-r)+r))},My=[em,Jg,$g],Ty=function(e){return My.find((function(t){return t.test(e)}))},Iy=function(e,t){var n=Ty(e),r=Ty(t),o=n.parse(e),i=r.parse(t);n===$g&&(o=Oy(o),n=Jg),r===$g&&(i=Oy(i),r=Jg);var a=Object.assign({},o);return function(e){for(var t in a)"alpha"!==t&&(a[t]=Ay(o[t],i[t],e));return a.alpha=Py(o.alpha,i.alpha,e),n.transform(a)}},Ry=function(e){return"number"==typeof e},Ny=function(e,t){return function(n){return t(e(n))}},Dy=function(){for(var e=arguments.length,t=new Array(e),n=0;n=o.numNumbers?Dy(jy(r.parsed,o.parsed),n):function(n){return"".concat(n>0?t:e)}},Vy=function(e,t){return function(n){return Py(e,t,n)}};function Wy(e,t,n){for(var r=[],o=n||function(e){return"number"==typeof e?Vy:"string"==typeof e?tm.test(e)?Iy:Hy:Array.isArray(e)?jy:"object"===kn(e)?By:void 0}(e[0]),i=e.length-1,a=0;a=e[r]&&(i=r-1,a=!0),!a){for(var s=1;so||s===r);s++);i=s-1}var l=Ey(e[i],e[i+1],o);return t[i](l)}}function qy(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.clamp,o=void 0===r||r,i=n.ease,a=n.mixer,s=e.length;t.length,!i||!Array.isArray(i)||i.length,e[0]>e[s-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var l=Wy(t,i,a),u=2===s?Uy(e,l):Gy(e,l);return o?function(t){return u(my(e[0],e[s-1],t))}:u}var Yy,Zy=function(e){return function(t){return 1-e(1-t)}},Xy=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},$y=function(e){return function(t){return t*t*((e+1)*t-e)}},Ky=function(e){return e},Qy=(Yy=2,function(e){return Math.pow(e,Yy)}),Jy=Zy(Qy),eb=Xy(Qy),tb=function(e){return 1-Math.sin(Math.acos(e))},nb=Zy(tb),rb=Xy(nb),ob=$y(1.525),ib=Zy(ob),ab=Xy(ob),sb=function(e){var t=$y(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),lb=function(e){if(1===e||0===e)return e;var t=e*e;return e<.36363636363636365?7.5625*t:e<.7272727272727273?9.075*t-9.9*e+3.4:e<.9?12.066481994459833*t-19.63545706371191*e+8.898060941828255:10.8*e*e-20.52*e+10.72},ub=Zy(lb);function cb(e,t){return e.map((function(){return t||eb})).splice(0,e.length-1)}function db(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,i=e.ease,a=e.offset,s=e.duration,l=void 0===s?300:s,u={done:!1,value:n},c=Array.isArray(o)?o:[n,o],d=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===c.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(c),l);function f(){return qy(d,c,{ease:Array.isArray(i)?i:cb(c,i)})}var h=f();return{next:function(e){return u.value=h(e),u.done=e>=l,u},flipTarget:function(){c.reverse(),h=f()}}}var fb={keyframes:db,spring:Cy,decay:function(e){var t=e.velocity,n=void 0===t?0:t,r=e.from,o=void 0===r?0:r,i=e.power,a=void 0===i?.8:i,s=e.timeConstant,l=void 0===s?350:s,u=e.restDelta,c=void 0===u?.5:u,d=e.modifyTarget,f={done:!1,value:o},h=a*n,p=o+h,v=void 0===d?p:d(p);return v!==p&&(h=v-o),{next:function(e){var t=-h*Math.exp(-e/l);return f.done=!(t>c||t<-c),f.value=f.done?v:v+t,f},flipTarget:function(){}}}};var hb=1/60*1e3,pb="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},vb="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(pb())}),hb)};var gb=!0,mb=!1,yb=!1,bb={delta:0,timestamp:0},wb=["read","update","preRender","render","postRender"],kb=wb.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],r=0,o=!1,i=!1,a=new WeakSet,s={schedule:function(e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&o,s=i?t:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&a.add(e),-1===s.indexOf(e)&&(s.push(e),i&&o&&(r=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),a.delete(e)},process:function(l){if(o)i=!0;else{o=!0;var u=[n,t];if(t=u[0],(n=u[1]).length=0,r=t.length)for(var c=0;c1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return mb||Eb(),n.schedule(e,t,r)},e}),{}),Sb=wb.reduce((function(e,t){return e[t]=kb[t].cancel,e}),{});wb.reduce((function(e,t){return e[t]=function(){return kb[t].process(bb)},e}),{});var Cb=function(e){return kb[e].process(bb)},_b=function e(t){mb=!1,bb.delta=gb?hb:Math.max(Math.min(t-bb.timestamp,40),1),bb.timestamp=t,yb=!0,wb.forEach(Cb),yb=!1,mb&&(gb=!1,vb(e))},Eb=function(){mb=!0,gb=!0,yb||vb(_b)};function Pb(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e-t-n}var Lb=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return xb.update(t,!0)},stop:function(){return Sb.update(t)}}};function Ob(e){var t,n,r,o,i,a=e.from,s=e.autoplay,l=void 0===s||s,u=e.driver,c=void 0===u?Lb:u,d=e.elapsed,f=void 0===d?0:d,h=e.repeat,p=void 0===h?0:h,v=e.repeatType,g=void 0===v?"loop":v,m=e.repeatDelay,y=void 0===m?0:m,b=e.onPlay,w=e.onStop,k=e.onComplete,x=e.onRepeat,S=e.onUpdate,C=gy(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),_=C.to,E=0,P=C.duration,L=!1,O=!0,A=function(e){if(Array.isArray(e.to))return db;if(fb[e.type])return fb[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?db:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Cy:db}(C);(null===(n=(t=A).needsInterpolation)||void 0===n?void 0:n.call(t,a,_))&&(i=qy([0,100],[a,_],{clamp:!1}),a=0,_=100);var M=A(Object.assign(Object.assign({},C),{from:a,to:_}));function T(){E++,"reverse"===g?f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return r?Pb(t+-e,t,n):t-(e-t)+n}(f,P,y,O=E%2==0):(f=Pb(f,P,y),"mirror"===g&&M.flipTarget()),L=!1,x&&x()}function I(e){if(O||(e=-e),f+=e,!L){var t=M.next(Math.max(0,f));o=t.value,i&&(o=i(o)),L=O?t.done:f<=0}null==S||S(o),L&&(0===E&&(null!=P||(P=f)),E=t+n:e<=-n}(f,P,y,O)&&T():(r.stop(),k&&k()))}return l&&(null==b||b(),(r=c(I)).start()),{stop:function(){null==w||w(),r.stop()}}}function Ab(e,t){return t?e*(1e3/t):0}function Mb(e){var t,n=e.from,r=void 0===n?0:n,o=e.velocity,i=void 0===o?0:o,a=e.min,s=e.max,l=e.power,u=void 0===l?.8:l,c=e.timeConstant,d=void 0===c?750:c,f=e.bounceStiffness,h=void 0===f?500:f,p=e.bounceDamping,v=void 0===p?10:p,g=e.restDelta,m=void 0===g?1:g,y=e.modifyTarget,b=e.driver,w=e.onUpdate,k=e.onComplete,x=e.onStop;function S(e){return void 0!==a&&es}function C(e){return void 0===a?s:void 0===s||Math.abs(a-e)A||-1===M&&e=.001?function(e,t,n,r){for(var o=0;o<8;++o){var i=Fb(t,n,r);if(0===i)return t;t-=(Bb(t,n,r)-e)/i}return t}(t,a,e,n):0===s?a:function(e,t,n,r,o){var i,a,s=0;do{(i=Bb(a=t+(n-t)/2,r,o)-e)>0?n=a:t=a}while(Math.abs(i)>1e-7&&++s<10);return a}(t,r,r+Hb,e,n)}return function(e){return 0===e||1===e?e:Bb(a(e),t,r)}}var Wb=("undefined"==typeof process||process.env,"production"),Ub=new Set;function Gb(e,t,n){e||Ub.has(t)||(console.warn(t),n&&console.warn(n),Ub.add(t))}var qb=new WeakMap,Yb=new WeakMap,Zb=function(e){var t=qb.get(e.target);t&&t(e)},Xb=function(e){e.forEach(Zb)};function $b(e,t,n){var r=function(e){var t=e.root,n=sn(e,s),r=t||document;Yb.has(r)||Yb.set(r,{});var o=Yb.get(r),i=JSON.stringify(n);return o[i]||(o[i]=new IntersectionObserver(Xb,un({root:t},n))),o[i]}(t);return qb.set(e,n),r.observe(e),function(){qb.delete(e),r.unobserve(e)}}var Kb={some:0,all:1};function Qb(e,t,n,r){var o=r.root,i=r.margin,a=r.amount,s=void 0===a?"some":a,l=r.once;cr.useEffect((function(){if(e&&n.current){var r={root:null==o?void 0:o.current,rootMargin:i,threshold:"number"==typeof s?s:Kb[s]};return $b(n.current,r,(function(e){var r=e.isIntersecting;if(t.isInView!==r&&(t.isInView=r,!l||r||!t.hasEnteredView)){r&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(Um.InView,r);var o=n.getProps(),i=r?o.onViewportEnter:o.onViewportLeave;i&&i(e)}}))}}),[e,o,i,s])}function Jb(e,t,n,r){var o=r.fallback,i=void 0===o||o;cr.useEffect((function(){e&&i&&("production"!==Wb&&Gb(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame((function(){t.hasEnteredView=!0;var e=n.getProps().onViewportEnter;e&&e(null),n.animationState&&n.animationState.setActive(Um.InView,!0)})))}),[e])}var ew=function(e){return function(t){return e(t),null}},tw={inView:ew((function(e){var t=e.visualElement,n=e.whileInView,r=e.onViewportEnter,o=e.onViewportLeave,i=e.viewport,a=void 0===i?{}:i,s=cr.useRef({hasEnteredView:!1,isInView:!1}),l=Boolean(n||r||o);a.once&&s.current.hasEnteredView&&(l=!1),("undefined"==typeof IntersectionObserver?Jb:Qb)(l,s.current,t,a)})),tap:ew((function(e){var t=e.onTap,n=e.onTapStart,r=e.onTapCancel,o=e.whileTap,i=e.visualElement,a=t||n||r||o,s=cr.useRef(!1),l=cr.useRef(null),u={passive:!(n||t||r||p)};function c(){l.current&&l.current(),l.current=null}function d(){return c(),s.current=!1,i.animationState&&i.animationState.setActive(Um.Tap,!1),!fy()}function f(e,n){d()&&(py(i.current,e.target)?t&&t(e,n):r&&r(e,n))}function h(e,t){d()&&r&&r(e,t)}function p(e,t){c(),s.current||(s.current=!0,l.current=Dy(ay(window,"pointerup",f,u),ay(window,"pointercancel",h,u)),i.animationState&&i.animationState.setActive(Um.Tap,!0),n&&n(e,t))}sy(i,"pointerdown",a?p:void 0,u),vy(c)})),focus:ew((function(e){var t=e.whileFocus,n=e.visualElement,r=n.animationState;Zm(n,"focus",t?function(){r&&r.setActive(Um.Focus,!0)}:void 0),Zm(n,"blur",t?function(){r&&r.setActive(Um.Focus,!1)}:void 0)})),hover:ew((function(e){var t=e.onHoverStart,n=e.onHoverEnd,r=e.whileHover,o=e.visualElement;sy(o,"pointerenter",t||r?hy(o,!0,t):void 0,{passive:!t}),sy(o,"pointerleave",n||r?hy(o,!1,n):void 0,{passive:!n})}))};function nw(){var e=cr.useContext(Kv);if(null===e)return[!0,null];var t=e.isPresent,n=e.onExitComplete,r=e.register,o=cr.useId();cr.useEffect((function(){return r(o)}),[]);return!t&&n?[!1,function(){return n&&n(o)}]:[!0]}function rw(){return null===(e=cr.useContext(Kv))||e.isPresent;var e}function ow(e,t){if(!Array.isArray(t))return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r2&&void 0!==arguments[2]&&arguments[2]&&o,s=i?t:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&a.add(e),-1===s.indexOf(e)&&(s.push(e),i&&o&&(r=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),a.delete(e)},process:function(l){if(o)i=!0;else{o=!0;var u=[n,t];if(t=u[0],(n=u[1]).length=0,r=t.length)for(var c=0;c1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return xw||Tw(),n.schedule(e,t,r)},e}),{}),Lw=_w.reduce((function(e,t){return e[t]=Ew[t].cancel,e}),{}),Ow=_w.reduce((function(e,t){return e[t]=function(){return Ew[t].process(Cw)},e}),{}),Aw=function(e){return Ew[e].process(Cw)},Mw=function e(t){xw=!1,Cw.delta=kw?yw:Math.max(Math.min(t-Cw.timestamp,40),1),Cw.timestamp=t,Sw=!0,_w.forEach(Aw),Sw=!1,xw&&(kw=!1,ww(e))},Tw=function(){xw=!0,kw=!0,Sw||ww(Mw)},Iw=function(){return Cw};function Rw(e,t){var n=performance.now(),r=function r(o){var i=o.timestamp-n;i>=t&&(Lw.read(r),e(i-t))};return Pw.read(r,!0),function(){return Lw.read(r)}}function Nw(e){var t=e.ease,n=e.times,r=e.yoyo,o=e.flip,i=e.loop,a=sn(e,u),s=un({},a);return n&&(s.offset=n),a.duration&&(s.duration=iw(a.duration)),a.repeatDelay&&(s.repeatDelay=iw(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!=typeof e[0]}(t)?t.map(sw):sw(t)),"tween"===a.type&&(s.type="keyframes"),(r||i||o)&&(r?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||r||o||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function Dw(e,t){var n,r;return null!==(r=null!==(n=(Hw(e,t)||{}).delay)&&void 0!==n?n:e.delay)&&void 0!==r?r:0}function zw(e,t,n){var r,o;return Array.isArray(t.to)&&void 0===e.duration&&(e.duration=.8),function(e){Array.isArray(e.to)&&null===e.to[0]&&(e.to=cn(e.to),e.to[0]=e.from)}(t),function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=sn(e,l);return!!Object.keys(t).length}(e)||(e=un(un({},e),(r=n,un({to:o=t.to},(Bm(o)?fw:hw[r]||hw.default)(o))))),un(un({},t),Nw(e))}function jw(e,t,n,r,o){var i=Hw(r,e)||{},a=void 0!==i.from?i.from:t.get(),s=lw(e,n);return"none"===a&&s&&"string"==typeof n?a=gw(e,n):Bw(a)&&"string"==typeof n?a=Fw(n):!Array.isArray(n)&&Bw(n)&&"string"==typeof a&&(n=Fw(a)),lw(e,a)&&s&&!1!==i.type?function(){var r={from:a,to:n,velocity:t.getVelocity(),onComplete:o,onUpdate:function(e){return t.set(e)}};return"inertia"===i.type||"decay"===i.type?Mb(un(un({},r),i)):Ob(un(un({},zw(i,r,e)),{},{onUpdate:function(e){r.onUpdate(e),i.onUpdate&&i.onUpdate(e)},onComplete:function(){r.onComplete(),i.onComplete&&i.onComplete()}}))}:function(){var e=Fm(n);return t.set(e),o(),i.onUpdate&&i.onUpdate(e),i.onComplete&&i.onComplete(),{stop:function(){}}}}function Bw(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function Fw(e){return"number"==typeof e?0:gw("",e)}function Hw(e,t){return e[t]||e.default||e}function Vw(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return mw&&(r={type:!1}),t.start((function(o){var i,a,s=jw(e,t,n,r,o),l=Dw(r,e),u=function(){return i=s()};return l?a=Rw(u,iw(l)):u(),function(){a&&a(),i&&i.stop()}}))}var Ww=function(e){return/^\-?\d*\.?\d+$/.test(e)},Uw=function(e){return/^0[^.\s]+$/.test(e)};function Gw(e,t){-1===e.indexOf(t)&&e.push(t)}function qw(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var Yw=function(){function e(){an(this,e),this.subscriptions=[]}return on(e,[{key:"add",value:function(e){var t=this;return Gw(this.subscriptions,e),function(){return qw(t.subscriptions,e)}}},{key:"notify",value:function(e,t,n){var r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(var o=0;o1&&void 0!==arguments[1])||arguments[1];n.prev=n.current,n.current=e;var r=Iw(),o=r.delta,i=r.timestamp;n.lastUpdated!==i&&(n.timeDelta=o,n.lastUpdated=i,Pw.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),t&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return Pw.postRender(n.velocityCheck)},this.velocityCheck=function(e){e.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=function(e){return!isNaN(parseFloat(e))}(this.current)}return on(e,[{key:"onChange",value:function(e){return this.updateSubscribers.add(e)}},{key:"clearListeners",value:function(){this.updateSubscribers.clear()}},{key:"onRenderRequest",value:function(e){return e(this.get()),this.renderSubscribers.add(e)}},{key:"attach",value:function(e){this.passiveEffect=e}},{key:"set",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}},{key:"get",value:function(){return this.current}},{key:"getPrevious",value:function(){return this.prev}},{key:"getVelocity",value:function(){return this.canTrackVelocity?Ab(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}},{key:"start",value:function(e){var t=this;return this.stop(),new Promise((function(n){t.hasAnimated=!0,t.stopAnimation=e(n)})).then((function(){return t.clearAnimation()}))}},{key:"stop",value:function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}},{key:"isAnimating",value:function(){return!!this.stopAnimation}},{key:"clearAnimation",value:function(){this.stopAnimation=null}},{key:"destroy",value:function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}]),e}();function Xw(e){return new Zw(e)}var $w=function(e){return function(t){return t.test(e)}},Kw=[jg,Ug,Wg,Vg,qg,Gg,{test:function(e){return"auto"===e},parse:function(e){return e}}],Qw=function(e){return Kw.find($w(e))},Jw=[].concat(Kw,[tm,lm]),ek=function(e){return Jw.find($w(e))};function tk(e,t,n){var r=e.getProps();return jm(r,t,void 0!==n?n:r.custom,function(e){var t={};return e.values.forEach((function(e,n){return t[n]=e.get()})),t}(e),function(e){var t={};return e.values.forEach((function(e,n){return t[n]=e.getVelocity()})),t}(e))}function nk(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xw(n))}function rk(e,t){var n=tk(e,t),r=n?e.makeTargetAnimatable(n,!1):{},o=r.transitionEnd,i=void 0===o?{}:o,a=(r.transition,sn(r,c));for(var s in a=un(un({},a),i)){nk(e,s,Fm(a[s]))}}function ok(e,t){if(t)return(t[e]||t.default||t).from}function ik(e){return Boolean(Pg(e)&&e.add)}function ak(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=tk(e,t,r.custom),i=o||{},a=i.transition,s=void 0===a?e.getDefaultTransition()||{}:a;r.transitionOverride&&(s=r.transitionOverride);var l=o?function(){return sk(e,o,r)}:function(){return Promise.resolve()},u=(null===(n=e.variantChildren)||void 0===n?void 0:n.size)?function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=s,i=o.delayChildren,a=void 0===i?0:i,l=o.staggerChildren,u=o.staggerDirection;return lk(e,t,a+n,l,u,r)}:function(){return Promise.resolve()},c=s,d=c.when;if(d){var f="beforeChildren"===d?[l,u]:[u,l],h=yn(f,2),p=h[0],v=h[1];return p().then(v)}return Promise.all([l(),u(r.delay)])}function sk(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.delay,i=void 0===o?0:o,a=r.transitionOverride,s=r.type,l=e.makeTargetAnimatable(t),u=l.transition,c=void 0===u?e.getDefaultTransition():u,f=l.transitionEnd,h=sn(l,d),p=e.getValue("willChange");a&&(c=a);var v=[],g=s&&(null===(n=e.animationState)||void 0===n?void 0:n.getState()[s]),m=function(t){var n=e.getValue(t),r=h[t];if(!n||void 0===r||g&&ck(g,t))return"continue";var o=un({delay:i},c);e.shouldReduceMotion&&_g.has(t)&&(o=un(un({},o),{},{type:!1,delay:0}));var a=Vw(t,n,r,o);ik(p)&&(p.add(t),a=a.then((function(){return p.remove(t)}))),v.push(a)};for(var y in h)m(y);return Promise.all(v).then((function(){f&&rk(e,f)}))}function lk(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=arguments.length>5?arguments[5]:void 0,a=[],s=(e.variantChildren.size-1)*r,l=1===o?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e*r}:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return s-e*r};return Array.from(e.variantChildren).sort(uk).forEach((function(e,r){a.push(ak(e,t,un(un({},i),{},{delay:n+l(r)})).then((function(){return e.notify("AnimationComplete",t)})))})),Promise.all(a)}function uk(e,t){return e.sortNodePosition(t)}function ck(e,t){var n=e.protectedKeys,r=e.needsAnimating,o=n.hasOwnProperty(t)&&!0!==r[t];return r[t]=!1,o}var dk=[Um.Animate,Um.InView,Um.Focus,Um.Hover,Um.Tap,Um.Drag,Um.Exit],fk=[].concat(dk).reverse(),hk=dk.length;function pk(e){return function(t){return Promise.all(t.map((function(t){var n=t.animation,r=t.options;return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.notify("AnimationStart",t),Array.isArray(t)){var o=t.map((function(t){return ak(e,t,r)}));n=Promise.all(o)}else if("string"==typeof t)n=ak(e,t,r);else{var i="function"==typeof t?tk(e,t,r.custom):t;n=sk(e,i,r)}return n.then((function(){return e.notify("AnimationComplete",t)}))}(e,n,r)})))}}function vk(e){var t,n=pk(e),r=(gn(t={},Um.Animate,gk(!0)),gn(t,Um.InView,gk()),gn(t,Um.Hover,gk()),gn(t,Um.Tap,gk()),gn(t,Um.Drag,gk()),gn(t,Um.Focus,gk()),gn(t,Um.Exit,gk()),t),o=!0,i=function(t,n){var r=tk(e,n);if(r){r.transition;var o=r.transitionEnd,i=sn(r,f);t=un(un(un({},t),i),o)}return t};function a(t,a){for(var s,l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],d=new Set,f={},h=1/0,p=function(){var n=fk[v],p=r[n],g=null!==(s=l[n])&&void 0!==s?s:u[n],m=rg(g),y=n===a?p.isActive:null;!1===y&&(h=v);var b=g===u[n]&&g!==l[n]&&m;if(b&&o&&e.manuallyAnimateOnMount&&(b=!1),p.protectedKeys=un({},f),!p.isActive&&null===y||!g&&!p.prevProp||og(g)||"boolean"==typeof g)return"continue";var w=function(e,t){if("string"==typeof t)return t!==e;if(Array.isArray(t))return!ow(t,e);return!1}(p.prevProp,g),k=w||n===a&&p.isActive&&!b&&m||v>h&&m,x=Array.isArray(g)?g:[g],S=x.reduce(i,{});!1===y&&(S={});var C=p.prevResolvedValues,_=void 0===C?{}:C,E=un(un({},_),S),P=function(e){k=!0,d.delete(e),p.needsAnimating[e]=!0};for(var L in E){var O=S[L],A=_[L];f.hasOwnProperty(L)||(O!==A?Bm(O)&&Bm(A)?!ow(O,A)||w?P(L):p.protectedKeys[L]=!0:void 0!==O?P(L):d.add(L):void 0!==O&&d.has(L)?P(L):p.protectedKeys[L]=!0)}p.prevProp=g,p.prevResolvedValues=S,p.isActive&&(f=un(un({},f),S)),o&&e.blockInitialAnimation&&(k=!1),k&&!b&&c.push.apply(c,cn(x.map((function(e){return{animation:e,options:un({type:n},t)}}))))},v=0;v0&&void 0!==arguments[0]&&arguments[0];return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var mk={animation:ew((function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=vk(t)),og(n)&&cr.useEffect((function(){return n.subscribe(t)}),[n])})),exit:ew((function(e){var t=e.custom,n=e.visualElement,r=yn(nw(),2),o=r[0],i=r[1],a=cr.useContext(Kv);cr.useEffect((function(){n.isPresent=o;var e=n.animationState&&n.animationState.setActive(Um.Exit,!o,{custom:a&&a.custom||t});e&&!o&&e.then(i)}),[o])}))},yk=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.transformPagePoint;if(an(this,e),this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(r.lastMoveEvent&&r.lastMoveEventInfo){var e=kk(r.lastMoveEventInfo,r.history),t=null!==r.startEvent,n=Nb(e.offset,{x:0,y:0})>=3;if(t||n){var o=e.point,i=Iw().timestamp;r.history.push(un(un({},o),{},{timestamp:i}));var a=r.handlers,s=a.onStart,l=a.onMove;t||(s&&s(r.lastMoveEvent,e),r.startEvent=r.lastMoveEvent),l&&l(r.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){r.lastMoveEvent=e,r.lastMoveEventInfo=bk(t,r.transformPagePoint),Xm(e)&&0===e.buttons?r.handlePointerUp(e,t):Pw.update(r.updatePoint,!0)},this.handlePointerUp=function(e,t){r.end();var n=r.handlers,o=n.onEnd,i=n.onSessionEnd,a=kk(bk(t,r.transformPagePoint),r.history);r.startEvent&&o&&o(e,a),i&&i(e,a)},!($m(t)&&t.touches.length>1)){this.handlers=n,this.transformPagePoint=i;var a=ty(t),s=bk(a,this.transformPagePoint),l=s.point,u=Iw(),c=u.timestamp;this.history=[un(un({},l),{},{timestamp:c})];var d=n.onSessionStart;d&&d(t,kk(s,this.history)),this.removeListeners=Dy(ay(window,"pointermove",this.handlePointerMove),ay(window,"pointerup",this.handlePointerUp),ay(window,"pointercancel",this.handlePointerUp))}}return on(e,[{key:"updateHandlers",value:function(e){this.handlers=e}},{key:"end",value:function(){this.removeListeners&&this.removeListeners(),Lw.update(this.updatePoint)}}]),e}();function bk(e,t){return t?{point:t(e.point)}:e}function wk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kk(e,t){var n=e.point;return{point:n,delta:wk(n,Sk(t)),offset:wk(n,xk(t)),velocity:Ck(t,.1)}}function xk(e){return e[0]}function Sk(e){return e[e.length-1]}function Ck(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,r=null,o=Sk(e);n>=0&&(r=e[n],!(o.timestamp-r.timestamp>iw(t)));)n--;if(!r)return{x:0,y:0};var i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};var a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function _k(e){return e.max-e.min}function Ek(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return Nb(e,t)3&&void 0!==arguments[3]?arguments[3]:.5;e.origin=r,e.originPoint=Py(t.min,t.max,e.origin),e.scale=_k(n)/_k(t),(Ek(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Py(n.min,n.max,e.origin)-e.originPoint,(Ek(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Lk(e,t,n,r){Pk(e.x,t.x,n.x,null==r?void 0:r.originX),Pk(e.y,t.y,n.y,null==r?void 0:r.originY)}function Ok(e,t,n){e.min=n.min+t.min,e.max=e.min+_k(t)}function Ak(e,t,n){e.min=t.min-n.min,e.max=e.min+_k(t)}function Mk(e,t,n){Ak(e.x,t.x,n.x),Ak(e.y,t.y,n.y)}function Tk(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ik(e,t){var n=t.min-e.min,r=t.max-e.max;if(t.max-t.min1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;e.min=Gk(e.min,t,n,r,o),e.max=Gk(e.max,t,n,r,o)}function Yk(e,t){var n=t.x,r=t.y;qk(e.x,n.translate,n.scale,n.originPoint),qk(e.y,r.translate,r.scale,r.originPoint)}function Zk(e,t){e.min=e.min+t,e.max=e.max+t}function Xk(e,t,n){var r=yn(n,3),o=r[0],i=r[1],a=r[2],s=void 0!==t[a]?t[a]:.5,l=Py(e.min,e.max,s);qk(e,t[o],t[i],l,t.scale)}var $k=["x","scaleX","originX"],Kk=["y","scaleY","originY"];function Qk(e,t){Xk(e.x,t,$k),Xk(e.y,t,Kk)}function Jk(e,t){return jk(function(e,t){if(!t)return e;var n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}var ex=new WeakMap,tx=function(){function e(t){an(this,e),this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}return on(e,[{key:"start",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.snapToCursor,o=void 0!==r&&r;if(!1!==this.visualElement.isPresent){var i=function(e){t.stopAnimation(),o&&t.snapToCursor(ty(e,"page").point)},a=function(e,n){var r,o=t.getProps(),i=o.drag,a=o.dragPropagation,s=o.onDragStart;(!i||a||(t.openGlobalLock&&t.openGlobalLock(),t.openGlobalLock=dy(i),t.openGlobalLock))&&(t.isDragging=!0,t.currentDirection=null,t.resolveConstraints(),t.visualElement.projection&&(t.visualElement.projection.isAnimationBlocked=!0,t.visualElement.projection.target=void 0),zk((function(e){var n,r,o=t.getAxisMotionValue(e).get()||0;if(Wg.test(o)){var i=null===(r=null===(n=t.visualElement.projection)||void 0===n?void 0:n.layout)||void 0===r?void 0:r.layoutBox[e];if(i)o=_k(i)*(parseFloat(o)/100)}t.originPoint[e]=o})),null==s||s(e,n),null===(r=t.visualElement.animationState)||void 0===r||r.setActive(Um.Drag,!0))},s=function(e,n){var r=t.getProps(),o=r.dragPropagation,i=r.dragDirectionLock,a=r.onDirectionLock,s=r.onDrag;if(o||t.openGlobalLock){var l=n.offset;if(i&&null===t.currentDirection)return t.currentDirection=rx(l),void(null!==t.currentDirection&&(null==a||a(t.currentDirection)));t.updateAxis("x",n.point,l),t.updateAxis("y",n.point,l),t.visualElement.render(),null==s||s(e,n)}},l=function(e,n){return t.stop(e,n)};this.panSession=new yk(e,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:l},{transformPagePoint:this.visualElement.getTransformPagePoint()})}}},{key:"stop",value:function(e,t){var n=this.isDragging;if(this.cancel(),n){var r=t.velocity;this.startAnimation(r);var o=this.getProps().onDragEnd;null==o||o(e,t)}}},{key:"cancel",value:function(){var e,t;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0,!this.getProps().dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(Um.Drag,!1)}},{key:"updateAxis",value:function(e,t,n){var r=this.getProps().drag;if(n&&nx(e,r,this.currentDirection)){var o=this.getAxisMotionValue(e),i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,t,n){var r=t.min,o=t.max;return void 0!==r&&eo&&(e=n?Py(o,e,n.max):Math.min(e,o)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}}},{key:"resolveConstraints",value:function(){var e=this,t=this.getProps(),n=t.dragConstraints,r=t.dragElastic,o=(this.visualElement.projection||{}).layout,i=this.constraints;n&&ng(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!n||!o)&&function(e,t){var n=t.top,r=t.left,o=t.bottom,i=t.right;return{x:Tk(e.x,r,i),y:Tk(e.y,n,o)}}(o.layoutBox,n),this.elastic=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rk;return!1===e?e=0:!0===e&&(e=Rk),{x:Nk(e,"left","right"),y:Nk(e,"top","bottom")}}(r),i!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&zk((function(t){e.getAxisMotionValue(t)&&(e.constraints[t]=function(e,t){var n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(o.layoutBox[t],e.constraints[t]))}))}},{key:"resolveRefConstraints",value:function(){var e=this.getProps(),t=e.dragConstraints,n=e.onMeasureDragConstraints;if(!t||!ng(t))return!1;var r=t.current,o=this.visualElement.projection;if(!o||!o.layout)return!1;var i=function(e,t,n){var r=Jk(e,n),o=t.scroll;return o&&(Zk(r.x,o.offset.x),Zk(r.y,o.offset.y)),r}(r,o.root,this.visualElement.getTransformPagePoint()),a=function(e,t){return{x:Ik(e.x,t.x),y:Ik(e.y,t.y)}}(o.layout.layoutBox,i);if(n){var s=n(function(e){var t=e.x,n=e.y;return{top:n.min,right:t.max,bottom:n.max,left:t.min}}(a));this.hasMutatedConstraints=!!s,s&&(a=jk(s))}return a}},{key:"startAnimation",value:function(e){var t=this,n=this.getProps(),r=n.drag,o=n.dragMomentum,i=n.dragElastic,a=n.dragTransition,s=n.dragSnapToOrigin,l=n.onDragTransitionEnd,u=this.constraints||{},c=zk((function(n){var l;if(nx(n,r,t.currentDirection)){var c=null!==(l=null==u?void 0:u[n])&&void 0!==l?l:{};s&&(c={min:0,max:0});var d=i?200:1e6,f=i?40:1e7,h=un(un({type:"inertia",velocity:o?e[n]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10},a),c);return t.startAxisValueAnimation(n,h)}}));return Promise.all(c).then(l)}},{key:"startAxisValueAnimation",value:function(e,t){return Vw(e,this.getAxisMotionValue(e),0,t)}},{key:"stopAnimation",value:function(){var e=this;zk((function(t){return e.getAxisMotionValue(t).stop()}))}},{key:"getAxisMotionValue",value:function(e){var t,n,r="_drag"+e.toUpperCase(),o=this.visualElement.getProps()[r];return o||this.visualElement.getValue(e,null!==(n=null===(t=this.visualElement.getProps().initial)||void 0===t?void 0:t[e])&&void 0!==n?n:0)}},{key:"snapToCursor",value:function(e){var t=this;zk((function(n){if(nx(n,t.getProps().drag,t.currentDirection)){var r=t.visualElement.projection,o=t.getAxisMotionValue(n);if(r&&r.layout){var i=r.layout.layoutBox[n],a=i.min,s=i.max;o.set(e[n]-Py(a,s,.5))}}}))}},{key:"scalePositionWithinConstraints",value:function(){var e,t=this;if(this.visualElement.current){var n=this.getProps(),r=n.drag,o=n.dragConstraints,i=this.visualElement.projection;if(ng(o)&&i&&this.constraints){this.stopAnimation();var a={x:0,y:0};zk((function(e){var n,r,o,i,s,l=t.getAxisMotionValue(e);if(l){var u=l.get();a[e]=(n={min:u,max:u},r=t.constraints[e],o=.5,i=_k(n),(s=_k(r))>i?o=Ey(r.min,r.max-i,n.min):i>s&&(o=Ey(n.min,n.max-s,r.min)),my(0,1,o))}}));var s=this.visualElement.getProps().transformTemplate;this.visualElement.current.style.transform=s?s({},""):"none",null===(e=i.root)||void 0===e||e.updateScroll(),i.updateLayout(),this.resolveConstraints(),zk((function(e){if(nx(e,r,null)){var n=t.getAxisMotionValue(e),o=t.constraints[e],i=o.min,s=o.max;n.set(Py(i,s,a[e]))}}))}}}},{key:"addListeners",value:function(){var e,t=this;if(this.visualElement.current){ex.set(this.visualElement,this);var n=ay(this.visualElement.current,"pointerdown",(function(e){var n=t.getProps(),r=n.drag,o=n.dragListener;r&&(void 0===o||o)&&t.start(e)})),r=function(){ng(t.getProps().dragConstraints)&&(t.constraints=t.resolveRefConstraints())},o=this.visualElement.projection,i=o.addEventListener("measure",r);o&&!o.layout&&(null===(e=o.root)||void 0===e||e.updateScroll(),o.updateLayout()),r();var a=Ym(window,"resize",(function(){return t.scalePositionWithinConstraints()})),s=o.addEventListener("didUpdate",(function(e){var n=e.delta,r=e.hasLayoutChanged;t.isDragging&&r&&(zk((function(e){var r=t.getAxisMotionValue(e);r&&(t.originPoint[e]+=n[e].translate,r.set(r.get()+n[e].translate))})),t.visualElement.render())}));return function(){a(),n(),i(),null==s||s()}}}},{key:"getProps",value:function(){var e=this.visualElement.getProps(),t=e.drag,n=void 0!==t&&t,r=e.dragDirectionLock,o=void 0!==r&&r,i=e.dragPropagation,a=void 0!==i&&i,s=e.dragConstraints,l=void 0!==s&&s,u=e.dragElastic,c=void 0===u?Rk:u,d=e.dragMomentum,f=void 0===d||d;return un(un({},e),{},{drag:n,dragDirectionLock:o,dragPropagation:a,dragConstraints:l,dragElastic:c,dragMomentum:f})}}]),e}();function nx(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}function rx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}var ox={pan:ew((function(e){var t=e.onPan,n=e.onPanStart,r=e.onPanEnd,o=e.onPanSessionStart,i=e.visualElement,a=t||n||r||o,s=cr.useRef(null),l=cr.useContext(Xv).transformPagePoint,u={onSessionStart:o,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,r&&r(e,t)}};cr.useEffect((function(){null!==s.current&&s.current.updateHandlers(u)})),sy(i,"pointerdown",a&&function(e){s.current=new yk(e,u,{transformPagePoint:l})}),vy((function(){return s.current&&s.current.end()}))})),drag:ew((function(e){var t=e.dragControls,n=e.visualElement,r=fg((function(){return new tx(n)}));cr.useEffect((function(){return t&&t.subscribe(r)}),[r,t]),cr.useEffect((function(){return r.addListeners()}),[r])}))};function ix(e){return"string"==typeof e&&e.startsWith("var(--")}var ax=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function sx(e){var t=ax.exec(e);if(!t)return[,];var n=yn(t,3);return[n[1],n[2]]}function lx(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=sx(e),o=yn(r,2),i=o[0],a=o[1];if(i){var s=window.getComputedStyle(t).getPropertyValue(i);return s?s.trim():ix(a)?lx(a,t,n+1):a}}var ux,cx=new Set(["width","height","top","left","right","bottom","x","y"]),dx=function(e){return cx.has(e)},fx=function(e,t){e.set(t,!1),e.set(t)},hx=function(e){return e===jg||e===Ug};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(ux||(ux={}));var px=function(e,t){return parseFloat(e.split(", ")[t])},vx=function(e,t){return function(n,r){var o=r.transform;if("none"===o||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return px(i[1],t);var a=o.match(/^matrix\((.+)\)$/);return a?px(a[1],e):0}},gx=new Set(["x","y","z"]),mx=Cg.filter((function(e){return!gx.has(e)}));function yx(e){var t=[];return mx.forEach((function(n){var r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t.length&&e.render(),t}var bx={width:function(e,t){var n=e.x,r=t.paddingLeft,o=void 0===r?"0":r,i=t.paddingRight,a=void 0===i?"0":i;return n.max-n.min-parseFloat(o)-parseFloat(a)},height:function(e,t){var n=e.y,r=t.paddingTop,o=void 0===r?"0":r,i=t.paddingBottom,a=void 0===i?"0":i;return n.max-n.min-parseFloat(o)-parseFloat(a)},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,r=t.top;return parseFloat(r)+(n.max-n.min)},right:function(e,t){var n=e.x,r=t.left;return parseFloat(r)+(n.max-n.min)},x:vx(4,13),y:vx(5,14)},wx=function(e,t,n){var r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),a=i.display,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),n.forEach((function(e){s[e]=bx[e](r,i)})),t.render();var l=t.measureViewportBox();return n.forEach((function(n){var r=t.getValue(n);fx(r,s[n]),e[n]=bx[n](l,i)})),e};function kx(e,t,n,r){return function(e){return Object.keys(e).some(dx)}(t)?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=un({},t),r=un({},r);var o=Object.keys(t).filter(dx),i=[],a=!1,s=[];if(o.forEach((function(o){var l=e.getValue(o);if(e.hasValue(o)){var u,c=n[o],d=Qw(c),f=t[o];if(Bm(f)){var h=f.length,p=null===f[0]?1:0;c=f[p],d=Qw(c);for(var v=p;v=0?window.pageYOffset:null,u=wx(t,e,s);return i.length&&i.forEach((function(t){var n=yn(t,2),r=n[0],o=n[1];e.getValue(r).set(o)})),e.render(),Qv&&null!==l&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}return{target:t,transitionEnd:r}}(e,t,n,r):{target:t,transitionEnd:r}}var xx=function(e,t,n,r){var o=function(e,t,n){var r=Object.assign({},(Kt(t),t)),o=e.current;if(!(o instanceof Element))return{target:r,transitionEnd:n};for(var i in n&&(n=un({},n)),e.values.forEach((function(e){var t=e.get();if(ix(t)){var n=lx(t,o);n&&e.set(n)}})),r){var a=r[i];if(ix(a)){var s=lx(a,o);s&&(r[i]=s,n&&void 0===n[i]&&(n[i]=a))}}return{target:r,transitionEnd:n}}(e,t,r);return kx(e,t=o.target,n,r=o.transitionEnd)},Sx={current:null},Cx={current:!1};var _x=Object.keys(dg),Ex=_x.length,Px=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Lx=function(){function e(t){var n=this,r=t.parent,o=t.props,i=t.reducedMotionConfig,a=t.visualState,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};an(this,e),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=function(){return n.notify("Update",n.latestValues)},this.render=function(){n.current&&(n.triggerBuild(),n.renderInstance(n.current,n.renderState,n.props.style,n.projection))},this.scheduleRender=function(){return Pw.render(n.render,!1,!0)};var l=a.latestValues,u=a.renderState;this.latestValues=l,this.baseTarget=un({},l),this.initialValues=o.initial?un({},l):{},this.renderState=u,this.parent=r,this.props=o,this.depth=r?r.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.isControllingVariants=ag(o),this.isVariantNode=sg(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(r&&r.current);var c=this.scrapeMotionValuesFromProps(o),d=c.willChange,f=sn(c,h);for(var p in f){var v=f[p];void 0!==l[p]&&Pg(v)&&(v.set(l[p],!1),ik(d)&&d.add(p))}}return on(e,[{key:"scrapeMotionValuesFromProps",value:function(e){return{}}},{key:"mount",value:function(e){var t,n=this;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(t=this.parent)||void 0===t?void 0:t.addVariantChild(this)),this.values.forEach((function(e,t){return n.bindToMotionValue(t,e)})),Cx.current||function(){if(Cx.current=!0,Qv)if(window.matchMedia){var e=window.matchMedia("(prefers-reduced-motion)"),t=function(){return Sx.current=e.matches};e.addListener(t),t()}else Sx.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Sx.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}},{key:"unmount",value:function(){var e,t,n;for(var r in null===(e=this.projection)||void 0===e||e.unmount(),Lw.update(this.notifyUpdate),Lw.render(this.render),this.valueSubscriptions.forEach((function(e){return e()})),null===(t=this.removeFromVariantTree)||void 0===t||t.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this),this.events)this.events[r].clear();this.current=null}},{key:"bindToMotionValue",value:function(e,t){var n=this,r=_g.has(e),o=t.onChange((function(t){n.latestValues[e]=t,n.props.onUpdate&&Pw.update(n.notifyUpdate,!1,!0),r&&n.projection&&(n.projection.isProjectionDirty=!0)})),i=t.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(e,(function(){o(),i()}))}},{key:"sortNodePosition",value:function(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}},{key:"loadFeatures",value:function(e,t,n,r,o,i){for(var a=this,s=[],l=0;l1&&void 0!==arguments[1])||arguments[1];return this.makeTargetAnimatableFromInstance(e,this.props,t)}},{key:"setProps",value:function(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=e;for(var t=0;t0&&void 0!==arguments[0]&&arguments[0];if(n)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){var r=(null===(t=this.parent)||void 0===t?void 0:t.getVariantContext())||{};return void 0!==this.props.initial&&(r.initial=this.props.initial),r}for(var o={},i=0;i1?r-1:0),i=1;i5)return o;var l=lm.createTransformer(e),u="number"!=typeof s[0]?1:0,c=r.x.scale*n.x,d=r.y.scale*n.y;s[0+u]/=c,s[1+u]/=d;var f=Py(c,d,.5);"number"==typeof s[2+u]&&(s[2+u]/=f),"number"==typeof s[3+u]&&(s[3+u]/=f);var h=l(s);if(i){var p=0;h=h.replace(zx,(function(){var e=a[p];return p++,e}))}return h}},Bx=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"componentDidMount",value:function(){var e,t=this,n=this.props,r=n.visualElement,o=n.layoutGroup,i=n.switchLayoutGroup,a=n.layoutId,s=r.projection;e=Fx,Object.assign(Sg,e),s&&(o.group&&o.group.add(s),i&&i.register&&a&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",(function(){t.safeToRemove()})),s.setOptions(un(un({},s.options),{},{onExitComplete:function(){return t.safeToRemove()}}))),hg.hasEverUpdated=!0}},{key:"getSnapshotBeforeUpdate",value:function(e){var t=this,n=this.props,r=n.layoutDependency,o=n.visualElement,i=n.drag,a=n.isPresent,s=o.projection;return s?(s.isPresent=a,i||e.layoutDependency!==r||void 0===r?s.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?s.promote():s.relegate()||Pw.postRender((function(){var e;(null===(e=s.getStack())||void 0===e?void 0:e.members.length)||t.safeToRemove()}))),null):null}},{key:"componentDidUpdate",value:function(){var e=this.props.visualElement.projection;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.visualElement,n=e.layoutGroup,r=e.switchLayoutGroup,o=t.projection;o&&(o.scheduleCheckAfterUnmount(),(null==n?void 0:n.group)&&n.group.remove(o),(null==r?void 0:r.deregister)&&r.deregister(o))}},{key:"safeToRemove",value:function(){var e=this.props.safeToRemove;null==e||e()}},{key:"render",value:function(){return null}}]),n}(qr.Component);var Fx={borderRadius:un(un({},Dx),{},{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Dx,borderTopRightRadius:Dx,borderBottomLeftRadius:Dx,borderBottomRightRadius:Dx,boxShadow:jx},Hx={measureLayout:function(e){var t=yn(nw(),2),n=t[0],r=t[1],o=cr.useContext(vg);return qr.createElement(Bx,un(un({},e),{},{layoutGroup:o,switchLayoutGroup:cr.useContext(mg),isPresent:n,safeToRemove:r}))}};function Vx(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Pg(e)?e:Xw(e);return Vw("",r,t,n),{stop:function(){return r.stop()},isAnimating:function(){return r.isAnimating()}}}var Wx=["TopLeft","TopRight","BottomLeft","BottomRight"],Ux=Wx.length,Gx=function(e){return"string"==typeof e?parseFloat(e):e},qx=function(e){return"number"==typeof e||Ug.test(e)};function Yx(e,t,n,r,o,i){var a,s,l,u;o?(e.opacity=Py(0,null!==(a=n.opacity)&&void 0!==a?a:1,Xx(r)),e.opacityExit=Py(null!==(s=t.opacity)&&void 0!==s?s:1,0,$x(r))):i&&(e.opacity=Py(null!==(l=t.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,r));for(var c=0;ct?1:n(Ey(e,t,r))}}function Qx(e,t){e.min=t.min,e.max=t.max}function Jx(e,t){Qx(e.x,t.x),Qx(e.y,t.y)}function eS(e,t,n,r,o){return e=Uk(e-=t,1/n,r),void 0!==o&&(e=Uk(e,1/o,r)),e}function tS(e,t,n,r,o){var i=yn(n,3),a=i[0],s=i[1],l=i[2];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:e;if(Wg.test(t)){t=parseFloat(t),t=Py(a.min,a.max,t/100)-a.min}if("number"==typeof t){var s=Py(i.min,i.max,r);e===i&&(s-=t),e.min=eS(e.min,t,n,s,o),e.max=eS(e.max,t,n,s,o)}}(e,t[a],t[s],t[l],t.scale,r,o)}var nS=["x","scaleX","originX"],rS=["y","scaleY","originY"];function oS(e,t,n,r){tS(e.x,t,nS,null==n?void 0:n.x,null==r?void 0:r.x),tS(e.y,t,rS,null==n?void 0:n.y,null==r?void 0:r.y)}function iS(e){return 0===e.translate&&1===e.scale}function aS(e){return iS(e.x)&&iS(e.y)}function sS(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function lS(e){return _k(e.x)/_k(e.y)}var uS=function(){function e(){an(this,e),this.members=[]}return on(e,[{key:"add",value:function(e){Gw(this.members,e),e.scheduleRender()}},{key:"remove",value:function(e){if(qw(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){var t=this.members[this.members.length-1];t&&this.promote(t)}}},{key:"relegate",value:function(e){var t,n=this.members.findIndex((function(t){return e===t}));if(0===n)return!1;for(var r=n;r>=0;r--){var o=this.members[r];if(!1!==o.isPresent){t=o;break}}return!!t&&(this.promote(t),!0)}},{key:"promote",value:function(e,t){var n,r=this.lead;e!==r&&(this.prevLead=r,this.lead=e,e.show(),r&&(r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(null===(n=e.root)||void 0===n?void 0:n.isUpdating)&&(e.isLayoutDirty=!0),!1===e.options.crossfade&&r.hide()))}},{key:"exitAnimationComplete",value:function(){this.members.forEach((function(e){var t,n,r,o,i;null===(n=(t=e.options).onExitComplete)||void 0===n||n.call(t),null===(i=null===(r=e.resumingFrom)||void 0===r?void 0:(o=r.options).onExitComplete)||void 0===i||i.call(o)}))}},{key:"scheduleRender",value:function(){this.members.forEach((function(e){e.instance&&e.scheduleRender(!1)}))}},{key:"removeLeadSnapshot",value:function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}]),e}();function cS(e,t,n){var r="",o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r="translate3d(".concat(o,"px, ").concat(i,"px, 0) ")),1===t.x&&1===t.y||(r+="scale(".concat(1/t.x,", ").concat(1/t.y,") ")),n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate(".concat(a,"deg) ")),s&&(r+="rotateX(".concat(s,"deg) ")),l&&(r+="rotateY(".concat(l,"deg) "))}var u=e.x.scale*t.x,c=e.y.scale*t.y;return 1===u&&1===c||(r+="scale(".concat(u,", ").concat(c,")")),r||"none"}var dS=function(e,t){return e.depth-t.depth},fS=function(){function e(){an(this,e),this.children=[],this.isDirty=!1}return on(e,[{key:"add",value:function(e){Gw(this.children,e),this.isDirty=!0}},{key:"remove",value:function(e){qw(this.children,e),this.isDirty=!0}},{key:"forEach",value:function(e){this.isDirty&&this.children.sort(dS),this.isDirty=!1,this.children.forEach(e)}}]),e}(),hS=["","X","Y","Z"],pS=0;function vS(e){var t=e.attachResizeListener,n=e.defaultParent,r=e.measureScroll,o=e.checkIsScrollRoot,i=e.resetTransform;return function(){function e(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null==n?void 0:n();an(this,e),this.id=pS++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){r.isUpdating&&(r.isUpdating=!1,r.clearAllSnapshots())},this.updateProjection=function(){r.nodes.forEach(xS),r.nodes.forEach(SS)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=o,this.root=i?i.root||i:this,this.path=i?[].concat(cn(i.path),[i]):[],this.parent=i,this.depth=i?i.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(var a=0;a1?n-1:0),o=1;o1&&void 0!==arguments[1]&&arguments[1];if(!this.instance){this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;var i=this.options,a=i.layoutId,s=i.layout,l=i.visualElement;if(l&&!l.current&&l.mount(e),this.root.nodes.add(this),null===(n=this.parent)||void 0===n||n.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),o&&(s||a)&&(this.isLayoutDirty=!0),t){var u,c=function(){return r.root.updateBlockedByResize=!1};t(e,(function(){r.root.updateBlockedByResize=!0,u&&u(),u=Rw(c,250),hg.hasAnimatedSinceResize&&(hg.hasAnimatedSinceResize=!1,r.nodes.forEach(kS))}))}a&&this.root.registerSharedNode(a,this),!1!==this.options.animate&&l&&(a||s)&&this.addEventListener("didUpdate",(function(e){var t,n,o,i,a,s=e.delta,u=e.hasLayoutChanged,c=e.hasRelativeTargetChanged,d=e.layout;if(r.isTreeAnimationBlocked())return r.target=void 0,void(r.relativeTarget=void 0);var f=null!==(n=null!==(t=r.options.transition)&&void 0!==t?t:l.getDefaultTransition())&&void 0!==n?n:AS,h=l.getProps(),p=h.onLayoutAnimationStart,v=h.onLayoutAnimationComplete,g=!r.targetLayout||!sS(r.targetLayout,d)||c,m=!u&&c;if((null===(o=r.resumeFrom)||void 0===o?void 0:o.instance)||m||u&&(g||!r.currentAnimation)){r.resumeFrom&&(r.resumingFrom=r.resumeFrom,r.resumingFrom.resumingFrom=void 0),r.setAnimationOrigin(s,m);var y=un(un({},Hw(f,"layout")),{},{onPlay:p,onComplete:v});l.shouldReduceMotion&&(y.delay=0,y.type=!1),r.startAnimation(y)}else u||0!==r.animationProgress||kS(r),r.isLead()&&(null===(a=(i=r.options).onExitComplete)||void 0===a||a.call(i));r.targetLayout=d}))}}},{key:"unmount",value:function(){var e,t;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(e=this.getStack())||void 0===e||e.remove(this),null===(t=this.parent)||void 0===t||t.children.delete(this),this.instance=void 0,Lw.preRender(this.updateProjection)}},{key:"blockUpdate",value:function(){this.updateManuallyBlocked=!0}},{key:"unblockUpdate",value:function(){this.updateManuallyBlocked=!1}},{key:"isUpdateBlocked",value:function(){return this.updateManuallyBlocked||this.updateBlockedByResize}},{key:"isTreeAnimationBlocked",value:function(){var e;return this.isAnimationBlocked||(null===(e=this.parent)||void 0===e?void 0:e.isTreeAnimationBlocked())||!1}},{key:"startUpdate",value:function(){var e;this.isUpdateBlocked()||(this.isUpdating=!0,null===(e=this.nodes)||void 0===e||e.forEach(CS),this.animationId++)}},{key:"willUpdate",value:function(){var e,t,n,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.root.isUpdateBlocked())null===(t=(e=this.options).onExitComplete)||void 0===t||t.call(e);else if(!this.root.isUpdating&&this.root.startUpdate(),!this.isLayoutDirty){this.isLayoutDirty=!0;for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:"measure",t=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&(this.scroll={animationId:this.root.animationId,phase:e,isRoot:o(this.instance),offset:r(this.instance)})}},{key:"resetTransform",value:function(){var e;if(i){var t=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!aS(this.projectionDelta),r=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate,o=null==r?void 0:r(this.latestValues,""),a=o!==this.prevTransformTemplateValue;t&&(n||Hk(this.latestValues)||a)&&(i(this.instance,o),this.shouldResetTransform=!1,this.scheduleRender())}}},{key:"measure",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.measurePageBox(),r=this.removeElementScroll(n);t&&(r=this.removeTransform(r)),IS(r);var o=null===(e=this.options.visualElement)||void 0===e?void 0:e.readValue("position"),i="fixed"===o||"sticky"===o?o:"static";return{animationId:this.root.animationId,measuredBox:n,layoutBox:r,latestValues:{},source:this.id,position:i}}},{key:"measurePageBox",value:function(){var e=this.options.visualElement;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};var t=e.measureViewportBox(),n=this.root.scroll;return n&&(Zk(t.x,n.offset.x),Zk(t.y,n.offset.y)),t}},{key:"removeElementScroll",value:function(e){var t={x:{min:0,max:0},y:{min:0,max:0}};Jx(t,e);for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n={x:{min:0,max:0},y:{min:0,max:0}};Jx(n,e);for(var r=0;r3&&void 0!==arguments[3]&&arguments[3],a=n.length;if(a){var s,l;t.x=t.y=1;for(var u=0;u0&&void 0!==arguments[0])||arguments[0];null===(t=(e=this.options).scheduleRender)||void 0===t||t.call(e),r&&(null===(n=this.getStack())||void 0===n||n.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}},{key:"setAnimationOrigin",value:function(e){var t,n,r=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.snapshot,a=(null==i?void 0:i.latestValues)||{},s=un({},this.latestValues),l={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!o;var u={x:{min:0,max:0},y:{min:0,max:0}},c=(null==i?void 0:i.source)!==(null===(t=this.layout)||void 0===t?void 0:t.source),d=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,f=Boolean(c&&!d&&!0===this.options.crossfade&&!this.path.some(OS));this.animationProgress=0,this.mixTargetDelta=function(t){var n,o=t/1e3;ES(l.x,e.x,o),ES(l.y,e.y,o),r.setTargetDelta(l),r.relativeTarget&&r.relativeTargetOrigin&&r.layout&&(null===(n=r.relativeParent)||void 0===n?void 0:n.layout)&&(Mk(u,r.layout.layoutBox,r.relativeParent.layout.layoutBox),LS(r.relativeTarget,r.relativeTargetOrigin,u,o)),c&&(r.animationValues=s,Yx(s,a,r.latestValues,o,f,d)),r.root.scheduleUpdateProjection(),r.scheduleRender(),r.animationProgress=o},this.mixTargetDelta(0)}},{key:"startAnimation",value:function(e){var t,n,r=this;this.notifyListeners("animationStart"),null===(t=this.currentAnimation)||void 0===t||t.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Lw.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pw.update((function(){hg.hasAnimatedSinceResize=!0,r.currentAnimation=Vx(0,1e3,un(un({},e),{},{onUpdate:function(t){var n;r.mixTargetDelta(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:function(){var t;null===(t=e.onComplete)||void 0===t||t.call(e),r.completeAnimation()}})),r.resumingFrom&&(r.resumingFrom.currentAnimation=r.currentAnimation),r.pendingAnimation=void 0}))}},{key:"completeAnimation",value:function(){var e;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(e=this.getStack())||void 0===e||e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}},{key:"finishAnimation",value:function(){var e;this.currentAnimation&&(null===(e=this.mixTargetDelta)||void 0===e||e.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}},{key:"applyTransformsToTarget",value:function(){var e=this.getLead(),t=e.targetWithTransforms,n=e.target,r=e.layout,o=e.latestValues;if(t&&n&&r){if(this!==e&&this.layout&&r&&RS(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};var i=_k(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+i;var a=_k(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+a}Jx(t,n),Qk(t,o),Lk(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}},{key:"registerSharedNode",value:function(e,t){var n,r,o;this.sharedNodes.has(e)||this.sharedNodes.set(e,new uS),this.sharedNodes.get(e).add(t),t.promote({transition:null===(n=t.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(r=t.options.initialPromotionConfig)||void 0===r?void 0:r.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(r,t)})}},{key:"isLead",value:function(){var e=this.getStack();return!e||e.lead===this}},{key:"getLead",value:function(){var e;return this.options.layoutId&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}},{key:"getPrevLead",value:function(){var e;return this.options.layoutId?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}},{key:"getStack",value:function(){var e=this.options.layoutId;if(e)return this.root.sharedNodes.get(e)}},{key:"promote",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.needsReset,n=e.transition,r=e.preserveFollowOpacity,o=this.getStack();o&&o.promote(this,r),t&&(this.projectionDelta=void 0,this.needsReset=!0),n&&this.setOptions({transition:n})}},{key:"relegate",value:function(){var e=this.getStack();return!!e&&e.relegate(this)}},{key:"resetRotation",value:function(){var e=this.options.visualElement;if(e){var t=!1,n=e.latestValues;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(t=!0),t){for(var r={},o=0;o0&&void 0!==arguments[0]?arguments[0]:{},o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";var i=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=Hm(r.pointerEvents)||"",o.transform=i?i(this.latestValues,""):"none",o;var a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){var s={};return this.options.layoutId&&(s.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,s.pointerEvents=Hm(r.pointerEvents)||""),this.hasProjected&&!Hk(this.latestValues)&&(s.transform=i?i({},""):"none",this.hasProjected=!1),s}var l=a.animationValues||a.latestValues;this.applyTransformsToTarget(),o.transform=cS(this.projectionDeltaWithTransform,this.treeScale,l),i&&(o.transform=i(l,o.transform));var u=this.projectionDelta,c=u.x,d=u.y;for(var f in o.transformOrigin="".concat(100*c.origin,"% ").concat(100*d.origin,"% 0"),a.animationValues?o.opacity=a===this?null!==(n=null!==(t=l.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=a===this?void 0!==l.opacity?l.opacity:"":void 0!==l.opacityExit?l.opacityExit:0,Sg)if(void 0!==l[f]){var h=Sg[f],p=h.correct,v=h.applyTo,g=p(l[f],a);if(v)for(var m=v.length,y=0;y=0;r--)if(Boolean(e.path[r].instance)){n=e.path[r];break}var o=(n&&n!==e.root?n.instance:document).querySelector('[data-projection-id="'.concat(t,'"]'));o&&e.mount(o,!0)}function TS(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function IS(e){TS(e.x),TS(e.y)}function RS(e,t,n){return"position"===e||"preserve-aspect"===e&&!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1;return Nb(e,t)<=n}(lS(t),lS(n),.2)}var NS=vS({attachResizeListener:function(e,t){return Ym(e,"resize",t)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}},checkIsScrollRoot:function(){return!0}}),DS={current:void 0},zS=vS({measureScroll:function(e){return{x:e.scrollLeft,y:e.scrollTop}},defaultParent:function(){if(!DS.current){var e=new NS(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),DS.current=e}return DS.current},resetTransform:function(e,t){e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:function(e){return Boolean("fixed"===window.getComputedStyle(e).position)}}),jS=un(un(un(un({},mk),tw),ox),Hx),BS=wg((function(e,t){return function(e,t,n,r,o){var i=t.forwardMotionProps,a=void 0!==i&&i;return un(un({},xg(e)?Gm:qm),{},{preloadedFeatures:n,useRender:Mm(a),createVisualElement:r,projectionNodeConstructor:o,Component:e})}(e,t,jS,Rx,zS)}));function FS(){var e=cr.useRef(!1);return Jv((function(){return e.current=!0,function(){e.current=!1}}),[]),e}var HS=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"getSnapshotBeforeUpdate",value:function(e){var t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){var n=this.props.sizeRef.current;n.height=t.offsetHeight||0,n.width=t.offsetWidth||0,n.top=t.offsetTop,n.left=t.offsetLeft}return null}},{key:"componentDidUpdate",value:function(){}},{key:"render",value:function(){return this.props.children}}]),n}(cr.Component);function VS(e){var t=e.children,n=e.isPresent,r=cr.useId(),o=cr.useRef(null),i=cr.useRef({width:0,height:0,top:0,left:0});return cr.useInsertionEffect((function(){var e=i.current,t=e.width,a=e.height,s=e.top,l=e.left;if(!n&&o.current&&t&&a){o.current.dataset.motionPopId=r;var u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule('\n [data-motion-pop-id="'.concat(r,'"] {\n position: absolute !important;\n width: ').concat(t,"px !important;\n height: ").concat(a,"px !important;\n top: ").concat(s,"px !important;\n left: ").concat(l,"px !important;\n }\n ")),function(){document.head.removeChild(u)}}}),[n]),cr.createElement(HS,{isPresent:n,childRef:o,sizeRef:i},cr.cloneElement(t,{ref:o}))}var WS=function(e){var t=e.children,n=e.initial,r=e.isPresent,o=e.onExitComplete,i=e.custom,a=e.presenceAffectsLayout,s=e.mode,l=fg(US),u=cr.useId(),c=cr.useMemo((function(){return{id:u,initial:n,isPresent:r,custom:i,onExitComplete:function(e){l.set(e,!0);var t,n=xn(l.values());try{for(n.s();!(t=n.n()).done;){if(!t.value)return}}catch(r){n.e(r)}finally{n.f()}o&&o()},register:function(e){return l.set(e,!1),function(){return l.delete(e)}}}}),a?void 0:[r]);return cr.useMemo((function(){l.forEach((function(e,t){return l.set(t,!1)}))}),[r]),cr.useEffect((function(){!r&&!l.size&&o&&o()}),[r]),"popLayout"===s&&(t=cr.createElement(VS,{isPresent:r},t)),cr.createElement(Kv.Provider,{value:c},t)};function US(){return new Map}var GS=function(e){return e.key||""};var qS=function(e){var t=e.children,n=e.custom,r=e.initial,o=void 0===r||r,i=e.onExitComplete,a=e.exitBeforeEnter,s=e.presenceAffectsLayout,l=void 0===s||s,u=e.mode,c=void 0===u?"sync":u;a&&(c="wait",Gb(!1,"Replace exitBeforeEnter with mode='wait'"));var d=function(){var e=FS(),t=yn(cr.useState(0),2),n=t[0],r=t[1],o=cr.useCallback((function(){e.current&&r(n+1)}),[n]);return[cr.useCallback((function(){return Pw.postRender(o)}),[o]),n]}(),f=yn(d,1)[0],h=cr.useContext(vg).forceRender;h&&(f=h);var p=FS(),v=function(e){var t=[];return cr.Children.forEach(e,(function(e){cr.isValidElement(e)&&t.push(e)})),t}(t),g=v,m=new Set,y=cr.useRef(g),b=cr.useRef(new Map).current,w=cr.useRef(!0);if(Jv((function(){w.current=!1,function(e,t){e.forEach((function(e){var n=GS(e);t.set(n,e)}))}(v,b),y.current=g})),vy((function(){w.current=!0,b.clear(),m.clear()})),w.current)return cr.createElement(cr.Fragment,null,g.map((function(e){return cr.createElement(WS,{key:GS(e),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:l,mode:c},e)})));g=cn(g);for(var k=y.current.map(GS),x=v.map(GS),S=k.length,C=0;C1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),cr.createElement(cr.Fragment,null,m.size?g:g.map((function(e){return cr.cloneElement(e)})))},YS=function(){return YS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function QS(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o0},cC={exit:{height:{duration:.2,ease:eC.ease},opacity:{duration:.3,ease:eC.ease}},enter:{height:{duration:.3,ease:eC.ease},opacity:{duration:.4,ease:eC.ease}}},dC={exit:function(e){var t,n=e.animateOpacity,r=e.startingHeight,o=e.transition,i=e.transitionEnd,a=e.delay;return un(un({},n&&{opacity:uC(r)?1:0}),{},{height:r,transitionEnd:null==i?void 0:i.exit,transition:null!==(t=null==o?void 0:o.exit)&&void 0!==t?t:lC(cC.exit,a)})},enter:function(e){var t,n=e.animateOpacity,r=e.endingHeight,o=e.transition,i=e.transitionEnd,a=e.delay;return un(un({},n&&{opacity:1}),{},{height:r,transitionEnd:null==i?void 0:i.enter,transition:null!==(t=null==o?void 0:o.enter)&&void 0!==t?t:sC(cC.enter,a)})}},fC=cr.forwardRef((function(e,t){var n=e.in,r=e.unmountOnExit,o=e.animateOpacity,i=void 0===o||o,a=e.startingHeight,s=void 0===a?0:a,l=e.endingHeight,u=void 0===l?"auto":l,c=e.style,d=e.className,f=e.transition,h=e.transitionEnd,p=sn(e,v),g=yn(cr.useState(!1),2),m=g[0],y=g[1];cr.useEffect((function(){var e=setTimeout((function(){y(!0)}));return function(){return clearTimeout(e)}}),[]),function(e){e.condition,e.message}({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});var b=parseFloat(s.toString())>0,w={startingHeight:s,endingHeight:u,animateOpacity:i,transition:m?f:{enter:{duration:0}},transitionEnd:{enter:null==h?void 0:h.enter,exit:r?null==h?void 0:h.exit:un(un({},null==h?void 0:h.exit),{},{display:b?"block":"none"})}},k=!r||n,x=n||r?"enter":"exit";return qr.createElement(qS,{initial:!1,custom:w},k&&qr.createElement(BS.div,un(un({ref:t},p),{},{className:JS("chakra-collapse",d),style:un({overflow:"hidden",display:"block"},c),custom:w,variants:dC,initial:!!r&&"exit",animate:x,exit:"exit"})))}));fC.displayName="Collapse";var hC={enter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.transition,r=t.transitionEnd,o=t.delay;return{opacity:1,transition:null!==(e=null==n?void 0:n.enter)&&void 0!==e?e:sC(aC.enter,o),transitionEnd:null==r?void 0:r.enter}},exit:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.transition,r=t.transitionEnd,o=t.delay;return{opacity:0,transition:null!==(e=null==n?void 0:n.exit)&&void 0!==e?e:lC(aC.exit,o),transitionEnd:null==r?void 0:r.exit}}},pC={initial:"exit",animate:"enter",exit:"exit",variants:hC},vC=cr.forwardRef((function(e,t){var n=e.unmountOnExit,r=e.in,o=e.className,i=e.transition,a=e.transitionEnd,s=e.delay,l=sn(e,g),u=r||n?"enter":"exit",c=!n||r&&n,d={transition:i,transitionEnd:a,delay:s};return qr.createElement(qS,{custom:d},c&&qr.createElement(BS.div,un(un({ref:t,className:JS("chakra-fade",o),custom:d},pC),{},{animate:u},l)))}));vC.displayName="Fade";var gC={exit:function(e){var t,n=e.reverse,r=e.initialScale,o=e.transition,i=e.transitionEnd,a=e.delay;return un(un({opacity:0},n?{scale:r,transitionEnd:null==i?void 0:i.exit}:{transitionEnd:un({scale:r},null==i?void 0:i.exit)}),{},{transition:null!==(t=null==o?void 0:o.exit)&&void 0!==t?t:lC(aC.exit,a)})},enter:function(e){var t,n=e.transitionEnd,r=e.transition,o=e.delay;return{opacity:1,scale:1,transition:null!==(t=null==r?void 0:r.enter)&&void 0!==t?t:sC(aC.enter,o),transitionEnd:null==n?void 0:n.enter}}},mC={initial:"exit",animate:"enter",exit:"exit",variants:gC},yC=cr.forwardRef((function(e,t){var n=e.unmountOnExit,r=e.in,o=e.reverse,i=void 0===o||o,a=e.initialScale,s=void 0===a?.95:a,l=e.className,u=e.transition,c=e.transitionEnd,d=e.delay,f=sn(e,m),h=!n||r&&n,p=r||n?"enter":"exit",v={initialScale:s,reverse:i,transition:u,transitionEnd:c,delay:d};return qr.createElement(qS,{custom:v},h&&qr.createElement(BS.div,un(un({ref:t,className:JS("chakra-offset-slide",l)},mC),{},{animate:p,custom:v},f)))}));yC.displayName="ScaleFade";var bC={exit:{duration:.15,ease:eC.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},wC={exit:function(e){var t,n=e.direction,r=e.transition,o=e.transitionEnd,i=e.delay;return un(un({},iC({direction:n}).exit),{},{transition:null!==(t=null==r?void 0:r.exit)&&void 0!==t?t:lC(bC.exit,i),transitionEnd:null==o?void 0:o.exit})},enter:function(e){var t,n=e.direction,r=e.transitionEnd,o=e.transition,i=e.delay;return un(un({},iC({direction:n}).enter),{},{transition:null!==(t=null==o?void 0:o.enter)&&void 0!==t?t:sC(bC.enter,i),transitionEnd:null==r?void 0:r.enter})}},kC=cr.forwardRef((function(e,t){var n=e.direction,r=void 0===n?"right":n,o=e.style,i=e.unmountOnExit,a=e.in,s=e.className,l=e.transition,u=e.transitionEnd,c=e.delay,d=e.motionProps,f=sn(e,y),h=iC({direction:r}),p=Object.assign({position:"fixed"},h.position,o),v=!i||a&&i,g=a||i?"enter":"exit",m={transitionEnd:u,transition:l,direction:r,delay:c};return qr.createElement(qS,{custom:m},v&&qr.createElement(BS.div,un(un({},f),{},{ref:t,initial:"exit",className:JS("chakra-slide",s),animate:g,exit:"exit",custom:m,variants:wC,style:p},d)))}));kC.displayName="Slide";var xC={initial:function(e){var t,n=e.offsetX,r=e.offsetY,o=e.transition,i=e.transitionEnd,a=e.delay;return{opacity:0,x:n,y:r,transition:null!==(t=null==o?void 0:o.exit)&&void 0!==t?t:lC(aC.exit,a),transitionEnd:null==i?void 0:i.exit}},enter:function(e){var t,n=e.transition,r=e.transitionEnd,o=e.delay;return{opacity:1,x:0,y:0,transition:null!==(t=null==n?void 0:n.enter)&&void 0!==t?t:sC(aC.enter,o),transitionEnd:null==r?void 0:r.enter}},exit:function(e){var t,n=e.offsetY,r=e.offsetX,o=e.transition,i=e.transitionEnd,a=e.reverse,s=e.delay,l={x:r,y:n};return un({opacity:0,transition:null!==(t=null==o?void 0:o.exit)&&void 0!==t?t:lC(aC.exit,s)},a?un(un({},l),{},{transitionEnd:null==i?void 0:i.exit}):{transitionEnd:un(un({},l),null==i?void 0:i.exit)})}},SC={initial:"initial",animate:"enter",exit:"exit",variants:xC},CC=cr.forwardRef((function(e,t){var n=e.unmountOnExit,r=e.in,o=e.reverse,i=void 0===o||o,a=e.className,s=e.offsetX,l=void 0===s?0:s,u=e.offsetY,c=void 0===u?8:u,d=e.transition,f=e.transitionEnd,h=e.delay,p=sn(e,b),v=!n||r&&n,g=r||n?"enter":"exit",m={offsetX:l,offsetY:c,reverse:i,transition:d,transitionEnd:f,delay:h};return qr.createElement(qS,{custom:m},v&&qr.createElement(BS.div,un(un({ref:t,className:JS("chakra-offset-slide",a),custom:m},SC),{},{animate:g},p)))}));CC.displayName="SlideFade";var _C=function(){for(var e=arguments.length,t=new Array(e),n=0;n"}),2),OC=LC[0],AC=LC[1],MC=yn(Av({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),2),TC=MC[0],IC=MC[1],RC=yn(Vv(),4),NC=RC[0],DC=(RC[1],RC[2]),zC=RC[3],jC=Cv((function(e,t){var n=(0,IC().getButtonProps)(e,t),r=un({display:"flex",alignItems:"center",width:"100%",outline:0},AC().button);return qr.createElement(Lv.button,un(un({},n),{},{className:_C("chakra-accordion__button",e.className),__css:r}))}));function BC(e){var t=e.onChange,n=e.defaultIndex,r=e.index,o=e.allowMultiple,i=e.allowToggle,a=sn(e,w);!function(e){var t=e.index||e.defaultIndex,n=null!=t&&!Array.isArray(t)&&e.allowMultiple;EC({condition:!!n,message:"If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ".concat(kn(t),",")})}(e),function(e){EC({condition:!(!e.allowMultiple||!e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}(e);var s=DC(),l=yn(cr.useState(-1),2),u=l[0],c=l[1];cr.useEffect((function(){return function(){c(-1)}}),[]);var d=yn(Zv({value:r,defaultValue:function(){return o?null!=n?n:[]:null!=n?n:-1},onChange:t}),2),f=d[0],h=d[1];return{index:f,setIndex:h,htmlProps:a,getAccordionItemProps:function(e){var t=!1;null!==e&&(t=Array.isArray(f)?f.includes(e):f===e);return{isOpen:t,onChange:function(t){if(null!==e)if(o&&Array.isArray(f)){var n=t?f.concat(e):f.filter((function(t){return t!==e}));h(n)}else t?h(e):i&&h(-1)}}},focusedIndex:u,setFocusedIndex:c,descendants:s}}jC.displayName="AccordionButton";var FC=yn(Av({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"}),2),HC=FC[0],VC=FC[1];function WC(e){var t=e.isDisabled,n=e.isFocusable,r=e.id,o=sn(e,k),i=VC(),a=i.getAccordionItemProps,s=i.setFocusedIndex,l=cr.useRef(null),u=cr.useId(),c=null!=r?r:u,d="accordion-button-".concat(c),f="accordion-panel-".concat(c);!function(e){EC({condition:!(!e.isFocusable||e.isDisabled),message:"Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.\n "})}(e);var h=zC({disabled:t&&!n}),p=h.register,v=h.index,g=h.descendants,m=a(-1===v?null:v),y=m.isOpen,b=m.onChange;!function(e){EC({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}({isOpen:y,isDisabled:t});var w=cr.useCallback((function(){null==b||b(!y),s(v)}),[v,s,y,b]),x=cr.useCallback((function(e){var t={ArrowDown:function(){var e=g.nextEnabled(v);null==e||e.node.focus()},ArrowUp:function(){var e=g.prevEnabled(v);null==e||e.node.focus()},Home:function(){var e=g.firstEnabled();null==e||e.node.focus()},End:function(){var e=g.lastEnabled();null==e||e.node.focus()}},n=t[e.key];n&&(e.preventDefault(),n(e))}),[g,v]),S=cr.useCallback((function(){s(v)}),[s,v]),C=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{type:"button",ref:Tv(p,l,n),id:d,disabled:!!t,"aria-expanded":!!y,"aria-controls":f,onClick:PC(e.onClick,w),onFocus:PC(e.onFocus,S),onKeyDown:PC(e.onKeyDown,x)})}),[d,t,y,w,S,x,f,p]),_=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,role:"region",id:f,"aria-labelledby":d,hidden:!y})}),[d,y,f]);return{isOpen:y,isDisabled:t,isFocusable:n,onOpen:function(){null==b||b(!0)},onClose:function(){null==b||b(!1)},getButtonProps:C,getPanelProps:_,htmlProps:o}}function UC(e){var t=IC(),n=t.isOpen,r=t.isDisabled,o=VC().reduceMotion,i=_C("chakra-accordion__icon",e.className),a=un({opacity:r?.4:1,transform:n?"rotate(-180deg)":void 0,transition:o?void 0:"transform 0.2s",transformOrigin:"center"},AC().icon);return qr.createElement(Gv,un({viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a},e),qr.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}UC.displayName="AccordionIcon";var GC=Cv((function(e,t){var n=e.children,r=e.className,o=WC(e),i=o.htmlProps,a=sn(o,x),s=un(un({},AC().container),{},{overflowAnchor:"none"}),l=cr.useMemo((function(){return a}),[a]);return qr.createElement(TC,{value:l},qr.createElement(Lv.div,un(un({ref:t},i),{},{className:_C("chakra-accordion__item",r),__css:s}),"function"==typeof n?n({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):n))}));GC.displayName="AccordionItem";var qC=Cv((function(e,t){var n=e.className,r=e.motionProps,o=sn(e,S),i=VC().reduceMotion,a=IC(),s=a.getPanelProps,l=a.isOpen,u=s(o,t),c=_C("chakra-accordion__panel",n),d=AC();i||delete u.hidden;var f=qr.createElement(Lv.div,un(un({},u),{},{__css:d.panel,className:c}));return i?f:qr.createElement(fC,un({in:l},r),f)}));qC.displayName="AccordionPanel";var YC=Cv((function(e,t){var n=e.children,r=e.reduceMotion,o=sn(e,C),i=Pv("Accordion",o),a=BC(ua(o)),s=a.htmlProps,l=a.descendants,u=sn(a,_),c=cr.useMemo((function(){return un(un({},u),{},{reduceMotion:!!r})}),[u,r]);return qr.createElement(NC,{value:l},qr.createElement(HC,{value:c},qr.createElement(OC,{value:i},qr.createElement(Lv.div,un(un({ref:t},s),{},{className:_C("chakra-accordion",o.className),__css:i.root}),n))))}));YC.displayName="Accordion";var ZC=fl({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),XC=Cv((function(e,t){var n=Ev("Spinner",e),r=ua(e),o=r.label,i=void 0===o?"Loading...":o,a=r.thickness,s=void 0===a?"2px":a,l=r.speed,u=void 0===l?"0.45s":l,c=r.emptyColor,d=void 0===c?"transparent":c,f=r.className,h=sn(r,E),p=function(){for(var e=arguments.length,t=new Array(e),n=0;n"}),2),JC=QC[0],e_=QC[1],t_=yn(Av({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),2),n_=t_[0],r_=t_[1],o_={info:{icon:function(e){return qr.createElement(Gv,un({viewBox:"0 0 24 24"},e),qr.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))},colorScheme:"blue"},warning:{icon:KC,colorScheme:"orange"},success:{icon:function(e){return qr.createElement(Gv,un({viewBox:"0 0 24 24"},e),qr.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))},colorScheme:"green"},error:{icon:KC,colorScheme:"red"},loading:{icon:XC,colorScheme:"blue"}};var i_=Cv((function(e,t){var n,r=ua(e),o=r.status,i=void 0===o?"info":o,a=r.addRole,s=void 0===a||a,l=sn(r,P),u=null!==(n=e.colorScheme)&&void 0!==n?n:function(e){return o_[e].colorScheme}(i),c=Pv("Alert",un(un({},e),{},{colorScheme:u})),d=un({width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden"},c.container);return qr.createElement(JC,{value:{status:i}},qr.createElement(n_,{value:c},qr.createElement(Lv.div,un(un({role:s?"alert":void 0,ref:t},l),{},{className:$C("chakra-alert",e.className),__css:d}))))}));i_.displayName="Alert";var a_=Cv((function(e,t){var n=un({display:"inline"},r_().description);return qr.createElement(Lv.div,un(un({ref:t},e),{},{className:$C("chakra-alert__desc",e.className),__css:n}))}));function s_(e){var t=e_().status,n=function(e){return o_[e].icon}(t),r=r_(),o="loading"===t?r.spinner:r.icon;return qr.createElement(Lv.span,un(un({display:"inherit"},e),{},{className:$C("chakra-alert__icon",e.className),__css:o}),e.children||qr.createElement(n,{h:"100%",w:"100%"}))}a_.displayName="AlertDescription",s_.displayName="AlertIcon";var l_=Cv((function(e,t){var n=r_();return qr.createElement(Lv.div,un(un({ref:t},e),{},{className:$C("chakra-alert__title",e.className),__css:n.title}))}));l_.displayName="AlertTitle";var u_=Cv((function(e,t){var n=e.htmlWidth,r=e.htmlHeight,o=e.alt,i=sn(e,L);return qr.createElement("img",un({width:n,height:r,ref:t,alt:o},i))}));u_.displayName="NativeImage";var c_=Cv((function(e,t){var n=e.fallbackSrc,r=e.fallback,o=e.src,i=e.srcSet,a=e.align,s=e.fit,l=e.loading,u=e.ignoreFallback,c=e.crossOrigin,d=e.fallbackStrategy,f=void 0===d?"beforeLoadOrError":d,h=e.referrerPolicy,p=sn(e,O),v=null!=l||u||!(void 0!==n||void 0!==r),g=function(e){var t=e.loading,n=e.src,r=e.srcSet,o=e.onLoad,i=e.onError,a=e.crossOrigin,s=e.sizes,l=e.ignoreFallback,u=yn(cr.useState("pending"),2),c=u[0],d=u[1];cr.useEffect((function(){d(n?"loading":"pending")}),[n]);var f=cr.useRef(),h=cr.useCallback((function(){if(n){p();var e=new Image;e.src=n,a&&(e.crossOrigin=a),r&&(e.srcset=r),s&&(e.sizes=s),t&&(e.loading=t),e.onload=function(e){p(),d("loaded"),null==o||o(e)},e.onerror=function(e){p(),d("failed"),null==i||i(e)},f.current=e}}),[n,a,r,s,o,i,t]),p=function(){f.current&&(f.current.onload=null,f.current.onerror=null,f.current=null)};return oo((function(){if(!l)return"loading"===c&&h(),function(){p()}}),[c,h,l]),l?"loaded":c}(un(un({},e),{},{ignoreFallback:v})),m=function(e,t){return"loaded"!==e&&"beforeLoadOrError"===t||"failed"===e&&"onError"===t}(g,f),y=un({ref:t,objectFit:s,objectPosition:a},v?p:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(a){o.e(a)}finally{o.f()}return r}(p,["onError","onLoad"]));return m?r||qr.createElement(Lv.img,un({as:u_,className:"chakra-image__placeholder",src:n},y)):qr.createElement(Lv.img,un({as:u_,src:o,srcSet:i,crossOrigin:c,loading:l,referrerPolicy:h,className:"chakra-image"},y))}));function d_(e){return cr.Children.toArray(e).filter((function(e){return cr.isValidElement(e)}))}c_.displayName="Image",Cv((function(e,t){return qr.createElement(Lv.img,un({ref:t,as:u_,className:"chakra-image"},e))}));var f_=function(){for(var e=arguments.length,t=new Array(e),n=0;n *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:{"& > *:not(style) ~ *:not(style)":{marginStart:s}}),qr.createElement(v_,{value:f},qr.createElement(Lv.div,un({ref:t,role:"group",__css:h,className:d,"data-attached":l?"":void 0},c)))}));k_.displayName="ButtonGroup";var x_=Cv((function(e,t){var n=e.icon,r=e.children,o=e.isRound,i=e["aria-label"],a=sn(e,R),s=n||r,l=cr.isValidElement(s)?cr.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return qr.createElement(b_,un({padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i},a),l)}));x_.displayName="IconButton";var S_=function(){for(var e=arguments.length,t=new Array(e),n=0;n\" "}),2),L_=P_[0],O_=P_[1],A_=yn(Av({strict:!1,name:"FormControlContext"}),2),M_=A_[0],T_=A_[1];var I_=Cv((function(e,t){var n=Pv("Form",e),r=function(e){var t=e.id,n=e.isRequired,r=e.isInvalid,o=e.isDisabled,i=e.isReadOnly,a=sn(e,N),s=cr.useId(),l=t||"field-".concat(s),u="".concat(l,"-label"),c="".concat(l,"-feedback"),d="".concat(l,"-helptext"),f=yn(cr.useState(!1),2),h=f[0],p=f[1],v=yn(cr.useState(!1),2),g=v[0],m=v[1],y=yn(cr.useState(!1),2),b=y[0],w=y[1],k=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({id:d},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:Tv(e,(function(e){e&&m(!0)}))})}),[d]),x=cr.useCallback((function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},n),{},{ref:a,"data-focus":C_(b),"data-disabled":C_(o),"data-invalid":C_(r),"data-readonly":C_(i),id:null!==(e=n.id)&&void 0!==e?e:u,htmlFor:null!==(t=n.htmlFor)&&void 0!==t?t:l})}),[l,o,b,r,i,u]),S=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({id:c},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:Tv(e,(function(e){e&&p(!0)})),"aria-live":"polite"})}),[c]),C=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un(un({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),a),{},{ref:e,role:"group"})}),[a]),_=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,role:"presentation","aria-hidden":!0,children:e.children||"*"})}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!b,onFocus:function(){return w(!0)},onBlur:function(){return w(!1)},hasFeedbackText:h,setHasFeedbackText:p,hasHelpText:g,setHasHelpText:m,id:l,labelId:u,feedbackId:c,helpTextId:d,htmlProps:a,getHelpTextProps:k,getErrorMessageProps:S,getRootProps:C,getLabelProps:x,getRequiredIndicatorProps:_}}(ua(e)),o=r.getRootProps,i=(r.htmlProps,sn(r,D)),a=S_("chakra-form-control",e.className);return qr.createElement(M_,{value:i},qr.createElement(L_,{value:n},qr.createElement(Lv.div,un(un({},o({},t)),{},{className:a,__css:n.container}))))}));I_.displayName="FormControl";var R_=Cv((function(e,t){var n=T_(),r=O_(),o=S_("chakra-form__helper-text",e.className);return qr.createElement(Lv.div,un(un({},null==n?void 0:n.getHelpTextProps(e,t)),{},{__css:r.helperText,className:o}))}));function N_(e){var t=D_(e),n=t.isDisabled,r=t.isInvalid,o=t.isReadOnly,i=t.isRequired;return un(un({},sn(t,z)),{},{disabled:n,readOnly:o,required:i,"aria-invalid":__(r),"aria-required":__(i),"aria-readonly":__(o)})}function D_(e){var t,n,r,o=T_(),i=e.id,a=e.disabled,s=e.readOnly,l=e.required,u=e.isRequired,c=e.isInvalid,d=e.isReadOnly,f=e.isDisabled,h=e.onFocus,p=e.onBlur,v=sn(e,j),g=e["aria-describedby"]?[e["aria-describedby"]]:[];return(null==o?void 0:o.hasFeedbackText)&&(null==o?void 0:o.isInvalid)&&g.push(o.feedbackId),(null==o?void 0:o.hasHelpText)&&g.push(o.helpTextId),un(un({},v),{},{"aria-describedby":g.join(" ")||void 0,id:null!=i?i:null==o?void 0:o.id,isDisabled:null!==(t=null!=a?a:f)&&void 0!==t?t:null==o?void 0:o.isDisabled,isReadOnly:null!==(n=null!=s?s:d)&&void 0!==n?n:null==o?void 0:o.isReadOnly,isRequired:null!==(r=null!=l?l:u)&&void 0!==r?r:null==o?void 0:o.isRequired,isInvalid:null!=c?c:null==o?void 0:o.isInvalid,onFocus:E_(null==o?void 0:o.onFocus,h),onBlur:E_(null==o?void 0:o.onBlur,p)})}R_.displayName="FormHelperText";var z_=yn(Av({name:"FormErrorStylesContext",errorMessage:"useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),j_=z_[0],B_=z_[1],F_=Cv((function(e,t){var n=Pv("FormError",e),r=ua(e),o=T_();return(null==o?void 0:o.isInvalid)?qr.createElement(j_,{value:n},qr.createElement(Lv.div,un(un({},null==o?void 0:o.getErrorMessageProps(r,t)),{},{className:S_("chakra-form__error-message",e.className),__css:un({display:"flex",alignItems:"center"},n.text)}))):null}));F_.displayName="FormErrorMessage";var H_=Cv((function(e,t){var n=B_(),r=T_();if(!(null==r?void 0:r.isInvalid))return null;var o=S_("chakra-form__error-icon",e.className);return qr.createElement(Gv,un(un({ref:t,"aria-hidden":!0},e),{},{__css:n.icon,className:o}),qr.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))}));H_.displayName="FormErrorIcon";var V_=Cv((function(e,t){var n,r=Ev("FormLabel",e),o=ua(e),i=(o.className,o.children),a=o.requiredIndicator,s=void 0===a?qr.createElement(W_,null):a,l=o.optionalIndicator,u=void 0===l?null:l,c=sn(o,B),d=T_(),f=null!==(n=null==d?void 0:d.getLabelProps(c,t))&&void 0!==n?n:un({ref:t},c);return qr.createElement(Lv.label,un(un({},f),{},{className:S_("chakra-form__label",o.className),__css:un({display:"block",textAlign:"start"},r)}),i,(null==d?void 0:d.isRequired)?s:u)}));V_.displayName="FormLabel";var W_=Cv((function(e,t){var n=T_(),r=O_();if(!(null==n?void 0:n.isRequired))return null;var o=S_("chakra-form__required-indicator",e.className);return qr.createElement(Lv.span,un(un({},null==n?void 0:n.getRequiredIndicatorProps(e,t)),{},{__css:r.requiredIndicator,className:o}))}));function U_(e,t){var n=cr.useRef(!1),r=cr.useRef(!1);cr.useEffect((function(){if(n.current&&r.current)return e();r.current=!0}),t),cr.useEffect((function(){return n.current=!0,function(){n.current=!1}}),[])}W_.displayName="RequiredIndicator";var G_={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};Lv("span",{baseStyle:G_}).displayName="VisuallyHidden",Lv("input",{baseStyle:G_}).displayName="VisuallyHiddenInput";var q_=!1,Y_=null,Z_=!1,X_=new Set,$_="undefined"!=typeof window&&null!=window.navigator&&/^Mac/.test(window.navigator.platform);function K_(e,t){X_.forEach((function(n){return n(e,t)}))}function Q_(e){Z_=!0,function(e){return!(e.metaKey||!$_&&e.altKey||e.ctrlKey)}(e)&&(Y_="keyboard",K_("keyboard",e))}function J_(e){Y_="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(Z_=!0,K_("pointer",e))}function eE(e){e.target!==window&&e.target!==document&&(Z_||(Y_="keyboard",K_("keyboard",e)),Z_=!1)}function tE(){Z_=!1}function nE(){return"pointer"!==Y_}function rE(e){!function(){if("undefined"!=typeof window&&!q_){var e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){Z_=!0;for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(a){o.e(a)}finally{o.f()}return r}function hE(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=D_(e),n=t.isDisabled,r=t.isReadOnly,o=t.isRequired,i=t.isInvalid,a=t.id,s=t.onBlur,l=t.onFocus,u=t["aria-describedby"],c=e.defaultChecked,d=e.isChecked,f=e.isFocusable,h=e.onChange,p=e.isIndeterminate,v=e.name,g=e.value,m=e.tabIndex,y=void 0===m?void 0:m,b=e["aria-label"],w=e["aria-labelledby"],k=e["aria-invalid"],x=sn(e,H),S=fE(x,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),C=Yv(h),_=Yv(s),E=Yv(l),P=cr.useState(!1),L=yn(P,2),O=L[0],A=L[1],M=cr.useState(!1),T=yn(M,2),I=T[0],R=T[1],N=cr.useState(!1),D=yn(N,2),z=D[0],j=D[1],B=cr.useState(!1),F=yn(B,2),V=F[0],W=F[1];cr.useEffect((function(){return rE(A)}),[]);var U=cr.useRef(null),G=cr.useState(!0),q=yn(G,2),Y=q[0],Z=q[1],X=cr.useState(!!c),$=yn(X,2),K=$[0],Q=$[1],J=void 0!==d,ee=J?d:K,te=cr.useCallback((function(e){r||n?e.preventDefault():(J||Q(ee?e.target.checked:!!p||e.target.checked),null==C||C(e))}),[r,n,ee,J,p,C]);oo((function(){U.current&&(U.current.indeterminate=Boolean(p))}),[p]),U_((function(){n&&R(!1)}),[n,R]),oo((function(){var e=U.current;(null==e?void 0:e.form)&&(e.form.onreset=function(){Q(!!c)})}),[]);var ne=n&&!f,re=cr.useCallback((function(e){" "===e.key&&W(!0)}),[W]),oe=cr.useCallback((function(e){" "===e.key&&W(!1)}),[W]);oo((function(){U.current&&(U.current.checked!==ee&&Q(U.current.checked))}),[U.current]);var ie=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=function(e){I&&e.preventDefault(),W(!0)};return un(un({},e),{},{ref:t,"data-active":sE(V),"data-hover":sE(z),"data-checked":sE(ee),"data-focus":sE(I),"data-focus-visible":sE(I&&O),"data-indeterminate":sE(p),"data-disabled":sE(n),"data-invalid":sE(i),"data-readonly":sE(r),"aria-hidden":!0,onMouseDown:lE(e.onMouseDown,o),onMouseUp:lE(e.onMouseUp,(function(){return W(!1)})),onMouseEnter:lE(e.onMouseEnter,(function(){return j(!0)})),onMouseLeave:lE(e.onMouseLeave,(function(){return j(!1)}))})}),[V,ee,n,I,O,z,p,i,r]),ae=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un(un({},S),e),{},{ref:Tv(t,(function(e){e&&Z("LABEL"===e.tagName)})),onClick:lE(e.onClick,(function(){var e;Y||(null==(e=U.current)||e.click(),requestAnimationFrame((function(){var e;null==(e=U.current)||e.focus()})))})),"data-disabled":sE(n),"data-checked":sE(ee),"data-invalid":sE(i)})}),[S,n,ee,i,Y]),se=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(U,t),type:"checkbox",name:v,value:g,id:a,tabIndex:y,onChange:lE(e.onChange,te),onBlur:lE(e.onBlur,_,(function(){return R(!1)})),onFocus:lE(e.onFocus,E,(function(){return R(!0)})),onKeyDown:lE(e.onKeyDown,re),onKeyUp:lE(e.onKeyUp,oe),required:o,checked:ee,disabled:ne,readOnly:r,"aria-label":b,"aria-labelledby":w,"aria-invalid":k?Boolean(k):i,"aria-describedby":u,"aria-disabled":n,style:G_})}),[v,g,a,te,_,E,re,oe,o,ee,ne,r,b,w,k,i,u,n,y]),le=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,onMouseDown:lE(e.onMouseDown,pE),onTouchStart:lE(e.onTouchStart,pE),"data-disabled":sE(n),"data-checked":sE(ee),"data-invalid":sE(i)})}),[ee,n,i]),ue={isInvalid:i,isFocused:I,isChecked:ee,isActive:V,isHovered:z,isIndeterminate:p,isDisabled:n,isReadOnly:r,isRequired:o};return{state:ue,getRootProps:ae,getCheckboxProps:ie,getInputProps:se,getLabelProps:le,htmlProps:S}}function pE(e){e.preventDefault(),e.stopPropagation()}var vE={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},gE={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},mE=fl({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),yE=fl({from:{opacity:0},to:{opacity:1}}),bE=fl({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),wE=Cv((function(e,t){var n=iE(),r=Pv("Checkbox",un(un({},n),e)),o=ua(e),i=o.spacing,a=void 0===i?"0.5rem":i,s=o.className,l=o.children,u=o.iconColor,c=o.iconSize,d=o.icon,f=void 0===d?qr.createElement(dE,null):d,h=o.isChecked,p=o.isDisabled,v=void 0===p?null==n?void 0:n.isDisabled:p,g=o.onChange,m=o.inputProps,y=sn(o,V),b=h;(null==n?void 0:n.value)&&o.value&&(b=n.value.includes(o.value));var w=g;(null==n?void 0:n.onChange)&&o.value&&(w=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.onChange,n=e.precision,r=e.defaultValue,o=e.value,i=e.step,a=void 0===i?1:i,s=e.min,l=void 0===s?Number.MIN_SAFE_INTEGER:s,u=e.max,c=void 0===u?Number.MAX_SAFE_INTEGER:u,d=e.keepWithinRange,f=void 0===d||d,h=Yv(t),p=cr.useState((function(){var e;return null==r?"":null!==(e=TE(r,a,n))&&void 0!==e?e:""})),v=yn(p,2),g=v[0],m=v[1],y=void 0!==o,b=y?o:g,w=ME(AE(b),a),k=null!=n?n:w,x=cr.useCallback((function(e){e!==b&&(y||m(e.toString()),null==h||h(e.toString(),AE(e)))}),[h,y,b]),S=cr.useCallback((function(e){var t=e;return f&&(t=LE(t,l,c)),SE(t,k)}),[k,f,c,l]),C=cr.useCallback((function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;e=""===b?AE(t):AE(b)+t,e=S(e),x(e)}),[S,a,x,b]),_=cr.useCallback((function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;e=""===b?AE(-t):AE(b)-t,e=S(e),x(e)}),[S,a,x,b]),E=cr.useCallback((function(){var e,t;null==r?e="":e=null!==(t=TE(r,a,n))&&void 0!==t?t:l;x(e)}),[r,n,a,x,l]),P=cr.useCallback((function(e){var t,n=null!==(t=TE(e,a,k))&&void 0!==t?t:l;x(n)}),[k,a,x,l]),L=AE(b),O=L>c||L1&&void 0!==arguments[1]?arguments[1]:[],n=cr.useRef(e);return HE((function(){n.current=e})),cr.useCallback((function(){for(var e,t,r=arguments.length,o=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},t=e.onClose,n=e.onOpen,r=e.isOpen,o=e.id,i=VE(n),a=VE(t),s=cr.useState(e.defaultIsOpen||!1),l=yn(s,2),u=l[0],c=l[1],d=WE(r,u),f=yn(d,2),h=f[0],p=f[1],v=UE(o,"disclosure"),g=cr.useCallback((function(){h||c(!1),null==a||a()}),[h,a]),m=cr.useCallback((function(){h||c(!0),null==i||i()}),[h,i]),y=cr.useCallback((function(){(p?g:m)()}),[p,m,g]);return{isOpen:!!p,onOpen:m,onClose:g,onToggle:y,isControlled:h,getButtonProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return un(un({},e),{},{"aria-expanded":p,"aria-controls":v,onClick:Dl(e.onClick,y)})},getDisclosureProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return un(un({},e),{},{hidden:!p,id:v})}}}function qE(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}var YE=Cv((function(e,t){var n=e.htmlSize,r=sn(e,U),o=Pv("Input",r),i=N_(ua(r)),a=Wv("chakra-input",e.className);return qr.createElement(Lv.input,un(un({size:n},i),{},{__css:o.field,ref:t,className:a}))}));YE.displayName="Input",YE.id="Input";var ZE=yn(Av({name:"InputGroupStylesContext",errorMessage:"useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),XE=ZE[0],$E=ZE[1],KE=Cv((function(e,t){var n=Pv("Input",e),r=ua(e),o=r.children,i=r.className,a=sn(r,G),s=Wv("chakra-input__group",i),l={},u=d_(o),c=n.field;u.forEach((function(e){if(n){var t,r;if(c&&"InputLeftElement"===e.type.id)l.paddingStart=null!==(t=c.height)&&void 0!==t?t:c.h;if(c&&"InputRightElement"===e.type.id)l.paddingEnd=null!==(r=c.height)&&void 0!==r?r:c.h;"InputRightAddon"===e.type.id&&(l.borderEndRadius=0),"InputLeftAddon"===e.type.id&&(l.borderStartRadius=0)}}));var d=u.map((function(t){var n,r,o=qE({size:(null==(n=t.props)?void 0:n.size)||e.size,variant:(null==(r=t.props)?void 0:r.variant)||e.variant});return"Input"!==t.type.id?cr.cloneElement(t,o):cr.cloneElement(t,Object.assign(o,l,t.props))}));return qr.createElement(Lv.div,un({className:s,ref:t,__css:{width:"100%",display:"flex",position:"relative"}},a),qr.createElement(XE,{value:n},d))}));KE.displayName="InputGroup";var QE={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},JE=Lv("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),eP=Cv((function(e,t){var n,r=e.placement,o=void 0===r?"left":r,i=sn(e,q),a=null!==(n=QE[o])&&void 0!==n?n:{},s=$E();return qr.createElement(JE,un(un({ref:t},i),{},{__css:un(un({},s.addon),a)}))}));eP.displayName="InputAddon";var tP=Cv((function(e,t){return qr.createElement(eP,un(un({ref:t,placement:"left"},e),{},{className:Wv("chakra-input__left-addon",e.className)}))}));tP.displayName="InputLeftAddon",tP.id="InputLeftAddon";var nP=Cv((function(e,t){return qr.createElement(eP,un(un({ref:t,placement:"right"},e),{},{className:Wv("chakra-input__right-addon",e.className)}))}));nP.displayName="InputRightAddon",nP.id="InputRightAddon";var rP=Lv("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),oP=Cv((function(e,t){var n,r,o,i=e.placement,a=void 0===i?"left":i,s=sn(e,Y),l=$E(),u=l.field,c=un((gn(o={},"left"===a?"insetStart":"insetEnd","0"),gn(o,"width",null!==(n=null==u?void 0:u.height)&&void 0!==n?n:null==u?void 0:u.h),gn(o,"height",null!==(r=null==u?void 0:u.height)&&void 0!==r?r:null==u?void 0:u.h),gn(o,"fontSize",null==u?void 0:u.fontSize),o),l.element);return qr.createElement(rP,un({ref:t,__css:c},s))}));oP.id="InputElement",oP.displayName="InputElement";var iP=Cv((function(e,t){var n=e.className,r=sn(e,Z),o=Wv("chakra-input__left-element",n);return qr.createElement(oP,un({ref:t,placement:"left",className:o},r))}));iP.id="InputLeftElement",iP.displayName="InputLeftElement";var aP=Cv((function(e,t){var n=e.className,r=sn(e,X),o=Wv("chakra-input__right-element",n);return qr.createElement(oP,un({ref:t,placement:"right",className:o},r))}));function sP(e,t){return Array.isArray(e)?e.map((function(e){return null===e?null:t(e)})):function(e){var t=kn(e);return null!=e&&("object"===t||"function"===t)&&!Array.isArray(e)}(e)?Object.keys(e).reduce((function(n,r){return n[r]=t(e[r]),n}),{}):null!=e?t(e):null}aP.id="InputRightElement",aP.displayName="InputRightElement";var lP=Cv((function(e,t){var n=e.ratio,r=void 0===n?4/3:n,o=e.children,i=e.className,a=sn(e,$),s=cr.Children.only(o),l=Wv("chakra-aspect-ratio",i);return qr.createElement(Lv.div,un({ref:t,position:"relative",className:l,_before:{height:0,content:'""',display:"block",paddingBottom:sP(r,(function(e){return"".concat(1/e*100,"%")}))},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}}},a),s)}));lP.displayName="AspectRatio";var uP=Cv((function(e,t){var n=Ev("Badge",e),r=ua(e),o=(r.className,sn(r,K));return qr.createElement(Lv.span,un(un({ref:t,className:Wv("chakra-badge",e.className)},o),{},{__css:un({display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle"},n)}))}));uP.displayName="Badge";var cP=Lv("div");cP.displayName="Box";var dP=Cv((function(e,t){var n=e.size,r=e.centerContent,o=void 0===r||r,i=sn(e,Q),a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return qr.createElement(cP,un({ref:t,boxSize:n,__css:un(un({},a),{},{flexShrink:0,flexGrow:0})},i))}));dP.displayName="Square";var fP=Cv((function(e,t){var n=e.size,r=sn(e,J);return qr.createElement(dP,un({size:n,ref:t,borderRadius:"9999px"},r))}));fP.displayName="Circle";var hP=Lv("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});hP.displayName="Center";var pP={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Cv((function(e,t){var n=e.axis,r=void 0===n?"both":n,o=sn(e,ee);return qr.createElement(Lv.div,un(un({ref:t,__css:pP[r]},o),{},{position:"absolute"}))}));var vP=Cv((function(e,t){var n=Ev("Code",e),r=ua(e),o=(r.className,sn(r,te));return qr.createElement(Lv.code,un(un({ref:t,className:Wv("chakra-code",e.className)},o),{},{__css:un({display:"inline-block"},n)}))}));vP.displayName="Code";var gP=Cv((function(e,t){var n=ua(e),r=n.className,o=n.centerContent,i=sn(n,ne),a=Ev("Container",e);return qr.createElement(Lv.div,un(un({ref:t,className:Wv("chakra-container",r)},i),{},{__css:un(un({},a),o&&{display:"flex",flexDirection:"column",alignItems:"center"})}))}));gP.displayName="Container";var mP=Cv((function(e,t){var n=Ev("Divider",e),r=n.borderLeftWidth,o=n.borderBottomWidth,i=n.borderTopWidth,a=n.borderRightWidth,s=n.borderWidth,l=n.borderStyle,u=n.borderColor,c=sn(n,re),d=ua(e),f=d.className,h=d.orientation,p=void 0===h?"horizontal":h,v=d.__css,g=sn(d,oe),m={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:o||i||s||"1px",width:"100%"}};return qr.createElement(Lv.hr,un(un({ref:t,"aria-orientation":p},g),{},{__css:un(un(un({},c),{},{border:"0",borderColor:u,borderStyle:l},m[p]),v),className:Wv("chakra-divider",f)}))}));mP.displayName="Divider";var yP=Cv((function(e,t){var n=e.direction,r=e.align,o=e.justify,i=e.wrap,a=e.basis,s=e.grow,l=e.shrink,u=sn(e,ie),c={display:"flex",flexDirection:n,alignItems:r,justifyContent:o,flexWrap:i,flexBasis:a,flexGrow:s,flexShrink:l};return qr.createElement(Lv.div,un({ref:t,__css:c},u))}));yP.displayName="Flex";var bP=Cv((function(e,t){var n=e.templateAreas,r=e.gap,o=e.rowGap,i=e.columnGap,a=e.column,s=e.row,l=e.autoFlow,u=e.autoRows,c=e.templateRows,d=e.autoColumns,f=e.templateColumns,h=sn(e,ae),p={display:"grid",gridTemplateAreas:n,gridGap:r,gridRowGap:o,gridColumnGap:i,gridAutoColumns:d,gridColumn:a,gridRow:s,gridAutoFlow:l,gridAutoRows:u,gridTemplateRows:c,gridTemplateColumns:f};return qr.createElement(Lv.div,un({ref:t,__css:p},h))}));function wP(e){return sP(e,(function(e){return"auto"===e?"auto":"span ".concat(e,"/span ").concat(e)}))}bP.displayName="Grid";var kP=Cv((function(e,t){var n=e.area,r=e.colSpan,o=e.colStart,i=e.colEnd,a=e.rowEnd,s=e.rowSpan,l=e.rowStart,u=sn(e,se),c=qE({gridArea:n,gridColumn:wP(r),gridRow:wP(s),gridColumnStart:o,gridColumnEnd:i,gridRowStart:l,gridRowEnd:a});return qr.createElement(Lv.div,un({ref:t,__css:c},u))}));kP.displayName="GridItem";var xP=Cv((function(e,t){var n=Ev("Heading",e),r=ua(e),o=(r.className,sn(r,le));return qr.createElement(Lv.h2,un(un({ref:t,className:Wv("chakra-heading",e.className)},o),{},{__css:n}))}));xP.displayName="Heading",Cv((function(e,t){var n=Ev("Mark",e),r=ua(e);return qr.createElement(cP,un(un({ref:t},r),{},{as:"mark",__css:un({bg:"transparent",whiteSpace:"nowrap"},n)}))}));var SP=Cv((function(e,t){var n=Ev("Kbd",e),r=ua(e),o=r.className,i=sn(r,ue);return qr.createElement(Lv.kbd,un(un({ref:t,className:Wv("chakra-kbd",o)},i),{},{__css:un({fontFamily:"mono"},n)}))}));SP.displayName="Kbd";var CP=Cv((function(e,t){var n=Ev("Link",e),r=ua(e),o=r.className,i=r.isExternal,a=sn(r,ce);return qr.createElement(Lv.a,un(un({target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:t,className:Wv("chakra-link",o)},a),{},{__css:n}))}));CP.displayName="Link",Cv((function(e,t){var n=e.isExternal,r=e.target,o=e.rel,i=e.className,a=sn(e,de);return qr.createElement(Lv.a,un(un({},a),{},{ref:t,className:Wv("chakra-linkbox__overlay",i),rel:n?"noopener noreferrer":o,target:n?"_blank":r,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}}))})),Cv((function(e,t){var n=e.className,r=sn(e,fe);return qr.createElement(Lv.div,un(un({ref:t,position:"relative"},r),{},{className:Wv("chakra-linkbox",n),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}}))}));var _P=yn(Av({name:"ListStylesContext",errorMessage:"useListStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),EP=_P[0],PP=_P[1],LP=Cv((function(e,t){var n=Pv("List",e),r=ua(e),o=r.children,i=r.styleType,a=void 0===i?"none":i,s=r.stylePosition,l=r.spacing,u=sn(r,he),c=d_(o),d=l?gn({},"& > *:not(style) ~ *:not(style)",{mt:l}):{};return qr.createElement(EP,{value:n},qr.createElement(Lv.ul,un({ref:t,listStyleType:a,listStylePosition:s,role:"list",__css:un(un({},n.container),d)},u),c))}));LP.displayName="List",Cv((function(e,t){e.as;var n=sn(e,pe);return qr.createElement(LP,un({ref:t,as:"ol",styleType:"decimal",marginStart:"1em"},n))})).displayName="OrderedList",Cv((function(e,t){e.as;var n=sn(e,ve);return qr.createElement(LP,un({ref:t,as:"ul",styleType:"initial",marginStart:"1em"},n))})).displayName="UnorderedList";var OP=Cv((function(e,t){var n=PP();return qr.createElement(Lv.li,un(un({ref:t},e),{},{__css:n.item}))}));OP.displayName="ListItem";var AP=Cv((function(e,t){var n=PP();return qr.createElement(Gv,un(un({ref:t,role:"presentation"},e),{},{__css:n.icon}))}));AP.displayName="ListIcon";var MP=Cv((function(e,t){var n=e.columns,r=e.spacingX,o=e.spacingY,i=e.spacing,a=e.minChildWidth,s=sn(e,ge),l=vv(),u=a?function(e,t){return sP(e,(function(e){var n=function(e,t,n){var r=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n];return function(n){var i=o.filter(Boolean),a=r.map((function(t,r){var o,a;if("breakpoints"===e)return function(e,t,n){var r,o;if(null==t)return t;var i=function(t){var n,r;return null==(r=null==(n=e.__breakpoints)?void 0:n.asArray)?void 0:r[t]};return null!==(r=null!==(o=i(t))&&void 0!==o?o:i(n))&&void 0!==r?r:n}(n,t,null!==(a=i[r])&&void 0!==a?a:t);var s="".concat(e,".").concat(t);return function(e,t,n){var r,o;if(null==t)return t;var i=function(t){var n,r;return null==(r=null==(n=e.__cssMap)?void 0:n[t])?void 0:r.value};return null!==(r=null!==(o=i(t))&&void 0!==o?o:i(n))&&void 0!==r?r:n}(n,s,null!==(o=i[r])&&void 0!==o?o:t)}));return Array.isArray(t)?a:a[0]}}("sizes",e,function(e){return"number"==typeof e?"".concat(e,"px"):e}(e))(t);return null===e?null:"repeat(auto-fit, minmax(".concat(n,", 1fr))")}))}(a,l):sP(n,(function(e){return null===e?null:"repeat(".concat(e,", minmax(0, 1fr))")}));return qr.createElement(bP,un({ref:t,gap:i,columnGap:r,rowGap:o,templateColumns:u},s))}));MP.displayName="SimpleGrid";var TP=Lv("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});TP.displayName="Spacer";var IP="& > *:not(style) ~ *:not(style)";var RP=function(e){return qr.createElement(Lv.div,un(un({className:"chakra-stack__item"},e),{},{__css:un({display:"inline-block",flex:"0 0 auto",minWidth:0},e.__css)}))};RP.displayName="StackItem";var NP=Cv((function(e,t){var n=e.isInline,r=e.direction,o=e.align,i=e.justify,a=e.spacing,s=void 0===a?"0.5rem":a,l=e.wrap,u=e.children,c=e.divider,d=e.className,f=e.shouldWrapChildren,h=sn(e,me),p=n?"row":null!=r?r:"column",v=cr.useMemo((function(){return function(e){var t=e.spacing,n=e.direction,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return gn({flexDirection:n},IP,sP(n,(function(e){return r[e]})))}({direction:p,spacing:s})}),[p,s]),g=cr.useMemo((function(){return function(e){var t=e.spacing,n=e.direction,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":sP(n,(function(e){return r[e]}))}}({spacing:s,direction:p})}),[s,p]),m=!!c,y=!f&&!m,b=cr.useMemo((function(){var e=d_(u);return y?e:e.map((function(t,n){var r=void 0!==t.key?t.key:n,o=n+1===e.length,i=f?qr.createElement(RP,{key:r},t):t;if(!m)return i;var a=cr.cloneElement(c,{__css:g}),s=o?null:a;return qr.createElement(cr.Fragment,{key:r},i,s)}))}),[c,g,m,y,f,u]),w=Wv("chakra-stack",d);return qr.createElement(Lv.div,un({ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:v.flexDirection,flexWrap:l,className:w,__css:m?{}:gn({},IP,v[IP])},h),b)}));NP.displayName="Stack";var DP=Cv((function(e,t){return qr.createElement(NP,un(un({align:"center"},e),{},{direction:"row",ref:t}))}));DP.displayName="HStack";var zP=Cv((function(e,t){return qr.createElement(NP,un(un({align:"center"},e),{},{direction:"column",ref:t}))}));zP.displayName="VStack";var jP=Cv((function(e,t){var n=Ev("Text",e),r=ua(e),o=(r.className,r.align,r.decoration,r.casing,sn(r,ye)),i=qE({textAlign:e.align,textDecoration:e.decoration,textTransform:e.casing});return qr.createElement(Lv.p,un(un(un({ref:t,className:Wv("chakra-text",e.className)},i),o),{},{__css:n}))}));function BP(e){return"number"==typeof e?"".concat(e,"px"):e}jP.displayName="Text";var FP=Cv((function(e,t){var n=e.spacing,r=void 0===n?"0.5rem":n,o=e.spacingX,i=e.spacingY,a=e.children,s=e.justify,l=e.direction,u=e.align,c=e.className,d=e.shouldWrapChildren,f=sn(e,be),h=cr.useMemo((function(){var e={spacingX:o,spacingY:i},t=e.spacingX,n=void 0===t?r:t,a=e.spacingY,c=void 0===a?r:a;return{"--chakra-wrap-x-spacing":function(e){return sP(n,(function(t){return BP(xo("space",t)(e))}))},"--chakra-wrap-y-spacing":function(e){return sP(c,(function(t){return BP(xo("space",t)(e))}))},"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}}),[r,o,i,s,u,l]),p=cr.useMemo((function(){return d?cr.Children.map(a,(function(e,t){return qr.createElement(HP,{key:t},e)})):a}),[a,d]);return qr.createElement(Lv.div,un({ref:t,className:Wv("chakra-wrap",c),overflow:"hidden"},f),qr.createElement(Lv.ul,{className:"chakra-wrap__list",__css:h},p))}));FP.displayName="Wrap";var HP=Cv((function(e,t){var n=e.className,r=sn(e,we);return qr.createElement(Lv.li,un({ref:t,__css:{display:"flex",alignItems:"flex-start"},className:Wv("chakra-wrap__listitem",n)},r))}));HP.displayName="WrapItem";var VP={body:{classList:{add:function(){},remove:function(){}}},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}}},WP=function(){},UP={document:VP,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:WP,removeEventListener:WP,getComputedStyle:function(){return{getPropertyValue:function(){return""}}},matchMedia:function(){return{matches:!1,addListener:WP,removeListener:WP}},requestAnimationFrame:function(e){return"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){"undefined"!=typeof setTimeout&&clearTimeout(e)},setTimeout:function(){return 0},clearTimeout:WP,setInterval:function(){return 0},clearInterval:WP},GP="undefined"!=typeof window?{window:window,document:document}:{window:UP,document:VP},qP=cr.createContext(GP);function YP(e){var t=e.children,n=e.environment,r=yn(cr.useState(null),2),o=r[0],i=r[1],a=yn(cr.useState(!1),2),s=a[0],l=a[1];cr.useEffect((function(){return l(!0)}),[]);var u=cr.useMemo((function(){if(n)return n;var e=null==o?void 0:o.ownerDocument,t=null==o?void 0:o.ownerDocument.defaultView;return e?{document:e,window:t}:GP}),[o,n]);return qr.createElement(qP.Provider,{value:u},t,!n&&s&&qr.createElement("span",{id:"__chakra_env",hidden:!0,ref:function(e){cr.startTransition((function(){e&&i(e)}))}}))}qP.displayName="EnvironmentContext",YP.displayName="EnvironmentProvider";var ZP=function(e){return e?"":void 0};function XP(){var e=cr.useRef(new Map),t=e.current,n=cr.useCallback((function(t,n,r,o){e.current.set(r,{type:n,el:t,options:o}),t.addEventListener(n,r,o)}),[]),r=cr.useCallback((function(t,n,r,o){t.removeEventListener(n,r,o),e.current.delete(r)}),[]);return cr.useEffect((function(){return function(){t.forEach((function(e,t){r(e.el,e.type,t,e.options)}))}}),[r,t]),{add:n,remove:r}}function $P(e){var t=e.target,n=t.tagName,r=t.isContentEditable;return"INPUT"!==n&&"TEXTAREA"!==n&&!0!==r}function KP(e){return null!=e&&"object"==kn(e)&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function QP(e){var t;return!!KP(e)&&e instanceof(null!==(t=e.ownerDocument.defaultView)&&void 0!==t?t:window).HTMLElement}function JP(e){return KP(e)?e.ownerDocument:document}var eL=function(e){return e.hasAttribute("tabindex")};function tL(e){return!(!e.parentElement||!tL(e.parentElement))||e.hidden}function nL(e){if(!QP(e)||tL(e)||function(e){return!0===Boolean(e.getAttribute("disabled"))||!0===Boolean(e.getAttribute("aria-disabled"))}(e))return!1;var t=e.localName;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;var n={a:function(){return e.hasAttribute("href")},audio:function(){return e.hasAttribute("controls")},video:function(){return e.hasAttribute("controls")}};return t in n?n[t]():!!function(e){var t=e.getAttribute("contenteditable");return"false"!==t&&null!=t}(e)||eL(e)}function rL(e){return!!e&&(QP(e)&&nL(e)&&!function(e){return eL(e)&&-1===e.tabIndex}(e))}var oL=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"].join();function iL(e){var t=Array.from(e.querySelectorAll(oL));return t.unshift(e),t.filter((function(e){return nL(e)&&function(e){return e.offsetWidth>0&&e.offsetHeight>0}(e)}))}function aL(e){var t=e.current;if(!t)return!1;var n=function(e){return JP(e).activeElement}(t);return!!n&&(!t.contains(n)&&!!rL(n))}function sL(e,t){var n=t.shouldFocus,r=t.visible,o=t.focusRef,i=n&&!r;U_((function(){if(i&&!aL(e)){var t=(null==o?void 0:o.current)||e.current;t&&requestAnimationFrame((function(){t.focus()}))}}),[i,e,o])}var lL={preventScroll:!0,shouldFocus:!1};function uL(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lL,n=t.focusRef,r=t.preventScroll,o=t.shouldFocus,i=t.visible,a=cL(e)?e.current:e,s=o&&i,l=cr.useRef(s),u=cr.useRef(i);oo((function(){!u.current&&i&&(l.current=s),u.current=i}),[i,s]);var c=cr.useCallback((function(){if(i&&a&&l.current&&(l.current=!1,!a.contains(document.activeElement)))if(null==n?void 0:n.current)requestAnimationFrame((function(){var e;null==(e=n.current)||e.focus({preventScroll:r})}));else{var e=iL(a);e.length>0&&requestAnimationFrame((function(){e[0].focus({preventScroll:r})}))}}),[i,r,a,n]);U_((function(){c()}),[c]),DE(a,"transitionend",c)}function cL(e){return"current"in e}var dL="top",fL="bottom",hL="right",pL="left",vL="auto",gL=[dL,fL,hL,pL],mL="start",yL="end",bL="viewport",wL="popper",kL=gL.reduce((function(e,t){return e.concat([t+"-"+mL,t+"-"+yL])}),[]),xL=[].concat(gL,[vL]).reduce((function(e,t){return e.concat([t,t+"-"+mL,t+"-"+yL])}),[]),SL=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function CL(e){return e?(e.nodeName||"").toLowerCase():null}function _L(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function EL(e){return e instanceof _L(e).Element||e instanceof Element}function PL(e){return e instanceof _L(e).HTMLElement||e instanceof HTMLElement}function LL(e){return"undefined"!=typeof ShadowRoot&&(e instanceof _L(e).ShadowRoot||e instanceof ShadowRoot)}var OL={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];PL(o)&&CL(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});PL(r)&&CL(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function AL(e){return e.split("-")[0]}var ML=Math.max,TL=Math.min,IL=Math.round;function RL(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function NL(){return!/^((?!chrome|android).)*safari/i.test(RL())}function DL(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&PL(e)&&(o=e.offsetWidth>0&&IL(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&IL(r.height)/e.offsetHeight||1);var a=(EL(e)?_L(e):window).visualViewport,s=!NL()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,u=(r.top+(s&&a?a.offsetTop:0))/i,c=r.width/o,d=r.height/i;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l,x:l,y:u}}function zL(e){var t=DL(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function jL(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&LL(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function BL(e){return _L(e).getComputedStyle(e)}function FL(e){return["table","td","th"].indexOf(CL(e))>=0}function HL(e){return((EL(e)?e.ownerDocument:e.document)||window.document).documentElement}function VL(e){return"html"===CL(e)?e:e.assignedSlot||e.parentNode||(LL(e)?e.host:null)||HL(e)}function WL(e){return PL(e)&&"fixed"!==BL(e).position?e.offsetParent:null}function UL(e){for(var t=_L(e),n=WL(e);n&&FL(n)&&"static"===BL(n).position;)n=WL(n);return n&&("html"===CL(n)||"body"===CL(n)&&"static"===BL(n).position)?t:n||function(e){var t=/firefox/i.test(RL());if(/Trident/i.test(RL())&&PL(e)&&"fixed"===BL(e).position)return null;var n=VL(e);for(LL(n)&&(n=n.host);PL(n)&&["html","body"].indexOf(CL(n))<0;){var r=BL(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function GL(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qL(e,t,n){return ML(e,TL(t,n))}function YL(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ZL(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var XL={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=AL(n.placement),l=GL(s),u=[pL,hL].indexOf(s)>=0?"height":"width";if(i&&a){var c=function(e,t){return YL("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ZL(e,gL))}(o.padding,n),d=zL(i),f="y"===l?dL:pL,h="y"===l?fL:hL,p=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],v=a[l]-n.rects.reference[l],g=UL(i),m=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=p/2-v/2,b=c[f],w=m-d[u]-c[h],k=m/2-d[u]/2+y,x=qL(b,k,w),S=l;n.modifiersData[r]=((t={})[S]=x,t.centerOffset=x-k,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&jL(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $L(e){return e.split("-")[1]}var KL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function QL(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=a.x,h=void 0===f?0:f,p=a.y,v=void 0===p?0:p,g="function"==typeof c?c({x:h,y:v}):{x:h,y:v};h=g.x,v=g.y;var m=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=pL,w=dL,k=window;if(u){var x=UL(n),S="clientHeight",C="clientWidth";if(x===_L(n)&&"static"!==BL(x=HL(n)).position&&"absolute"===s&&(S="scrollHeight",C="scrollWidth"),o===dL||(o===pL||o===hL)&&i===yL)w=fL,v-=(d&&x===k&&k.visualViewport?k.visualViewport.height:x[S])-r.height,v*=l?1:-1;if(o===pL||(o===dL||o===fL)&&i===yL)b=hL,h-=(d&&x===k&&k.visualViewport?k.visualViewport.width:x[C])-r.width,h*=l?1:-1}var _,E=Object.assign({position:s},u&&KL),P=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:IL(t*r)/r||0,y:IL(n*r)/r||0}}({x:h,y:v}):{x:h,y:v};return h=P.x,v=P.y,l?Object.assign({},E,((_={})[w]=y?"0":"",_[b]=m?"0":"",_.transform=(k.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",_)):Object.assign({},E,((t={})[w]=y?v+"px":"",t[b]=m?h+"px":"",t.transform="",t))}var JL={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,u={placement:AL(t.placement),variation:$L(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,QL(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,QL(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},eO={passive:!0};var tO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,l=_L(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach((function(e){e.addEventListener("scroll",n.update,eO)})),s&&l.addEventListener("resize",n.update,eO),function(){i&&u.forEach((function(e){e.removeEventListener("scroll",n.update,eO)})),s&&l.removeEventListener("resize",n.update,eO)}},data:{}},nO={left:"right",right:"left",bottom:"top",top:"bottom"};function rO(e){return e.replace(/left|right|bottom|top/g,(function(e){return nO[e]}))}var oO={start:"end",end:"start"};function iO(e){return e.replace(/start|end/g,(function(e){return oO[e]}))}function aO(e){var t=_L(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function sO(e){return DL(HL(e)).left+aO(e).scrollLeft}function lO(e){var t=BL(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function uO(e){return["html","body","#document"].indexOf(CL(e))>=0?e.ownerDocument.body:PL(e)&&lO(e)?e:uO(VL(e))}function cO(e,t){var n;void 0===t&&(t=[]);var r=uO(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=_L(r),a=o?[i].concat(i.visualViewport||[],lO(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(cO(VL(a)))}function dO(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function fO(e,t,n){return t===bL?dO(function(e,t){var n=_L(e),r=HL(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=NL();(u||!u&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+sO(e),y:l}}(e,n)):EL(t)?function(e,t){var n=DL(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):dO(function(e){var t,n=HL(e),r=aO(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=ML(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=ML(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+sO(e),l=-r.scrollTop;return"rtl"===BL(o||n).direction&&(s+=ML(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(HL(e)))}function hO(e,t,n,r){var o="clippingParents"===t?function(e){var t=cO(VL(e)),n=["absolute","fixed"].indexOf(BL(e).position)>=0&&PL(e)?UL(e):e;return EL(n)?t.filter((function(e){return EL(e)&&jL(e,n)&&"body"!==CL(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=fO(e,n,r);return t.top=ML(o.top,t.top),t.right=TL(o.right,t.right),t.bottom=TL(o.bottom,t.bottom),t.left=ML(o.left,t.left),t}),fO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function pO(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?AL(o):null,a=o?$L(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case dL:t={x:s,y:n.y-r.height};break;case fL:t={x:s,y:n.y+n.height};break;case hL:t={x:n.x+n.width,y:l};break;case pL:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=i?GL(i):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case mL:t[u]=t[u]-(n[c]/2-r[c]/2);break;case yL:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function vO(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?"clippingParents":s,u=n.rootBoundary,c=void 0===u?bL:u,d=n.elementContext,f=void 0===d?wL:d,h=n.altBoundary,p=void 0!==h&&h,v=n.padding,g=void 0===v?0:v,m=YL("number"!=typeof g?g:ZL(g,gL)),y=f===wL?"reference":wL,b=e.rects.popper,w=e.elements[p?y:f],k=hO(EL(w)?w:w.contextElement||HL(e.elements.popper),l,c,a),x=DL(e.elements.reference),S=pO({reference:x,element:b,strategy:"absolute",placement:o}),C=dO(Object.assign({},b,S)),_=f===wL?C:x,E={top:k.top-_.top+m.top,bottom:_.bottom-k.bottom+m.bottom,left:k.left-_.left+m.left,right:_.right-k.right+m.right},P=e.modifiersData.offset;if(f===wL&&P){var L=P[o];Object.keys(E).forEach((function(e){var t=[hL,fL].indexOf(e)>=0?1:-1,n=[dL,fL].indexOf(e)>=0?"y":"x";E[e]+=L[n]*t}))}return E}function gO(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?xL:l,c=$L(r),d=c?s?kL:kL.filter((function(e){return $L(e)===c})):gL,f=d.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=d);var h=f.reduce((function(t,n){return t[n]=vO(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[AL(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var mO={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,v=n.allowedAutoPlacements,g=t.options.placement,m=AL(g),y=l||(m===g||!p?[rO(g)]:function(e){if(AL(e)===vL)return[];var t=rO(e);return[iO(e),t,iO(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(AL(n)===vL?gO(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:v}):n)}),[]),w=t.rects.reference,k=t.rects.popper,x=new Map,S=!0,C=b[0],_=0;_=0,A=O?"width":"height",M=vO(t,{placement:E,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),T=O?L?hL:pL:L?fL:dL;w[A]>k[A]&&(T=rO(T));var I=rO(T),R=[];if(i&&R.push(M[P]<=0),s&&R.push(M[T]<=0,M[I]<=0),R.every((function(e){return e}))){C=E,S=!1;break}x.set(E,R)}if(S)for(var N=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return C=t,"break"},D=p?3:1;D>0;D--){if("break"===N(D))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function yO(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bO(e){return[dL,hL,fL,pL].some((function(t){return e[t]>=0}))}var wO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=vO(t,{elementContext:"reference"}),s=vO(t,{altBoundary:!0}),l=yO(a,r),u=yO(s,o,i),c=bO(l),d=bO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};var kO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=xL.reduce((function(e,n){return e[n]=function(e,t,n){var r=AL(e),o=[pL,dL].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[pL,hL].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}};var xO={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=pO({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var SO={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=void 0===f||f,p=n.tetherOffset,v=void 0===p?0:p,g=vO(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),m=AL(t.placement),y=$L(t.placement),b=!y,w=GL(m),k="x"===w?"y":"x",x=t.modifiersData.popperOffsets,S=t.rects.reference,C=t.rects.popper,_="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,E="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(x){if(i){var O,A="y"===w?dL:pL,M="y"===w?fL:hL,T="y"===w?"height":"width",I=x[w],R=I+g[A],N=I-g[M],D=h?-C[T]/2:0,z=y===mL?S[T]:C[T],j=y===mL?-C[T]:-S[T],B=t.elements.arrow,F=h&&B?zL(B):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=H[A],W=H[M],U=qL(0,S[T],F[T]),G=b?S[T]/2-D-U-V-E.mainAxis:z-U-V-E.mainAxis,q=b?-S[T]/2+D+U+W+E.mainAxis:j+U+W+E.mainAxis,Y=t.elements.arrow&&UL(t.elements.arrow),Z=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,X=null!=(O=null==P?void 0:P[w])?O:0,$=I+q-X,K=qL(h?TL(R,I+G-X-Z):R,I,h?ML(N,$):N);x[w]=K,L[w]=K-I}if(s){var Q,J="x"===w?dL:pL,ee="x"===w?fL:hL,te=x[k],ne="y"===k?"height":"width",re=te+g[J],oe=te-g[ee],ie=-1!==[dL,pL].indexOf(m),ae=null!=(Q=null==P?void 0:P[k])?Q:0,se=ie?re:te-S[ne]-C[ne]-ae+E.altAxis,le=ie?te+S[ne]+C[ne]-ae-E.altAxis:oe,ue=h&&ie?function(e,t,n){var r=qL(e,t,n);return r>n?n:r}(se,te,le):qL(h?se:re,te,h?le:oe);x[k]=ue,L[k]=ue-te}t.modifiersData[r]=L}},requiresIfExists:["offset"]};function CO(e,t,n){void 0===n&&(n=!1);var r=PL(t),o=PL(t)&&function(e){var t=e.getBoundingClientRect(),n=IL(t.width)/e.offsetWidth||1,r=IL(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=HL(t),a=DL(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==CL(t)||lO(i))&&(s=function(e){return e!==_L(e)&&PL(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:aO(e);var t}(t)),PL(t)?((l=DL(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=sO(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function _O(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function EO(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var PO={placement:"bottom",modifiers:[],strategy:"absolute"};function LO(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:"ltr",o=(null==(n=UO[e])?void 0:n[r])||e;return"ltr"===r?o:null!==(t=GO[e])&&void 0!==t?t:o}function YO(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.enabled,n=void 0===t||t,r=e.modifiers,o=e.placement,i=void 0===o?"bottom":o,a=e.strategy,s=void 0===a?"absolute":a,l=e.arrowPadding,u=void 0===l?8:l,c=e.eventListeners,d=void 0===c||c,f=e.offset,h=e.gutter,p=void 0===h?8:h,v=e.flip,g=void 0===v||v,m=e.boundary,y=void 0===m?"clippingParents":m,b=e.preventOverflow,w=void 0===b||b,k=e.matchWidth,x=e.direction,S=void 0===x?"ltr":x,C=cr.useRef(null),_=cr.useRef(null),E=cr.useRef(null),P=qO(i,S),L=cr.useRef((function(){})),O=cr.useCallback((function(){var e;n&&C.current&&_.current&&(null==(e=L.current)||e.call(L),E.current=AO(C.current,_.current,{placement:P,modifiers:[VO,BO,zO,un(un({},DO),{},{enabled:!!k}),un({name:"eventListeners"},NO(d)),{name:"arrow",options:{padding:u}},{name:"offset",options:{offset:null!=f?f:[0,p]}},{name:"flip",enabled:!!g,options:{padding:8}},{name:"preventOverflow",enabled:!!w,options:{boundary:y}}].concat(cn(null!=r?r:[])),strategy:s}),E.current.forceUpdate(),L.current=E.current.destroy)}),[P,n,r,k,d,u,f,p,g,w,y,s]);cr.useEffect((function(){return function(){var e;C.current||_.current||(null==(e=E.current)||e.destroy(),E.current=null)}}),[]);var A=cr.useCallback((function(e){C.current=e,O()}),[O]),M=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(A,t)})}),[A]),T=cr.useCallback((function(e){_.current=e,O()}),[O]),I=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(T,t),style:un(un({},e.style),{},{position:s,minWidth:k?void 0:"max-content",inset:"0 auto auto 0"})})}),[s,T,k]),R=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(e.size,e.shadowColor,e.bg,e.style,sn(e,xe));return un(un({},n),{},{ref:t,"data-popper-arrow":"",style:ZO(e)})}),[]),N=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,"data-popper-arrow-inner":""})}),[]);return{update:function(){var e;null==(e=E.current)||e.update()},forceUpdate:function(){var e;null==(e=E.current)||e.forceUpdate()},transformOrigin:TO.transformOrigin.varRef,referenceRef:A,popperRef:T,getPopperProps:I,getArrowProps:R,getArrowInnerProps:N,getReferenceProps:M}}function ZO(e){var t=e.size,n=e.shadowColor,r=e.bg,o=un(un({},e.style),{},{position:"absolute"});return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function XO(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onClose,n=e.onOpen,r=e.isOpen,o=e.id,i=Yv(n),a=Yv(t),s=cr.useState(e.defaultIsOpen||!1),l=yn(s,2),u=l[0],c=l[1],d=void 0!==r?r:u,f=void 0!==r,h=cr.useId(),p=null!=o?o:"disclosure-".concat(h),v=cr.useCallback((function(){f||c(!1),null==a||a()}),[f,a]),g=cr.useCallback((function(){f||c(!0),null==i||i()}),[f,i]),m=cr.useCallback((function(){d?v():g()}),[d,g,v]);function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return un(un({},e),{},{"aria-expanded":d,"aria-controls":p,onClick:function(t){var n;null==(n=e.onClick)||n.call(e,t),m()}})}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return un(un({},e),{},{hidden:!d,id:p})}return{isOpen:d,onOpen:g,onClose:v,onToggle:m,isControlled:f,getButtonProps:y,getDisclosureProps:b}}function $O(e){var t=e.isOpen,n=e.ref,r=yn(cr.useState(t),2),o=r[0],i=r[1],a=yn(cr.useState(!1),2),s=a[0],l=a[1];return cr.useEffect((function(){s||(i(t),l(!0))}),[t,s,o]),DE((function(){return n.current}),"animationend",(function(){i(t)})),{present:!(!t&&!o),onComplete:function(){var e,t=function(e){var t,n;return null!==(t=null==(n=JP(e))?void 0:n.defaultView)&&void 0!==t?t:window}(n.current),r=new t.CustomEvent("animationend",{bubbles:!0});null==(e=n.current)||e.dispatchEvent(r)}}}function KO(e){var t=e.wasSelected,n=e.enabled,r=e.isSelected,o=e.mode;return!n||(!!r||!("keepMounted"!==(void 0===o?"unmount":o)||!t))}var QO={},JO={get exports(){return QO},set exports(e){QO=e}},eA={},tA={},nA={get exports(){return tA},set exports(e){tA=e}},rA={}; /** * @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(e,t){var n=e.length;e.push(t);e:for(;0>>1,i=e[r];if(!(0>>1;ro(l,n))uo(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(uo(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===("undefined"==typeof performance?"undefined":kn(performance))&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,h=!1,p=!1,v=!1,g="function"==typeof setTimeout?setTimeout:null,m="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))break;r(u),o.sortIndex=o.expirationTime,t(l,o)}o=n(u)}}function w(e){if(v=!1,b(e),!p)if(null!==n(l))p=!0,T(k);else{var t=n(u);null!==t&&I(w,t.startTime-e)}}function k(t,o){p=!1,v&&(v=!1,m(_),_=-1),h=!0;var i=f;try{for(b(o),d=n(l);null!==d&&(!(d.expirationTime>o)||t&&!L());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(o)}else r(l);d=n(l)}if(null!==d)var c=!0;else{var g=n(u);null!==g&&I(w,g.startTime-o),c=!1}return c}finally{d=null,f=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,S=!1,C=null,_=-1,E=5,P=-1;function L(){return!(e.unstable_now()-Pe||125a?(r.sortIndex=i,t(u,r),null===n(l)&&r===n(u)&&(v?(m(_),_=-1):v=!0,I(w,i-a))):(r.sortIndex=s,t(l,r),p||h||(p=!0,T(k))),r},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(rA),function(e){e.exports=rA}(nA); /** * @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 oA=cr,iA=tA;function aA(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nt}return!1}function mA(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var yA={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){yA[e]=new mA(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];yA[t]=new mA(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){yA[e]=new mA(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){yA[e]=new mA(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){yA[e]=new mA(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){yA[e]=new mA(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){yA[e]=new mA(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){yA[e]=new mA(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){yA[e]=new mA(e,5,!1,e.toLowerCase(),null,!1,!1)}));var bA=/[\-:]([a-z])/g;function wA(e){return e[1].toUpperCase()}function kA(e,t,n,r){var o=yA.hasOwnProperty(t)?yA[t]:null;(null!==o?0!==o.type:r||!(2--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{HA=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?FA(e):""}function WA(e){switch(e.tag){case 5:return FA(e.type);case 16:return FA("Lazy");case 13:return FA("Suspense");case 19:return FA("SuspenseList");case 0:case 2:case 15:return e=VA(e.type,!1);case 11:return e=VA(e.type.render,!1);case 1:return e=VA(e.type,!0);default:return""}}function UA(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case _A:return"Fragment";case CA:return"Portal";case PA:return"Profiler";case EA:return"StrictMode";case MA:return"Suspense";case TA:return"SuspenseList"}if("object"===kn(e))switch(e.$$typeof){case OA:return(e.displayName||"Context")+".Consumer";case LA:return(e._context.displayName||"Context")+".Provider";case AA:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case IA:return null!==(t=e.displayName||null)?t:UA(e.type)||"Memo";case RA:t=e._payload,e=e._init;try{return UA(e(t))}catch(qke){}}return null}function GA(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=(e=t.render).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 UA(t);case 8:return t===EA?"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("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function qA(e){switch(kn(e)){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function YA(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ZA(e){e._valueTracker||(e._valueTracker=function(e){var t=YA(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function XA(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=YA(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function $A(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(nxe){return e.body}}function KA(e,t){var n=t.checked;return BA({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function QA(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=qA(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function JA(e,t){null!=(t=t.checked)&&kA(e,"checked",t,!1)}function eM(e,t){JA(e,t);var n=qA(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?nM(e,t.type,n):t.hasOwnProperty("defaultValue")&&nM(e,t.type,qA(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function tM(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function nM(e,t,n){"number"===t&&$A(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var rM=Array.isArray;function oM(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=dM.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function hM(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pM={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},vM=["Webkit","ms","Moz","O"];function gM(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pM.hasOwnProperty(e)&&pM[e]?(""+t).trim():t+"px"}function mM(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=gM(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(pM).forEach((function(e){vM.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pM[t]=pM[e]}))}));var yM=BA({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 bM(e,t){if(t){if(yM[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(aA(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(aA(60));if("object"!==kn(t.dangerouslySetInnerHTML)||!("__html"in t.dangerouslySetInnerHTML))throw Error(aA(61))}if(null!=t.style&&"object"!==kn(t.style))throw Error(aA(62))}}function wM(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;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 kM=null;function xM(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var SM=null,CM=null,_M=null;function EM(e){if(e=bN(e)){if("function"!=typeof SM)throw Error(aA(280));var t=e.stateNode;t&&(t=kN(t),SM(e.stateNode,e.type,t))}}function PM(e){CM?_M?_M.push(e):_M=[e]:CM=e}function LM(){if(CM){var e=CM,t=_M;if(_M=CM=null,EM(e),t)for(e=0;e>>=0,0===e?32:31-(lT(e)/uT|0)|0},lT=Math.log,uT=Math.LN2;var cT=64,dT=4194304;function fT(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hT(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=fT(s):0!==(i&=a)&&(r=fT(i))}else 0!==(a=n&~o)?r=fT(a):0!==i&&(r=fT(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function yT(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-sT(t)]=n}function bT(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-sT(n),o=1<=NI),jI=String.fromCharCode(32),BI=!1;function FI(e,t){switch(e){case"keyup":return-1!==II.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HI(e){return"object"===kn(e=e.detail)&&"data"in e?e.data:null}var VI=!1;var WI={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 UI(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!WI[e.type]:"textarea"===t}function GI(e,t,n,r){PM(r),0<(t=qR(t,"onChange")).length&&(n=new cI("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var qI=null,YI=null;function ZI(e){jR(e,0)}function XI(e){if(XA(wN(e)))return e}function $I(e,t){if("change"===e)return t}var KI=!1;if(dA){var QI;if(dA){var JI="oninput"in document;if(!JI){var eR=document.createElement("div");eR.setAttribute("oninput","return;"),JI="function"==typeof eR.oninput}QI=JI}else QI=!1;KI=QI&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=uR(r)}}function dR(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dR(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function fR(){for(var e=window,t=$A();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(Kke){n=!1}if(!n)break;t=$A((e=t.contentWindow).document)}return t}function hR(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pR(e){var t=fR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dR(n.ownerDocument.documentElement,n)){if(null!==r&&hR(n))if(t=r.start,void 0===(e=r.end)&&(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).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=cR(n,i);var a=cR(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n=document.documentMode,gR=null,mR=null,yR=null,bR=!1;function wR(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;bR||null==gR||gR!==$A(r)||("selectionStart"in(r=gR)&&hR(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},yR&&lR(yR,r)||(yR=r,0<(r=qR(mR,"onSelect")).length&&(t=new cI("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gR)))}function kR(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xR={animationend:kR("Animation","AnimationEnd"),animationiteration:kR("Animation","AnimationIteration"),animationstart:kR("Animation","AnimationStart"),transitionend:kR("Transition","TransitionEnd")},SR={},CR={};function _R(e){if(SR[e])return SR[e];if(!xR[e])return e;var t,n=xR[e];for(t in n)if(n.hasOwnProperty(t)&&t in CR)return SR[e]=n[t];return e}dA&&(CR=document.createElement("div").style,"AnimationEvent"in window||(delete xR.animationend.animation,delete xR.animationiteration.animation,delete xR.animationstart.animation),"TransitionEvent"in window||delete xR.transitionend.transition);var ER=_R("animationend"),PR=_R("animationiteration"),LR=_R("animationstart"),OR=_R("transitionend"),AR=new Map,MR="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 TR(e,t){AR.set(e,t),uA(t,[e])}for(var IR=0;IRSN||(e.current=xN[SN],xN[SN]=null,SN--)}function EN(e,t){SN++,xN[SN]=e.current,e.current=t}var PN={},LN=CN(PN),ON=CN(!1),AN=PN;function MN(e,t){var n=e.type.contextTypes;if(!n)return PN;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function TN(e){return null!=(e=e.childContextTypes)}function IN(){_N(ON),_N(LN)}function RN(e,t,n){if(LN.current!==PN)throw Error(aA(168));EN(LN,t),EN(ON,n)}function NN(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(aA(108,GA(e)||"Unknown",o));return BA({},n,r)}function DN(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||PN,AN=LN.current,EN(LN,e),EN(ON,ON.current),!0}function zN(e,t,n){var r=e.stateNode;if(!r)throw Error(aA(169));n?(e=NN(e,t,AN),r.__reactInternalMemoizedMergedChildContext=e,_N(ON),_N(LN),EN(LN,e)):_N(ON),EN(ON,n)}var jN=null,BN=!1,FN=!1;function HN(e){null===jN?jN=[e]:jN.push(e)}function VN(){if(!FN&&null!==jN){FN=!0;var e=0,t=wT;try{var n=jN;for(wT=1;e>=a,o-=a,$N=1<<32-sT(t)+o|n<v?(g=p,p=null):g=p.sibling;var m=f(o,p,s[v],l);if(null===m){null===p&&(p=g);break}e&&p&&null===m.alternate&&t(o,p),a=i(m,a,v),null===c?u=m:c.sibling=m,c=m,p=g}if(v===s.length)return n(o,p),oD&&QN(o,v),u;if(null===p){for(;vv?(g=p,p=null):g=p.sibling;var y=f(o,p,m.value,l);if(null===y){null===p&&(p=g);break}e&&p&&null===y.alternate&&t(o,p),a=i(y,a,v),null===c?u=y:c.sibling=y,c=y,p=g}if(m.done)return n(o,p),oD&&QN(o,v),u;if(null===p){for(;!m.done;v++,m=s.next())null!==(m=d(o,m.value,l))&&(a=i(m,a,v),null===c?u=m:c.sibling=m,c=m);return oD&&QN(o,v),u}for(p=r(o,p);!m.done;v++,m=s.next())null!==(m=h(p,o,v,m.value,l))&&(e&&null!==m.alternate&&p.delete(null===m.key?v:m.key),a=i(m,a,v),null===c?u=m:c.sibling=m,c=m);return e&&p.forEach((function(e){return t(o,e)})),oD&&QN(o,v),u}return function e(r,i,s,l){if("object"===kn(s)&&null!==s&&s.type===_A&&null===s.key&&(s=s.props.children),"object"===kn(s)&&null!==s){switch(s.$$typeof){case SA:e:{for(var u=s.key,c=i;null!==c;){if(c.key===u){if((u=s.type)===_A){if(7===c.tag){n(r,c.sibling),(i=o(c,s.props.children)).return=r,r=i;break e}}else if(c.elementType===u||"object"===kn(u)&&null!==u&&u.$$typeof===RA&&ZD(u)===c.type){n(r,c.sibling),(i=o(c,s.props)).ref=qD(r,c,s),i.return=r,r=i;break e}n(r,c);break}t(r,c),c=c.sibling}s.type===_A?((i=RF(s.props.children,r.mode,l,s.key)).return=r,r=i):((l=IF(s.type,s.key,s.props,null,r.mode,l)).ref=qD(r,i,s),l.return=r,r=l)}return a(r);case CA:e:{for(c=s.key;null!==i;){if(i.key===c){if(4===i.tag&&i.stateNode.containerInfo===s.containerInfo&&i.stateNode.implementation===s.implementation){n(r,i.sibling),(i=o(i,s.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=zF(s,r.mode,l)).return=r,r=i}return a(r);case RA:return e(r,i,(c=s._init)(s._payload),l)}if(rM(s))return p(r,i,s,l);if(zA(s))return v(r,i,s,l);YD(r,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,s)).return=r,r=i):(n(r,i),(i=DF(s,r.mode,l)).return=r,r=i),a(r)):n(r,i)}}var $D=XD(!0),KD=XD(!1),QD={},JD=CN(QD),ez=CN(QD),tz=CN(QD);function nz(e){if(e===QD)throw Error(aA(174));return e}function rz(e,t){switch(EN(tz,t),EN(ez,e),EN(JD,QD),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:cM(null,"");break;default:t=cM(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}_N(JD),EN(JD,t)}function oz(){_N(JD),_N(ez),_N(tz)}function iz(e){nz(tz.current);var t=nz(JD.current),n=cM(t,e.type);t!==n&&(EN(ez,e),EN(JD,n))}function az(e){ez.current===e&&(_N(JD),_N(ez))}var sz=CN(0);function lz(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uz=[];function cz(){for(var e=0;en?n:4,e(!0);var r=fz.transition;fz.transition={};try{e(!1),t()}finally{wT=n,fz.transition=r}}function Jz(){return Ez().memoizedState}function ej(e,t,n){var r=eF(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},nj(e))rj(t,n);else if(null!==(n=LD(e,t,n,r))){tF(n,e,r,JB()),oj(n,t,r)}}function tj(e,t,n){var r=eF(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(nj(e))rj(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,sR(s,a)){var l=t.interleaved;return null===l?(o.next=o,PD(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(hpe){}null!==(n=LD(e,t,o,r))&&(tF(n,e,r,o=JB()),oj(n,t,r))}}function nj(e){var t=e.alternate;return e===pz||null!==t&&t===pz}function rj(e,t){yz=mz=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oj(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bT(e,n)}}var ij={readContext:_D,useCallback:kz,useContext:kz,useEffect:kz,useImperativeHandle:kz,useInsertionEffect:kz,useLayoutEffect:kz,useMemo:kz,useReducer:kz,useRef:kz,useState:kz,useDebugValue:kz,useDeferredValue:kz,useTransition:kz,useMutableSource:kz,useSyncExternalStore:kz,useId:kz,unstable_isNewReconciler:!1},aj={readContext:_D,useCallback:function(e,t){return _z().memoizedState=[e,void 0===t?null:t],e},useContext:_D,useEffect:Vz,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Fz(4194308,4,qz.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fz(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fz(4,2,e,t)},useMemo:function(e,t){var n=_z();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_z();return t=void 0!==n?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=ej.bind(null,pz,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},_z().memoizedState=e},useState:zz,useDebugValue:Zz,useDeferredValue:function(e){return _z().memoizedState=e},useTransition:function(){var e=zz(!1),t=e[0];return e=Qz.bind(null,e[1]),_z().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pz,o=_z();if(oD){if(void 0===n)throw Error(aA(407));n=n()}else{if(n=t(),null===LB)throw Error(aA(349));0!=(30&hz)||Tz(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Vz(Rz.bind(null,r,i,e),[e]),r.flags|=2048,jz(9,Iz.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=_z(),t=LB.identifierPrefix;if(oD){var n=KN;t=":"+t+"R"+(n=($N&~(1<<32-sT($N)-1)).toString(32)+n),0<(n=bz++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=wz++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sj={readContext:_D,useCallback:Xz,useContext:_D,useEffect:Wz,useImperativeHandle:Yz,useInsertionEffect:Uz,useLayoutEffect:Gz,useMemo:$z,useReducer:Lz,useRef:Bz,useState:function(){return Lz(Pz)},useDebugValue:Zz,useDeferredValue:function(e){return Kz(Ez(),vz.memoizedState,e)},useTransition:function(){return[Lz(Pz)[0],Ez().memoizedState]},useMutableSource:Az,useSyncExternalStore:Mz,useId:Jz,unstable_isNewReconciler:!1},lj={readContext:_D,useCallback:Xz,useContext:_D,useEffect:Wz,useImperativeHandle:Yz,useInsertionEffect:Uz,useLayoutEffect:Gz,useMemo:$z,useReducer:Oz,useRef:Bz,useState:function(){return Oz(Pz)},useDebugValue:Zz,useDeferredValue:function(e){var t=Ez();return null===vz?t.memoizedState=e:Kz(t,vz.memoizedState,e)},useTransition:function(){return[Oz(Pz)[0],Ez().memoizedState]},useMutableSource:Az,useSyncExternalStore:Mz,useId:Jz,unstable_isNewReconciler:!1};function uj(e,t){try{var n="",r=t;do{n+=WA(r),r=r.return}while(r);var o=n}catch(Xke){o="\nError generating stack: "+Xke.message+"\n"+Xke.stack}return{value:e,source:t,stack:o,digest:null}}function cj(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function dj(e,t){try{console.error(t.value)}catch(qke){setTimeout((function(){throw qke}))}}var fj="function"==typeof WeakMap?WeakMap:Map;function hj(e,t,n){(n=ID(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){WB||(WB=!0,UB=r),dj(0,t)},n}function pj(e,t,n){(n=ID(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){dj(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){dj(0,t),"function"!=typeof r&&(null===GB?GB=new Set([this]):GB.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function vj(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new fj;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=CF.bind(null,e,t,n),t.then(e,e))}function gj(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function mj(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=ID(-1,1)).tag=2,RD(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var yj=xA.ReactCurrentOwner,bj=!1;function wj(e,t,n,r){t.child=null===e?KD(t,null,n,r):$D(t,e.child,n,r)}function kj(e,t,n,r,o){n=n.render;var i=t.ref;return CD(t,o),r=Sz(e,t,n,r,i,o),n=Cz(),null===e||bj?(oD&&n&&eD(t),t.flags|=1,wj(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wj(e,t,o))}function xj(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||MF(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=IF(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Sj(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:lR)(a,r)&&e.ref===t.ref)return Wj(e,t,o)}return t.flags|=1,(e=TF(i,r)).ref=t.ref,e.return=t,t.child=e}function Sj(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(lR(i,r)&&e.ref===t.ref){if(bj=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,Wj(e,t,o);0!=(131072&e.flags)&&(bj=!0)}}return Ej(e,t,n,r,o)}function Cj(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},EN(TB,MB),MB|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,EN(TB,MB),MB|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,EN(TB,MB),MB|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,EN(TB,MB),MB|=r;return wj(e,t,o,n),t.child}function _j(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ej(e,t,n,r,o){var i=TN(n)?AN:LN.current;return i=MN(t,i),CD(t,o),n=Sz(e,t,n,r,i,o),r=Cz(),null===e||bj?(oD&&r&&eD(t),t.flags|=1,wj(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wj(e,t,o))}function Pj(e,t,n,r,o){if(TN(n)){var i=!0;DN(t)}else i=!1;if(CD(t,o),null===t.stateNode)Vj(e,t),WD(t,n,r),GD(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"===kn(u)&&null!==u?u=_D(u):u=MN(t,u=TN(n)?AN:LN.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&UD(t,a,r,u),AD=!1;var f=t.memoizedState;a.state=f,zD(t,r,a,o),l=t.memoizedState,s!==r||f!==l||ON.current||AD?("function"==typeof c&&(FD(t,n,c,r),l=t.memoizedState),(s=AD||VD(t,n,s,r,f,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,TD(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:gD(t.type,s),a.props=u,d=t.pendingProps,f=a.context,"object"===kn(l=n.contextType)&&null!==l?l=_D(l):l=MN(t,l=TN(n)?AN:LN.current);var h=n.getDerivedStateFromProps;(c="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&UD(t,a,r,l),AD=!1,f=t.memoizedState,a.state=f,zD(t,r,a,o);var p=t.memoizedState;s!==d||f!==p||ON.current||AD?("function"==typeof h&&(FD(t,n,h,r),p=t.memoizedState),(u=AD||VD(t,n,u,r,f,p,l)||!1)?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Lj(e,t,n,r,i,o)}function Lj(e,t,n,r,o,i){_j(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&zN(t,n,!1),Wj(e,t,i);r=t.stateNode,yj.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=$D(t,e.child,null,i),t.child=$D(t,null,s,i)):wj(e,t,s,i),t.memoizedState=r.state,o&&zN(t,n,!0),t.child}function Oj(e){var t=e.stateNode;t.pendingContext?RN(0,t.pendingContext,t.pendingContext!==t.context):t.context&&RN(0,t.context,!1),rz(e,t.containerInfo)}function Aj(e,t,n,r,o){return hD(),pD(o),t.flags|=256,wj(e,t,n,r),t.child}var Mj,Tj,Ij,Rj={dehydrated:null,treeContext:null,retryLane:0};function Nj(e){return{baseLanes:e,cachePool:null,transitions:null}}function Dj(e,t,n){var r,o=t.pendingProps,i=sz.current,a=!1,s=0!=(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&0!=(2&i)),r?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),EN(sz,1&i),null===e)return uD(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(s=o.children,e=o.fallback,a?(o=t.mode,a=t.child,s={mode:"hidden",children:s},0==(1&o)&&null!==a?(a.childLanes=0,a.pendingProps=s):a=NF(s,o,0,null),e=RF(e,o,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Nj(n),t.memoizedState=Rj,e):zj(t,s));if(null!==(i=e.memoizedState)&&null!==(r=i.dehydrated))return function(e,t,n,r,o,i,a){if(n)return 256&t.flags?(t.flags&=-257,jj(e,t,a,r=cj(Error(aA(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=NF({mode:"visible",children:r.children},o,0,null),(i=RF(i,o,a,null)).flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,0!=(1&t.mode)&&$D(t,e.child,null,a),t.child.memoizedState=Nj(a),t.memoizedState=Rj,i);if(0==(1&t.mode))return jj(e,t,a,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var s=r.dgst;return r=s,jj(e,t,a,r=cj(i=Error(aA(419)),r,void 0))}if(s=0!=(a&e.childLanes),bj||s){if(null!==(r=LB)){switch(a&-a){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}0!==(o=0!=(o&(r.suspendedLanes|a))?0:o)&&o!==i.retryLane&&(i.retryLane=o,OD(e,o),tF(r,e,o,-1))}return pF(),jj(e,t,a,r=cj(Error(aA(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=EF.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,rD=uN(o.nextSibling),nD=t,oD=!0,iD=null,null!==e&&(YN[ZN++]=$N,YN[ZN++]=KN,YN[ZN++]=XN,$N=e.id,KN=e.overflow,XN=t),t=zj(t,r.children),t.flags|=4096,t)}(e,t,s,o,r,i,n);if(a){a=o.fallback,s=t.mode,r=(i=e.child).sibling;var l={mode:"hidden",children:o.children};return 0==(1&s)&&t.child!==i?((o=t.child).childLanes=0,o.pendingProps=l,t.deletions=null):(o=TF(i,l)).subtreeFlags=14680064&i.subtreeFlags,null!==r?a=TF(r,a):(a=RF(a,s,n,null)).flags|=2,a.return=t,o.return=t,o.sibling=a,t.child=o,o=a,a=t.child,s=null===(s=e.child.memoizedState)?Nj(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=Rj,o}return e=(a=e.child).sibling,o=TF(a,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function zj(e,t){return(t=NF({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function jj(e,t,n,r){return null!==r&&pD(r),$D(t,e.child,null,n),(e=zj(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Bj(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),SD(e.return,t,n)}function Fj(e,t,n,r,o){var i=e.memoizedState;null===i?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 Hj(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(wj(e,t,r.children,n),0!=(2&(r=sz.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Bj(e,n,t);else if(19===e.tag)Bj(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(EN(sz,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===lz(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Fj(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===lz(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Fj(t,!0,n,null,i);break;case"together":Fj(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vj(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wj(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),NB|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(aA(153));if(null!==t.child){for(n=TF(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=TF(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Uj(e,t){if(!oD)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Gj(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)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 qj(e,t,n){var r=t.pendingProps;switch(tD(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gj(t),null;case 1:case 17:return TN(t.type)&&IN(),Gj(t),null;case 3:return r=t.stateNode,oz(),_N(ON),_N(LN),cz(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(dD(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==iD&&(iF(iD),iD=null))),Gj(t),null;case 5:az(t);var o=nz(tz.current);if(n=t.type,null!==e&&null!=t.stateNode)Tj(e,t,n,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(aA(166));return Gj(t),null}if(e=nz(JD.current),dD(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[fN]=t,r[hN]=i,e=0!=(1&t.mode),n){case"dialog":BR("cancel",r),BR("close",r);break;case"iframe":case"object":case"embed":BR("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),"select"===n&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[fN]=t,e[hN]=r,Mj(e,t),t.stateNode=e;e:{switch(a=wM(n,r),n){case"dialog":BR("cancel",e),BR("close",e),o=r;break;case"iframe":case"object":case"embed":BR("load",e),o=r;break;case"video":case"audio":for(o=0;oHB&&(t.flags|=128,r=!0,Uj(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=lz(a))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Uj(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!oD)return Gj(t),null}else 2*QM()-i.renderingStartTime>HB&&1073741824!==n&&(t.flags|=128,r=!0,Uj(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(n=i.last)?n.sibling=a:t.child=a,i.last=a)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=QM(),t.sibling=null,n=sz.current,EN(sz,r?1&n|2:1&n),t):(Gj(t),null);case 22:case 23:return cF(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&MB)&&(Gj(t),6&t.subtreeFlags&&(t.flags|=8192)):Gj(t),null;case 24:case 25:return null}throw Error(aA(156,t.tag))}function Yj(e,t){switch(tD(t),t.tag){case 1:return TN(t.type)&&IN(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return oz(),_N(ON),_N(LN),cz(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return az(t),null;case 13:if(_N(sz),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(aA(340));hD()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return _N(sz),null;case 4:return oz(),null;case 10:return xD(t.type._context),null;case 22:case 23:return cF(),null;default:return null}}Mj=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Tj=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,nz(JD.current);var i,a=null;switch(n){case"input":o=KA(e,o),r=KA(e,r),a=[];break;case"select":o=BA({},o,{value:void 0}),r=BA({},r,{value:void 0}),a=[];break;case"textarea":o=iM(e,o),r=iM(e,r),a=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=JR)}for(u in bM(n,r),n=null,o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&null!=o[u])if("style"===u){var s=o[u];for(i in s)s.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(lA.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var l=r[u];if(s=null!=o?o[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(null!=l||null!=s))if("style"===u)if(s){for(i in s)!s.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in l)l.hasOwnProperty(i)&&s[i]!==l[i]&&(n||(n={}),n[i]=l[i])}else n||(a||(a=[]),a.push(u,n)),n=l;else"dangerouslySetInnerHTML"===u?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(a=a||[]).push(u,l)):"children"===u?"string"!=typeof l&&"number"!=typeof l||(a=a||[]).push(u,""+l):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(lA.hasOwnProperty(u)?(null!=l&&"onScroll"===u&&BR("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}},Ij=function(e,t,n,r){n!==r&&(t.flags|=4)};var Zj=!1,Xj=!1,$j="function"==typeof WeakSet?WeakSet:Set,Kj=null;function Qj(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(Kke){SF(e,t,Kke)}else n.current=null}function Jj(e,t,n){try{n()}catch(Kke){SF(e,t,Kke)}}var eB=!1;function tB(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&Jj(t,n,i)}o=o.next}while(o!==r)}}function nB(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect: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 rB(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function oB(e){var t=e.alternate;null!==t&&(e.alternate=null,oB(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[fN],delete t[hN],delete t[vN],delete t[gN],delete t[mN])),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 iB(e){return 5===e.tag||3===e.tag||4===e.tag}function aB(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||iB(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function sB(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=JR));else if(4!==r&&null!==(e=e.child))for(sB(e,t,n),e=e.sibling;null!==e;)sB(e,t,n),e=e.sibling}function lB(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(lB(e,t,n),e=e.sibling;null!==e;)lB(e,t,n),e=e.sibling}var uB=null,cB=!1;function dB(e,t,n){for(n=n.child;null!==n;)fB(e,t,n),n=n.sibling}function fB(e,t,n){if(aT&&"function"==typeof aT.onCommitFiberUnmount)try{aT.onCommitFiberUnmount(iT,n)}catch(Qke){}switch(n.tag){case 5:Xj||Qj(n,t);case 6:var r=uB,o=cB;uB=null,dB(e,t,n),cB=o,null!==(uB=r)&&(cB?(e=uB,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):uB.removeChild(n.stateNode));break;case 18:null!==uB&&(cB?(e=uB,n=n.stateNode,8===e.nodeType?lN(e.parentNode,n):1===e.nodeType&&lN(e,n),WT(e)):lN(uB,n.stateNode));break;case 4:r=uB,o=cB,uB=n.stateNode.containerInfo,cB=!0,dB(e,t,n),uB=r,cB=o;break;case 0:case 11:case 14:case 15:if(!Xj&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&Jj(n,t,a),o=o.next}while(o!==r)}dB(e,t,n);break;case 1:if(!Xj&&(Qj(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(Qke){SF(n,t,Qke)}dB(e,t,n);break;case 21:dB(e,t,n);break;case 22:1&n.mode?(Xj=(r=Xj)||null!==n.memoizedState,dB(e,t,n),Xj=r):dB(e,t,n);break;default:dB(e,t,n)}}function hB(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new $j),t.forEach((function(t){var r=PF.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function pB(e,t){var n=t.deletions;if(null!==n)for(var r=0;ro&&(o=a),r&=~i}if(r=o,10<(r=(120>(r=QM()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*SB(r/1960))-r)){e.timeoutHandle=rN(wF.bind(null,e,BB,VB),r);break}wF(e,BB,VB);break;default:throw Error(aA(329))}}}return nF(e,QM()),e.callbackNode===n?rF.bind(null,e):null}function oF(e,t){var n=jB;return e.current.memoizedState.isDehydrated&&(dF(e,t).flags|=256),2!==(e=vF(e,t))&&(t=BB,BB=n,null!==t&&iF(t)),e}function iF(e){null===BB?BB=e:BB.push.apply(BB,e)}function aF(e,t){for(t&=~zB,t&=~DB,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===YB)var r=!1;else{if(e=YB,YB=null,ZB=0,0!=(6&PB))throw Error(aA(331));var o=PB;for(PB|=4,Kj=e.current;null!==Kj;){var i=Kj,a=i.child;if(0!=(16&Kj.flags)){var s=i.deletions;if(null!==s){for(var l=0;lQM()-FB?dF(e,0):zB|=n),nF(e,t)}function _F(e,t){0===t&&(0==(1&e.mode)?t=1:(t=dT,0==(130023424&(dT<<=1))&&(dT=4194304)));var n=JB();null!==(e=OD(e,t))&&(yT(e,t,n),nF(e,n))}function EF(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),_F(e,n)}function PF(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(aA(314))}null!==r&&r.delete(t),_F(e,n)}function LF(e,t){return ZM(e,t)}function OF(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 AF(e,t,n,r){return new OF(e,t,n,r)}function MF(e){return!(!(e=e.prototype)||!e.isReactComponent)}function TF(e,t){var n=e.alternate;return null===n?((n=AF(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function IF(e,t,n,r,o,i){var a=2;if(r=e,"function"==typeof e)MF(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case _A:return RF(n.children,o,i,t);case EA:a=8,o|=8;break;case PA:return(e=AF(12,n,t,2|o)).elementType=PA,e.lanes=i,e;case MA:return(e=AF(13,n,t,o)).elementType=MA,e.lanes=i,e;case TA:return(e=AF(19,n,t,o)).elementType=TA,e.lanes=i,e;case NA:return NF(n,o,i,t);default:if("object"===kn(e)&&null!==e)switch(e.$$typeof){case LA:a=10;break e;case OA:a=9;break e;case AA:a=11;break e;case IA:a=14;break e;case RA:a=16,r=null;break e}throw Error(aA(130,null==e?e:kn(e),""))}return(t=AF(a,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function RF(e,t,n,r){return(e=AF(7,e,r,t)).lanes=n,e}function NF(e,t,n,r){return(e=AF(22,e,r,t)).elementType=NA,e.lanes=n,e.stateNode={isHidden:!1},e}function DF(e,t,n){return(e=AF(6,e,null,t)).lanes=n,e}function zF(e,t,n){return(t=AF(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function jF(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=mT(0),this.expirationTimes=mT(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mT(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function BF(e,t,n,r,o,i,a,s,l){return e=new jF(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=AF(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},MD(i),e}function FF(e,t,n){var r=3=0||(o[n]=e[n]);return o}var _H={},EH={get exports(){return _H},set exports(e){_H=e}};function PH(){}function LH(){}LH.resetWarningCache=PH;EH.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:LH,resetWarningCache:PH};return n.PropTypes=n,n}();var OH="data-focus-lock",AH="data-focus-lock-disabled";function MH(e,t){return n=t||null,r=function(t){return e.forEach((function(e){return function(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}(e,t)}))},o=cr.useState((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0],o.callback=r,o.facade;var n,r,o}var TH={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function IH(e){return e}function RH(e,t){void 0===t&&(t=IH);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(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}function NH(e,t){return void 0===t&&(t=IH),RH(e,t)}function DH(e){void 0===e&&(e={});var t=RH(null);return t.options=YS({async:!0,ssr:!1},e),t}var zH=function(e){var t=e.sideCar,n=ZS(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 cr.createElement(r,YS({},n))};zH.isSideCarExport=!0;var jH=NH({},(function(e){return{target:e.target,currentTarget:e.currentTarget}})),BH=NH(),FH=NH(),HH=DH({async:!0}),VH=[],WH=cr.forwardRef((function(e,t){var n,r=cr.useState(),o=r[0],i=r[1],a=cr.useRef(),s=cr.useRef(!1),l=cr.useRef(null),u=e.children,c=e.disabled,d=e.noFocusGuards,f=e.persistentFocus,h=e.crossFrame,p=e.autoFocus;e.allowTextSelection;var v=e.group,g=e.className,m=e.whiteList,y=e.hasPositiveIndices,b=e.shards,w=void 0===b?VH:b,k=e.as,x=void 0===k?"div":k,S=e.lockProps,C=void 0===S?{}:S,_=e.sideCar,E=e.returnFocus,P=e.focusOptions,L=e.onActivation,O=e.onDeactivation,A=cr.useState({})[0],M=cr.useCallback((function(){l.current=l.current||document&&document.activeElement,a.current&&L&&L(a.current),s.current=!0}),[L]),T=cr.useCallback((function(){s.current=!1,O&&O(a.current)}),[O]);cr.useEffect((function(){c||(l.current=null)}),[]);var I=cr.useCallback((function(e){var t=l.current;if(t&&t.focus){var n="function"==typeof E?E(t):E;if(n){var r="object"===kn(n)?n:void 0;l.current=null,e?Promise.resolve().then((function(){return t.focus(r)})):t.focus(r)}}}),[E]),R=cr.useCallback((function(e){s.current&&jH.useMedium(e)}),[]),N=BH.useMedium,D=cr.useCallback((function(e){a.current!==e&&(a.current=e,i(e))}),[]),z=ps(((n={})[AH]=c&&"disabled",n[OH]=v,n),C),j=!0!==d,B=j&&"tail"!==d,F=MH([t,D]);return cr.createElement(cr.Fragment,null,j&&[cr.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:c?-1:0,style:TH}),y?cr.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:c?-1:1,style:TH}):null],!c&&cr.createElement(_,{id:A,sideCar:HH,observed:o,disabled:c,persistentFocus:f,crossFrame:h,autoFocus:p,whiteList:m,shards:w,onActivation:M,onDeactivation:T,returnFocus:I,focusOptions:P}),cr.createElement(x,ps({ref:F},z,{className:g,onBlur:N,onFocus:R}),u),B&&cr.createElement("div",{"data-focus-guard":!0,tabIndex:c?-1:0,style:TH}))}));WH.propTypes={},WH.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var UH=WH;function GH(e,t){return GH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},GH(e,t)}function qH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,GH(e,t)}function YH(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ZH=function(e){for(var t=Array(e.length),n=0;n=0})).sort(lV)},cV=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"].join(","),dV="".concat(cV,", [data-focus-guard]"),fV=function e(t,n){var r;return ZH((null===(r=t.shadowRoot)||void 0===r?void 0:r.children)||t.children).reduce((function(t,r){return t.concat(r.matches(n?dV:cV)?[r]:[],e(r))}),[])},hV=function(e,t){return e.reduce((function(e,n){return e.concat(fV(n,t),n.parentNode?ZH(n.parentNode.querySelectorAll(cV)).filter((function(e){return e===n})):[])}),[])},pV=function(e,t){return ZH(e).filter((function(e){return JH(t,e)})).filter((function(e){return function(e){return!((nV(e)||function(e){return"BUTTON"===e.tagName}(e))&&("hidden"===e.type||e.disabled))}(e)}))},vV=function(e,t){return void 0===t&&(t=new Map),ZH(e).filter((function(e){return eV(t,e)}))},gV=function(e,t,n){return uV(pV(hV(e,n),t),!0,n)},mV=function(e,t){return uV(pV(hV(e),t),!1)},yV=function(e,t){return pV(function(e){var t=e.querySelectorAll("[".concat("data-autofocus-inside","]"));return ZH(t).map((function(e){return hV([e])})).reduce((function(e,t){return e.concat(t)}),[])}(e),t)},bV=function e(t,n){return t.shadowRoot?e(t.shadowRoot,n):!(void 0===Object.getPrototypeOf(t).contains||!Object.getPrototypeOf(t).contains.call(t,n))||ZH(t.children).some((function(t){return e(t,n)}))},wV=function e(t){return t.parentNode?e(t.parentNode):t},kV=function(e){return XH(e).filter(Boolean).reduce((function(e,t){var n=t.getAttribute(OH);return e.push.apply(e,n?function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter((function(e,n){return!t.has(n)}))}(ZH(wV(t).querySelectorAll("[".concat(OH,'="').concat(n,'"]:not([').concat(AH,'="disabled"])')))):[t]),e}),[])},xV=function e(t){return t.activeElement?t.activeElement.shadowRoot?e(t.activeElement.shadowRoot):t.activeElement:void 0},SV=function(){return document.activeElement?document.activeElement.shadowRoot?xV(document.activeElement.shadowRoot):document.activeElement:void 0},CV=function(e){return Boolean(ZH(e.querySelectorAll("iframe")).some((function(e){return function(e){return e===document.activeElement}(e)})))},_V=function(e){var t=document&&SV();return!(!t||t.dataset&&t.dataset.focusGuard)&&kV(e).some((function(e){return bV(e,t)||CV(e)}))},EV=function(e,t){return rV(e)&&e.name?function(e,t){return t.filter(rV).filter((function(t){return t.name===e.name})).filter((function(e){return e.checked}))[0]||e}(e,t):e},PV=function(e){return e[0]&&e.length>1?EV(e[0],e):e[0]},LV=function(e,t){return e.length>1?e.indexOf(EV(e[t],e)):t},OV="NEW_FOCUS",AV=function(e,t,n,r){var o=e.length,i=e[0],a=e[o-1],s=iV(n);if(!(n&&e.indexOf(n)>=0)){var l,u,c=void 0!==n?t.indexOf(n):-1,d=r?t.indexOf(r):c,f=r?e.indexOf(r):-1,h=c-d,p=t.indexOf(i),v=t.indexOf(a),g=(l=t,u=new Set,l.forEach((function(e){return u.add(EV(e,l))})),l.filter((function(e){return u.has(e)}))),m=(void 0!==n?g.indexOf(n):-1)-(r?g.indexOf(r):c),y=LV(e,0),b=LV(e,o-1);return-1===c||-1===f?OV:!h&&f>=0?f:c<=p&&s&&Math.abs(h)>1?b:c>=v&&s&&Math.abs(h)>1?y:h&&Math.abs(m)>1?f:c<=p?b:c>v?y:h?Math.abs(h)>1?f:(o+f+h)%o:void 0}},MV=function(e,t,n){var r,o=e.map((function(e){return e.node})),i=vV(o.filter((r=n,function(e){var t,n=null===(t=tV(e))||void 0===t?void 0:t.autofocus;return e.autofocus||void 0!==n&&"false"!==n||r.indexOf(e)>=0})));return i&&i.length?PV(i):PV(vV(t))},TV=function e(t,n){return void 0===n&&(n=[]),n.push(t),t.parentNode&&e(t.parentNode.host||t.parentNode,n),n},IV=function(e,t){for(var n=TV(e),r=TV(t),o=0;o=0)return i}return!1},RV=function(e,t,n){var r=XH(e),o=XH(t),i=r[0],a=!1;return o.filter(Boolean).forEach((function(e){a=IV(a||e,e)||a,n.filter(Boolean).forEach((function(e){var t=IV(i,e);t&&(a=!a||bV(t,a)?t:IV(t,a))}))})),a},NV=function(e,t){return e.reduce((function(e,n){return e.concat(yV(n,t))}),[])},DV=function(e,t){var n=document&&SV(),r=kV(e).filter(aV),o=RV(n||e,e,r),i=new Map,a=mV(r,i),s=gV(r,i).filter((function(e){var t=e.node;return aV(t)}));if(s[0]||(s=a)[0]){var l=mV([o],i).map((function(e){return e.node})),u=function(e,t){var n=new Map;return t.forEach((function(e){return n.set(e.node,e)})),e.map((function(e){return n.get(e)})).filter(sV)}(l,s),c=u.map((function(e){return e.node})),d=AV(c,l,n,t);return d===OV?{node:MV(a,c,NV(r,i))}:void 0===d?d:u[d]}},zV=0,jV=!1,BV=function(e,t,n){void 0===n&&(n={});var r,o,i=DV(e,t);if(!jV&&i){if(zV>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),jV=!0,void setTimeout((function(){jV=!1}),1);zV++,r=i.node,o=n.focusOptions,"focus"in r&&r.focus(o),"contentWindow"in r&&r.contentWindow&&r.contentWindow.focus(),zV--}};function FV(e){var t=window.setImmediate;void 0!==t?t(e):setTimeout(e,1)}var HV=function(){return document&&document.activeElement===document.body||!!(e=document&&SV())&&ZH(document.querySelectorAll("[".concat("data-no-focus-lock","]"))).some((function(t){return bV(t,e)}));var e},VV=null,WV=null,UV=null,GV=!1,qV=function(){return!0};function YV(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else{if(!a.lockItem)break;if(i!==e)return;o=null}}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var ZV=function(e){return e&&"current"in e?e.current:e},XV=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},$V=function(){var e,t,n,r,o,i,a,s=!1;if(VV){var l=VV,u=l.observed,c=l.persistentFocus,d=l.autoFocus,f=l.shards,h=l.crossFrame,p=l.focusOptions,v=u||UV&&UV.portaledElement,g=document&&document.activeElement;if(v){var m=[v].concat(f.map(ZV).filter(Boolean));if(g&&!function(e){return(VV.whiteList||qV)(e)}(g)||(c||(h?Boolean(GV):"meanwhile"===GV)||!HV()||!WV&&d)&&(v&&!(_V(m)||g&&function(e,t){return t.some((function(t){return XV(e,t,t)}))}(g,m)||(a=g,UV&&UV.portaledElement===a))&&(document&&!WV&&g&&!d?(g.blur&&g.blur(),document.body.focus()):(s=BV(m,WV,{focusOptions:p}),UV={})),GV=!1,WV=document&&document.activeElement),document){var y=document&&document.activeElement,b=(t=kV(e=m).filter(aV),n=RV(e,e,t),r=new Map,o=gV([n],r,!0),i=gV(t,r).filter((function(e){var t=e.node;return aV(t)})).map((function(e){return e.node})),o.map((function(e){var t=e.node;return{node:t,index:e.index,lockItem:i.indexOf(t)>=0,guard:iV(t)}}))),w=b.map((function(e){return e.node})).indexOf(y);w>-1&&(b.filter((function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),YV(w,b.length,1,b),YV(w,-1,-1,b))}}}return s},KV=function(e){$V()&&e&&(e.stopPropagation(),e.preventDefault())},QV=function(){return FV($V)},JV=function(){GV="just",setTimeout((function(){GV="meanwhile"}),0)};jH.assignSyncMedium((function(e){var t=e.target,n=e.currentTarget;n.contains(t)||(UV={observerNode:n,portaledElement:t})})),BH.assignMedium(QV),FH.assignMedium((function(e){return e({moveFocusInside:BV,focusInside:_V})}));var eW=function(e,t){return function(n){var r,o=[];function i(){r=e(o.map((function(e){return e.props}))),t(r)}var a=function(e){function t(){return e.apply(this,arguments)||this}qH(t,e),t.peek=function(){return r};var a=t.prototype;return a.componentDidMount=function(){o.push(this),i()},a.componentDidUpdate=function(){i()},a.componentWillUnmount=function(){var e=o.indexOf(this);o.splice(e,1),i()},a.render=function(){return qr.createElement(n,this.props)},t}(cr.PureComponent);return YH(a,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(n)+")"),a}}((function(e){return e.filter((function(e){return!e.disabled}))}),(function(e){var t=e.slice(-1)[0];t&&!VV&&(document.addEventListener("focusin",KV),document.addEventListener("focusout",QV),window.addEventListener("blur",JV));var n=VV,r=n&&t&&t.id===n.id;VV=t,n&&!r&&(n.onDeactivation(),e.filter((function(e){return e.id===n.id})).length||n.returnFocus(!t)),t?(WV=null,r&&n.observed===t.observed||t.onActivation(),$V(),FV($V)):(document.removeEventListener("focusin",KV),document.removeEventListener("focusout",QV),window.removeEventListener("blur",JV),WV=null)}))((function(){return null})),tW=cr.forwardRef((function(e,t){return cr.createElement(UH,ps({sideCar:eW,ref:t},e))})),nW=UH.propTypes||{};nW.sideCar,CH(nW,["sideCar"]),tW.propTypes={};var rW=tW,oW=function(e){var t=e.initialFocusRef,n=e.finalFocusRef,r=e.contentRef,o=e.restoreFocus,i=e.children,a=e.isDisabled,s=e.autoFocus,l=e.persistentFocus,u=e.lockFocusAcrossFrames,c=cr.useCallback((function(){if(null==t?void 0:t.current)t.current.focus();else if(null==r?void 0:r.current){0===iL(r.current).length&&requestAnimationFrame((function(){var e;null==(e=r.current)||e.focus()}))}}),[t,r]),d=cr.useCallback((function(){var e;null==(e=null==n?void 0:n.current)||e.focus()}),[n]),f=o&&!n;return qr.createElement(rW,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:c,onDeactivation:d,returnFocus:f},i)};oW.displayName="FocusLock";var iW="right-scroll-bar-position",aW="width-before-scroll-bar",sW=DH(),lW=function(){},uW=cr.forwardRef((function(e,t){var n=cr.useRef(null),r=cr.useState({onScrollCapture:lW,onWheelCapture:lW,onTouchMoveCapture:lW}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,v=e.allowPinchZoom,g=e.as,m=void 0===g?"div":g,y=ZS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=f,w=MH([n,t]),k=YS(YS({},y),o);return cr.createElement(cr.Fragment,null,c&&cr.createElement(b,{sideCar:sW,removeScrollBar:u,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!v,lockRef:n}),a?cr.cloneElement(cr.Children.only(s),YS(YS({},k),{ref:w})):cr.createElement(m,YS({},k,{className:l,ref:w}),s))}));uW.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},uW.classNames={fullWidth:aW,zeroRight:iW};function cW(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var dW=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=cW())&&(!function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){!--e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fW=function(){var e,t=(e=dW(),function(t,n){cr.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},hW={left:0,top:0,right:0,gap:0},pW=function(e){return parseInt(e||"",10)||0},vW=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return hW;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[pW(n),pW(r),pW(o)]}(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])}},gW=fW(),mW=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(iW," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(aW," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(iW," .").concat(iW," {\n right: 0 ").concat(r,";\n }\n \n .").concat(aW," .").concat(aW," {\n margin-right: 0 ").concat(r,";\n }\n \n body {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},yW=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r,i=cr.useMemo((function(){return vW(o)}),[o]);return cr.createElement(gW,{styles:mW(i,!t,o,n?"":"!important")})},bW=!1;if("undefined"!=typeof window)try{var wW=Object.defineProperty({},"passive",{get:function(){return bW=!0,!0}});window.addEventListener("test",wW,wW),window.removeEventListener("test",wW,wW)}catch(COe){bW=!1}var kW=!!bW&&{passive:!1},xW=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},SW=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),CW(e,n)){var r=_W(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},CW=function(e,t){return"v"===e?function(e){return xW(e,"overflowY")}(t):function(e){return xW(e,"overflowX")}(t)},_W=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},EW=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},PW=function(e){return[e.deltaX,e.deltaY]},LW=function(e){return e&&"current"in e?e.current:e},OW=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},AW=0,MW=[];var TW,IW=(TW=function(e){var t=cr.useRef([]),n=cr.useRef([0,0]),r=cr.useRef(),o=cr.useState(AW++)[0],i=cr.useState((function(){return fW()}))[0],a=cr.useRef(e);cr.useEffect((function(){a.current=e}),[e]),cr.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=QS([e.lockRef.current],(e.shards||[]).map(LW),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var s=cr.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!a.current.allowPinchZoom;var o,i=EW(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],u="deltaY"in e?e.deltaY:s[1]-i[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=SW(d,c);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=SW(d,c)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||u)&&(r.current=o),!o)return!0;var h=r.current||o;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),u=!1,c=a>0,d=0,f=0;do{var h=_W(e,s),p=h[0],v=h[1]-h[2]-i*p;(p||v)&&CW(e,s)&&(d+=v,f+=p),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(o&&0===d||!o&&a>d)||!c&&(o&&0===f||!o&&-a>f))&&(u=!0),u}(h,t,e,"h"===h?l:u,!0)}),[]),l=cr.useCallback((function(e){var n=e;if(MW.length&&MW[MW.length-1]===i){var r="deltaY"in n?PW(n):EW(n),o=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(a.current.shards||[]).map(LW).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?s(n,l[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=cr.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),c=cr.useCallback((function(e){n.current=EW(e),r.current=void 0}),[]),d=cr.useCallback((function(t){u(t.type,PW(t),t.target,s(t,e.lockRef.current))}),[]),f=cr.useCallback((function(t){u(t.type,EW(t),t.target,s(t,e.lockRef.current))}),[]);cr.useEffect((function(){return MW.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,kW),document.addEventListener("touchmove",l,kW),document.addEventListener("touchstart",c,kW),function(){MW=MW.filter((function(e){return e!==i})),document.removeEventListener("wheel",l,kW),document.removeEventListener("touchmove",l,kW),document.removeEventListener("touchstart",c,kW)}}),[]);var h=e.removeScrollBar,p=e.inert;return cr.createElement(cr.Fragment,null,p?cr.createElement(i,{styles:OW(o)}):null,h?cr.createElement(yW,{gapMode:"margin"}):null)},sW.useMedium(TW),zH),RW=cr.forwardRef((function(e,t){return cr.createElement(uW,YS({},e,{ref:t,sideCar:IW}))}));RW.classNames=uW.classNames;var NW=RW,DW=function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({role:"dialog"},e),{},{ref:Tv(t,v),id:b,tabIndex:-1,"aria-modal":!0,"aria-labelledby":E?w:void 0,"aria-describedby":O?k:void 0,onClick:zW(e.onClick,(function(e){return e.stopPropagation()}))})}),[k,O,b,w,E]),T=cr.useCallback((function(e){e.stopPropagation(),x.current===e.target&&jW.isTopModal(v)&&(l&&(null==i||i()),null==h||h())}),[i,l,h]),I=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,g),onClick:zW(e.onClick,T),onKeyDown:zW(e.onKeyDown,C),onMouseDown:zW(e.onMouseDown,S)})}),[C,S,T]);return{isOpen:o,onClose:i,headerId:w,bodyId:k,setBodyMounted:A,setHeaderMounted:P,dialogRef:v,overlayRef:g,getDialogProps:M,getDialogContainerProps:I}}var FW=yn(Av({name:"ModalStylesContext",errorMessage:"useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),HW=FW[0],VW=FW[1],WW=yn(Av({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),2),UW=WW[0],GW=WW[1],qW=function(e){var t=e.portalProps,n=e.children,r=e.autoFocus,o=e.trapFocus,i=e.initialFocusRef,a=e.finalFocusRef,s=e.returnFocusOnClose,l=e.blockScrollOnMount,u=e.allowPinchZoom,c=e.preserveScrollBarGap,d=e.motionPreset,f=e.lockFocusAcrossFrames,h=e.onCloseComplete,p=Pv("Modal",e),v=un(un({},BW(e)),{},{autoFocus:r,trapFocus:o,initialFocusRef:i,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:c,motionPreset:d,lockFocusAcrossFrames:f});return qr.createElement(UW,{value:v},qr.createElement(HW,{value:p},qr.createElement(qS,{onExitComplete:h},v.isOpen&&qr.createElement(gH,un({},t),n))))};qW.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"},qW.displayName="Modal";var YW=Cv((function(e,t){var n=e.className,r=sn(e,Ce),o=GW(),i=o.bodyId,a=o.setBodyMounted;cr.useEffect((function(){return a(!0),function(){return a(!1)}}),[a]);var s=DW("chakra-modal__body",n),l=VW();return qr.createElement(Lv.div,un(un({ref:t,className:s,id:i},r),{},{__css:l.body}))}));YW.displayName="ModalBody";var ZW=Cv((function(e,t){var n=e.onClick,r=e.className,o=sn(e,_e),i=GW().onClose,a=DW("chakra-modal__close-btn",r),s=VW();return qr.createElement(xE,un({ref:t,__css:s.closeButton,className:a,onClick:zW(n,(function(e){e.stopPropagation(),i()}))},o))}));function XW(e){var t=GW(),n=t.autoFocus,r=t.trapFocus,o=t.dialogRef,i=t.initialFocusRef,a=t.blockScrollOnMount,s=t.allowPinchZoom,l=t.finalFocusRef,u=t.returnFocusOnClose,c=t.preserveScrollBarGap,d=t.lockFocusAcrossFrames,f=yn(nw(),2),h=f[0],p=f[1];return cr.useEffect((function(){!h&&p&&setTimeout(p)}),[h,p]),qr.createElement(oW,{autoFocus:n,isDisabled:!r,initialFocusRef:i,finalFocusRef:l,restoreFocus:u,contentRef:o,lockFocusAcrossFrames:d},qr.createElement(NW,{removeScrollBar:!c,allowPinchZoom:s,enabled:a,forwardProps:!0},e.children))}ZW.displayName="ModalCloseButton";var $W={slideInBottom:un(un({},SC),{},{custom:{offsetY:16,reverse:!0}}),slideInRight:un(un({},SC),{},{custom:{offsetX:16,reverse:!0}}),scale:un(un({},mC),{},{custom:{initialScale:.95,reverse:!0}}),none:{}},KW=Lv(BS.section),QW=cr.forwardRef((function(e,t){var n=e.preset,r=e.motionProps,o=void 0===r?function(e){return $W[e||"none"]}(n):r,i=sn(e,Ee);return qr.createElement(KW,un(un({ref:t},o),i))}));QW.displayName="ModalTransition";var JW=Cv((function(e,t){var n=e.className,r=e.children,o=e.containerProps,i=e.motionProps,a=sn(e,Pe),s=GW(),l=s.getDialogProps,u=s.getDialogContainerProps,c=l(a,t),d=u(o),f=DW("chakra-modal__content",n),h=VW(),p=un({display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0},h.dialog),v=un({display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0},h.dialogContainer),g=GW().motionPreset;return qr.createElement(XW,null,qr.createElement(Lv.div,un(un({},d),{},{className:"chakra-modal__content-container",tabIndex:-1,__css:v}),qr.createElement(QW,un(un({preset:g,motionProps:i,className:f},c),{},{__css:p}),r)))}));JW.displayName="ModalContent";var eU=Cv((function(e,t){var n=e.className,r=sn(e,Le),o=DW("chakra-modal__footer",n),i=un({display:"flex",alignItems:"center",justifyContent:"flex-end"},VW().footer);return qr.createElement(Lv.footer,un(un({ref:t},r),{},{__css:i,className:o}))}));eU.displayName="ModalFooter";var tU=Cv((function(e,t){var n=e.className,r=sn(e,Oe),o=GW(),i=o.headerId,a=o.setHeaderMounted;cr.useEffect((function(){return a(!0),function(){return a(!1)}}),[a]);var s=DW("chakra-modal__header",n),l=un({flex:0},VW().header);return qr.createElement(Lv.header,un(un({ref:t,className:s,id:i},r),{},{__css:l}))}));tU.displayName="ModalHeader";var nU=Lv(BS.div),rU=Cv((function(e,t){var n=e.className,r=(e.transition,e.motionProps),o=sn(e,Ae),i=DW("chakra-modal__overlay",n),a=un({pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh"},VW().overlay),s=GW().motionPreset,l=r||("none"===s?{}:pC);return qr.createElement(nU,un(un({},l),{},{__css:a,ref:t,className:i},o))}));function oU(e){var t=e.leastDestructiveRef,n=sn(e,Me);return qr.createElement(qW,un(un({},n),{},{initialFocusRef:t}))}rU.displayName="ModalOverlay";var iU=Cv((function(e,t){return qr.createElement(JW,un({ref:t,role:"alertdialog"},e))})),aU=yn(Av(),2),sU=(aU[0],aU[1]),lU=Lv(kC),uU=Cv((function(e,t){var n=e.className,r=e.children,o=e.motionProps,i=e.containerProps,a=sn(e,Te),s=GW(),l=s.getDialogProps,u=s.getDialogContainerProps,c=s.isOpen,d=l(a,t),f=u(i),h=DW("chakra-modal__content",n),p=VW(),v=un({display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0},p.dialog),g=un({display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0},p.dialogContainer),m=sU().placement;return qr.createElement(XW,null,qr.createElement(Lv.div,un(un({},f),{},{className:"chakra-modal__content-container",__css:g}),qr.createElement(lU,un(un({motionProps:o,direction:m,in:c,className:h},d),{},{__css:v}),r)))}));uU.displayName="DrawerContent";var cU=function(){for(var e=arguments.length,t=new Array(e),n=0;n\" "}),2),kU=wU[0],xU=wU[1],SU=yn(Av({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),2),CU=SU[0],_U=SU[1],EU=Cv((function(e,t){var n=Pv("NumberInput",e),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.focusInputOnChange,n=void 0===t||t,r=e.clampValueOnBlur,o=void 0===r||r,i=e.keepWithinRange,a=void 0===i||i,s=e.min,l=void 0===s?Number.MIN_SAFE_INTEGER:s,u=e.max,c=void 0===u?Number.MAX_SAFE_INTEGER:u,d=e.step,f=void 0===d?1:d,h=e.isReadOnly,p=e.isDisabled,v=e.isRequired,g=e.isInvalid,m=e.pattern,y=void 0===m?"[0-9]*(.[0-9]+)?":m,b=e.inputMode,w=void 0===b?"decimal":b,k=e.allowMouseWheel,x=e.id,S=(e.onChange,e.precision,e.name),C=e["aria-describedby"],_=e["aria-label"],E=e["aria-labelledby"],P=e.onFocus,L=e.onBlur,O=e.onInvalid,A=e.getAriaValueText,M=e.isValidCharacter,T=e.format,I=e.parse,R=sn(e,Ie),N=Yv(P),D=Yv(L),z=Yv(O),j=Yv(null!=M?M:yU),B=Yv(A),F=OE(e),H=F.update,V=F.increment,W=F.decrement,U=yn(cr.useState(!1),2),G=U[0],q=U[1],Y=!(h||p),Z=cr.useRef(null),X=cr.useRef(null),$=cr.useRef(null),K=cr.useRef(null),Q=cr.useCallback((function(e){return e.split("").filter(j).join("")}),[j]),J=cr.useCallback((function(e){var t;return null!==(t=null==I?void 0:I(e))&&void 0!==t?t:e}),[I]),ee=cr.useCallback((function(e){var t;return(null!==(t=null==T?void 0:T(e))&&void 0!==t?t:e).toString()}),[T]);U_((function(){(F.valueAsNumber>c||F.valueAsNumber0&&void 0!==arguments[0]?arguments[0]:f)}),[V,Y,f]),ne=cr.useCallback((function(){Y&&W(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f)}),[W,Y,f]),re=gU(te,ne);vU($,"disabled",re.stop,re.isSpinning),vU(K,"disabled",re.stop,re.isSpinning);var oe=cr.useCallback((function(e){if(!e.nativeEvent.isComposing){var t=J(e.currentTarget.value);H(Q(t)),X.current={start:e.currentTarget.selectionStart,end:e.currentTarget.selectionEnd}}}),[H,Q,J]),ie=cr.useCallback((function(e){var t,n,r;null==N||N(e),X.current&&(e.target.selectionStart=null!==(t=X.current.start)&&void 0!==t?t:null==(r=e.currentTarget.value)?void 0:r.length,e.currentTarget.selectionEnd=null!==(n=X.current.end)&&void 0!==n?n:e.currentTarget.selectionStart)}),[N]),ae=cr.useCallback((function(e){if(!e.nativeEvent.isComposing){bU(e,j)||e.preventDefault();var t=se(e)*f,n={ArrowUp:function(){return te(t)},ArrowDown:function(){return ne(t)},Home:function(){return H(l)},End:function(){return H(c)}}[e.key];n&&(e.preventDefault(),n(e))}}),[j,f,te,ne,H,l,c]),se=function(e){var t=1;return(e.metaKey||e.ctrlKey)&&(t=.1),e.shiftKey&&(t=10),t},le=cr.useMemo((function(){var e=null==B?void 0:B(F.value);return null!=e?e:F.value.toString()||void 0}),[F.value,B]),ue=cr.useCallback((function(){var e=F.value;""!==F.value&&(/^[eE]/.test(F.value.toString())?F.setValue(""):(F.valueAsNumberc&&(e=c),F.cast(e)))}),[F,c,l]),ce=cr.useCallback((function(){q(!1),o&&ue()}),[o,q,ue]),de=cr.useCallback((function(){n&&requestAnimationFrame((function(){var e;null==(e=Z.current)||e.focus()}))}),[n]),fe=cr.useCallback((function(e){e.preventDefault(),re.up(),de()}),[de,re]),he=cr.useCallback((function(e){e.preventDefault(),re.down(),de()}),[de,re]);DE((function(){return Z.current}),"wheel",(function(e){var t,n,r=(null!==(t=null==(n=Z.current)?void 0:n.ownerDocument)&&void 0!==t?t:document).activeElement===Z.current;if(k&&r){e.preventDefault();var o=se(e)*f,i=Math.sign(e.deltaY);-1===i?te(o):1===i&&ne(o)}}),{passive:!1});var pe=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=p||a&&F.isAtMax;return un(un({},e),{},{ref:Tv(t,$),role:"button",tabIndex:-1,onPointerDown:fU(e.onPointerDown,(function(e){0!==e.button||n||fe(e)})),onPointerLeave:fU(e.onPointerLeave,re.stop),onPointerUp:fU(e.onPointerUp,re.stop),disabled:n,"aria-disabled":dU(n)})}),[F.isAtMax,a,fe,re.stop,p]),ve=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=p||a&&F.isAtMin;return un(un({},e),{},{ref:Tv(t,K),role:"button",tabIndex:-1,onPointerDown:fU(e.onPointerDown,(function(e){0!==e.button||n||he(e)})),onPointerLeave:fU(e.onPointerLeave,re.stop),onPointerUp:fU(e.onPointerUp,re.stop),disabled:n,"aria-disabled":dU(n)})}),[F.isAtMin,a,he,re.stop,p]),ge=cr.useCallback((function(){var e,t,n,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({name:S,inputMode:w,type:"text",pattern:y,"aria-labelledby":E,"aria-label":_,"aria-describedby":C,id:x,disabled:p},o),{},{readOnly:null!==(e=o.readOnly)&&void 0!==e?e:h,"aria-readonly":null!==(t=o.readOnly)&&void 0!==t?t:h,"aria-required":null!==(n=o.required)&&void 0!==n?n:v,required:null!==(r=o.required)&&void 0!==r?r:v,ref:Tv(Z,i),value:ee(F.value),role:"spinbutton","aria-valuemin":l,"aria-valuemax":c,"aria-valuenow":Number.isNaN(F.valueAsNumber)?void 0:F.valueAsNumber,"aria-invalid":dU(null!=g?g:F.isOutOfRange),"aria-valuetext":le,autoComplete:"off",autoCorrect:"off",onChange:fU(o.onChange,oe),onKeyDown:fU(o.onKeyDown,ae),onFocus:fU(o.onFocus,ie,(function(){return q(!0)})),onBlur:fU(o.onBlur,D,ce)})}),[S,w,y,E,_,ee,C,x,p,v,h,g,F.value,F.valueAsNumber,F.isOutOfRange,l,c,le,oe,ae,ie,D,ce]);return{value:ee(F.value),valueAsNumber:F.valueAsNumber,isFocused:G,isDisabled:p,isReadOnly:h,getIncrementButtonProps:pe,getDecrementButtonProps:ve,getInputProps:ge,htmlProps:R}}(D_(ua(e))),o=r.htmlProps,i=sn(r,Re),a=cr.useMemo((function(){return i}),[i]);return qr.createElement(CU,{value:a},qr.createElement(kU,{value:n},qr.createElement(Lv.div,un(un({},o),{},{ref:t,className:cU("chakra-numberinput",e.className),__css:un({position:"relative",zIndex:0},n.root)}))))}));EU.displayName="NumberInput";var PU=Cv((function(e,t){var n=xU();return qr.createElement(Lv.div,un(un({"aria-hidden":!0,ref:t},e),{},{__css:un({display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1},n.stepperGroup)}))}));PU.displayName="NumberInputStepper";var LU=Cv((function(e,t){var n=(0,_U().getInputProps)(e,t),r=xU();return qr.createElement(Lv.input,un(un({},n),{},{className:cU("chakra-numberinput__field",e.className),__css:un({width:"100%"},r.field)}))}));LU.displayName="NumberInputField";var OU=Lv("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),AU=Cv((function(e,t){var n,r=xU(),o=(0,_U().getDecrementButtonProps)(e,t);return qr.createElement(OU,un(un({},o),{},{__css:r.stepper}),null!==(n=e.children)&&void 0!==n?n:qr.createElement(hU,null))}));AU.displayName="NumberDecrementStepper";var MU=Cv((function(e,t){var n,r=(0,_U().getIncrementButtonProps)(e,t),o=xU();return qr.createElement(OU,un(un({},r),{},{__css:o.stepper}),null!==(n=e.children)&&void 0!==n?n:qr.createElement(pU,null))}));MU.displayName="NumberIncrementStepper";var TU=function(){for(var e=arguments.length,t=new Array(e),n=0;n`"}),2),zU=DU[0],jU=DU[1],BU=yn(Av({name:"PopoverStylesContext",errorMessage:"usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),FU=BU[0],HU=BU[1],VU="click",WU="hover";function UU(e,t){return e===t||(null==e?void 0:e.contains(t))}function GU(e){var t,n=e.currentTarget.ownerDocument.activeElement;return null!==(t=e.relatedTarget)&&void 0!==t?t:n}function qU(e){var t=Pv("Popover",e),n=ua(e),r=n.children,o=sn(n,De),i=vv(),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.closeOnBlur,n=void 0===t||t,r=e.closeOnEsc,o=void 0===r||r,i=e.initialFocusRef,a=e.id,s=e.returnFocusOnClose,l=void 0===s||s,u=e.autoFocus,c=void 0===u||u,d=e.arrowSize,f=e.arrowShadowColor,h=e.trigger,p=void 0===h?VU:h,v=e.openDelay,g=void 0===v?200:v,m=e.closeDelay,y=void 0===m?200:m,b=e.isLazy,w=e.lazyBehavior,k=void 0===w?"unmount":w,x=e.computePositionOnMount,S=sn(e,Ne),C=XO(e),_=C.isOpen,E=C.onClose,P=C.onOpen,L=C.onToggle,O=cr.useRef(null),A=cr.useRef(null),M=cr.useRef(null),T=cr.useRef(!1),I=cr.useRef(!1);_&&(I.current=!0);var R=yn(cr.useState(!1),2),N=R[0],D=R[1],z=yn(cr.useState(!1),2),j=z[0],B=z[1],F=cr.useId(),H=null!=a?a:F,V=yn(["popover-trigger","popover-content","popover-header","popover-body"].map((function(e){return"".concat(e,"-").concat(H)})),4),W=V[0],U=V[1],G=V[2],q=V[3],Y=YO(un(un({},S),{},{enabled:_||!!x})),Z=Y.referenceRef,X=Y.getArrowProps,$=Y.getPopperProps,K=Y.getArrowInnerProps,Q=Y.forceUpdate,J=$O({isOpen:_,ref:M});FE({enabled:_,ref:A}),sL(M,{focusRef:A,visible:_,shouldFocus:l&&p===VU}),uL(M,{focusRef:i,visible:_,shouldFocus:c&&p===VU});var ee=KO({wasSelected:I.current,enabled:b,mode:k,isSelected:J.present}),te=cr.useCallback((function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=un(un({},t),{},{style:un(un({},t.style),{},(e={transformOrigin:TO.transformOrigin.varRef},gn(e,TO.arrowSize.var,d?"".concat(d,"px"):void 0),gn(e,TO.arrowShadowColor.var,f),e)),ref:Tv(M,r),children:ee?t.children:null,id:U,tabIndex:-1,role:"dialog",onKeyDown:RU(t.onKeyDown,(function(e){o&&"Escape"===e.key&&E()})),onBlur:RU(t.onBlur,(function(e){var t=GU(e),r=UU(M.current,t),o=UU(A.current,t);_&&n&&!r&&!o&&E()})),"aria-labelledby":N?G:void 0,"aria-describedby":j?q:void 0});return p===WU&&(i.role="tooltip",i.onMouseEnter=RU(t.onMouseEnter,(function(){T.current=!0})),i.onMouseLeave=RU(t.onMouseLeave,(function(e){null!==e.nativeEvent.relatedTarget&&(T.current=!1,setTimeout((function(){return E()}),y))}))),i}),[ee,U,N,G,j,q,p,o,E,_,n,y,f,d]),ne=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return $(un(un({},e),{},{style:un({visibility:_?"visible":"hidden"},e.style)}),t)}),[_,$]),re=cr.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,O,Z)})}),[O,Z]),oe=cr.useRef(),ie=cr.useRef(),ae=cr.useCallback((function(e){null==O.current&&Z(e)}),[Z]),se=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=un(un({},e),{},{ref:Tv(A,t,ae),id:W,"aria-haspopup":"dialog","aria-expanded":_,"aria-controls":U});return p===VU&&(r.onClick=RU(e.onClick,L)),p===WU&&(r.onFocus=RU(e.onFocus,(function(){void 0===oe.current&&P()})),r.onBlur=RU(e.onBlur,(function(e){var t=GU(e),r=!UU(M.current,t);_&&n&&r&&E()})),r.onKeyDown=RU(e.onKeyDown,(function(e){"Escape"===e.key&&E()})),r.onMouseEnter=RU(e.onMouseEnter,(function(){T.current=!0,oe.current=window.setTimeout((function(){return P()}),g)})),r.onMouseLeave=RU(e.onMouseLeave,(function(){T.current=!1,oe.current&&(clearTimeout(oe.current),oe.current=void 0),ie.current=window.setTimeout((function(){!1===T.current&&E()}),y)}))),r}),[W,_,U,p,ae,L,P,n,E,g,y]);cr.useEffect((function(){return function(){oe.current&&clearTimeout(oe.current),ie.current&&clearTimeout(ie.current)}}),[]);var le=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:G,ref:Tv(e,(function(e){D(!!e)}))})}),[G]),ue=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:q,ref:Tv(e,(function(e){B(!!e)}))})}),[q]);return{forceUpdate:Q,isOpen:_,onAnimationComplete:J.onComplete,onClose:E,getAnchorProps:re,getArrowProps:X,getArrowInnerProps:K,getPopoverPositionerProps:ne,getPopoverProps:te,getTriggerProps:se,getHeaderProps:le,getBodyProps:ue}}(un(un({},o),{},{direction:i.direction}));return qr.createElement(zU,{value:a},qr.createElement(FU,{value:t},function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r\" "}),2),fG=dG[0],hG=dG[1],pG=Cv((function(e,t){var n=e.min,r=e.max,o=e.value,i=e.isIndeterminate,a=e.role,s=sn(e,He),l=sG({value:o,min:n,max:r,isIndeterminate:i,role:a}),u=un({height:"100%"},hG().filledTrack);return qr.createElement(Lv.div,un(un(un({ref:t,style:un({width:"".concat(l.percent,"%")},s.style)},l.bind),s),{},{__css:u}))})),vG=Cv((function(e,t){var n,r=ua(e),o=r.value,i=r.min,a=void 0===i?0:i,s=r.max,l=void 0===s?100:s,u=r.hasStripe,c=r.isAnimated,d=r.children,f=r.borderRadius,h=r.isIndeterminate,p=r["aria-label"],v=r["aria-labelledby"],g=r.title,m=r.role,y=sn(r,Ve),b=Pv("Progress",e),w=null!=f?f:null==(n=b.track)?void 0:n.borderRadius,k={animation:"".concat(aG," 1s linear infinite")},x=un(un({},!h&&u&&c&&k),h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:"".concat(iG," 1s ease infinite normal none running")}),S=un({overflow:"hidden",position:"relative"},b.track);return qr.createElement(Lv.div,un({ref:t,borderRadius:w,__css:S},y),qr.createElement(fG,{value:b},qr.createElement(pG,{"aria-label":p,"aria-labelledby":v,min:a,max:l,value:o,isIndeterminate:h,css:x,borderRadius:w,title:g,role:m}),d))}));vG.displayName="Progress",Lv("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}}).displayName="CircularProgressLabel";var gG=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:"page",n=e.touches[0]||e.changedTouches[0];return{x:n["".concat(t,"X")],y:n["".concat(t,"Y")]}}function _G(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return{x:e["".concat(t,"X")],y:e["".concat(t,"Y")]}}function EG(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return SG(e)?CG(e,t):_G(e,t)}function PG(e){return function(t){var n=xG(t);(!n||n&&0===t.button)&&e(t)}}function LG(e,t,n,r){return function(e,t,n,r){return e.addEventListener(t,n,r),function(){e.removeEventListener(t,n,r)}}(e,t,function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(t){e(t,{point:EG(t)})}var r=t?PG(n):n;return r}(n,"pointerdown"===t),r)}function OG(e){var t=cr.useRef(null);return t.current=e,t}kG.displayName="SelectIcon";var AG=function(){function e(t,n,r){var o,i=this;if(an(this,e),gn(this,"history",[]),gn(this,"startEvent",null),gn(this,"lastEvent",null),gn(this,"lastEventInfo",null),gn(this,"handlers",{}),gn(this,"removeListeners",(function(){})),gn(this,"threshold",3),gn(this,"win",void 0),gn(this,"updatePoint",(function(){if(i.lastEvent&&i.lastEventInfo){var e=TG(i.lastEventInfo,i.history),t=null!==i.startEvent,n=function(e,t){if("number"==typeof e&&"number"==typeof t)return NG(e,t);if(DG(e)&&DG(t)){var n=NG(e.x,t.x),r=NG(e.y,t.y);return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}return 0}(e.offset,{x:0,y:0})>=i.threshold;if(t||n){var r=Pl().timestamp;i.history.push(un(un({},e.point),{},{timestamp:r}));var o=i.handlers,a=o.onStart,s=o.onMove;t||(null==a||a(i.lastEvent,e),i.startEvent=i.lastEvent),null==s||s(i.lastEvent,e)}}})),gn(this,"onPointerMove",(function(e,t){i.lastEvent=e,i.lastEventInfo=t,xl.update(i.updatePoint,!0)})),gn(this,"onPointerUp",(function(e,t){var n=TG(t,i.history),r=i.handlers,o=r.onEnd,a=r.onSessionEnd;null==a||a(e,n),i.end(),o&&i.startEvent&&(null==o||o(e,n))})),this.win=null!==(o=t.view)&&void 0!==o?o:window,!(SG(a=t)&&a.touches.length>1)){var a;this.handlers=n,r&&(this.threshold=r),t.stopPropagation(),t.preventDefault();var s={point:EG(t)},l=Pl().timestamp;this.history=[un(un({},s.point),{},{timestamp:l})];var u=n.onSessionStart;null==u||u(t,TG(s,this.history)),this.removeListeners=function(){for(var e=arguments.length,t=new Array(e),n=0;n=0&&(r=e[n],!(o.timestamp-r.timestamp>IG(t)));)n--;if(!r)return{x:0,y:0};var i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};var a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function NG(e,t){return Math.abs(e-t)}function DG(e){return"x"in e&&"y"in e}function zG(e,t){var n=t.onPan,r=t.onPanStart,o=t.onPanEnd,i=t.onPanSessionStart,a=t.onPanSessionEnd,s=t.threshold,l=Boolean(n||r||o||i||a),u=cr.useRef(null),c=OG({onSessionStart:i,onSessionEnd:a,onStart:r,onMove:n,onEnd:function(e,t){u.current=null,null==o||o(e,t)}});cr.useEffect((function(){var e;null==(e=u.current)||e.updateHandlers(c.current)})),cr.useEffect((function(){var t=e.current;if(t&&l)return LG(t,"pointerdown",(function(e){u.current=new AG(e,c.current,s)}))}),[e,l,c,s]),cr.useEffect((function(){return function(){var e;null==(e=u.current)||e.end(),u.current=null}}),[])}var jG=Boolean(null==globalThis?void 0:globalThis.document)?cr.useLayoutEffect:cr.useEffect;function BG(e){var t=e.getNodes,n=e.observeMutation,r=void 0===n||n,o=yn(cr.useState([]),2),i=o[0],a=o[1],s=yn(cr.useState(0),2),l=s[0],u=s[1];return jG((function(){var e=t(),n=e.map((function(e,t){return function(e,t){var n;if(e){t({width:e.offsetWidth,height:e.offsetHeight});var r=new(null!==(n=e.ownerDocument.defaultView)&&void 0!==n?n:window).ResizeObserver((function(n){if(Array.isArray(n)&&n.length){var r,o,i=yn(n,1)[0];if("borderBoxSize"in i){var a=i.borderBoxSize,s=Array.isArray(a)?a[0]:a;r=s.inlineSize,o=s.blockSize}else r=e.offsetWidth,o=e.offsetHeight;t({width:r,height:o})}}));return r.observe(e,{box:"border-box"}),function(){return r.unobserve(e)}}t(void 0)}(e,(function(e){a((function(n){return[].concat(cn(n.slice(0,t)),[e],cn(n.slice(t+1)))}))}))}));if(r){var o=e[0];n.push(function(e,t){var n,r;if(e&&e.parentElement){var o=new(null!==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)&&void 0!==n?n:window).MutationObserver((function(){t()}));return o.observe(e.parentElement,{childList:!0}),function(){o.disconnect()}}}(o,(function(){u((function(e){return e+1}))})))}return function(){n.forEach((function(e){null==e||e()}))}}),[l]),i}function FG(e){return yn(BG({observeMutation:!1,getNodes:function(){var t;return["object"===kn(t=e)&&null!==t&&"current"in t?e.current:e]}}),1)[0]}var HG=Object.getOwnPropertyNames,VG=function(e,t){return function(){return e&&(t=(0,e[HG(e)[0]])(e=0)),t}}({"../../../react-shim.js":function(){}});VG(),VG(),VG();var WG=function(e){return e?"":void 0},UG=function(e){return!!e||void 0},GG=function(){for(var e=arguments.length,t=new Array(e),n=0;nXG(t).height?e:t}),ZG):r.reduce((function(e,t){return XG(e).width>XG(t).width?e:t}),ZG),a=un({position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0},YG({orientation:t,vertical:i?{paddingLeft:i.width/2,paddingRight:i.width/2}:{},horizontal:i?{paddingTop:i.height/2,paddingBottom:i.height/2}:{}})),s=un({position:"absolute"},YG({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})),l=1===n.length,u=[0,o?100-n[0]:n[0]],c=l?u:n,d=c[0];!l&&o&&(d=100-d);var f=Math.abs(c[c.length-1]-c[0]);return{trackStyle:s,innerTrackStyle:un(un({},s),YG({orientation:t,vertical:o?{height:"".concat(f,"%"),top:"".concat(d,"%")}:{height:"".concat(f,"%"),bottom:"".concat(d,"%")},horizontal:o?{width:"".concat(f,"%"),right:"".concat(d,"%")}:{width:"".concat(f,"%"),left:"".concat(d,"%")}})),rootStyle:a,getThumbStyle:function(e){var o,i=null!==(o=r[e])&&void 0!==o?o:ZG;return un({position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none"},YG({orientation:t,vertical:{bottom:"calc(".concat(n[e],"% - ").concat(i.height/2,"px)")},horizontal:{left:"calc(".concat(n[e],"% - ").concat(i.width/2,"px)")}}))}}}function KG(e){var t=e.isReversed,n=e.direction,r=e.orientation;return"ltr"===n||"vertical"===r?t:!t}function QG(e){var t=e.min,n=void 0===t?0:t,r=e.max,o=void 0===r?100:r,i=e.onChange,a=e.value,s=e.defaultValue,l=e.isReversed,u=e.direction,c=void 0===u?"ltr":u,d=e.orientation,f=void 0===d?"horizontal":d,h=e.id,p=e.isDisabled,v=e.isReadOnly,g=e.onChangeStart,m=e.onChangeEnd,y=e.step,b=void 0===y?1:y,w=e.getAriaValueText,k=e["aria-valuetext"],x=e["aria-label"],S=e["aria-labelledby"],C=e.name,_=e.focusThumbOnChange,E=void 0===_||_,P=e.minStepsBetweenThumbs,L=void 0===P?0:P,O=sn(e,qe),A=Yv(g),M=Yv(m),T=Yv(w),I=KG({isReversed:l,direction:c,orientation:f}),R=yn(Zv({value:a,defaultValue:null!=s?s:[25,75],onChange:i}),2),N=R[0],D=R[1];if(!Array.isArray(N))throw new TypeError("[range-slider] You passed an invalid value for `value` or `defaultValue`, expected `Array` but got `".concat(kn(N),"`"));var z=yn(cr.useState(!1),2),j=z[0],B=z[1],F=yn(cr.useState(!1),2),H=F[0],V=F[1],W=yn(cr.useState(-1),2),U=W[0],G=W[1],q=!(p||v),Y=cr.useRef(N),Z=N.map((function(e){return LE(e,n,o)})),X=function(e,t,n,r){return e.map((function(o,i){return{min:0===i?t:e[i-1]+r,max:i===e.length-1?n:e[i+1]-r}}))}(Z,n,o,L*b),$=cr.useRef({eventSource:null,value:[],valueBounds:[]});$.current.value=Z,$.current.valueBounds=X;var K=Z.map((function(e){return o-e+n})),Q=(I?K:Z).map((function(e){return _E(e,n,o)})),J="vertical"===f,ee=cr.useRef(null),te=cr.useRef(null),ne=BG({getNodes:function(){var e=te.current,t=null==e?void 0:e.querySelectorAll("[role=slider]");return t?Array.from(t):[]}}),re=cr.useId(),oe=function(e){return{root:"slider-root-".concat(e),getThumb:function(t){return"slider-thumb-".concat(e,"-").concat(t)},getInput:function(t){return"slider-input-".concat(e,"-").concat(t)},track:"slider-track-".concat(e),innerTrack:"slider-filled-track-".concat(e),getMarker:function(t){return"slider-marker-".concat(e,"-").concat(t)},output:"slider-output-".concat(e)}}(null!=h?h:re),ie=cr.useCallback((function(e){var t,r;if(ee.current){$.current.eventSource="pointer";var i=ee.current.getBoundingClientRect(),a=null!==(t=null==(r=e.touches)?void 0:r[0])&&void 0!==t?t:e,s=a.clientX,l=a.clientY,u=(J?i.bottom-l:s-i.left)/(J?i.height:i.width);return I&&(u=1-u),EE(u,n,o)}}),[J,I,o,n]),ae=(o-n)/10,se=b||(o-n)/100,le=cr.useMemo((function(){return{setValueAtIndex:function(e,t){if(q){var n=$.current.valueBounds[e];t=LE(t=parseFloat(PE(t,n.min,se)),n.min,n.max);var r=cn($.current.value);r[e]=t,D(r)}},setActiveIndex:G,stepUp:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:se,n=$.current.value[e],r=I?n-t:n+t;le.setValueAtIndex(e,r)},stepDown:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:se,n=$.current.value[e],r=I?n+t:n-t;le.setValueAtIndex(e,r)},reset:function(){D(Y.current)}}}),[se,I,D,q]),ue=cr.useCallback((function(e){var t={ArrowRight:function(){return le.stepUp(U)},ArrowUp:function(){return le.stepUp(U)},ArrowLeft:function(){return le.stepDown(U)},ArrowDown:function(){return le.stepDown(U)},PageUp:function(){return le.stepUp(U,ae)},PageDown:function(){return le.stepDown(U,ae)},Home:function(){var e=X[U].min;le.setValueAtIndex(U,e)},End:function(){var e=X[U].max;le.setValueAtIndex(U,e)}}[e.key];t&&(e.preventDefault(),e.stopPropagation(),t(e),$.current.eventSource="keyboard")}),[le,U,ae,X]),ce=cr.useMemo((function(){return $G({isReversed:I,orientation:f,thumbRects:ne,thumbPercents:Q})}),[I,f,Q,ne]),de=ce.getThumbStyle,fe=ce.rootStyle,he=ce.trackStyle,pe=ce.innerTrackStyle,ve=cr.useCallback((function(e){var t,n=null!=e?e:U;if(-1!==n&&E){var r=oe.getThumb(n),o=null==(t=te.current)?void 0:t.ownerDocument.getElementById(r);o&&setTimeout((function(){return o.focus()}))}}),[E,U,oe]);U_((function(){"keyboard"===$.current.eventSource&&(null==M||M($.current.value))}),[Z,M]);zG(te,{onPanSessionStart:function(e){q&&(B(!0),function(e){var t=ie(e)||0,n=$.current.value.map((function(e){return Math.abs(e-t)})),r=Math.min.apply(Math,cn(n)),o=n.indexOf(r),i=n.filter((function(e){return e===r}));i.length>1&&t>$.current.value[o]&&(o=o+i.length-1),G(o),le.setValueAtIndex(o,t),ve(o)}(e),null==A||A($.current.value))},onPanSessionEnd:function(){q&&(B(!1),null==M||M($.current.value))},onPan:function(e){q&&function(e){if(-1!=U){var t=ie(e)||0;G(U),le.setValueAtIndex(U,t),ve(U)}}(e)}});var ge=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un(un({},e),O),{},{id:oe.root,ref:Tv(t,te),tabIndex:-1,"aria-disabled":UG(p),"data-focused":WG(H),style:un(un({},e.style),fe)})}),[O,p,H,fe,oe]),me=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,ee),id:oe.track,"data-disabled":WG(p),style:un(un({},e.style),he)})}),[p,he,oe]),ye=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,id:oe.innerTrack,style:un(un({},e.style),pe)})}),[pe,oe]),be=cr.useCallback((function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.index,o=sn(e,Ye),i=Z[r];if(null==i)throw new TypeError("[range-slider > thumb] Cannot find value at index `".concat(r,"`. The `value` or `defaultValue` length is : ").concat(Z.length));var a=X[r];return un(un({},o),{},{ref:n,role:"slider",tabIndex:q?0:void 0,id:oe.getThumb(r),"data-active":WG(j&&U===r),"aria-valuetext":null!==(t=null==T?void 0:T(i))&&void 0!==t?t:null==k?void 0:k[r],"aria-valuemin":a.min,"aria-valuemax":a.max,"aria-valuenow":i,"aria-orientation":f,"aria-disabled":UG(p),"aria-readonly":UG(v),"aria-label":null==x?void 0:x[r],"aria-labelledby":(null==x?void 0:x[r])||null==S?void 0:S[r],style:un(un({},e.style),de(r)),onKeyDown:qG(e.onKeyDown,ue),onFocus:qG(e.onFocus,(function(){V(!0),G(r)})),onBlur:qG(e.onBlur,(function(){V(!1),G(-1)}))})}),[oe,Z,X,q,j,U,T,k,f,p,v,x,S,de,ue,V]),we=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,id:oe.output,htmlFor:Z.map((function(e,t){return oe.getThumb(t)})).join(" "),"aria-live":"off"})}),[oe,Z]),ke=cr.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.value,i=sn(e,Ze),a=!(ro),s=r>=Z[0]&&r<=Z[Z.length-1],l=_E(r,n,o),u=un({position:"absolute",pointerEvents:"none"},YG({orientation:f,vertical:{bottom:"".concat(l=I?100-l:l,"%")},horizontal:{left:"".concat(l,"%")}}));return un(un({},i),{},{ref:t,id:oe.getMarker(e.value),role:"presentation","aria-hidden":!0,"data-disabled":WG(p),"data-invalid":WG(!a),"data-highlighted":WG(s),style:un(un({},e.style),u)})}),[p,I,o,n,f,Z,oe]),xe=cr.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.index,r=sn(e,Xe);return un(un({},r),{},{ref:t,id:oe.getInput(n),type:"hidden",value:Z[n],name:Array.isArray(C)?C[n]:"".concat(C,"-").concat(n)})}),[C,Z,oe]);return{state:{value:Z,isFocused:H,isDragging:j,getThumbPercent:function(e){return Q[e]},getThumbMinValue:function(e){return X[e].min},getThumbMaxValue:function(e){return X[e].max}},actions:le,getRootProps:ge,getTrackProps:me,getInnerTrackProps:ye,getThumbProps:be,getMarkerProps:ke,getInputProps:xe,getOutputProps:we}}var JG=yn(Av({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),2),eq=JG[0],tq=JG[1],nq=yn(Av({name:"RangeSliderStylesContext",errorMessage:"useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),rq=nq[0],oq=nq[1],iq=Cv((function(e,t){var n=Pv("Slider",e),r=ua(e),o=vv().direction;r.direction=o;var i=QG(r),a=i.getRootProps,s=sn(i,$e),l=cr.useMemo((function(){return un(un({},s),{},{name:e.name})}),[s,e.name]);return qr.createElement(eq,{value:l},qr.createElement(rq,{value:n},qr.createElement(Lv.div,un(un({},a({},t)),{},{className:"chakra-slider",__css:n.container}),e.children)))}));iq.defaultProps={orientation:"horizontal"},iq.displayName="RangeSlider";var aq=Cv((function(e,t){var n=tq(),r=n.getThumbProps,o=n.getInputProps,i=n.name,a=oq(),s=r(e,t);return qr.createElement(Lv.div,un(un({},s),{},{className:GG("chakra-slider__thumb",e.className),__css:a.thumb}),s.children,i&&qr.createElement("input",un({},o({index:e.index}))))}));aq.displayName="RangeSliderThumb";var sq=Cv((function(e,t){var n=tq().getTrackProps,r=oq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__track",e.className),__css:r.track,"data-testid":"chakra-range-slider-track"}))}));sq.displayName="RangeSliderTrack";var lq=Cv((function(e,t){var n=tq().getInnerTrackProps,r=oq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:"chakra-slider__filled-track",__css:r.filledTrack}))}));function uq(e){var t=e.orientation,n=e.vertical,r=e.horizontal;return"vertical"===t?n:r}function cq(e,t){return t"}),2),fq=dq[0],hq=dq[1],pq=yn(Av({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),2),vq=pq[0],gq=pq[1],mq=Cv((function(e,t){var n=Pv("Slider",e),r=ua(e),o=vv().direction;r.direction=o;var i=function(e){var t,n=e.min,r=void 0===n?0:n,o=e.max,i=void 0===o?100:o,a=e.onChange,s=e.value,l=e.defaultValue,u=e.isReversed,c=e.direction,d=void 0===c?"ltr":c,f=e.orientation,h=void 0===f?"horizontal":f,p=e.id,v=e.isDisabled,g=e.isReadOnly,m=e.onChangeStart,y=e.onChangeEnd,b=e.step,w=void 0===b?1:b,k=e.getAriaValueText,x=e["aria-valuetext"],S=e["aria-label"],C=e["aria-labelledby"],_=e.name,E=e.focusThumbOnChange,P=void 0===E||E,L=sn(e,Ke),O=Yv(m),A=Yv(y),M=Yv(k),T=KG({isReversed:u,direction:d,orientation:h}),I=yn(Zv({value:s,defaultValue:null!=l?l:cq(r,i),onChange:a}),2),R=I[0],N=I[1],D=yn(cr.useState(!1),2),z=D[0],j=D[1],B=yn(cr.useState(!1),2),F=B[0],H=B[1],V=!(v||g),W=(i-r)/10,U=w||(i-r)/100,G=LE(R,r,i),q=_E(T?i-G+r:G,r,i),Y="vertical"===h,Z=OG({min:r,max:i,step:w,isDisabled:v,value:G,isInteractive:V,isReversed:T,isVertical:Y,eventSource:null,focusThumbOnChange:P,orientation:h}),X=cr.useRef(null),$=cr.useRef(null),K=cr.useRef(null),Q=cr.useId(),J=null!=p?p:Q,ee="slider-thumb-".concat(J),te="slider-track-".concat(J),ne=cr.useCallback((function(e){var t,n;if(X.current){var r=Z.current;r.eventSource="pointer";var o=X.current.getBoundingClientRect(),i=null!==(t=null==(n=e.touches)?void 0:n[0])&&void 0!==t?t:e,a=i.clientX,s=i.clientY,l=(Y?o.bottom-s:a-o.left)/(Y?o.height:o.width);T&&(l=1-l);var u=EE(l,r.min,r.max);return r.step&&(u=parseFloat(PE(u,r.min,r.step))),LE(u,r.min,r.max)}}),[Y,T,Z]),re=cr.useCallback((function(e){var t=Z.current;t.isInteractive&&(e=LE(e=parseFloat(PE(e,t.min,U)),t.min,t.max),N(e))}),[U,N,Z]),oe=cr.useMemo((function(){return{stepUp:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U;re(T?G-e:G+e)},stepDown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U;re(T?G+e:G-e)},reset:function(){re(l||0)},stepTo:function(e){re(e)}}}),[re,T,G,U,l]),ie=cr.useCallback((function(e){var t=Z.current,n={ArrowRight:function(){return oe.stepUp()},ArrowUp:function(){return oe.stepUp()},ArrowLeft:function(){return oe.stepDown()},ArrowDown:function(){return oe.stepDown()},PageUp:function(){return oe.stepUp(W)},PageDown:function(){return oe.stepDown(W)},Home:function(){return re(t.min)},End:function(){return re(t.max)}}[e.key];n&&(e.preventDefault(),e.stopPropagation(),n(e),t.eventSource="keyboard")}),[oe,re,W,Z]),ae=null!==(t=null==M?void 0:M(G))&&void 0!==t?t:x,se=FG($),le=cr.useMemo((function(){var e=Z.current,t=null!=se?se:{width:0,height:0};return $G({isReversed:T,orientation:e.orientation,thumbRects:[t],thumbPercents:[q]})}),[T,se,q,Z]),ue=le.getThumbStyle,ce=le.rootStyle,de=le.trackStyle,fe=le.innerTrackStyle,he=cr.useCallback((function(){Z.current.focusThumbOnChange&&setTimeout((function(){var e;return null==(e=$.current)?void 0:e.focus()}))}),[Z]);function pe(e){var t=ne(e);null!=t&&t!==Z.current.value&&N(t)}U_((function(){var e=Z.current;he(),"keyboard"===e.eventSource&&(null==A||A(e.value))}),[G,A]),zG(K,{onPanSessionStart:function(e){var t=Z.current;t.isInteractive&&(j(!0),he(),pe(e),null==O||O(t.value))},onPanSessionEnd:function(){var e=Z.current;e.isInteractive&&(j(!1),null==A||A(e.value))},onPan:function(e){Z.current.isInteractive&&pe(e)}});var ve=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un(un({},e),L),{},{ref:Tv(t,K),tabIndex:-1,"aria-disabled":UG(v),"data-focused":WG(F),style:un(un({},e.style),ce)})}),[L,v,F,ce]),ge=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,X),id:te,"data-disabled":WG(v),style:un(un({},e.style),de)})}),[v,te,de]),me=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,style:un(un({},e.style),fe)})}),[fe]),ye=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,$),role:"slider",tabIndex:V?0:void 0,id:ee,"data-active":WG(z),"aria-valuetext":ae,"aria-valuemin":r,"aria-valuemax":i,"aria-valuenow":G,"aria-orientation":h,"aria-disabled":UG(v),"aria-readonly":UG(g),"aria-label":S,"aria-labelledby":S?void 0:C,style:un(un({},e.style),ue(0)),onKeyDown:qG(e.onKeyDown,ie),onFocus:qG(e.onFocus,(function(){return H(!0)})),onBlur:qG(e.onBlur,(function(){return H(!1)}))})}),[V,ee,z,ae,r,i,G,h,v,g,S,C,ue,ie]),be=cr.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=!(e.valuei),o=G>=e.value,a=_E(e.value,r,i),s=un({position:"absolute",pointerEvents:"none"},uq({orientation:h,vertical:{bottom:"".concat(T?100-a:a,"%")},horizontal:{left:"".concat(T?100-a:a,"%")}}));return un(un({},e),{},{ref:t,role:"presentation","aria-hidden":!0,"data-disabled":WG(v),"data-invalid":WG(!n),"data-highlighted":WG(o),style:un(un({},e.style),s)})}),[v,T,i,r,h,G]),we=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:e,type:"hidden",value:G,name:_})}),[_,G]);return{state:{value:G,isFocused:F,isDragging:z},actions:oe,getRootProps:ve,getTrackProps:ge,getInnerTrackProps:me,getThumbProps:ye,getMarkerProps:be,getInputProps:we}}(r),a=i.getInputProps,s=i.getRootProps,l=sn(i,Qe),u=s(),c=a({},t);return qr.createElement(fq,{value:l},qr.createElement(vq,{value:n},qr.createElement(Lv.div,un(un({},u),{},{className:GG("chakra-slider",e.className),__css:n.container}),e.children,qr.createElement("input",un({},c)))))}));mq.defaultProps={orientation:"horizontal"},mq.displayName="Slider";var yq=Cv((function(e,t){var n=hq().getThumbProps,r=gq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__thumb",e.className),__css:r.thumb}))}));yq.displayName="SliderThumb";var bq=Cv((function(e,t){var n=hq().getTrackProps,r=gq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__track",e.className),__css:r.track}))}));bq.displayName="SliderTrack";var wq=Cv((function(e,t){var n=hq().getInnerTrackProps,r=gq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__filled-track",e.className),__css:r.filledTrack}))}));wq.displayName="SliderFilledTrack";var kq=Cv((function(e,t){var n=hq().getMarkerProps,r=gq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__marker",e.className),__css:r.mark}))}));kq.displayName="SliderMark";var xq=function(){for(var e=arguments.length,t=new Array(e),n=0;n"}),2),Iq=Tq[0],Rq=Tq[1];function Nq(e){var t=e.isDisabled,n=e.isFocusable,r=sn(e,tt),o=Rq(),i=o.setSelectedIndex,a=o.isManual,s=o.id,l=o.setFocusedIndex,u=o.selectedIndex,c=Mq({disabled:t&&!n}),d=c.index,f=c.register,h=d===u,p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ref,n=e.isDisabled,r=e.isFocusable,o=e.clickOnEnter,i=void 0===o||o,a=e.clickOnSpace,s=void 0===a||a,l=e.onMouseDown,u=e.onMouseUp,c=e.onClick,d=e.onKeyDown,f=e.onKeyUp,h=e.tabIndex,p=e.onMouseOver,v=e.onMouseLeave,g=sn(e,ke),m=yn(cr.useState(!0),2),y=m[0],b=m[1],w=yn(cr.useState(!1),2),k=w[0],x=w[1],S=XP(),C=function(e){e&&"BUTTON"!==e.tagName&&b(!1)},_=y?h:h||0,E=n&&!r,P=cr.useCallback((function(e){if(n)return e.stopPropagation(),void e.preventDefault();e.currentTarget.focus(),null==c||c(e)}),[n,c]),L=cr.useCallback((function(e){k&&$P(e)&&(e.preventDefault(),e.stopPropagation(),x(!1),S.remove(document,"keyup",L,!1))}),[k,S]),O=cr.useCallback((function(e){if(null==d||d(e),!(n||e.defaultPrevented||e.metaKey)&&$P(e.nativeEvent)&&!y){var t=i&&"Enter"===e.key;s&&" "===e.key&&(e.preventDefault(),x(!0)),t&&(e.preventDefault(),e.currentTarget.click()),S.add(document,"keyup",L,!1)}}),[n,y,d,i,s,S,L]),A=cr.useCallback((function(e){null==f||f(e),n||e.defaultPrevented||e.metaKey||$P(e.nativeEvent)&&!y&&s&&" "===e.key&&(e.preventDefault(),x(!1),e.currentTarget.click())}),[s,y,n,f]),M=cr.useCallback((function(e){0===e.button&&(x(!1),S.remove(document,"mouseup",M,!1))}),[S]),T=cr.useCallback((function(e){if(0===e.button){if(n)return e.stopPropagation(),void e.preventDefault();y||x(!0),e.currentTarget.focus({preventScroll:!0}),S.add(document,"mouseup",M,!1),null==l||l(e)}}),[n,y,l,S,M]),I=cr.useCallback((function(e){0===e.button&&(y||x(!1),null==u||u(e))}),[u,y]),R=cr.useCallback((function(e){n?e.preventDefault():null==p||p(e)}),[n,p]),N=cr.useCallback((function(e){k&&(e.preventDefault(),x(!1)),null==v||v(e)}),[k,v]),D=Tv(t,C);return un(un({},g),{},y?{ref:D,type:"button","aria-disabled":E?void 0:n,disabled:E,onClick:P,onMouseDown:l,onMouseUp:u,onKeyUp:f,onKeyDown:d,onMouseOver:p,onMouseLeave:v}:{ref:D,role:"button","data-active":ZP(k),"aria-disabled":n?"true":void 0,tabIndex:E?void 0:_,onClick:P,onMouseDown:T,onMouseUp:I,onKeyUp:A,onKeyDown:O,onMouseOver:R,onMouseLeave:N})}(un(un({},r),{},{ref:Tv(f,e.ref),isDisabled:t,isFocusable:n,onClick:Eq(e.onClick,(function(){i(d)}))}));return un(un({},p),{},{id:Bq(s,d),role:"tab",tabIndex:h?0:-1,type:"button","aria-selected":h,"aria-controls":Fq(s,d),onFocus:t?void 0:Eq(e.onFocus,(function(){l(d),!a&&!(t&&n)&&i(d)}))})}var Dq=yn(Av({}),2),zq=Dq[0],jq=Dq[1];function Bq(e,t){return"".concat(e,"--tab-").concat(t)}function Fq(e,t){return"".concat(e,"--tabpanel-").concat(t)}var Hq=yn(Av({name:"TabsStylesContext",errorMessage:"useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),Vq=Hq[0],Wq=Hq[1],Uq=Cv((function(e,t){var n=Pv("Tabs",e),r=ua(e),o=r.children,i=r.className,a=function(e){var t,n=e.defaultIndex,r=e.onChange,o=e.index,i=e.isManual,a=e.isLazy,s=e.lazyBehavior,l=void 0===s?"unmount":s,u=e.orientation,c=void 0===u?"horizontal":u,d=e.direction,f=void 0===d?"ltr":d,h=sn(e,et),p=yn(cr.useState(null!=n?n:0),2),v=p[0],g=p[1],m=yn(Zv({defaultValue:null!=n?n:0,value:o,onChange:r}),2),y=m[0],b=m[1];cr.useEffect((function(){null!=o&&g(o)}),[o]);var w=Aq(),k=cr.useId(),x=null!==(t=e.id)&&void 0!==t?t:k;return{id:"tabs-".concat(x),selectedIndex:y,focusedIndex:v,setSelectedIndex:b,setFocusedIndex:g,isManual:i,isLazy:a,lazyBehavior:l,orientation:c,descendants:w,direction:f,htmlProps:h}}(sn(r,rt)),s=a.htmlProps,l=a.descendants,u=sn(a,ot),c=cr.useMemo((function(){return u}),[u]),d=(s.isFitted,sn(s,it));return qr.createElement(Lq,{value:l},qr.createElement(Iq,{value:c},qr.createElement(Vq,{value:n},qr.createElement(Lv.div,un(un({className:_q("chakra-tabs",i),ref:t},d),{},{__css:n.root}),o))))}));Uq.displayName="Tabs";var Gq=Cv((function(e,t){var n,r,o,i,a,s,l,u,c,d,f,h,p=(n=Rq(),r=Oq(),o=n.selectedIndex,i=n.orientation,a="horizontal"===i,s="vertical"===i,l=yn(cr.useState((function(){return a?{left:0,width:0}:s?{top:0,height:0}:void 0})),2),u=l[0],c=l[1],d=yn(cr.useState(!1),2),f=d[0],h=d[1],oo((function(){if(null!=o){var e=r.item(o);if(null!=e){a&&c({left:e.node.offsetLeft,width:e.node.offsetWidth}),s&&c({top:e.node.offsetTop,height:e.node.offsetHeight});var t=requestAnimationFrame((function(){h(!0)}));return function(){t&&cancelAnimationFrame(t)}}}}),[o,a,s,r]),un({position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:f?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)"},u)),v=un(un({},e.style),p),g=Wq();return qr.createElement(Lv.div,un(un({ref:t},e),{},{className:_q("chakra-tabs__tab-indicator",e.className),style:v,__css:g.indicator}))}));Gq.displayName="TabIndicator";var qq=Cv((function(e,t){var n=function(e){var t=Rq(),n=t.focusedIndex,r=t.orientation,o=t.direction,i=Oq(),a=cr.useCallback((function(e){var t,a=function(){var e,t=i.nextEnabled(n);t&&(null==(e=t.node)||e.focus())},s=function(){var e,t=i.prevEnabled(n);t&&(null==(e=t.node)||e.focus())},l="horizontal"===r,u="vertical"===r,c=e.key,d="ltr"===o?"ArrowRight":"ArrowLeft",f=(gn(t={},"ltr"===o?"ArrowLeft":"ArrowRight",(function(){return l&&s()})),gn(t,d,(function(){return l&&a()})),gn(t,"ArrowDown",(function(){return u&&a()})),gn(t,"ArrowUp",(function(){return u&&s()})),gn(t,"Home",(function(){var e,t=i.firstEnabled();t&&(null==(e=t.node)||e.focus())})),gn(t,"End",(function(){var e,t=i.lastEnabled();t&&(null==(e=t.node)||e.focus())})),t),h=f[c];h&&(e.preventDefault(),h(e))}),[i,n,r,o]);return un(un({},e),{},{role:"tablist","aria-orientation":r,onKeyDown:Eq(e.onKeyDown,a)})}(un(un({},e),{},{ref:t})),r=un({display:"flex"},Wq().tablist);return qr.createElement(Lv.div,un(un({},n),{},{className:_q("chakra-tabs__tablist",e.className),__css:r}))}));qq.displayName="TabList";var Yq=Cv((function(e,t){var n=function(e){var t=e.children,n=sn(e,nt),r=Rq(),o=r.isLazy,i=r.lazyBehavior,a=jq(),s=a.isSelected,l=a.id,u=a.tabId,c=cr.useRef(!1);s&&(c.current=!0);var d=KO({wasSelected:c.current,isSelected:s,enabled:o,mode:i});return un(un({tabIndex:0},n),{},{children:d?t:null,role:"tabpanel","aria-labelledby":u,hidden:!s,id:l})}(un(un({},e),{},{ref:t})),r=Wq();return qr.createElement(Lv.div,un(un({outline:"0"},n),{},{className:_q("chakra-tabs__tab-panel",e.className),__css:r.tabpanel}))}));Yq.displayName="TabPanel";var Zq=Cv((function(e,t){var n=function(e){var t=Rq(),n=t.id,r=t.selectedIndex,o=d_(e.children).map((function(e,t){return cr.createElement(zq,{key:t,value:{isSelected:t===r,id:Fq(n,t),tabId:Bq(n,t),selectedIndex:r}},e)}));return un(un({},e),{},{children:o})}(e),r=Wq();return qr.createElement(Lv.div,un(un({},n),{},{width:"100%",ref:t,className:_q("chakra-tabs__tab-panels",e.className),__css:r.tabpanels}))}));Zq.displayName="TabPanels";var Xq=Cv((function(e,t){var n=Wq(),r=Nq(un(un({},e),{},{ref:t})),o=un({outline:"0",display:"flex",alignItems:"center",justifyContent:"center"},n.tab);return qr.createElement(Lv.button,un(un({},r),{},{className:_q("chakra-tabs__tab",e.className),__css:o}))}));Xq.displayName="Tab";var $q=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(COe){o.e(COe)}finally{o.f()}return r}(n,Kq):n;return qr.createElement(Lv.textarea,un(un({ref:t,rows:i},a),{},{className:$q("chakra-textarea",o),__css:s}))}));function Jq(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};sY+=1;var o=null!==(t=r.id)&&void 0!==t?t:sY,i=null!==(n=r.position)&&void 0!==n?n:"bottom";return{id:o,message:e,position:i,duration:r.duration,onCloseComplete:r.onCloseComplete,onRequestRemove:function(){return aY.removeToast(String(o),i)},status:r.status,requestClose:!1,containerStyle:r.containerStyle}}(e,t),o=n.position,i=n.id;return r((function(e){var t,r,i=o.includes("top")?[n].concat(cn(null!==(t=e[o])&&void 0!==t?t:[])):[].concat(cn(null!==(r=e[o])&&void 0!==r?r:[]),[n]);return un(un({},e),{},gn({},o,i))})),i},update:function(e,t){e&&r((function(n){var r=un({},n),o=rY(r,e),i=o.position,a=o.index;return i&&-1!==a&&(r[i][a]=un(un(un({},r[i][a]),t),{},{message:uY(t)})),r}))},closeAll:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.positions;r((function(e){return(null!=t?t:["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((function(t,n){return t[n]=e[n].map((function(e){return un(un({},e),{},{requestClose:!0})})),t}),un({},e))}))},close:function(e){r((function(t){var n=oY(t,e);return n?un(un({},t),{},gn({},n,t[n].map((function(t){return t.id==e?un(un({},t),{},{requestClose:!0}):t})))):t}))},isActive:function(e){return Boolean(rY(aY.getState(),e).position)}}}({top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]});var sY=0;var lY=function(e){var t=e.status,n=e.variant,r=void 0===n?"solid":n,o=e.id,i=e.title,a=e.isClosable,s=e.onClose,l=e.description,u=e.icon,c=o?{root:"toast-".concat(o),title:"toast-".concat(o,"-title"),description:"toast-".concat(o,"-description")}:void 0;return qr.createElement(i_,{addRole:!1,status:t,variant:r,id:null==c?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},qr.createElement(s_,null,u),qr.createElement(Lv.div,{flex:"1",maxWidth:"100%"},i&&qr.createElement(l_,{id:null==c?void 0:c.title},i),l&&qr.createElement(a_,{id:null==c?void 0:c.description,display:"block"},l)),a&&qr.createElement(xE,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1}))};function uY(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.render,n=e.toastComponent,r=void 0===n?lY:n,o=function(n){return"function"==typeof t?t(un(un({},n),e)):qr.createElement(r,un(un({},n),e))};return o}function cY(e){var t=gv().theme;return cr.useMemo((function(){return function(e,t){var n=function(n){var r;return un(un(un({},t),n),{},{position:tY(null!==(r=null==n?void 0:n.position)&&void 0!==r?r:null==t?void 0:t.position,e)})},r=function(e){var t=n(e),r=uY(t);return aY.notify(r,t)};return r.update=function(e,t){aY.update(e,n(t))},r.promise=function(e,t){var n=r(un(un({},t.loading),{},{status:"loading",duration:null}));e.then((function(e){return r.update(n,un({status:"success",duration:5e3},Jq(t.success,e)))})).catch((function(e){return r.update(n,un({status:"error",duration:5e3},Jq(t.error,e)))}))},r.closeAll=aY.closeAll,r.close=aY.close,r.isActive=aY.isActive,r}(t.direction,e)}),[e,t.direction])}var dY={initial:function(e){var t=e.position,n=["top","bottom"].includes(t)?"y":"x",r=["top-right","bottom-right"].includes(t)?1:-1;return"bottom"===t&&(r=1),gn({opacity:0},n,24*r)},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},fY=cr.memo((function(e){var t=e.id,n=e.message,r=e.onCloseComplete,o=e.onRequestRemove,i=e.requestClose,a=void 0!==i&&i,s=e.position,l=void 0===s?"bottom":s,u=e.duration,c=void 0===u?5e3:u,d=e.containerStyle,f=e.motionVariants,h=void 0===f?dY:f,p=e.toastSpacing,v=void 0===p?"0.5rem":p,g=yn(cr.useState(c),2),m=g[0],y=g[1],b=rw();U_((function(){b||null==r||r()}),[b]),U_((function(){y(c)}),[c]);var w=function(){b&&o()};cr.useEffect((function(){b&&a&&o()}),[b,a,o]),function(e,t){var n=Yv(e);cr.useEffect((function(){var e;if(null!=t)return e=window.setTimeout((function(){n()}),t),function(){e&&window.clearTimeout(e)}}),[t,n])}(w,m);var k=cr.useMemo((function(){return un({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:v},d)}),[d,v]),x=cr.useMemo((function(){return function(e){var t="center";return e.includes("right")&&(t="flex-end"),e.includes("left")&&(t="flex-start"),{display:"flex",flexDirection:"column",alignItems:t}}(l)}),[l]);return qr.createElement(BS.li,{layout:!0,className:"chakra-toast",variants:h,initial:"initial",animate:"animate",exit:"exit",onHoverStart:function(){return y(null)},onHoverEnd:function(){return y(c)},custom:{position:l},style:x},qr.createElement(Lv.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:k},Jq(n,{id:t,onClose:w})))}));fY.displayName="ToastComponent";var hY=function(e){var t=cr.useSyncExternalStore(aY.subscribe,aY.getState,aY.getState),n=e.children,r=e.motionVariants,o=e.component,i=void 0===o?fY:o,a=e.portalProps,s=Object.keys(t).map((function(e){var n=t[e];return qr.createElement("ul",{role:"region","aria-live":"polite",key:e,id:"chakra-toast-manager-".concat(e),style:iY(e)},qr.createElement(qS,{initial:!1},n.map((function(e){return qr.createElement(i,un({key:e.id,motionVariants:r},e))}))))}));return qr.createElement(qr.Fragment,null,n,qr.createElement(gH,un({},a),s))};var pY={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function vY(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.openDelay,n=void 0===t?0:t,r=e.closeDelay,o=void 0===r?0:r,i=e.closeOnClick,a=void 0===i||i,s=e.closeOnMouseDown,l=e.closeOnScroll,u=e.closeOnPointerDown,c=void 0===u?s:u,d=e.closeOnEsc,f=void 0===d||d,h=e.onOpen,p=e.onClose,v=e.placement,g=e.id,m=e.isOpen,y=e.defaultIsOpen,b=e.arrowSize,w=void 0===b?10:b,k=e.arrowShadowColor,x=e.arrowPadding,S=e.modifiers,C=e.isDisabled,_=e.gutter,E=e.offset,P=e.direction,L=sn(e,st),O=XO({isOpen:m,defaultIsOpen:y,onOpen:h,onClose:p}),A=O.isOpen,M=O.onOpen,T=O.onClose,I=YO({enabled:A,placement:v,arrowPadding:x,modifiers:S,gutter:_,offset:E,direction:P}),R=I.referenceRef,N=I.getPopperProps,D=I.getArrowInnerProps,z=I.getArrowProps,j=cr.useId(),B=null!=g?g:j,F="tooltip-".concat(B),H=cr.useRef(null),V=cr.useRef(),W=cr.useCallback((function(){V.current&&(clearTimeout(V.current),V.current=void 0)}),[]),U=cr.useRef(),G=cr.useCallback((function(){U.current&&(clearTimeout(U.current),U.current=void 0)}),[]),q=cr.useCallback((function(){G(),T()}),[T,G]),Y=bY(H,q),Z=cr.useCallback((function(){if(!C&&!V.current){Y();var e=mY(H);V.current=e.setTimeout(M,n)}}),[Y,C,M,n]),X=cr.useCallback((function(){W();var e=mY(H);U.current=e.setTimeout(q,o)}),[o,q,W]),$=cr.useCallback((function(){A&&a&&X()}),[a,X,A]),K=cr.useCallback((function(){A&&c&&X()}),[c,X,A]),Q=cr.useCallback((function(e){A&&"Escape"===e.key&&X()}),[A,X]);DE((function(){return gY(H)}),"keydown",f?Q:void 0),DE((function(){return gY(H)}),"scroll",(function(){A&&l&&q()})),cr.useEffect((function(){C&&(W(),A&&T())}),[C,A,T,W]),cr.useEffect((function(){return function(){W(),G()}}),[W,G]),DE((function(){return H.current}),"pointerleave",X);var J=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=un(un({},e),{},{ref:Tv(H,t,R),onPointerEnter:vY(e.onPointerEnter,(function(e){"touch"!==e.pointerType&&Z()})),onClick:vY(e.onClick,$),onPointerDown:vY(e.onPointerDown,K),onFocus:vY(e.onFocus,Z),onBlur:vY(e.onBlur,X),"aria-describedby":A?F:void 0});return n}),[Z,X,K,A,F,$,R]),ee=cr.useCallback((function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return N(un(un({},t),{},{style:un(un({},t.style),{},(e={},gn(e,TO.arrowSize.var,w?"".concat(w,"px"):void 0),gn(e,TO.arrowShadowColor.var,k),e))}),n)}),[N,w,k]),te=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=un(un({},e.style),{},{position:"relative",transformOrigin:TO.transformOrigin.varRef});return un(un(un({ref:t},L),e),{},{id:F,role:"tooltip",style:n})}),[L,F]);return{isOpen:A,show:Z,hide:X,getTriggerProps:J,getTooltipProps:te,getTooltipPositionerProps:ee,getArrowProps:z,getArrowInnerProps:D}}(un(un({},y),{},{direction:a.direction}));if("string"==typeof s||u)k=qr.createElement(Lv.span,un({display:"inline-block",tabIndex:0},x.getTriggerProps()),s);else{var S=cr.Children.only(s);k=cr.cloneElement(S,x.getTriggerProps(S.props,S.ref))}var C=!!c,_=x.getTooltipProps({},t),E=C?function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(COe){o.e(COe)}finally{o.f()}return r}(_,["role","id"]):_,P=function(e,t){var n,r={},o=xn(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;i in e&&(r[i]=e[i])}}catch(COe){o.e(COe)}finally{o.f()}return r}(_,["role","id"]);return l?qr.createElement(qr.Fragment,null,k,qr.createElement(qS,null,x.isOpen&&qr.createElement(gH,un({},h),qr.createElement(Lv.div,un(un({},x.getTooltipPositionerProps()),{},{__css:{zIndex:o.zIndex,pointerEvents:"none"}}),qr.createElement(wY,un(un(un({variants:pY,initial:"exit",animate:"enter",exit:"exit"},m),E),{},{__css:o}),l,C&&qr.createElement(Lv.span,un({srOnly:!0},P),c),d&&qr.createElement(Lv.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},qr.createElement(Lv.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}}))))))):qr.createElement(qr.Fragment,null,s)}));kY.displayName="Tooltip";var xY=function(e){var t=e.children,n=e.colorModeManager,r=e.portalZIndex,o=e.resetCSS,i=void 0===o||o,a=e.theme,s=void 0===a?{}:a,l=e.environment,u=e.cssVarsRoot,c=qr.createElement(YP,{environment:l},t);return qr.createElement(mv,{theme:s,cssVarsRoot:u},qr.createElement(po,{colorModeManager:n,options:s.config},i?qr.createElement(NE,null):qr.createElement(RE,null),qr.createElement(bv,null),r?qr.createElement(lH,{zIndex:r},c):c))};function SY(e){var t=e.children,n=e.theme,r=void 0===n?lv:n,o=e.toastOptions,i=sn(e,ut);return qr.createElement(xY,un({theme:r},i),t,qr.createElement(hY,un({},o)))}var CY={},_Y=QO;CY.createRoot=_Y.createRoot,CY.hydrateRoot=_Y.hydrateRoot;var EY={},PY={get exports(){return EY},set exports(e){EY=e}},LY={},OY=cr;var AY="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},MY=OY.useState,TY=OY.useEffect,IY=OY.useLayoutEffect,RY=OY.useDebugValue;function NY(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!AY(e,n)}catch(Xke){return!0}}var DY="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=MY({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return IY((function(){o.value=n,o.getSnapshot=t,NY(o)&&i({inst:o})}),[e,n,t]),TY((function(){return NY(o)&&i({inst:o}),e((function(){NY(o)&&i({inst:o})}))}),[e]),RY(n),n};LY.useSyncExternalStore=void 0!==OY.useSyncExternalStore?OY.useSyncExternalStore:DY,function(e){e.exports=LY}(PY);var zY={},jY={get exports(){return zY},set exports(e){zY=e}},BY={},FY=cr,HY=EY;var VY="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},WY=HY.useSyncExternalStore,UY=FY.useRef,GY=FY.useEffect,qY=FY.useMemo,YY=FY.useDebugValue;BY.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=UY(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=qY((function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return s=t}return s=e}if(t=s,VY(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,s=n)}var i,s,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,o]);var s=WY(e,i[0],i[1]);return GY((function(){a.hasValue=!0,a.value=s}),[s]),YY(s),s},function(e){e.exports=BY}(jY);var ZY=function(e){e()},XY=function(){return ZY},$Y=cr.createContext(null);function KY(){return cr.useContext($Y)}var QY=function(){throw new Error("uSES not initialized!")},JY=function(e,t){return e===t};function eZ(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$Y,t=e===$Y?KY:function(){return cr.useContext(e)};return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JY,r=t(),o=r.store,i=r.subscription,a=r.getServerState,s=QY(i.addNestedSub,o.getState,a||o.getState,e,n);return cr.useDebugValue(s),s}}var tZ,nZ=eZ(),rZ={},oZ={get exports(){return rZ},set exports(e){rZ=e}},iZ={},aZ=Symbol.for("react.element"),sZ=Symbol.for("react.portal"),lZ=Symbol.for("react.fragment"),uZ=Symbol.for("react.strict_mode"),cZ=Symbol.for("react.profiler"),dZ=Symbol.for("react.provider"),fZ=Symbol.for("react.context"),hZ=Symbol.for("react.server_context"),pZ=Symbol.for("react.forward_ref"),vZ=Symbol.for("react.suspense"),gZ=Symbol.for("react.suspense_list"),mZ=Symbol.for("react.memo"),yZ=Symbol.for("react.lazy"),bZ=Symbol.for("react.offscreen");function wZ(e){if("object"===kn(e)&&null!==e){var t=e.$$typeof;switch(t){case aZ:switch(e=e.type){case lZ:case cZ:case uZ:case vZ:case gZ:return e;default:switch(e=e&&e.$$typeof){case hZ:case fZ:case pZ:case yZ:case mZ:case dZ:return e;default:return t}}case sZ:return t}}}tZ=Symbol.for("react.module.reference"),iZ.ContextConsumer=fZ,iZ.ContextProvider=dZ,iZ.Element=aZ,iZ.ForwardRef=pZ,iZ.Fragment=lZ,iZ.Lazy=yZ,iZ.Memo=mZ,iZ.Portal=sZ,iZ.Profiler=cZ,iZ.StrictMode=uZ,iZ.Suspense=vZ,iZ.SuspenseList=gZ,iZ.isAsyncMode=function(){return!1},iZ.isConcurrentMode=function(){return!1},iZ.isContextConsumer=function(e){return wZ(e)===fZ},iZ.isContextProvider=function(e){return wZ(e)===dZ},iZ.isElement=function(e){return"object"===kn(e)&&null!==e&&e.$$typeof===aZ},iZ.isForwardRef=function(e){return wZ(e)===pZ},iZ.isFragment=function(e){return wZ(e)===lZ},iZ.isLazy=function(e){return wZ(e)===yZ},iZ.isMemo=function(e){return wZ(e)===mZ},iZ.isPortal=function(e){return wZ(e)===sZ},iZ.isProfiler=function(e){return wZ(e)===cZ},iZ.isStrictMode=function(e){return wZ(e)===uZ},iZ.isSuspense=function(e){return wZ(e)===vZ},iZ.isSuspenseList=function(e){return wZ(e)===gZ},iZ.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===lZ||e===cZ||e===uZ||e===vZ||e===gZ||e===bZ||"object"===kn(e)&&null!==e&&(e.$$typeof===yZ||e.$$typeof===mZ||e.$$typeof===dZ||e.$$typeof===fZ||e.$$typeof===pZ||e.$$typeof===tZ||void 0!==e.getModuleId)},iZ.typeOf=wZ,function(e){e.exports=iZ}(oZ);var kZ={notify:function(){},get:function(){return[]}};function xZ(e,t){var n,r=kZ;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){var e=XY(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}var a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=kZ)},getListeners:function(){return r}};return a}var SZ=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?cr.useLayoutEffect:cr.useEffect;function CZ(e){var t=e.store,n=e.context,r=e.children,o=e.serverState,i=cr.useMemo((function(){var e=xZ(t);return{store:t,subscription:e,getServerState:o?function(){return o}:void 0}}),[t,o]),a=cr.useMemo((function(){return t.getState()}),[t]);SZ((function(){var e=i.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=void 0}}),[i,a]);var s=n||$Y;return qr.createElement(s.Provider,{value:i},r)}function _Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$Y,t=e===$Y?KY:function(){return cr.useContext(e)};return function(){return t().store}}var EZ=_Z();function PZ(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$Y,t=e===$Y?EZ:_Z(e);return function(){return t().dispatch}}var LZ,OZ=PZ();function AZ(e){return AZ="function"==typeof Symbol&&"symbol"===kn(Symbol.iterator)?function(e){return kn(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":kn(e)},AZ(e)}function MZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TZ(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:YZ(e)?2:ZZ(e)?3:0}function UZ(e,t){return 2===WZ(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function GZ(e,t,n){var r=WZ(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function qZ(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function YZ(e){return kX&&e instanceof Map}function ZZ(e){return xX&&e instanceof Set}function XZ(e){return e.o||e.t}function $Z(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=OX(e);delete t[EX];for(var n=LX(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=QZ),Object.freeze(e),t&&VZ(e,(function(e,t){return KZ(t,!0)}),!0)),e}function QZ(){BZ(2)}function JZ(e){return null==e||"object"!=kn(e)||Object.isFrozen(e)}function eX(e){var t=AX[e];return t||BZ(18,e),t}function tX(){return bX}function nX(e,t){t&&(eX("Patches"),e.u=[],e.s=[],e.v=t)}function rX(e){oX(e),e.p.forEach(aX),e.p=null}function oX(e){e===bX&&(bX=e.l)}function iX(e){return bX={p:[],l:bX,h:e,m:!0,_:0}}function aX(e){var t=e[EX];0===t.i||1===t.i?t.j():t.O=!0}function sX(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||eX("ES5").S(t,e,r),r?(n[EX].P&&(rX(t),BZ(4)),HZ(e)&&(e=lX(t,e),t.l||cX(t,e)),t.u&&eX("Patches").M(n[EX].t,e,t.u,t.s)):e=lX(t,n,[]),rX(t),t.u&&t.v(t.u,t.s),e!==CX?e:void 0}function lX(e,t,n){if(JZ(t))return t;var r=t[EX];if(!r)return VZ(t,(function(o,i){return uX(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return cX(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=$Z(r.k):r.o;VZ(3===r.i?new Set(o):o,(function(t,i){return uX(e,r,o,t,i,n)})),cX(e,o,!1),n&&e.u&&eX("Patches").R(r,n,e.u,e.s)}return r.o}function uX(e,t,n,r,o,i){if(FZ(o)){var a=lX(e,o,i&&t&&3!==t.i&&!UZ(t.D,r)?i.concat(r):void 0);if(GZ(n,r,a),!FZ(a))return;e.m=!1}if(HZ(o)&&!JZ(o)){if(!e.h.F&&e._<1)return;lX(e,o),t&&t.A.l||cX(e,o)}}function cX(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&KZ(t,n)}function dX(e,t){var n=e[EX];return(n?XZ(n):e)[t]}function fX(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function hX(e){e.P||(e.P=!0,e.l&&hX(e.l))}function pX(e){e.o||(e.o=$Z(e.t))}function vX(e,t,n){var r=YZ(t)?eX("MapSet").N(t,n):ZZ(t)?eX("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:tX(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=MX;n&&(o=[r],i=TX);var a=Proxy.revocable(o,i),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):eX("ES5").J(t,n);return(n?n.A:tX()).p.push(r),r}function gX(e){return FZ(e)||BZ(22,e),function e(t){if(!HZ(t))return t;var n,r=t[EX],o=WZ(t);if(r){if(!r.P&&(r.i<4||!eX("ES5").K(r)))return r.t;r.I=!0,n=mX(t,o),r.I=!1}else n=mX(t,o);return VZ(n,(function(t,o){r&&function(e,t){return 2===WZ(e)?e.get(t):e[t]}(r.t,t)===o||GZ(n,t,e(o))})),3===o?new Set(n):n}(e)}function mX(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return $Z(e)}zZ(jZ,"defaultProps",{children:null,loading:null});var yX,bX,wX="undefined"!=typeof Symbol&&"symbol"==kn(Symbol("x")),kX="undefined"!=typeof Map,xX="undefined"!=typeof Set,SX="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,CX=wX?Symbol.for("immer-nothing"):((yX={})["immer-nothing"]=!0,yX),_X=wX?Symbol.for("immer-draftable"):"__$immer_draftable",EX=wX?Symbol.for("immer-state"):"__$immer_state",PX=""+Object.prototype.constructor,LX="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,OX=Object.getOwnPropertyDescriptors||function(e){var t={};return LX(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},AX={},MX={get:function(e,t){if(t===EX)return e;var n=XZ(e);if(!UZ(n,t))return function(e,t,n){var r,o=fX(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!HZ(r)?r:r===dX(e.t,t)?(pX(e),e.o[t]=vX(e.A.h,r,e)):r},has:function(e,t){return t in XZ(e)},ownKeys:function(e){return Reflect.ownKeys(XZ(e))},set:function(e,t,n){var r=fX(XZ(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=dX(XZ(e),t),i=null==o?void 0:o[EX];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(qZ(n,o)&&(void 0!==n||UZ(e.t,t)))return!0;pX(e),hX(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==dX(e.t,t)||t in e.t?(e.D[t]=!1,pX(e),hX(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=XZ(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){BZ(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){BZ(12)}},TX={};VZ(MX,(function(e,t){TX[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),TX.deleteProperty=function(e,t){return TX.set.call(this,e,t,void 0)},TX.set=function(e,t,n){return MX.set.call(this,e[0],t,n,e[0])};var IX=function(){function e(e){var t=this;this.g=SX,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,a=Array(r>1?r-1:0),s=1;s1?r-1:0),i=1;i=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=eX("Patches").$;return FZ(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),RX=new IX,NX=RX.produce;function DX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zX(e){for(var t=1;t-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return YX}return{get:r,put:function(t,o){r(t)===YX&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(l,c);function f(){var t=d.get(arguments);if(t===YX){if(t=e.apply(null,arguments),u){var n=d.getEntries(),r=n.find((function(e){return u(e.value,t)}));r&&(t=r.value)}d.put(arguments,t)}return t}return f.clearCache=function(){return d.clear()},f}function $X(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":kn(e)})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function KX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0;t--){var o=e[t][EX];if(!o.P)switch(o.i){case 5:r(o)&&hX(o);break;case 4:n(o)&&hX(o)}}}function n(e){for(var t=e.t,n=e.k,r=LX(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==EX){var a=t[i];if(void 0===a&&!UZ(t,i))return!0;var s=n[i],l=s&&s[EX];if(l?l.t!==a:!qZ(s,a))return!0}}var u=!!t[EX];return r.length!==LX(t).length+(u?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Z$(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:Q$,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case R$:return $$({},e,{registry:[].concat(Z$(e.registry),[t.key])});case A$:var n=e.registry.indexOf(t.key),r=Z$(e.registry);return r.splice(n,1),$$({},e,{registry:r,bootstrapped:0===r.length});default:return e}};var eK={},tK={};function nK(e){return nK="function"==typeof Symbol&&"symbol"===kn(Symbol.iterator)?function(e){return kn(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":kn(e)},nK(e)}function rK(){}tK.__esModule=!0,tK.default=function(e){var t="".concat(e,"Storage");return function(e){if("object"!==("undefined"==typeof self?"undefined":nK(self))||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch(Dhe){return!1}return!0}(t)?self[t]:oK};var oK={getItem:rK,setItem:rK,removeItem:rK};eK.__esModule=!0,eK.default=function(e){var t=(0,aK.default)(e);return{getItem:function(e){return new Promise((function(n,r){n(t.getItem(e))}))},setItem:function(e,n){return new Promise((function(r,o){r(t.setItem(e,n))}))},removeItem:function(e){return new Promise((function(n,r){n(t.removeItem(e))}))}}};var iK,aK=(iK=tK)&&iK.__esModule?iK:{default:iK};var sK,lK=function(e){return e&&e.__esModule?e:{default:e}}(eK);sK=(0,lK.default)("local");var uK={},cK={},dK={};Object.defineProperty(dK,"__esModule",{value:!0}),dK.PLACEHOLDER_UNDEFINED=dK.PACKAGE_NAME=void 0,dK.PACKAGE_NAME="redux-deep-persist",dK.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var fK={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,(t=e.ConfigType||(e.ConfigType={}))[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(fK),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;var t=dK,n=fK;e.isObjectLike=function(e){return"object"===kn(e)&&null!==e};e.isLength=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Number.MAX_SAFE_INTEGER},e.isArray=Array.isArray||function(t){return(0,e.isLength)(t&&t.length)&&"[object Array]"===Object.prototype.toString.call(t)};e.isPlainObject=function(t){return!!t&&"object"===kn(t)&&!(0,e.isArray)(t)};e.isIntegerString=function(e){return String(~~e)===e&&Number(e)>=0};e.isString=function(e){return"[object String]"===Object.prototype.toString.call(e)};e.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)};e.isEmpty=function(e){return 0===Object.keys(e).length};var r=Object.prototype.hasOwnProperty;e.getCircularPath=function(t,n,r){for(var o in r||(r=new Set([t])),n||(n=""),t){var i=n?"".concat(n,".").concat(o):o,a=t[o];if((0,e.isObjectLike)(a))return r.has(a)?"".concat(n,".").concat(o,":"):(r.add(a),(0,e.getCircularPath)(a,i,r))}return null};e._cloneDeep=function(t){if(!(0,e.isObjectLike)(t))return t;if((0,e.isDate)(t))return new Date(+t);var n=(0,e.isArray)(t)?[]:{};for(var r in t){var o=t[r];n[r]=(0,e._cloneDeep)(o)}return n};e.cloneDeep=function(n){var r=(0,e.getCircularPath)(n);if(r)throw new Error("".concat(t.PACKAGE_NAME,": circular dependency detected under the path '").concat(r,"' of object you're trying to persist: ").concat(n));return(0,e._cloneDeep)(n)};e.difference=function(t,n){if(t===n)return{};if(!(0,e.isObjectLike)(t)||!(0,e.isObjectLike)(n))return n;var o=(0,e.cloneDeep)(t),i=(0,e.cloneDeep)(n),a=Object.keys(o).reduce((function(e,t){return r.call(i,t)||(e[t]=void 0),e}),{});if((0,e.isDate)(o)||(0,e.isDate)(i))return o.valueOf()===i.valueOf()?{}:i;var s=Object.keys(i).reduce((function(t,n){if(!r.call(o,n))return t[n]=i[n],t;var a=(0,e.difference)(o[n],i[n]);return(0,e.isObjectLike)(a)&&(0,e.isEmpty)(a)&&!(0,e.isDate)(a)?(0,e.isArray)(o)&&!(0,e.isArray)(i)||!(0,e.isArray)(o)&&(0,e.isArray)(i)?i:t:(t[n]=a,t)}),a);return delete s._persist,s};e.path=function(t,n){return n.reduce((function(t,n){if(t){var r=parseInt(n,10),o=(0,e.isIntegerString)(n)&&r<0?t.length+r:n;return(0,e.isString)(t)?t.charAt(o):t[o]}}),t)};e.assocPath=function(t,n){var r=cn(t).reverse().reduce((function(t,r,o){var i=(0,e.isIntegerString)(r)?[]:{};return i[r]=0===o?n:t,i}),{});return r};e.dissocPath=function(t,n){var r=(0,e.cloneDeep)(t);return n.reduce((function(t,r,o){return o===n.length-1&&t&&(0,e.isObjectLike)(t)&&delete t[r],t&&t[r]}),r),r};var o=function n(r,o){for(var i=arguments.length,a=new Array(i>2?i-2:0),s=2;s1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0;if(!(0,e.isObjectLike)(o))return o;for(var u in o){var c=o[u],d=(0,e.isArray)(o),f=s?s+"."+u:u;null===c&&(a===n.ConfigType.WHITELIST&&-1===i.indexOf(f)||a===n.ConfigType.BLACKLIST&&-1!==i.indexOf(f))&&d&&(o[parseInt(u,10)]=void 0),void 0===c&&l&&a===n.ConfigType.BLACKLIST&&-1===i.indexOf(f)&&d&&(o[parseInt(u,10)]=t.PLACEHOLDER_UNDEFINED),r(c,i,a,f,l)}};e.preserveUndefined=function(t,n,r,o){var a=(0,e.cloneDeep)(t);return i(a,n,r,"",o),a};e.unique=function(e,t,n){return n.indexOf(e)===t};e.findDuplicatesAndSubsets=function(t){return t.reduce((function(n,r){var o=t.filter((function(e){return e===r})),i=t.filter((function(e){return 0===(r+".").indexOf(e+".")})),a=n.duplicates,s=n.subsets,l=o.length>1&&-1===a.indexOf(r),u=i.length>1;return{duplicates:[].concat(cn(a),cn(l?o:[])),subsets:[].concat(cn(s),cn(u?i:[])).filter(e.unique).sort()}}),{duplicates:[],subsets:[]})};e.singleTransformValidator=function(r,o,i){var a=i===n.ConfigType.WHITELIST?"whitelist":"blacklist",s="".concat(t.PACKAGE_NAME,": incorrect ").concat(a," configuration."),l="Check your create".concat(i===n.ConfigType.WHITELIST?"White":"Black","list arguments.\n\n");if(!(0,e.isString)(o)||o.length<1)throw new Error("".concat(s," Name (key) of reducer is required. ").concat(l));if(r&&r.length){var u=(0,e.findDuplicatesAndSubsets)(r),c=u.duplicates,d=u.subsets;if(c.length>1)throw new Error("".concat(s," Duplicated paths.\n\n ").concat(JSON.stringify(c),"\n\n ").concat(l));if(d.length>1)throw new Error("".concat(s," You are trying to persist an entire property and also some of its subset.\n\n").concat(JSON.stringify(d),"\n\n ").concat(l))}};e.transformsValidator=function(n){if((0,e.isArray)(n)){var r=(null==n?void 0:n.map((function(e){return e.deepPersistKey})).filter((function(e){return e})))||[];if(r.length){var o=r.filter((function(e,t){return r.indexOf(e)!==t}));if(o.length)throw new Error("".concat(t.PACKAGE_NAME,": found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed.\n\n Duplicates: ").concat(JSON.stringify(o)))}}};e.configValidator=function(n){var r=n.whitelist,o=n.blacklist;if(r&&r.length&&o&&o.length)throw new Error("".concat(t.PACKAGE_NAME,": you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config."));if(r){var i=(0,e.findDuplicatesAndSubsets)(r),a=i.duplicates,s=i.subsets;(0,e.throwError)({duplicates:a,subsets:s},"whitelist")}if(o){var l=(0,e.findDuplicatesAndSubsets)(o),u=l.duplicates,c=l.subsets;(0,e.throwError)({duplicates:u,subsets:c},"blacklist")}};e.throwError=function(e,n){var r=e.duplicates,o=e.subsets;if(r.length)throw new Error("".concat(t.PACKAGE_NAME,": duplicates of paths found in your ").concat(n,".\n\n ").concat(JSON.stringify(r)));if(o.length)throw new Error("".concat(t.PACKAGE_NAME,": subsets of some parent keys found in your ").concat(n,". You must decide if you want to persist an entire path or its specific subset.\n\n ").concat(JSON.stringify(o)))};e.getRootKeysGroup=function(t){return(0,e.isArray)(t)?t.filter(e.unique).reduce((function(e,t){var n=t.split("."),r=n[0],o=n.slice(1).join(".")||void 0,i=e.filter((function(e){return Object.keys(e)[0]===r}))[0],a=i?Object.values(i)[0]:void 0;return i||e.push(gn({},r,o?[o]:void 0)),i&&!a&&o&&(i[r]=[o]),i&&a&&o&&a.push(o),e}),[]):[]}}(cK),function(e){var t=ir&&ir.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o2&&void 0!==arguments[2]?arguments[2]:{},r=n.whitelist||null,o=n.blacklist||null;function i(e){return!(!r||-1!==r.indexOf(e))||!(!o||-1===o.indexOf(e))}return{in:function(t,n,r){return!i(n)&&e?e(t,n,r):t},out:function(e,n,r){return!i(n)&&t?t(e,n,r):e},deepPersistKey:r&&r[0]}};e.autoMergeDeep=function(e,t,o,i){var a=i.debug,s=i.whitelist,l=i.blacklist,u=i.transforms;if(s||l)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(u);var c=(0,n.cloneDeep)(o),d=e;if(d&&(0,n.isObjectLike)(d)){var f=(0,n.difference)(t,o);(0,n.isEmpty)(f)||(d=(0,n.mergeDeep)(e,f,{preserveUndefined:!0}),a&&console.log("".concat(r.PACKAGE_NAME,"/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ").concat(JSON.stringify(f)))),Object.keys(d).forEach((function(e){"_persist"!==e&&((0,n.isObjectLike)(c[e])?c[e]=(0,n.mergeDeep)(c[e],d[e]):c[e]=d[e])}))}return a&&d&&(0,n.isObjectLike)(d)&&console.log("".concat(r.PACKAGE_NAME,"/autoMergeDeep: rehydrated keys ").concat(JSON.stringify(d))),c};e.createWhitelist=function(e,t){return(0,n.singleTransformValidator)(t,e,o.ConfigType.WHITELIST),i((function(e){if(!t||!t.length)return e;var o,i=null;return t.forEach((function(t){var a=t.split(".");void 0===(o=(0,n.path)(e,a))&&(0,n.isIntegerString)(a[a.length-1])&&(o=r.PLACEHOLDER_UNDEFINED);var s=(0,n.assocPath)(a,o),l=(0,n.isArray)(s)?[]:{};i=(0,n.mergeDeep)(i||l,s,{preservePlaceholder:!0})})),i||e}),(function(e){return(0,n.preserveUndefined)(e,t,o.ConfigType.WHITELIST)}),{whitelist:[e]})};e.createBlacklist=function(e,t){return(0,n.singleTransformValidator)(t,e,o.ConfigType.BLACKLIST),i((function(e){if(t&&t.length){var r=(0,n.preserveUndefined)(e,t,o.ConfigType.BLACKLIST,!0);return t.map((function(e){return e.split(".")})).reduce((function(e,t){return(0,n.dissocPath)(e,t)}),r)}}),(function(e){return(0,n.preserveUndefined)(e,t,o.ConfigType.BLACKLIST)}),{whitelist:[e]})};e.getTransforms=function(t,n){return n.map((function(n){var r=Object.keys(n)[0],i=n[r];return t===o.ConfigType.WHITELIST?(0,e.createWhitelist)(r,i):(0,e.createBlacklist)(r,i)}))};e.getPersistConfig=function(r){var i=r.key,a=r.whitelist,s=r.blacklist,l=r.storage,u=r.transforms,c=r.rootReducer,d=t(r,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:a,blacklist:s});var f=(0,n.getRootKeysGroup)(a),h=(0,n.getRootKeysGroup)(s),p=Object.keys(c(void 0,{type:""})),v=f.map((function(e){return Object.keys(e)[0]})),g=h.map((function(e){return Object.keys(e)[0]})),m=p.filter((function(e){return-1===v.indexOf(e)&&-1===g.indexOf(e)})),y=(0,e.getTransforms)(o.ConfigType.WHITELIST,f),b=(0,e.getTransforms)(o.ConfigType.BLACKLIST,h),w=(0,n.isArray)(a)?m.map((function(t){return(0,e.createBlacklist)(t)})):[];return Object.assign(Object.assign({},d),{key:i,storage:l,transforms:[].concat(cn(y),cn(b),cn(w),cn(u||[])),stateReconciler:e.autoMergeDeep})}}(uK);var hK=function(e,t){return Math.floor(e/t)*t},pK=function(e,t){return Math.round(e/t)*t};var vK=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e},gK=/\s/;var mK=function(e){for(var t=e.length;t--&&gK.test(e.charAt(t)););return t},yK=mK,bK=/^\s+/;var wK=function(e){return e?e.slice(0,yK(e)+1).replace(bK,""):e};var kK=function(e){var t=kn(e);return null!=e&&("object"==t||"function"==t)},xK="object"==kn(ir)&&ir&&ir.Object===Object&&ir,SK=xK,CK="object"==("undefined"==typeof self?"undefined":kn(self))&&self&&self.Object===Object&&self,_K=SK||CK||Function("return this")(),EK=_K.Symbol,PK=EK,LK=Object.prototype,OK=LK.hasOwnProperty,AK=LK.toString,MK=PK?PK.toStringTag:void 0;var TK=function(e){var t=OK.call(e,MK),n=e[MK];try{e[MK]=void 0;var r=!0}catch(Dhe){}var o=AK.call(e);return r&&(t?e[MK]=n:delete e[MK]),o},IK=Object.prototype.toString;var RK=function(e){return IK.call(e)},NK=TK,DK=RK,zK=EK?EK.toStringTag:void 0;var jK=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":zK&&zK in Object(e)?NK(e):DK(e)};var BK=function(e){return null!=e&&"object"==kn(e)},FK=jK,HK=BK;var VK=function(e){return"symbol"==kn(e)||HK(e)&&"[object Symbol]"==FK(e)},WK=wK,UK=kK,GK=VK,qK=/^[-+]0x[0-9a-f]+$/i,YK=/^0b[01]+$/i,ZK=/^0o[0-7]+$/i,XK=parseInt;var $K=function(e){if("number"==typeof e)return e;if(GK(e))return NaN;if(UK(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=UK(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=WK(e);var n=YK.test(e);return n||ZK.test(e)?XK(e.slice(2),n?2:8):qK.test(e)?NaN:+e},KK=vK,QK=$K;var JK=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=QK(n))==n?n:0),void 0!==t&&(t=(t=QK(t))==t?t:0),KK(QK(e),t,n)};var eQ=function(){this.__data__=[],this.size=0};var tQ=function(e,t){return e===t||e!=e&&t!=t},nQ=tQ;var rQ=function(e,t){for(var n=e.length;n--;)if(nQ(e[n][0],t))return n;return-1},oQ=rQ,iQ=Array.prototype.splice;var aQ=function(e){var t=this.__data__,n=oQ(t,e);return!(n<0)&&(n==t.length-1?t.pop():iQ.call(t,n,1),--this.size,!0)},sQ=rQ;var lQ=function(e){var t=this.__data__,n=sQ(t,e);return n<0?void 0:t[n][1]},uQ=rQ;var cQ=function(e){return uQ(this.__data__,e)>-1},dQ=rQ;var fQ=function(e,t){var n=this.__data__,r=dQ(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},hQ=eQ,pQ=aQ,vQ=lQ,gQ=cQ,mQ=fQ;function yQ(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},x0=jK,S0=k0,C0=BK,_0={};_0["[object Float32Array]"]=_0["[object Float64Array]"]=_0["[object Int8Array]"]=_0["[object Int16Array]"]=_0["[object Int32Array]"]=_0["[object Uint8Array]"]=_0["[object Uint8ClampedArray]"]=_0["[object Uint16Array]"]=_0["[object Uint32Array]"]=!0,_0["[object Arguments]"]=_0["[object Array]"]=_0["[object ArrayBuffer]"]=_0["[object Boolean]"]=_0["[object DataView]"]=_0["[object Date]"]=_0["[object Error]"]=_0["[object Function]"]=_0["[object Map]"]=_0["[object Number]"]=_0["[object Object]"]=_0["[object RegExp]"]=_0["[object Set]"]=_0["[object String]"]=_0["[object WeakMap]"]=!1;var E0=function(e){return C0(e)&&S0(e.length)&&!!_0[x0(e)]};var P0=function(e){return function(t){return e(t)}},L0={},O0={get exports(){return L0},set exports(e){L0=e}};!function(e,t){var n=xK,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(Dhe){}}();e.exports=a}(O0,L0);var A0=E0,M0=P0,T0=L0&&L0.isTypedArray,I0=T0?M0(T0):A0,R0=o0,N0=p0,D0=v0,z0=g0,j0=w0,B0=I0,F0=Object.prototype.hasOwnProperty;var H0=function(e,t){var n=D0(e),r=!n&&N0(e),o=!n&&!r&&z0(e),i=!n&&!r&&!o&&B0(e),a=n||r||o||i,s=a?R0(e.length,String):[],l=s.length;for(var u in e)!t&&!F0.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||j0(u,l))||s.push(u);return s},V0=Object.prototype;var W0=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||V0)};var U0=function(e,t){return function(n){return e(t(n))}},G0=U0(Object.keys,Object),q0=W0,Y0=G0,Z0=Object.prototype.hasOwnProperty;var X0=function(e){if(!q0(e))return Y0(e);var t=[];for(var n in Object(e))Z0.call(e,n)&&"constructor"!=n&&t.push(n);return t},$0=LQ,K0=k0;var Q0=function(e){return null!=e&&K0(e.length)&&!$0(e)},J0=H0,e1=X0,t1=Q0;var n1=function(e){return t1(e)?J0(e):e1(e)},r1=r0,o1=n1;var i1=function(e,t){return e&&r1(t,o1(t),e)};var a1=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},s1=kK,l1=W0,u1=a1,c1=Object.prototype.hasOwnProperty;var d1=function(e){if(!s1(e))return u1(e);var t=l1(e),n=[];for(var r in e)("constructor"!=r||!t&&c1.call(e,r))&&n.push(r);return n},f1=H0,h1=d1,p1=Q0;var v1=function(e){return p1(e)?f1(e,!0):h1(e)},g1=r0,m1=v1;var y1=function(e,t){return e&&g1(t,m1(t),e)},b1={},w1={get exports(){return b1},set exports(e){b1=e}};!function(e,t){var n=_K,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(w1,b1);var k1=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n4&&void 0!==arguments[4]?arguments[4]:.95,i=e*o/n,a=t*o/r,s=Math.min(1,Math.min(i,a));return s},I5=.95,R5=function(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}},N5=function(e){for(var t=e.width,n=e.height,r={width:t,height:n},o=t/n,i=t*n,a=448;i<262144;){if(a+=64,t===n){r.width=512,r.height=512;break}o>1?(r.width=a,r.height=pK(a/o,64)):o<1&&(r.height=a,r.width=pK(a*o,64)),i=r.width*r.height}return r},D5=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],z5=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],j5=function(e){return"line"===e.kind&&"mask"===e.layer},B5=function(e){return"image"===e.kind&&"base"===e.layer},F5=function(e){return"line"===e.kind},H5={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},V5=k$({name:"canvas",initialState:{boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:H5,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},reducers:{setTool:function(e,t){var n=t.payload;e.tool=t.payload,"move"!==n&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:function(e,t){e.layer=t.payload},toggleTool:function(e){var t=e.tool;"move"!==t&&(e.tool="brush"===t?"eraser":"brush")},setMaskColor:function(e,t){e.maskColor=t.payload},setBrushColor:function(e,t){e.brushColor=t.payload},setBrushSize:function(e,t){e.brushSize=t.payload},clearMask:function(e){e.pastLayerStates.push(A5(e.layerState)),e.layerState.objects=e.layerState.objects.filter((function(e){return!j5(e)})),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:function(e){e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:function(e){e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:function(e,t){e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:function(e,t){e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:function(e,t){e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:function(e,t){e.shouldShowBrushPreview=t.payload},setShouldShowBrush:function(e,t){e.shouldShowBrush=t.payload},setCursorPosition:function(e,t){e.cursorPosition=t.payload},setInitialCanvasImage:function(e,t){var n=t.payload,r=e.stageDimensions,o={width:hK(JK(n.width,64,512),64),height:hK(JK(n.height,64,512),64)},i={x:pK(n.width/2-o.width/2,64),y:pK(n.height/2-o.height/2,64)};if("auto"===e.boundingBoxScaleMethod){var a=N5(o);e.scaledBoundingBoxDimensions=a}e.boundingBoxDimensions=o,e.boundingBoxCoordinates=i,e.pastLayerStates.push(A5(e.layerState)),e.layerState=un(un({},H5),{},{objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]}),e.futureLayerStates=[],e.isCanvasInitialized=!1;var s=T5(r.width,r.height,n.width,n.height,I5),l=M5(r.width,r.height,0,0,n.width,n.height,s);e.stageScale=s,e.stageCoordinates=l,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:function(e,t){var n,r=(n=t.payload,{width:pK(n.width,64),height:pK(n.height,64)});if(e.boundingBoxDimensions=r,"auto"===e.boundingBoxScaleMethod){var o=N5(r);e.scaledBoundingBoxDimensions=o}},setBoundingBoxCoordinates:function(e,t){e.boundingBoxCoordinates=R5(t.payload)},setStageCoordinates:function(e,t){e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:function(e,t){e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:function(e,t){e.doesCanvasNeedScaling=t.payload},setStageScale:function(e,t){e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:function(e,t){e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:function(e,t){e.isDrawing=t.payload},clearCanvasHistory:function(e){e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:function(e,t){e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:function(e){e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:function(e,t){e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:function(e,t){e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:function(e,t){e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:function(e,t){e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:function(e,t){e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:function(e,t){e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:function(e,t){var n=t.payload,r=n.boundingBox,o=n.image;r&&o&&(e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push(un(un({kind:"image",layer:"base"},r),{},{image:o})),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:function(e){e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea=un({},H5.stagingArea),e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:function(e){var t=e.boundingBoxCoordinates,n=e.boundingBoxDimensions,r=e.brushColor;e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push(un(un(un({kind:"fillRect",layer:"base"},t),n),{},{color:r})),e.futureLayerStates=[]},addEraseRect:function(e){var t=e.boundingBoxCoordinates,n=e.boundingBoxDimensions;e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push(un(un({kind:"eraseRect",layer:"base"},t),n)),e.futureLayerStates=[]},addLine:function(e,t){var n=e.tool,r=e.layer,o=e.brushColor,i=e.brushSize,a=e.shouldRestrictStrokesToBox;if("move"!==n&&"colorPicker"!==n){var s=i/2,l="base"===r&&"brush"===n?{color:o}:{};e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();var u=un({kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload},l);a&&(u.clip=un(un({},e.boundingBoxCoordinates),e.boundingBoxDimensions)),e.layerState.objects.push(u),e.futureLayerStates=[]}},addPointToCurrentLine:function(e,t){var n,r=e.layerState.objects.findLast(F5);r&&(n=r.points).push.apply(n,cn(t.payload))},undo:function(e){var t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(A5(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:function(e){var t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:function(e,t){e.shouldShowGrid=t.payload},setIsMovingStage:function(e,t){e.isMovingStage=t.payload},setShouldSnapToGrid:function(e,t){e.shouldSnapToGrid=t.payload},setShouldAutoSave:function(e,t){e.shouldAutoSave=t.payload},setShouldShowIntermediates:function(e,t){e.shouldShowIntermediates=t.payload},resetCanvas:function(e){e.pastLayerStates.push(A5(e.layerState)),e.layerState=H5,e.futureLayerStates=[]},setCanvasContainerDimensions:function(e,t){e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:function(e){var t=e.canvasContainerDimensions,n=t.width,r=t.height,o=e.layerState.objects.find(B5),i={width:Math.floor(n),height:Math.floor(r)};if(o){var a=o.width,s=o.height,l=T5(n,r,a,s,.95),u=M5(i.width,i.height,0,0,a,s,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=R5(u),e.stageDimensions=i,e.isCanvasInitialized=!0}else{var c=T5(i.width,i.height,512,512,I5),d=M5(i.width,i.height,0,0,512,512,c),f={width:512,height:512};if(e.stageScale=c,e.stageCoordinates=d,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=f,"auto"===e.boundingBoxScaleMethod){var h=N5(f);e.scaledBoundingBoxDimensions=h}}},resizeCanvas:function(e){var t=e.canvasContainerDimensions,n=t.width,r=t.height,o={width:Math.floor(n),height:Math.floor(r)};if(e.stageDimensions=o,!e.layerState.objects.find(B5)){var i=T5(o.width,o.height,512,512,I5),a=M5(o.width,o.height,0,0,512,512,i),s={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=a,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=s,"auto"===e.boundingBoxScaleMethod){var l=N5(s);e.scaledBoundingBoxDimensions=l}}},resetCanvasView:function(e,t){var n=t.payload,r=n.contentRect,o=n.shouldScaleTo1,i=e.stageDimensions,a=i.width,s=i.height,l=r.x,u=r.y,c=r.width,d=r.height;if(0!==c&&0!==d){var f=o?1:T5(a,s,c,d,I5),h=M5(a,s,l,u,c,d,f);e.stageScale=f,e.stageCoordinates=h}else{var p=T5(a,s,512,512,I5),v=M5(a,s,0,0,512,512,p),g={width:512,height:512};if(e.stageScale=p,e.stageCoordinates=v,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=g,"auto"===e.boundingBoxScaleMethod){var m=N5(g);e.scaledBoundingBoxDimensions=m}}},nextStagingAreaImage:function(e){var t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:function(e){var t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:function(e){var t=e.layerState.stagingArea,n=t.images,r=t.selectedImageIndex;e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push(un({},n[r])),e.layerState.stagingArea=un({},H5.stagingArea),e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:function(e){var t=e.boundingBoxDimensions,n=e.boundingBoxCoordinates,r=e.stageDimensions,o=e.stageScale,i=r.width/o,a=r.height/o;if(n.x<0||n.x+t.width>i||n.y<0||n.y+t.height>a){var s={width:hK(JK(i,64,512),64),height:hK(JK(a,64,512),64)},l={x:pK(i/2-s.width/2,64),y:pK(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,"auto"===e.boundingBoxScaleMethod){var u=N5(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:function(e,t){if(e.boundingBoxScaleMethod=t.payload,"auto"===t.payload){var n=N5(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:function(e,t){e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:function(e,t){e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:function(e,t){e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:function(e,t){e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:function(e,t){e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:function(e,t){e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:function(e,t){e.colorPickerColor=t.payload},commitColorPickerColor:function(e){e.brushColor=un(un({},e.colorPickerColor),{},{a:e.brushColor.a}),e.tool="brush"},setMergedCanvas:function(e,t){e.pastLayerStates.push(A5(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:function(e){e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:function(e){e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),W5=V5.actions,U5=W5.addEraseRect,G5=W5.addFillRect,q5=W5.addImageToStagingArea,Y5=W5.addLine,Z5=W5.addPointToCurrentLine,X5=W5.clearCanvasHistory,$5=W5.clearMask,K5=W5.commitColorPickerColor,Q5=W5.commitStagingAreaImage,J5=W5.discardStagedImages,e3=(W5.fitBoundingBoxToStage,W5.mouseLeftCanvas),t3=W5.nextStagingAreaImage,n3=W5.prevStagingAreaImage,r3=W5.redo,o3=W5.resetCanvas,i3=W5.resetCanvasInteractionState,a3=W5.resetCanvasView,s3=W5.resizeAndScaleCanvas,l3=W5.resizeCanvas,u3=W5.setBoundingBoxCoordinates,c3=W5.setBoundingBoxDimensions,d3=(W5.setBoundingBoxPreviewFill,W5.setBoundingBoxScaleMethod),f3=W5.setBrushColor,h3=W5.setBrushSize,p3=W5.setCanvasContainerDimensions,v3=W5.setColorPickerColor,g3=W5.setCursorPosition,m3=W5.setDoesCanvasNeedScaling,y3=W5.setInitialCanvasImage,b3=W5.setIsDrawing,w3=W5.setIsMaskEnabled,k3=W5.setIsMouseOverBoundingBox,x3=(W5.setIsMoveBoundingBoxKeyHeld,W5.setIsMoveStageKeyHeld,W5.setIsMovingBoundingBox),S3=W5.setIsMovingStage,C3=W5.setIsTransformingBoundingBox,_3=W5.setLayer,E3=W5.setMaskColor,P3=W5.setMergedCanvas,L3=W5.setShouldAutoSave,O3=W5.setShouldCropToBoundingBoxOnSave,A3=W5.setShouldDarkenOutsideBoundingBox,M3=(W5.setShouldLockBoundingBox,W5.setShouldPreserveMaskedArea),T3=W5.setShouldShowBoundingBox,I3=(W5.setShouldShowBrush,W5.setShouldShowBrushPreview,W5.setShouldShowCanvasDebugInfo),R3=(W5.setShouldShowCheckboardTransparency,W5.setShouldShowGrid),N3=W5.setShouldShowIntermediates,D3=W5.setShouldShowStagingImage,z3=W5.setShouldShowStagingOutline,j3=W5.setShouldSnapToGrid,B3=W5.setStageCoordinates,F3=W5.setStageScale,H3=W5.setTool,V3=(W5.toggleShouldLockBoundingBox,W5.toggleTool,W5.undo),W3=W5.setScaledBoundingBoxDimensions,U3=W5.setShouldRestrictStrokesToBox,G3=V5.reducer,q3=k$({name:"gallery",initialState:{currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},reducers:{setCurrentImage:function(e,t){e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:function(e,t){var n=t.payload,r=n.uuid,o=n.category,i=e.categories[o].images,a=i.filter((function(e){return e.uuid!==r}));if(r===e.currentImageUuid){var s=i.findIndex((function(e){return e.uuid===r})),l=JK(s,0,a.length-1);e.currentImage=a.length?a[l]:void 0,e.currentImageUuid=a.length?a[l].uuid:""}e.categories[o].images=a},addImage:function(e,t){var n=t.payload,r=n.image,o=n.category,i=r.uuid,a=r.url,s=r.mtime,l=e.categories[o];l.images.find((function(e){return e.url===a&&e.mtime===s}))||(l.images.unshift(r),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=r,e.currentCategory=o),e.intermediateImage=void 0,l.latest_mtime=s)},setIntermediateImage:function(e,t){e.intermediateImage=t.payload},clearIntermediateImage:function(e){e.intermediateImage=void 0},selectNextImage:function(e){var t=e.currentImage;if(t){var n=e.categories[t.category].images;if(t){var r=n.findIndex((function(e){return e.uuid===t.uuid}));if(r0){var o=n[r-1];e.currentImage=o,e.currentImageUuid=o.uuid}}}},addGalleryImages:function(e,t){var n=t.payload,r=n.images,o=n.areMoreImagesAvailable,i=n.category,a=e.categories[i].images;if(r.length>0){var s=r.filter((function(e){return!a.find((function(t){return t.url===e.url&&t.mtime===e.mtime}))}));if(e.categories[i].images=a.concat(s).sort((function(e,t){return t.mtime-e.mtime})),!e.currentImage){var l=r[0];e.currentImage=l,e.currentImageUuid=l.uuid}e.categories[i].latest_mtime=r[0].mtime,e.categories[i].earliest_mtime=r[r.length-1].mtime}void 0!==o&&(e.categories[i].areMoreImagesAvailable=o)},setShouldPinGallery:function(e,t){e.shouldPinGallery=t.payload},setShouldShowGallery:function(e,t){e.shouldShowGallery=t.payload},setGalleryScrollPosition:function(e,t){e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:function(e,t){e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:function(e,t){e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:function(e,t){e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:function(e,t){e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:function(e,t){e.currentCategory=t.payload},setGalleryWidth:function(e,t){e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:function(e,t){e.shouldUseSingleGalleryColumn=t.payload}}}),Y3=q3.actions,Z3=Y3.addImage,X3=Y3.clearIntermediateImage,$3=Y3.removeImage,K3=Y3.setCurrentImage,Q3=Y3.addGalleryImages,J3=Y3.setIntermediateImage,e4=Y3.selectNextImage,t4=Y3.selectPrevImage,n4=Y3.setShouldPinGallery,r4=Y3.setShouldShowGallery,o4=Y3.setGalleryScrollPosition,i4=Y3.setGalleryImageMinimumWidth,a4=Y3.setGalleryImageObjectFit,s4=Y3.setShouldHoldGalleryOpen,l4=Y3.setShouldAutoSwitchToNewImages,u4=Y3.setCurrentCategory,c4=Y3.setGalleryWidth,d4=Y3.setShouldUseSingleGalleryColumn,f4=q3.reducer,h4=k$({name:"lightbox",initialState:{isLightboxOpen:!1},reducers:{setIsLightboxOpen:function(e,t){e.isLightboxOpen=t.payload}}}),p4=h4.actions.setIsLightboxOpen,v4=h4.reducer,g4=function(e){return 1===e.length?e[0].prompt:e.map((function(e){return"".concat(e.prompt,":").concat(e.weight)})).join(" ")};function m4(e){var t=g4(e),n=null,r=new RegExp(/(?<=\[)[^\][]*(?=])/,"gi"),o=cn(t.matchAll(r));return o&&o.length>0&&(n=o.join(", "),t=t.replaceAll(r,"").replaceAll("[]","").trim()),[t,n]}var y4=function(e){var t=e.split(",").map((function(e){return e.split(":")})),n=t.map((function(e){return{seed:Number(e[0]),weight:Number(e[1])}}));return!!b4(n)&&n},b4=function(e){return"string"==typeof e?Boolean(y4(e)):Boolean(e.length&&!e.some((function(e){var t=e.seed,n=e.weight,r=!isNaN(parseInt(t.toString(),10)),o=!isNaN(parseInt(n.toString(),10))&&n>=0&&n<=1;return!(r&&o)})))},w4=function(e){return e.reduce((function(e,t,n,r){var o=t.seed,i=t.weight;return e+="".concat(o,":").concat(i),n!==r.length-1&&(e+=","),e}),"")},k4={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},x4=k$({name:"generation",initialState:k4,reducers:{setPrompt:function(e,t){var n=t.payload;e.prompt="string"==typeof n?n:g4(n)},setNegativePrompt:function(e,t){var n=t.payload;e.negativePrompt="string"==typeof n?n:g4(n)},setIterations:function(e,t){e.iterations=t.payload},setSteps:function(e,t){e.steps=t.payload},setCfgScale:function(e,t){e.cfgScale=t.payload},setThreshold:function(e,t){e.threshold=t.payload},setPerlin:function(e,t){e.perlin=t.payload},setHeight:function(e,t){e.height=t.payload},setWidth:function(e,t){e.width=t.payload},setSampler:function(e,t){e.sampler=t.payload},setSeed:function(e,t){e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:function(e,t){e.img2imgStrength=t.payload},setMaskPath:function(e,t){e.maskPath=t.payload},setSeamless:function(e,t){e.seamless=t.payload},setShouldFitToWidthHeight:function(e,t){e.shouldFitToWidthHeight=t.payload},resetSeed:function(e){e.seed=-1},setParameter:function(e,t){var n=t.payload,r=n.key,o=n.value,i=un(un({},e),{},gn({},r,o));return"seed"===r&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:function(e,t){e.shouldGenerateVariations=t.payload},setVariationAmount:function(e,t){e.variationAmount=t.payload},setSeedWeights:function(e,t){e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:function(e,t){var n=t.payload.image,r=n.sampler,o=n.prompt,i=n.seed,a=n.variations,s=n.steps,l=n.cfg_scale,u=n.threshold,c=n.perlin,d=n.seamless,f=(n.hires_fix,n.width),h=n.height;a&&a.length>0?(e.seedWeights=w4(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),o&&(e.prompt=g4(o)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),e.threshold=void 0===u?0:u,c&&(e.perlin=c),void 0===c&&(e.perlin=0),"boolean"==typeof d&&(e.seamless=d),f&&(e.width=f),h&&(e.height=h)},setAllImageToImageParameters:function(e,t){var n=t.payload.image,r=n.type,o=n.strength,i=n.fit,a=n.init_image_path,s=n.mask_image_path;"img2img"===r&&(a&&(e.initialImage=a),s&&(e.maskPath=s),o&&(e.img2imgStrength=o),"boolean"==typeof i&&(e.shouldFitToWidthHeight=i))},setAllParameters:function(e,t){var n=t.payload.image,r=n.type,o=n.sampler,i=n.prompt,a=n.seed,s=n.variations,l=n.steps,u=n.cfg_scale,c=n.threshold,d=n.perlin,f=n.seamless,h=(n.hires_fix,n.width),p=n.height,v=n.strength,g=n.fit,m=n.init_image_path,y=n.mask_image_path;if("img2img"===r&&(m&&(e.initialImage=m),y&&(e.maskPath=y),v&&(e.img2imgStrength=v),"boolean"==typeof g&&(e.shouldFitToWidthHeight=g)),s&&s.length>0?(e.seedWeights=w4(s),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,a&&(e.seed=a,e.shouldRandomizeSeed=!1),i){var b=yn(m4(i),2),w=b[0],k=b[1];w&&(e.prompt=w),e.negativePrompt=k||""}o&&(e.sampler=o),l&&(e.steps=l),u&&(e.cfgScale=u),c&&(e.threshold=c),void 0===c&&(e.threshold=0),d&&(e.perlin=d),void 0===d&&(e.perlin=0),"boolean"==typeof f&&(e.seamless=f),h&&(e.width=h),p&&(e.height=p)},resetParametersState:function(e){return un(un({},e),k4)},setShouldRandomizeSeed:function(e,t){e.shouldRandomizeSeed=t.payload},setInitialImage:function(e,t){e.initialImage=t.payload},clearInitialImage:function(e){e.initialImage=void 0},setSeamSize:function(e,t){e.seamSize=t.payload},setSeamBlur:function(e,t){e.seamBlur=t.payload},setSeamStrength:function(e,t){e.seamStrength=t.payload},setSeamSteps:function(e,t){e.seamSteps=t.payload},setTileSize:function(e,t){e.tileSize=t.payload},setInfillMethod:function(e,t){e.infillMethod=t.payload}}}),S4=x4.actions,C4=S4.clearInitialImage,_4=(S4.resetParametersState,S4.resetSeed,S4.setAllImageToImageParameters),E4=S4.setAllParameters,P4=(S4.setAllTextToImageParameters,S4.setCfgScale),L4=S4.setHeight,O4=S4.setImg2imgStrength,A4=S4.setInfillMethod,M4=S4.setInitialImage,T4=S4.setIterations,I4=S4.setMaskPath,R4=(S4.setParameter,S4.setPerlin),N4=S4.setPrompt,D4=S4.setNegativePrompt,z4=S4.setSampler,j4=S4.setSeamBlur,B4=S4.setSeamless,F4=S4.setSeamSize,H4=S4.setSeamSteps,V4=S4.setSeamStrength,W4=S4.setSeed,U4=S4.setSeedWeights,G4=S4.setShouldFitToWidthHeight,q4=S4.setShouldGenerateVariations,Y4=S4.setShouldRandomizeSeed,Z4=S4.setSteps,X4=S4.setThreshold,$4=S4.setTileSize,K4=S4.setVariationAmount,Q4=S4.setWidth,J4=x4.reducer,e6={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingStrength:.75},t6=k$({name:"postprocessing",initialState:e6,reducers:{setFacetoolStrength:function(e,t){e.facetoolStrength=t.payload},setCodeformerFidelity:function(e,t){e.codeformerFidelity=t.payload},setUpscalingLevel:function(e,t){e.upscalingLevel=t.payload},setUpscalingStrength:function(e,t){e.upscalingStrength=t.payload},setHiresFix:function(e,t){e.hiresFix=t.payload},setHiresStrength:function(e,t){e.hiresStrength=t.payload},resetPostprocessingState:function(e){return un(un({},e),e6)},setShouldRunFacetool:function(e,t){e.shouldRunFacetool=t.payload},setFacetoolType:function(e,t){e.facetoolType=t.payload},setShouldRunESRGAN:function(e,t){e.shouldRunESRGAN=t.payload},setShouldLoopback:function(e,t){e.shouldLoopback=t.payload}}}),n6=t6.actions,r6=(n6.resetPostprocessingState,n6.setCodeformerFidelity),o6=n6.setFacetoolStrength,i6=n6.setFacetoolType,a6=n6.setHiresFix,s6=n6.setHiresStrength,l6=n6.setShouldLoopback,u6=n6.setShouldRunESRGAN,c6=n6.setShouldRunFacetool,d6=n6.setUpscalingLevel,f6=n6.setUpscalingStrength,h6=t6.reducer;function p6(e){return p6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p6(e)}function v6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g6(e){var t=function(e,t){if("object"!==p6(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==p6(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===p6(t)?t:String(t)}function m6(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};v6(this,e),this.init(t,n)}return y6(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||O6,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function z6(e,t,n){var r=D6(e,t,Object);r.obj[r.k]=n}function j6(e,t){var n=D6(e,t),r=n.obj,o=n.k;if(r)return r[o]}function B6(e,t,n){var r=j6(e,n);return void 0!==r?r:j6(t,n)}function F6(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):F6(e[r],t[r],n):e[r]=t[r]);return e}function H6(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var V6={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function W6(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return V6[e]})):e}var U6="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,G6=[" ",",","?","!",";"];function q6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y6(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;ii+a;)a++,l=o[s=r.slice(i,i+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var u=r.slice(i+a).join(n);return u?X6(l,u,n):void 0}o=o[r[i]]}return o}}var $6=function(e){k6(n,e);var t=Z6(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return v6(this,n),r=t.call(this),U6&&T6.call(b6(r)),r.data=e||{},r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return y6(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=j6(this.data,a);return s||!i||"string"!=typeof n?s:X6(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),z6(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=j6(this.data,a)||{};r?F6(s,n,o):s=Y6(Y6({},s),n),z6(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Y6(Y6({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(T6),K6={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}};function Q6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J6(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return v6(this,n),r=t.call(this),U6&&T6.call(b6(r)),N6(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,b6(r)),r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=M6.create("translator"),r}return y6(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=G6.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),e=l.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t,r){var o=this;if("object"!==p6(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,u=s.namespaces,c=u[u.length-1],d=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(f){var h=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(c).concat(h).concat(l),p):"".concat(c).concat(h).concat(l)}return i?(p.res=l,p):l}var p=this.resolve(e,t),v=p&&p.res,g=p&&p.usedKey||l,m=p&&p.exactUsedKey||l,y=Object.prototype.toString.apply(v),b=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,x="string"!=typeof v&&"boolean"!=typeof v&&"number"!=typeof v;if(k&&v&&x&&b.indexOf(y)<0&&("string"!=typeof w||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,v,J6(J6({},t),{},{ns:u})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=S,p):S}if(a){var C="[object Array]"===y,_=C?[]:{},E=C?m:g;for(var P in v)if(Object.prototype.hasOwnProperty.call(v,P)){var L="".concat(E).concat(a).concat(P);_[P]=this.translate(L,J6(J6({},t),{joinArrays:!1,ns:u})),_[P]===L&&(_[P]=v[P])}v=_}}else if(k&&"string"==typeof w&&"[object Array]"===y)(v=v.join(w))&&(v=this.extendTranslation(v,e,t,r));else{var O=!1,A=!1,M=void 0!==t.count&&"string"!=typeof t.count,T=n.hasDefaultValue(t),I=M?this.pluralResolver.getSuffix(d,t.count,t):"",R=t["defaultValue".concat(I)]||t.defaultValue;!this.isValidLookup(v)&&T&&(O=!0,v=R),this.isValidLookup(v)||(A=!0,v=l);var N=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=N&&A?void 0:v,z=T&&R!==v&&this.options.updateMissing;if(A||O||z){if(this.logger.log(z?"updateKey":"missingKey",d,c,l,z?R:v),a){var j=this.resolve(l,J6(J6({},t),{},{keySeparator:!1}));j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var B=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var H=0;H1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),u=l.key;n=u;var c=l.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,f=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),h=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);c.forEach((function(e){a.isValidLookup(t)||(i=e,!t7["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(t7["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,l=[u];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,u,n,e,s);else{var c;d&&(c=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(u+c),f&&l.push(u+p)),h){var v="".concat(u).concat(a.options.contextSeparator).concat(s.context);l.push(v),d&&(l.push(v+c),f&&l.push(v+p))}}for(;i=l.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(T6);function r7(e){return e.charAt(0).toUpperCase()+e.slice(1)}var o7=function(){function e(t){v6(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=M6.create("languageUtils")}return y6(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=r7(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=r7(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=r7(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),i7=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],a7={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},s7=["v1","v2","v3"],l7={zero:0,one:1,two:2,few:3,many:4,other:5};function u7(){var e={};return i7.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:a7[t.fc]}}))})),e}var c7=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};v6(this,e),this.languageUtils=t,this.options=n,this.logger=M6.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=u7()}return y6(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return l7[e]-l7[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!s7.includes(this.options.compatibilityJSON)}}]),e}();function d7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f7(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};v6(this,e),this.logger=M6.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return y6(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:W6,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?H6(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?H6(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?H6(t.nestingPrefix):t.nestingPrefixEscaped||H6("$t("),this.nestingSuffix=t.nestingSuffix?H6(t.nestingSuffix):t.nestingSuffixEscaped||H6(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSeparator)<0){var o=B6(t,l,e);return s.alwaysFormat?s.format(o,void 0,n,f7(f7(f7({},r),t),{},{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),u=i.join(s.formatSeparator).trim();return s.format(B6(t,l,a),u,n,f7(f7(f7({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?u(s.escape(e)):u(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=c(n)))if("function"==typeof d){var l=d(e,o,r);i="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))i="";else{if(f){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=R6(i));var u=t.safeValue(i);if(e=e.replace(o[0],u),f?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o=f7(f7({},t),o))}catch(Dhe){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),Dhe),"".concat(e).concat(n).concat(i)}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var l=[];(o=f7({},a)).applyPostProcessor=!1,delete o.defaultValue;var u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var c=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=c.shift(),l=c,u=!0}if((r=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=R6(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),u&&(r=l.reduce((function(e,t){return i.format(e,t,a.lng,f7(f7({},a),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function p7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v7(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};v6(this,e),this.logger=M6.create("formatter"),this.options=t,this.formats={number:g7((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:g7((function(e,t){var n=new Intl.NumberFormat(e,v7(v7({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:g7((function(e,t){var n=new Intl.DateTimeFormat(e,v7({},t));return function(e){return n.format(e)}})),relativetime:g7((function(e,t){var n=new Intl.RelativeTimeFormat(e,v7({},t));return function(e){return n.format(e,t.range||"day")}})),list:g7((function(e,t){var n=new Intl.ListFormat(e,v7({},t));return function(e){return n.format(e)}}))},this.init(t)}return y6(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=g7(t)}},{key:"format",value:function(e,t,n,r){var o=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=E6(e.split(":")),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(o.formats[a]){var l=e;try{var u=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},c=u.locale||u.lng||r.locale||r.lng||n;l=o.formats[a](e,c,v7(v7(v7({},s),r),u))}catch(d){o.logger.warn(d)}return l}return o.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function y7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b7(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return v6(this,n),i=t.call(this),U6&&T6.call(b6(i)),i.backend=e,i.store=r,i.services=o,i.languageUtils=o.languageUtils,i.options=a,i.logger=M6.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,a.backend,a),i}return y6(n,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var o=D6(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}(n.loaded,[o],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a});else{this.readingCalls++;var s=function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var u=r.waitingReads.shift();r.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}s&&l&&o2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=b7(b7({},i),{},{isUpdate:o}),l=this.backend.create.bind(this.backend);if(l.length<6)try{var u;(u=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof u.then?u.then((function(e){return a(null,e)})).catch(a):a(null,u)}catch(COe){a(COe)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}]),n}(T6);function x7(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===p6(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===p6(e[2])||"object"===p6(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function S7(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function C7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _7(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(v6(this,n),e=t.call(this),U6&&T6.call(b6(e)),e.options=S7(r),e.services={},e.logger=M6,e.modules={external:[]},L7(b6(e)),o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,o),x6(e,b6(e));setTimeout((function(){e.init(r,o)}),0)}return e}return y6(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=x7();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=_7(_7(_7({},r),this.options),S7(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=_7(_7({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?M6.init(o(this.modules.logger),this.options):M6.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=m7);var a=new o7(this.options);this.store=new $6(this.options.resources,this.options);var s=this.services;s.logger=M6,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new c7(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new h7(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new k7(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=I6(),f=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P7,r=n,o="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var i=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(o)a(o);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=I6();return e||(e=this.languages),t||(t=this.options.ns),n||(n=P7),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&K6.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=I6();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==p6(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=I6();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=I6();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new o7(x7());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P7,o=_7(_7(_7({},this.options),t),{isClone:!0}),i=new n(o);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.services=_7({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new n7(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new O7(e,t)}));var A7=O7.createInstance();function M7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T7(e){return T7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T7(e)}function I7(e){var t=function(e,t){if("object"!==T7(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==T7(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===T7(t)?t:String(t)}function R7(e,t){for(var n=0;n0){var a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(a))}if(r.domain){if(!B7.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain=".concat(r.domain)}if(r.path){if(!B7.test(r.path))throw new TypeError("option path is invalid");i+="; Path=".concat(r.path)}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");i+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},H7=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=F7(e,encodeURIComponent(t),o)},V7=function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1).split("&"),o=0;o0)r[o].substring(0,i)===e.lookupQuerystring&&(t=r[o].substring(i+1))}}return t}},G7=null,q7=function(){if(null!==G7)return G7;try{G7="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(Dhe){G7=!1}return G7},Y7={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&q7()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&q7()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},Z7=null,X7=function(){if(null!==Z7)return Z7;try{Z7="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(Dhe){Z7=!1}return Z7},$7={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&X7()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&X7()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},K7={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n0?t:void 0}},Q7={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},J7={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},e9={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,n="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};var t9=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M7(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=j7(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(W7),this.addDetector(U7),this.addDetector(Y7),this.addDetector($7),this.addDetector(K7),this.addDetector(Q7),this.addDetector(J7),this.addDetector(e9)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}],n&&R7(t.prototype,n),r&&R7(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function n9(e){return n9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n9(e)}t9.type="languageDetector";var r9=[],o9=r9.forEach,i9=r9.slice;function a9(e){return o9.call(i9.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}function s9(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":n9(XMLHttpRequest))}function l9(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var u9,c9={},d9={get exports(){return c9},set exports(e){c9=e}},f9={},h9={get exports(){return f9},set exports(e){f9=e}};function p9(){return u9||(u9=1,function(e,t){var n="undefined"!=typeof self?self:ir,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(Dhe){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&function(e){return e&&DataView.prototype.isPrototypeOf(e)}(e)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=p(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function k(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},k.error=function(){var e=new k(null,{status:0,statusText:""});return e.type="error",e};var x=[301,302,303,307,308];k.redirect=function(e,t){if(-1===x.indexOf(t))throw new RangeError("Invalid status code");return new k(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(COe){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(r,i){var a=new b(e,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new k(o,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=f,e.Request=b,e.Response=k),t.Headers=f,t.Request=b,t.Response=k,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t}(h9,f9)),f9}!function(e,t){var n;if("function"==typeof fetch&&(n=void 0!==ir&&ir.fetch?ir.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),void 0!==l9&&("undefined"==typeof window||void 0===window.document)){var r=n||p9();r.default&&(r=r.default),t.default=r,e.exports=t.default}}(d9,c9);var v9,g9,m9,y9=c9,b9=or({__proto__:null,default:y9},[c9]);function w9(e){return w9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w9(e)}"function"==typeof fetch&&(v9="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),s9()&&("undefined"!=typeof global&&global.XMLHttpRequest?g9=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(g9=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?m9=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(m9=window.ActiveXObject)),v9||!b9||g9||m9||(v9=y9||b9),"function"!=typeof v9&&(v9=void 0);var k9=function(e,t){if(t&&"object"===w9(t)){var n="";for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},x9=function(e,t,n){v9(e,t).then((function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)})).catch(n)},S9=!1,C9=function(e,t,n,r){return"function"==typeof n&&(r=n,n=void 0),r=r||function(){},v9&&0!==t.indexOf("file:")?function(e,t,n,r){e.queryStringParams&&(t=k9(t,e.queryStringParams));var o=a9({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(o["Content-Type"]="application/json");var i="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=a9({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},S9?{}:i);try{x9(t,a,r)}catch(Dhe){if(!i||0===Object.keys(i).length||!Dhe.message||Dhe.message.indexOf("not implemented")<0)return r(Dhe);try{Object.keys(i).forEach((function(e){delete a[e]})),x9(t,a,r),S9=!0}catch(COe){r(COe)}}}(e,t,n,r):s9()||"function"==typeof ActiveXObject?function(e,t,n,r){n&&"object"===w9(n)&&(n=k9("",n).slice(1)),e.queryStringParams&&(t=k9(t,e.queryStringParams));try{var o;(o=g9?new g9:new m9("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var i=e.customHeaders;if(i="function"==typeof i?i():i)for(var a in i)o.setRequestHeader(a,i[a]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(Dhe){console&&console.log(Dhe)}}(e,t,n,r):void r(new Error("No fetch and no xhr implementation found!"))};function _9(e){return _9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_9(e)}function E9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P9(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};E9(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=a9(n,this.options||{},O9()),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,r,o){var i,a=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(i=s)?i:Promise.resolve(i)).then((function(i){if(!i)return o(null,{});var s=a.services.interpolator.interpolate(i,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(s,o,t,r)}))}},{key:"loadUrl",value:function(e,t,n,r){var o=this;this.options.request(this.options,e,void 0,(function(i,a){if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&i&&i.message&&i.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+i.message,!0);if(i)return t(i,!1);var s,l;try{s="string"==typeof a.data?o.options.parse(a.data,n,r):a.data}catch(Dhe){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,r,o){var i=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,r),s=0,l=[],u=[];e.forEach((function(n){var r=i.options.addPath;"function"==typeof i.options.addPath&&(r=i.options.addPath(n,t));var c=i.services.interpolator.interpolate(r,{lng:n,ns:t});i.options.request(i.options,c,a,(function(t,n){s+=1,l.push(t),u.push(n),s===e.length&&o&&o(l,u)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,r=t.languageUtils,o=t.logger,i=n.language;if(!i||"cimode"!==i.toLowerCase()){var a=[],s=function(e){r.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};s(i),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),a.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(r,i){r&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),r),!r&&i&&o.log("loaded namespace ".concat(e," for language ").concat(t),i),n.loaded("".concat(t,"|").concat(e),r,i)}))}))}))}}}],n&&P9(t.prototype,n),r&&P9(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function M9(e){return M9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M9(e)}function T9(e){var t=function(e,t){if("object"!==M9(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M9(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===M9(t)?t:String(t)}function I9(e,t,n){return(t=T9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R9(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e))))}function B9(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return D9("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):j9(e,t,n)}var F9=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,H9={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},V9=function(e){return H9[e]};function W9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U9(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};q9=U9(U9({},q9),e)}(e.options.react),function(e){G9=e}(e)}},K9=cr.createContext(),Q9=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.usedNamespaces={}}var t,n,r;return t=e,(n=[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])&&X9(t.prototype,n),r&&X9(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function J9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=cr.useContext(K9)||{},o=r.i18n,i=r.defaultNS,a=n||o||Z9();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Q9),!a){D9("You will need to pass in an i18next instance by using initReactI18next");var s=function(e){return Array.isArray(e)?e[e.length-1]:e},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&void 0!==a.options.react.wait&&D9("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=n8(n8(n8({},Y9()),a.options.react),t),c=u.useSuspense,d=u.keyPrefix,f=e||i||a.options&&a.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(f);var h=(a.isInitialized||a.initializedStoreOnce)&&f.every((function(e){return B9(e,a,u)}));function p(){return a.getFixedT(null,"fallback"===u.nsMode?f:f[0],d)}var v=cr.useState(p),g=e8(v,2),m=g[0],y=g[1],b=f.join(),w=r8(b),k=cr.useRef(!0);cr.useEffect((function(){var e=u.bindI18n,t=u.bindI18nStore;function n(){k.current&&y(p)}return k.current=!0,h||c||z9(a,f,(function(){k.current&&y(p)})),h&&w&&w!==b&&k.current&&y(p),e&&a&&a.on(e,n),t&&a&&a.store.on(t,n),function(){k.current=!1,e&&a&&e.split(" ").forEach((function(e){return a.off(e,n)})),t&&a&&t.split(" ").forEach((function(e){return a.store.off(e,n)}))}}),[a,b]);var x=cr.useRef(!0);cr.useEffect((function(){k.current&&!x.current&&y(p),x.current=!1}),[a,d]);var S=[m,a,h];if(S.t=m,S.i18n=a,S.ready=h,h)return S;if(!h&&!c)return S;throw new Promise((function(e){z9(a,f,(function(){e()}))}))}A7.use(A9).use(t9).use($9).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});var i8=k$({name:"system",initialState:{isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:A7.isInitialized?A7.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},reducers:{setShouldDisplayInProgressType:function(e,t){e.shouldDisplayInProgressType=t.payload},setIsProcessing:function(e,t){e.isProcessing=t.payload},setCurrentStatus:function(e,t){e.currentStatus=t.payload},setSystemStatus:function(e,t){return un(un({},e),t.payload)},errorOccurred:function(e){e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=A7.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:function(e){e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?A7.t("common:statusConnected"):A7.t("common:statusDisconnected")},addLogEntry:function(e,t){var n=t.payload,r={timestamp:n.timestamp,message:n.message,level:n.level||"info"};e.log.push(r)},setShouldShowLogViewer:function(e,t){e.shouldShowLogViewer=t.payload},setIsConnected:function(e,t){e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:function(e,t){e.socketId=t.payload},setShouldConfirmOnDelete:function(e,t){e.shouldConfirmOnDelete=t.payload},setOpenAccordions:function(e,t){e.openAccordions=t.payload},setSystemConfig:function(e,t){return un(un({},e),t.payload)},setShouldDisplayGuides:function(e,t){e.shouldDisplayGuides=t.payload},processingCanceled:function(e){e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=A7.t("common:statusProcessingCanceled")},generationRequested:function(e){e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=A7.t("common:statusPreparing")},setModelList:function(e,t){e.model_list=t.payload},setIsCancelable:function(e,t){e.isCancelable=t.payload},modelChangeRequested:function(e){e.currentStatus=A7.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:function(e,t){e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:function(e,t){e.enableImageDebugging=t.payload},addToast:function(e,t){e.toastQueue.push(t.payload)},clearToastQueue:function(e){e.toastQueue=[]},setProcessingIndeterminateTask:function(e,t){e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:function(e,t){e.searchFolder=t.payload},setFoundModels:function(e,t){e.foundModels=t.payload},setOpenModel:function(e,t){e.openModel=t.payload}}}),a8=i8.actions,s8=a8.setShouldDisplayInProgressType,l8=a8.setIsProcessing,u8=a8.addLogEntry,c8=a8.setShouldShowLogViewer,d8=a8.setIsConnected,f8=(a8.setSocketId,a8.setShouldConfirmOnDelete),h8=a8.setOpenAccordions,p8=a8.setSystemStatus,v8=a8.setCurrentStatus,g8=a8.setSystemConfig,m8=a8.setShouldDisplayGuides,y8=a8.processingCanceled,b8=a8.errorOccurred,w8=a8.errorSeen,k8=a8.setModelList,x8=a8.setIsCancelable,S8=a8.modelChangeRequested,C8=a8.setSaveIntermediatesInterval,_8=a8.setEnableImageDebugging,E8=a8.generationRequested,P8=a8.addToast,L8=a8.clearToastQueue,O8=a8.setProcessingIndeterminateTask,A8=a8.setSearchFolder,M8=a8.setFoundModels,T8=a8.setOpenModel,I8=i8.reducer,R8=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],N8=k$({name:"ui",initialState:{activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},reducers:{setActiveTab:function(e,t){"number"==typeof t.payload?e.activeTab=t.payload:e.activeTab=R8.indexOf(t.payload)},setCurrentTheme:function(e,t){e.currentTheme=t.payload},setParametersPanelScrollPosition:function(e,t){e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:function(e,t){e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:function(e,t){e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:function(e,t){e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:function(e,t){e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:function(e,t){e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:function(e,t){e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:function(e,t){e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:function(e,t){e.addNewModelUIOption=t.payload}}}),D8=N8.actions,z8=D8.setActiveTab,j8=D8.setCurrentTheme,B8=D8.setParametersPanelScrollPosition,F8=D8.setShouldHoldParametersPanelOpen,H8=D8.setShouldPinParametersPanel,V8=D8.setShouldShowParametersPanel,W8=D8.setShouldShowDualDisplay,U8=D8.setShouldShowImageDetails,G8=D8.setShouldUseCanvasBetaLayout,q8=D8.setShouldShowExistingModelsInSearch,Y8=D8.setAddNewModelUIOption,Z8=N8.reducer,X8=Object.create(null);X8.open="0",X8.close="1",X8.ping="2",X8.pong="3",X8.message="4",X8.upgrade="5",X8.noop="6";var $8=Object.create(null);Object.keys(X8).forEach((function(e){$8[X8[e]]=e}));for(var K8={type:"error",data:"parser error"},Q8="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),J8="function"==typeof ArrayBuffer,eee=function(e,t,n){var r=e.type,o=e.data;return Q8&&o instanceof Blob?t?n(o):tee(o,n):J8&&(o instanceof ArrayBuffer||function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer}(o))?t?n(o):tee(new Blob([o]),n):n(X8[r]+(o||""))},tee=function(e,t){var n=new FileReader;return n.onload=function(){var e=n.result.split(",")[1];t("b"+e)},n.readAsDataURL(e)},nee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ree="undefined"==typeof Uint8Array?[]:new Uint8Array(256),oee=0;oee1?{type:$8[n],data:e.substring(1)}:{type:$8[n]}:K8},see=function(e,t){if(iee){var n=function(e){var t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u=new ArrayBuffer(a),c=new Uint8Array(u);for(t=0;t>4,c[l++]=(15&r)<<4|o>>2,c[l++]=(3&o)<<6|63&i;return u}(e);return lee(n,t)}return{base64:!0,data:e}},lee=function(e,t){return"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e},uee=String.fromCharCode(30);function cee(e){if(e)return function(e){for(var t in cee.prototype)e[t]=cee.prototype[t];return e}(e)}cee.prototype.on=cee.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},cee.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},cee.prototype.off=cee.prototype.removeListener=cee.prototype.removeAllListeners=cee.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o1?t-1:0),r=1;r=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}var mee,yee=function(e){pn(n,e);var t=Qt(n);function n(e,r,o){var i;return an(this,n),(i=t.call(this,e)).description=r,i.context=o,i.type="TransportError",i}return on(n)}(Xt(Error)),bee=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this)).writable=!1,vee(en(r),e),r.opts=e,r.query=e.query,r.readyState="",r.socket=e.socket,r}return on(n,[{key:"onError",value:function(e,t,r){return Yt(nn(n.prototype),"emitReserved",this).call(this,"error",new yee(e,t,r)),this}},{key:"open",value:function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}},{key:"close",value:function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}},{key:"send",value:function(e){"open"===this.readyState&&this.write(e)}},{key:"onOpen",value:function(){this.readyState="open",this.writable=!0,Yt(nn(n.prototype),"emitReserved",this).call(this,"open")}},{key:"onData",value:function(e){var t=aee(e,this.socket.binaryType);this.onPacket(t)}},{key:"onPacket",value:function(e){Yt(nn(n.prototype),"emitReserved",this).call(this,"packet",e)}},{key:"onClose",value:function(e){this.readyState="closed",Yt(nn(n.prototype),"emitReserved",this).call(this,"close",e)}}]),n}(cee),wee="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),kee={},xee=0,See=0;function Cee(e){var t="";do{t=wee[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function _ee(){var e=Cee(+new Date);return e!==mee?(xee=0,mee=e):e+"."+Cee(xee++)}for(;See<64;See++)kee[wee[See]]=See;function Eee(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Pee(e){for(var t={},n=e.split("&"),r=0,o=n.length;r0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Ree(this.uri(),e)}},{key:"doWrite",value:function(e,t){var n=this,r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(function(e,t){n.onError("xhr post error",e,t)}))}},{key:"doPoll",value:function(){var e=this,t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(function(t,n){e.onError("xhr poll error",t,n)})),this.pollXhr=t}}]),n}(bee),Ree=function(e){pn(n,e);var t=Qt(n);function n(e,r){var o;return an(this,n),vee(en(o=t.call(this)),r),o.opts=r,o.method=r.method||"GET",o.uri=e,o.async=!1!==r.async,o.data=void 0!==r.data?r.data:null,o.create(),o}return on(n,[{key:"create",value:function(){var e=this,t=fee(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;var r=this.xhr=new Aee(t);try{r.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var o in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this.opts.extraHeaders[o])}catch(Dhe){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(Dhe){}try{r.setRequestHeader("Accept","*/*")}catch(Dhe){}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=function(){4===r.readyState&&(200===r.status||1223===r.status?e.onLoad():e.setTimeoutFn((function(){e.onError("number"==typeof r.status?r.status:0)}),0))},r.send(this.data)}catch(Dhe){return void this.setTimeoutFn((function(){e.onError(Dhe)}),0)}"undefined"!=typeof document&&(this.index=n.requestsCount++,n.requests[this.index]=this)}},{key:"onError",value:function(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}},{key:"cleanup",value:function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=Mee,e)try{this.xhr.abort()}catch(Dhe){}"undefined"!=typeof document&&delete n.requests[this.index],this.xhr=null}}},{key:"onLoad",value:function(){var e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}},{key:"abort",value:function(){this.cleanup()}}]),n}(cee);if(Ree.requestsCount=0,Ree.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Nee);else if("function"==typeof addEventListener){addEventListener("onpagehide"in dee?"pagehide":"unload",Nee,!1)}function Nee(){for(var e in Ree.requests)Ree.requests.hasOwnProperty(e)&&Ree.requests[e].abort()}var Dee="function"==typeof Promise&&"function"==typeof Promise.resolve?function(e){return Promise.resolve().then(e)}:function(e,t){return t(e,0)},zee=dee.WebSocket||dee.MozWebSocket,jee="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),Bee=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).supportsBinary=!e.forceBase64,r}return on(n,[{key:"name",get:function(){return"websocket"}},{key:"doOpen",value:function(){if(this.check()){var e=this.uri(),t=this.opts.protocols,n=jee?{}:fee(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=jee?new zee(e,t,n):t?new zee(e,t):new zee(e)}catch(COe){return this.emitReserved("error",COe)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}}},{key:"addEventListeners",value:function(){var e=this;this.ws.onopen=function(){e.opts.autoUnref&&e.ws._socket.unref(),e.onOpen()},this.ws.onclose=function(t){return e.onClose({description:"websocket connection closed",context:t})},this.ws.onmessage=function(t){return e.onData(t.data)},this.ws.onerror=function(t){return e.onError("websocket error",t)}}},{key:"write",value:function(e){var t=this;this.writable=!1;for(var n=function(){var n=e[r],o=r===e.length-1;eee(n,t.supportsBinary,(function(e){try{t.ws.send(e)}catch(Dhe){}o&&Dee((function(){t.writable=!0,t.emitReserved("drain")}),t.setTimeoutFn)}))},r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return an(this,n),r=t.call(this),e&&"object"===kn(e)&&(o=e,e=null),e?(e=Wee(e),o.hostname=e.host,o.secure="https"===e.protocol||"wss"===e.protocol,o.port=e.port,e.query&&(o.query=e.query)):o.host&&(o.hostname=Wee(o.host).host),vee(en(r),o),r.secure=null!=o.secure?o.secure:"undefined"!=typeof location&&"https:"===location.protocol,o.hostname&&!o.port&&(o.port=r.secure?"443":"80"),r.hostname=o.hostname||("undefined"!=typeof location?location.hostname:"localhost"),r.port=o.port||("undefined"!=typeof location&&location.port?location.port:r.secure?"443":"80"),r.transports=o.transports||["polling","websocket"],r.readyState="",r.writeBuffer=[],r.prevBufferLen=0,r.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},o),r.opts.path=r.opts.path.replace(/\/$/,"")+"/","string"==typeof r.opts.query&&(r.opts.query=Pee(r.opts.query)),r.id=null,r.upgrades=null,r.pingInterval=null,r.pingTimeout=null,r.pingTimeoutTimer=null,"function"==typeof addEventListener&&(r.opts.closeOnBeforeunload&&(r.beforeunloadEventListener=function(){r.transport&&(r.transport.removeAllListeners(),r.transport.close())},addEventListener("beforeunload",r.beforeunloadEventListener,!1)),"localhost"!==r.hostname&&(r.offlineEventListener=function(){r.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",r.offlineEventListener,!1))),r.open(),r}return on(n,[{key:"createTransport",value:function(e){var t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);var n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Fee[e](n)}},{key:"open",value:function(){var e,t=this;if(this.opts.rememberUpgrade&&n.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((function(){t.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(Dhe){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}},{key:"setTransport",value:function(e){var t=this;this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(function(e){return t.onClose("transport close",e)}))}},{key:"probe",value:function(e){var t=this,r=this.createTransport(e),o=!1;n.priorWebsocketSuccess=!1;var i=function(){o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",(function(e){if(!o)if("pong"===e.type&&"probe"===e.data){if(t.upgrading=!0,t.emitReserved("upgrading",r),!r)return;n.priorWebsocketSuccess="websocket"===r.name,t.transport.pause((function(){o||"closed"!==t.readyState&&(d(),t.setTransport(r),r.send([{type:"upgrade"}]),t.emitReserved("upgrade",r),r=null,t.upgrading=!1,t.flush())}))}else{var i=new Error("probe error");i.transport=r.name,t.emitReserved("upgradeError",i)}})))};function a(){o||(o=!0,d(),r.close(),r=null)}var s=function(e){var n=new Error("probe error: "+e);n.transport=r.name,a(),t.emitReserved("upgradeError",n)};function l(){s("transport closed")}function u(){s("socket closed")}function c(e){r&&e.name!==r.name&&a()}var d=function(){r.removeListener("open",i),r.removeListener("error",s),r.removeListener("close",l),t.off("close",u),t.off("upgrading",c)};r.once("open",i),r.once("error",s),r.once("close",l),this.once("close",u),this.once("upgrading",c),r.open()}},{key:"onOpen",value:function(){if(this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause)for(var e=0,t=this.upgrades.length;e1))return this.writeBuffer;for(var e=1,t=0;t0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}},{key:"write",value:function(e,t,n){return this.sendPacket("message",e,t,n),this}},{key:"send",value:function(e,t,n){return this.sendPacket("message",e,t,n),this}},{key:"sendPacket",value:function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}}},{key:"close",value:function(){var e=this,t=function(){e.onClose("forced close"),e.transport.close()},n=function n(){e.off("upgrade",n),e.off("upgradeError",n),t()},r=function(){e.once("upgrade",n),e.once("upgradeError",n)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){e.upgrading?r():t()})):this.upgrading?r():t()),this}},{key:"onError",value:function(e){n.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}},{key:"onClose",value:function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}},{key:"filterUpgrades",value:function(e){for(var t=[],n=0,r=e.length;n=0&&e.num0;case tte.ACK:case tte.BINARY_ACK:return Array.isArray(t)}}}]),n}(cee),ote=function(){function e(t){an(this,e),this.packet=t,this.buffers=[],this.reconPack=t}return on(e,[{key:"takeBinaryData",value:function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=Jee(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}},{key:"finishedReconstruction",value:function(){this.reconPack=null,this.buffers=[]}}]),e}(),ite=Object.freeze(Object.defineProperty({__proto__:null,Decoder:rte,Encoder:nte,get PacketType(){return tte},protocol:5},Symbol.toStringTag,{value:"Module"}));function ate(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var ste=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),lte=function(e){pn(n,e);var t=Qt(n);function n(e,r,o){var i;return an(this,n),(i=t.call(this)).connected=!1,i.receiveBuffer=[],i.sendBuffer=[],i.ids=0,i.acks={},i.flags={},i.io=e,i.nsp=r,o&&o.auth&&(i.auth=o.auth),i.io._autoConnect&&i.open(),i}return on(n,[{key:"disconnected",get:function(){return!this.connected}},{key:"subEvents",value:function(){if(!this.subs){var e=this.io;this.subs=[ate(e,"open",this.onopen.bind(this)),ate(e,"packet",this.onpacket.bind(this)),ate(e,"error",this.onerror.bind(this)),ate(e,"close",this.onclose.bind(this))]}}},{key:"active",get:function(){return!!this.subs}},{key:"connect",value:function(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}},{key:"open",value:function(){return this.connect()}},{key:"send",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}ute.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=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},ute.prototype.reset=function(){this.attempts=0},ute.prototype.setMin=function(e){this.ms=e},ute.prototype.setMax=function(e){this.max=e},ute.prototype.setJitter=function(e){this.jitter=e};var cte=function(e){pn(n,e);var t=Qt(n);function n(e,r){var o,i;an(this,n),(o=t.call(this)).nsps={},o.subs=[],e&&"object"===kn(e)&&(r=e,e=void 0),(r=r||{}).path=r.path||"/socket.io",o.opts=r,vee(en(o),r),o.reconnection(!1!==r.reconnection),o.reconnectionAttempts(r.reconnectionAttempts||1/0),o.reconnectionDelay(r.reconnectionDelay||1e3),o.reconnectionDelayMax(r.reconnectionDelayMax||5e3),o.randomizationFactor(null!==(i=r.randomizationFactor)&&void 0!==i?i:.5),o.backoff=new ute({min:o.reconnectionDelay(),max:o.reconnectionDelayMax(),jitter:o.randomizationFactor()}),o.timeout(null==r.timeout?2e4:r.timeout),o._readyState="closed",o.uri=e;var a=r.parser||ite;return o.encoder=new a.Encoder,o.decoder=new a.Decoder,o._autoConnect=!1!==r.autoConnect,o._autoConnect&&o.open(),o}return on(n,[{key:"reconnection",value:function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}},{key:"reconnectionAttempts",value:function(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}},{key:"reconnectionDelay",value:function(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}},{key:"randomizationFactor",value:function(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}},{key:"reconnectionDelayMax",value:function(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}},{key:"timeout",value:function(e){return arguments.length?(this._timeout=e,this):this._timeout}},{key:"maybeReconnectOnOpen",value:function(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}},{key:"open",value:function(e){var t=this;if(~this._readyState.indexOf("open"))return this;this.engine=new Uee(this.uri,this.opts);var n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;var o=ate(n,"open",(function(){r.onopen(),e&&e()})),i=ate(n,"error",(function(n){r.cleanup(),r._readyState="closed",t.emitReserved("error",n),e?e(n):r.maybeReconnectOnOpen()}));if(!1!==this._timeout){var a=this._timeout;0===a&&o();var s=this.setTimeoutFn((function(){o(),n.close(),n.emit("error",new Error("timeout"))}),a);this.opts.autoUnref&&s.unref(),this.subs.push((function(){clearTimeout(s)}))}return this.subs.push(o),this.subs.push(i),this}},{key:"connect",value:function(e){return this.open(e)}},{key:"onopen",value:function(){this.cleanup(),this._readyState="open",this.emitReserved("open");var e=this.engine;this.subs.push(ate(e,"ping",this.onping.bind(this)),ate(e,"data",this.ondata.bind(this)),ate(e,"error",this.onerror.bind(this)),ate(e,"close",this.onclose.bind(this)),ate(this.decoder,"decoded",this.ondecoded.bind(this)))}},{key:"onping",value:function(){this.emitReserved("ping")}},{key:"ondata",value:function(e){try{this.decoder.add(e)}catch(Dhe){this.onclose("parse error",Dhe)}}},{key:"ondecoded",value:function(e){var t=this;Dee((function(){t.emitReserved("packet",e)}),this.setTimeoutFn)}},{key:"onerror",value:function(e){this.emitReserved("error",e)}},{key:"socket",value:function(e,t){var n=this.nsps[e];return n||(n=new lte(this,e,t),this.nsps[e]=n),n}},{key:"_destroy",value:function(e){for(var t=0,n=Object.keys(this.nsps);t=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{var n=this.backoff.duration();this._reconnecting=!0;var r=this.setTimeoutFn((function(){t.skipReconnect||(e.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((function(n){n?(t._reconnecting=!1,t.reconnect(),e.emitReserved("reconnect_error",n)):t.onreconnect()})))}),n);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}}},{key:"onreconnect",value:function(){var e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}]),n}(cee),dte={};function fte(e,t){"object"===kn(e)&&(t=e,e=void 0);var n,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=Wee(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var o=-1!==r.host.indexOf(":"),i=o?"["+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}(e,(t=t||{}).path||"/socket.io"),o=r.source,i=r.id,a=r.path,s=dte[i]&&a in dte[i].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||s?n=new cte(o,t):(dte[i]||(dte[i]=new cte(o,t)),n=dte[i]),r.query&&!t.query&&(t.query=r.queryKey),n.socket(r.path,t)}Object.assign(fte,{Manager:cte,Socket:lte,io:fte,connect:fte});var hte=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],pte=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],vte=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],gte=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],mte=[{key:"2x",value:2},{key:"4x",value:4}],yte=4294967295,bte=["gfpgan","codeformer"],wte=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],kte=Math.PI/180;var xte="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},Ste={_global:xte,version:"8.3.14",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle:function(e){return Ste.angleDeg?e*kte:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:function(){return Ste.DD.isDragging},isDragReady:function(){return!!Ste.DD.node},releaseCanvasOnDestroy:!0,document:xte.document,_injectGlobal:function(e){xte.Konva=e}},Cte=function(e){Ste[e.prototype.getClassName()]=e};Ste._injectGlobal(Ste);var _te=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[1,0,0,1,0,0];an(this,e),this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}return on(e,[{key:"reset",value:function(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}},{key:"copy",value:function(){return new e(this.m)}},{key:"copyInto",value:function(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}},{key:"point",value:function(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}},{key:"translate",value:function(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}},{key:"scale",value:function(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,o=this.m[1]*t+this.m[3]*n,i=this.m[0]*-n+this.m[2]*t,a=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=o,this.m[2]=i,this.m[3]=a,this}},{key:"getTranslation",value:function(){return{x:this.m[4],y:this.m[5]}}},{key:"skew",value:function(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,o=this.m[2]+this.m[0]*e,i=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=o,this.m[3]=i,this}},{key:"multiply",value:function(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],a=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}},{key:"invert",value:function(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}},{key:"getMatrix",value:function(){return this.m}},{key:"decompose",value:function(){var e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],o=e*r-t*n,i={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){var a=Math.sqrt(e*e+t*t);i.rotation=t>0?Math.acos(e/a):-Math.acos(e/a),i.scaleX=a,i.scaleY=o/a,i.skewX=(e*n+t*r)/o,i.skewY=0}else if(0!=n||0!=r){var s=Math.sqrt(n*n+r*r);i.rotation=Math.PI/2-(r>0?Math.acos(-n/s):-Math.acos(n/s)),i.scaleX=o/s,i.scaleY=s,i.skewX=0,i.skewY=(e*n+t*r)/o}return i.rotation=Ite._getRotation(i.rotation),i}}]),e}(),Ete=Math.PI/180,Pte=180/Math.PI,Lte="Konva error: ",Ote={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},Ate=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Mte=[],Tte="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)},Ite={_isElement:function(e){return!(!e||1!=e.nodeType)},_isFunction:function(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject:function(e){return!!e&&e.constructor===Object},_isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},_isNumber:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e)},_isString:function(e){return"[object String]"===Object.prototype.toString.call(e)},_isBoolean:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},isObject:function(e){return e instanceof Object},isValidSelector:function(e){if("string"!=typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:function(e){return 0===e||e>0?1:-1},requestAnimFrame:function(e){Mte.push(e),1===Mte.length&&Tte((function(){var e=Mte;Mte=[],e.forEach((function(e){e()}))}))},createCanvasElement:function(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(Dhe){}return e},createImageElement:function(){return document.createElement("img")},_isInDocument:function(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage:function(e,t){var n=Ite.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:function(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb:function(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor:function(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB:function(e){var t;return e in Ote?{r:(t=Ote[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=Ate.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA:function(e){return e=e||"black",Ite._namedColorToRBA(e)||Ite._hex3ColorToRGBA(e)||Ite._hex6ColorToRGBA(e)||Ite._rgbColorToRGBA(e)||Ite._rgbaColorToRGBA(e)||Ite._hslColorToRGBA(e)},_namedColorToRBA:function(e){var t=Ote[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA:function(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA:function(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map((function(e,t){return"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)}));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA:function(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA:function(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA:function(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){var t,n,r,o=dn(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e)),i=(o[0],o.slice(1)),a=Number(i[0])/360,s=Number(i[1])/100,l=Number(i[2])/100;if(0===s)return r=255*l,{r:Math.round(r),g:Math.round(r),b:Math.round(r),a:1};for(var u=2*l-(t=l<.5?l*(1+s):l+s-l*s),c=[0,0,0],d=0;d<3;d++)(n=a+1/3*-(d-1))<0&&n++,n>1&&n--,r=6*n<1?u+6*(t-u)*n:2*n<1?t:3*n<2?u+(t-u)*(2/3-n)*6:u,c[d]=255*r;return{r:Math.round(c[0]),g:Math.round(c[1]),b:Math.round(c[2]),a:1}}},haveIntersection:function(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-o)*(n-o)+(r-i)*(r-i)):l=((a=e+c*(n-e))-o)*(a-o)+((s=t+c*(r-t))-i)*(s-i)}return[a,s,l]},_getProjectionToLine:function(e,t,n){var r=Ite.cloneObject(e),o=Number.MAX_VALUE;return t.forEach((function(i,a){if(n||a!==t.length-1){var s=t[(a+1)%t.length],l=Ite._getProjectionToSegment(i.x,i.y,s.x,s.y,e.x,e.y),u=l[0],c=l[1],d=l[2];dt.length){var a=t;t=e,e=a}for(r=0;r255?255:e<0?0:Math.round(e)}function Dte(){if(Ste.isUnminified)return function(e,t){return Ite._isNumber(e)||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function zte(e){if(Ste.isUnminified)return function(t,n){var r=Ite._isNumber(t),o=Ite._isArray(t)&&t.length==e;return r||o||Ite.warn(Rte(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function jte(){if(Ste.isUnminified)return function(e,t){return Ite._isNumber(e)||"auto"===e||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function Bte(){if(Ste.isUnminified)return function(e,t){return Ite._isString(e)||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function Fte(){if(Ste.isUnminified)return function(e,t){var n=Ite._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function Hte(){if(Ste.isUnminified)return function(e,t){return!0===e||!1===e||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var Vte="get",Wte="set",Ute={addGetterSetter:function(e,t,n,r,o){Ute.addGetter(e,t,n),Ute.addSetter(e,t,r,o),Ute.addOverloadedGetterSetter(e,t)},addGetter:function(e,t,n){var r=Vte+Ite._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter:function(e,t,n,r){var o=Wte+Ite._capitalize(t);e.prototype[o]||Ute.overWriteSetter(e,t,n,r)},overWriteSetter:function(e,t,n,r){var o=Wte+Ite._capitalize(t);e.prototype[o]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter:function(e,t,n,r,o){var i,a,s=n.length,l=Ite._capitalize,u=Vte+l(t),c=Wte+l(t);e.prototype[u]=function(){var e={};for(i=0;i=100&&t.shift()}},{key:"reset",value:function(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}},{key:"getCanvas",value:function(){return this.canvas}},{key:"clear",value:function(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}},{key:"_applyLineCap",value:function(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)}},{key:"_applyOpacity",value:function(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}},{key:"_applyLineJoin",value:function(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}},{key:"setAttr",value:function(e,t){this._context[e]=t}},{key:"arc",value:function(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)}},{key:"arcTo",value:function(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)}},{key:"beginPath",value:function(){this._context.beginPath()}},{key:"bezierCurveTo",value:function(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)}},{key:"clearRect",value:function(e,t,n,r){this._context.clearRect(e,t,n,r)}},{key:"clip",value:function(){this._context.clip()}},{key:"closePath",value:function(){this._context.closePath()}},{key:"createImageData",value:function(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}},{key:"createLinearGradient",value:function(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}},{key:"createPattern",value:function(e,t){return this._context.createPattern(e,t)}},{key:"createRadialGradient",value:function(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)}},{key:"drawImage",value:function(e,t,n,r,o,i,a,s,l){var u=arguments,c=this._context;3===u.length?c.drawImage(e,t,n):5===u.length?c.drawImage(e,t,n,r,o):9===u.length&&c.drawImage(e,t,n,r,o,i,a,s,l)}},{key:"ellipse",value:function(e,t,n,r,o,i,a,s){this._context.ellipse(e,t,n,r,o,i,a,s)}},{key:"isPointInPath",value:function(e,t){return this._context.isPointInPath(e,t)}},{key:"fill",value:function(e){e?this._context.fill(e):this._context.fill()}},{key:"fillRect",value:function(e,t,n,r){this._context.fillRect(e,t,n,r)}},{key:"strokeRect",value:function(e,t,n,r){this._context.strokeRect(e,t,n,r)}},{key:"fillText",value:function(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}},{key:"measureText",value:function(e){return this._context.measureText(e)}},{key:"getImageData",value:function(e,t,n,r){return this._context.getImageData(e,t,n,r)}},{key:"lineTo",value:function(e,t){this._context.lineTo(e,t)}},{key:"moveTo",value:function(e,t){this._context.moveTo(e,t)}},{key:"rect",value:function(e,t,n,r){this._context.rect(e,t,n,r)}},{key:"putImageData",value:function(e,t,n){this._context.putImageData(e,t,n)}},{key:"quadraticCurveTo",value:function(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}},{key:"restore",value:function(){this._context.restore()}},{key:"rotate",value:function(e){this._context.rotate(e)}},{key:"save",value:function(){this._context.save()}},{key:"scale",value:function(e,t){this._context.scale(e,t)}},{key:"setLineDash",value:function(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}},{key:"getLineDash",value:function(){return this._context.getLineDash()}},{key:"setTransform",value:function(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)}},{key:"stroke",value:function(e){e?this._context.stroke(e):this._context.stroke()}},{key:"strokeText",value:function(e,t,n,r){this._context.strokeText(e,t,n,r)}},{key:"transform",value:function(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)}},{key:"translate",value:function(e,t){this._context.translate(e,t)}},{key:"_enableTrace",value:function(){var e,t,n=this,r=qte.length,o=this.setAttr,i=function(e){var r,o=n[e];n[e]=function(){return t=Gte(Array.prototype.slice.call(arguments,0)),r=o.apply(n,arguments),n._trace({method:e,args:t}),r}};for(e=0;e0&&void 0!==arguments[0]?arguments[0]:{width:0,height:0};return an(this,n),(e=t.call(this,r)).context=new Xte(en(e)),e.setSize(r.width,r.height),e}return on(n)}(Kte),Jte=function(e){pn(n,e);var t=Qt(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:0,height:0};return an(this,n),(e=t.call(this,r)).hitCanvas=!0,e.context=new $te(en(e)),e.setSize(r.width,r.height),e}return on(n)}(Kte),ene={get isDragging(){var e=!1;return ene._dragElements.forEach((function(t){"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return ene._dragElements.forEach((function(t){e=t.node})),e},_dragElements:new Map,_drag:function(e){var t=[];ene._dragElements.forEach((function(n,r){var o=n.node,i=o.getStage();i.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=Ite._getFirstPointerId(e));var a=i._changedPointerPositions.find((function(e){return e.id===n.pointerId}));if(a){if("dragging"!==n.dragStatus){var s=o.dragDistance();if(Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y))1&&void 0!==arguments[1]&&arguments[1];if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;ene._dragElements.forEach((function(e){"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var o=!t&&!Ste.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!o}},{key:"show",value:function(){return this.visible(!0),this}},{key:"hide",value:function(){return this.visible(!1),this}},{key:"getZIndex",value:function(){return this.index||0}},{key:"getAbsoluteZIndex",value:function(){var e,t,n,r,o=this.getDepth(),i=this,a=0;return"Stage"!==i.nodeType&&function s(l){for(e=[],t=l.length,n=0;n0&&e[0].getDepth()<=o&&s(e)}(i.getStage().getChildren()),a}},{key:"getDepth",value:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}},{key:"_batchTransformChanges",value:function(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(fne),this._clearSelfAndDescendantCache(rne)),this._needClearTransformCache=!1}},{key:"setPosition",value:function(e){var t=this;return this._batchTransformChanges((function(){t.x(e.x),t.y(e.y)})),this}},{key:"getPosition",value:function(){return{x:this.x(),y:this.y()}}},{key:"getRelativePointerPosition",value:function(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}},{key:"getAbsolutePosition",value:function(e){for(var t=!1,n=this.parent;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),o=new _te,i=this.offset();return o.m=r.slice(),o.translate(i.x,i.y),o.getTranslation()}},{key:"setAbsolutePosition",value:function(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(fne);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(fne),this._clearSelfAndDescendantCache(rne),this}},{key:"_setTransform",value:function(e){var t;for(t in e)this.attrs[t]=e[t]}},{key:"_clearTransform",value:function(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}},{key:"move",value:function(e){var t=e.x,n=e.y,r=this.x(),o=this.y();return void 0!==t&&(r+=t),void 0!==n&&(o+=n),this.setPosition({x:r,y:o}),this}},{key:"_eachAncestorReverse",value:function(e,t){var n,r,o=[],i=this.getParent();if(!t||t._id!==this._id){for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}},{key:"moveToBottom",value:function(){if(!this.parent)return Ite.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}},{key:"setZIndex",value:function(e){if(!this.parent)return Ite.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&Ite.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}},{key:"getAbsoluteOpacity",value:function(){return this._getCache(tne,this._getAbsoluteOpacity)}},{key:"_getAbsoluteOpacity",value:function(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}},{key:"moveTo",value:function(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}},{key:"toObject",value:function(){var e,t,n,r,o={},i=this.getAttrs();for(e in o.attrs={},i)t=i[e],Ite.isObject(t)&&!Ite._isPlainObject(t)&&!Ite._isArray(t)||(n="function"==typeof this[e]&&this[e],delete i[e],r=n?n.call(this):null,i[e]=t,r!==t&&(o.attrs[e]=t));return o.className=this.getClassName(),Ite._prepareToStringify(o)}},{key:"toJSON",value:function(){return JSON.stringify(this.toObject())}},{key:"getParent",value:function(){return this.parent}},{key:"findAncestors",value:function(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var o=this.parent;o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}},{key:"isAncestorOf",value:function(e){return!1}},{key:"findAncestor",value:function(e,t,n){return this.findAncestors(e,t,n)[0]}},{key:"_isMatch",value:function(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),o=r.length;for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return t.target=t.target||this,n?this._fireAndBubble(e,t):this._fire(e,t),this}},{key:"getAbsoluteTransform",value:function(e){return e?this._getAbsoluteTransform(e):this._getCache(rne,this._getAbsoluteTransform)}},{key:"_getAbsoluteTransform",value:function(e){var t;if(e)return t=new _te,this._eachAncestorReverse((function(e){var n=e.transformsEnabled();"all"===n?t.multiply(e.getTransform()):"position"===n&&t.translate(e.x()-e.offsetX(),e.y()-e.offsetY())}),e),t;t=this._cache.get(rne)||new _te,this.parent?this.parent.getAbsoluteTransform().copyInto(t):t.reset();var n=this.transformsEnabled();if("all"===n)t.multiply(this.getTransform());else if("position"===n){var r=this.attrs.x||0,o=this.attrs.y||0,i=this.attrs.offsetX||0,a=this.attrs.offsetY||0;t.translate(r-i,o-a)}return t.dirty=!1,t}},{key:"getAbsoluteScale",value:function(e){for(var t=this;t;)t._isUnderCache&&(e=t),t=t.getParent();var n=this.getAbsoluteTransform(e).decompose();return{x:n.scaleX,y:n.scaleY}}},{key:"getAbsoluteRotation",value:function(){return this.getAbsoluteTransform().decompose().rotation}},{key:"getTransform",value:function(){return this._getCache(fne,this._getTransform)}},{key:"_getTransform",value:function(){var e,t,n=this._cache.get(fne)||new _te;n.reset();var r=this.x(),o=this.y(),i=Ste.getAngle(this.rotation()),a=null!==(e=this.attrs.scaleX)&&void 0!==e?e:1,s=null!==(t=this.attrs.scaleY)&&void 0!==t?t:1,l=this.attrs.skewX||0,u=this.attrs.skewY||0,c=this.attrs.offsetX||0,d=this.attrs.offsetY||0;return 0===r&&0===o||n.translate(r,o),0!==i&&n.rotate(i),0===l&&0===u||n.skew(l,u),1===a&&1===s||n.scale(a,s),0===c&&0===d||n.translate(-1*c,-1*d),n.dirty=!1,n}},{key:"clone",value:function(e){var t,n,r,o,i,a=Ite.cloneObject(this.attrs);for(t in e)a[t]=e[t];var s=new this.constructor(a);for(t in this.eventListeners)for(r=(n=this.eventListeners[t]).length,o=0;o1&&void 0!==arguments[1])||arguments[1];ene._dragElements.has(this._id)||this._createDragElement(e);var n=ene._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},t)}},{key:"_setDragPosition",value:function(e,t){var n=this.getStage()._getPointerById(t.pointerId);if(n){var r={x:n.x-t.offset.x,y:n.y-t.offset.y},o=this.dragBoundFunc();if(void 0!==o){var i=o.call(this,r,e);i?r=i:Ite.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}this._lastPos&&this._lastPos.x===r.x&&this._lastPos.y===r.y||(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}}},{key:"stopDrag",value:function(e){var t=ene._dragElements.get(this._id);t&&(t.dragStatus="stopped"),ene._endDragBefore(e),ene._endDragAfter(e)}},{key:"setDraggable",value:function(e){this._setAttr("draggable",e),this._dragChange()}},{key:"isDragging",value:function(){var e=ene._dragElements.get(this._id);return!!e&&"dragging"===e.dragStatus}},{key:"_listenDrag",value:function(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",(function(e){var t=this;if((!(void 0!==e.evt.button)||Ste.dragButtons.indexOf(e.evt.button)>=0)&&!this.isDragging()){var n=!1;ene._dragElements.forEach((function(e){t.isAncestorOf(e.node)&&(n=!0)})),n||this._createDragElement(e)}}))}},{key:"_dragChange",value:function(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;var e=ene._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&ene._dragElements.delete(this._id)}}},{key:"_dragCleanup",value:function(){this.off("mousedown.konva"),this.off("touchstart.konva")}},{key:"isClientRectOnScreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0},t=this.getStage();if(!t)return!1;var n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return Ite.haveIntersection(n,this.getClientRect())}}],[{key:"create",value:function(e,t){return Ite._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}},{key:"_createNode",value:function(t,n){var r,o,i,a=e.prototype.getClassName.call(t),s=t.children;if(n&&(t.attrs.container=n),Ste[a]||(Ite.warn('Can not find a node with class name "'+a+'". Fallback to "Shape".'),a="Shape"),r=new(0,Ste[a])(t.attrs),s)for(o=s.length,i=0;i0}},{key:"removeChildren",value:function(){return this.getChildren().forEach((function(e){e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}},{key:"destroyChildren",value:function(){return this.getChildren().forEach((function(e){e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1){for(var r=0;r0?t[0]:void 0}},{key:"_generalFind",value:function(e,t){var n=[];return this._descendants((function(r){var o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),n}},{key:"_descendants",value:function(e){var t,n=xn(this.getChildren());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e(r))return!0;if(r.hasChildren()&&r._descendants(e))return!0}}catch(COe){n.e(COe)}finally{n.f()}return!1}},{key:"toObject",value:function(){var e=gne.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((function(t){e.children.push(t.toObject())})),e}},{key:"isAncestorOf",value:function(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}},{key:"clone",value:function(e){var t=gne.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}},{key:"getAllIntersections",value:function(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}},{key:"_clearSelfAndDescendantCache",value:function(e){var t;Yt(nn(n.prototype),"_clearSelfAndDescendantCache",this).call(this,e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}},{key:"_setChildrenIndices",value:function(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}},{key:"drawScene",value:function(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),o=r&&r.getContext(),i=this._getCanvasCache(),a=i&&i.scene,s=r&&r.isCache;if(!this.isVisible()&&!s)return this;if(a){o.save();var l=this.getAbsoluteTransform(t).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,t);return this}},{key:"drawHit",value:function(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,o=r&&r.getContext(),i=this._getCanvasCache();if(i&&i.hit){o.save();var a=this.getAbsoluteTransform(t).getMatrix();o.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",r,t);return this}},{key:"_drawChildren",value:function(e,t,n){var r,o=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),s=this.clipFunc(),l=i&&a||s,u=n===this;if(l){o.save();var c=this.getAbsoluteTransform(n),d=c.getMatrix();if(o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),o.beginPath(),s)s.call(this,o,this);else{var f=this.clipX(),h=this.clipY();o.rect(f,h,i,a)}o.clip(),d=c.copy().invert().getMatrix(),o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var p=!u&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;p&&(o.save(),o._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),p&&o.restore(),l&&o.restore()}},{key:"getClientRect",value:function(e){var t,n,r,o,i,a=(e=e||{}).skipTransform,s=e.relativeTo,l={x:1/0,y:1/0,width:0,height:0},u=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var a=t.getClientRect({relativeTo:u,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===a.width&&0===a.height||(void 0===n?(n=a.x,r=a.y,o=a.x+a.width,i=a.y+a.height):(n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x+a.width),i=Math.max(i,a.y+a.height)))}}));for(var c=this.find("Shape"),d=!1,f=0;f=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse"},Xne=function(e){var t=Zne(e);return"pointer"===t?Ste.pointerEventsEnabled&&Yne.pointer:"touch"===t?Yne.touch:"mouse"===t?Yne.mouse:void 0};function $ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e.clipFunc||e.clipWidth||e.clipHeight)&&Ite.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}var Kne=[],Qne=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,$ne(e)))._pointerPositions=[],r._changedPointerPositions=[],r._buildDOM(),r._bindContentEvents(),Kne.push(en(r)),r.on("widthChange.konva heightChange.konva",r._resizeDOM),r.on("visibleChange.konva",r._checkVisibility),r.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(function(){$ne(r.attrs)})),r._checkVisibility(),r}return on(n,[{key:"_validateAdd",value:function(e){var t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||Ite.throw("You may only add layers to the stage.")}},{key:"_checkVisibility",value:function(){if(this.content){var e=this.visible()?"":"none";this.content.style.display=e}}},{key:"setContainer",value:function(e){if("string"===kn(e)){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}},{key:"shouldDrawHit",value:function(){return!0}},{key:"clear",value:function(){var e,t=this.children,n=t.length;for(e=0;e-1&&Kne.splice(t,1),Ite.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}},{key:"getPointerPosition",value:function(){var e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(Ite.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)}},{key:"_getPointerById",value:function(e){return this._pointerPositions.find((function(t){return t.id===e}))}},{key:"getPointersPositions",value:function(){return this._pointerPositions}},{key:"getStage",value:function(){return this}},{key:"getContent",value:function(){return this.content}},{key:"_toKonvaCanvas",value:function(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new Qte({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}},{key:"getIntersection",value:function(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){var r=n[t].getIntersection(e);if(r)return r}return null}},{key:"_resizeDOM",value:function(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((function(n){n.setSize({width:e,height:t}),n.draw()}))}},{key:"add",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o1){for(var i=0;i5&&Ite.warn("The stage has "+a+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),Ste.isBrowser&&this.content.appendChild(e.canvas._canvas),this}},{key:"getParent",value:function(){return null}},{key:"getLayer",value:function(){return null}},{key:"hasPointerCapture",value:function(e){return Sne(e,this)}},{key:"setPointerCapture",value:function(e){Cne(e,this)}},{key:"releaseCapture",value:function(e){_ne(e)}},{key:"getLayers",value:function(){return this.children}},{key:"_bindContentEvents",value:function(){var e=this;Ste.isBrowser&&qne.forEach((function(t){var n=yn(t,2),r=n[0],o=n[1];e.content.addEventListener(r,(function(t){e[o](t)}),{passive:!1})}))}},{key:"_pointerenter",value:function(e){this.setPointersPositions(e);var t=Xne(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}},{key:"_pointerover",value:function(e){this.setPointersPositions(e);var t=Xne(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}},{key:"_getTargetShape",value:function(e){var t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}},{key:"_pointerleave",value:function(e){var t=Xne(e.type),n=Zne(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),o=!ene.isDragging||Ste.hitOnDragEnabled;r&&o?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):o&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}},{key:"_pointerdown",value:function(e){var t=this,n=Xne(e.type),r=Zne(e.type);if(n){this.setPointersPositions(e);var o=!1;this._changedPointerPositions.forEach((function(i){var a=t.getIntersection(i);if(ene.justDragged=!1,Ste["_"+r+"ListenClick"]=!0,a&&a.isListening()){Ste.capturePointerEventsEnabled&&a.setPointerCapture(i.id),t[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:e,pointerId:i.id}),o=!0;var s=e.type.indexOf("touch")>=0;a.preventDefault()&&e.cancelable&&s&&e.preventDefault()}})),o||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}},{key:"_pointermove",value:function(e){var t=this,n=Xne(e.type),r=Zne(e.type);if(n&&(ene.isDragging&&ene.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!ene.isDragging||Ste.hitOnDragEnabled)){var o={},i=!1,a=this._getTargetShape(r);this._changedPointerPositions.forEach((function(s){var l=kne(s.id)||t.getIntersection(s),u=s.id,c={evt:e,pointerId:u},d=a!==l;if(d&&a&&(a._fireAndBubble(n.pointerout,Object.assign({},c),l),a._fireAndBubble(n.pointerleave,Object.assign({},c),l)),l){if(o[l._id])return;o[l._id]=!0}l&&l.isListening()?(i=!0,d&&(l._fireAndBubble(n.pointerover,Object.assign({},c),a),l._fireAndBubble(n.pointerenter,Object.assign({},c),a),t[r+"targetShape"]=l),l._fireAndBubble(n.pointermove,Object.assign({},c))):a&&(t._fire(n.pointerover,{evt:e,target:t,currentTarget:t,pointerId:u}),t[r+"targetShape"]=null)})),i||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}}},{key:"_pointerup",value:function(e){var t=this,n=Xne(e.type),r=Zne(e.type);if(n){this.setPointersPositions(e);var o=this[r+"ClickStartShape"],i=this[r+"ClickEndShape"],a={},s=!1;this._changedPointerPositions.forEach((function(l){var u=kne(l.id)||t.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}var c=l.id,d={evt:e,pointerId:c},f=!1;Ste["_"+r+"InDblClickWindow"]?(f=!0,clearTimeout(t[r+"DblTimeout"])):ene.justDragged||(Ste["_"+r+"InDblClickWindow"]=!0,clearTimeout(t[r+"DblTimeout"])),t[r+"DblTimeout"]=setTimeout((function(){Ste["_"+r+"InDblClickWindow"]=!1}),Ste.dblClickWindow),u&&u.isListening()?(s=!0,t[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},d)),Ste["_"+r+"ListenClick"]&&o&&o===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},d)),f&&i&&i===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},d)))):(t[r+"ClickEndShape"]=null,Ste["_"+r+"ListenClick"]&&t._fire(n.pointerclick,{evt:e,target:t,currentTarget:t,pointerId:c}),f&&t._fire(n.pointerdblclick,{evt:e,target:t,currentTarget:t,pointerId:c}))})),s||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ste["_"+r+"ListenClick"]=!1,e.cancelable&&"touch"!==r&&e.preventDefault()}}},{key:"_contextmenu",value:function(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Fne,{evt:e}):this._fire(Fne,{evt:e,target:this,currentTarget:this})}},{key:"_wheel",value:function(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Gne,{evt:e}):this._fire(Gne,{evt:e,target:this,currentTarget:this})}},{key:"_pointercancel",value:function(e){this.setPointersPositions(e);var t=kne(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(Rne,xne(e)),_ne(e.pointerId)}},{key:"_lostpointercapture",value:function(e){_ne(e.pointerId)}},{key:"setPointersPositions",value:function(e){var t=this,n=this._getContentPosition(),r=null,o=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(function(e){t._pointerPositions.push({id:e.identifier,x:(e.clientX-n.left)/n.scaleX,y:(e.clientY-n.top)/n.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(function(e){t._changedPointerPositions.push({id:e.identifier,x:(e.clientX-n.left)/n.scaleX,y:(e.clientY-n.top)/n.scaleY})}))):(r=(e.clientX-n.left)/n.scaleX,o=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:o},this._pointerPositions=[{x:r,y:o,id:Ite._getFirstPointerId(e)}],this._changedPointerPositions=[{x:r,y:o,id:Ite._getFirstPointerId(e)}])}},{key:"_setPointerPosition",value:function(e){Ite.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}},{key:"_getContentPosition",value:function(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}},{key:"_buildDOM",value:function(){if(this.bufferCanvas=new Qte({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Jte({pixelRatio:1,width:this.width(),height:this.height()}),Ste.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}}},{key:"cache",value:function(){return Ite.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}},{key:"clearCache",value:function(){return this}},{key:"batchDraw",value:function(){return this.getChildren().forEach((function(e){e.batchDraw()})),this}}]),n}(yne);Qne.prototype.nodeType="Stage",Cte(Qne),Ute.addGetterSetter(Qne,"container");var Jne,ere="hasShadow",tre="shadowRGBA",nre="patternImage",rre="linearGradient",ore="radialGradient";function ire(){return Jne||(Jne=Ite.createCanvasElement().getContext("2d"))}var are={};var sre=function(e){pn(n,e);var t=Qt(n);function n(e){var r,o;for(an(this,n),r=t.call(this,e);!(o=Ite.getRandomColor())||o in are;);return r.colorKey=o,are[o]=en(r),r}return on(n,[{key:"getContext",value:function(){return Ite.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}},{key:"getCanvas",value:function(){return Ite.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}},{key:"getSceneFunc",value:function(){return this.attrs.sceneFunc||this._sceneFunc}},{key:"getHitFunc",value:function(){return this.attrs.hitFunc||this._hitFunc}},{key:"hasShadow",value:function(){return this._getCache(ere,this._hasShadow)}},{key:"_hasShadow",value:function(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}},{key:"_getFillPattern",value:function(){return this._getCache(nre,this.__getFillPattern)}},{key:"__getFillPattern",value:function(){if(this.fillPatternImage()){var e=ire().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){var t=new _te;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(Ste.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());var n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}},{key:"_getLinearGradient",value:function(){return this._getCache(rre,this.__getLinearGradient)}},{key:"__getLinearGradient",value:function(){var e=this.fillLinearGradientColorStops();if(e){for(var t=ire(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),o=t.createLinearGradient(n.x,n.y,r.x,r.y),i=0;i0}},{key:"destroy",value:function(){return gne.prototype.destroy.call(this),delete are[this.colorKey],delete this.colorKey,this}},{key:"_useBufferCanvas",value:function(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;var n=e||this.hasFill(),r=this.hasStroke(),o=1!==this.getAbsoluteOpacity();if(n&&r&&o)return!0;var i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(n&&r&&i&&a)}},{key:"setStrokeHitEnabled",value:function(e){Ite.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}},{key:"getStrokeHitEnabled",value:function(){return 0!==this.hitStrokeWidth()}},{key:"getSelfRect",value:function(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}},{key:"getClientRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke(),i=o&&this.strokeWidth()||0,a=r.width+i,s=r.height+i,l=!e.skipShadow&&this.hasShadow(),u=l?this.shadowOffsetX():0,c=l?this.shadowOffsetY():0,d=a+Math.abs(u),f=s+Math.abs(c),h=l&&this.shadowBlur()||0,p=d+2*h,v=f+2*h,g={width:p,height:v,x:-(i/2+h)+Math.min(u,0)+r.x,y:-(i/2+h)+Math.min(c,0)+r.y};return t?g:this._transformedRect(g,n)}},{key:"drawScene",value:function(e,t){var n,r,o=this.getLayer(),i=e||o.getCanvas(),a=i.getContext(),s=this._getCanvasCache(),l=this.getSceneFunc(),u=this.hasShadow(),c=i.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(s){a.save();var f=this.getAbsoluteTransform(t).getMatrix();return a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!l)return this;if(a.save(),this._useBufferCanvas()&&!c){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var h=this.getAbsoluteTransform(t).getMatrix();r.transform(h[0],h[1],h[2],h[3],h[4],h[5]),l.call(this,r,this),r.restore();var p=n.pixelRatio;u&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(a._applyLineJoin(this),!d){h=this.getAbsoluteTransform(t).getMatrix();a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}u&&a._applyShadow(this),l.call(this,a,this)}return a.restore(),this}},{key:"drawHit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),o=e||r.hitCanvas,i=o&&o.getContext(),a=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),l=s&&s.hit;if(this.colorKey||Ite.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),l){i.save();var u=this.getAbsoluteTransform(t).getMatrix();return i.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(i),i.restore(),this}if(!a)return this;i.save(),i._applyLineJoin(this);var c=this===t;if(!c){var d=this.getAbsoluteTransform(t).getMatrix();i.transform(d[0],d[1],d[2],d[3],d[4],d[5])}return a.call(this,i,this),i.restore(),this}},{key:"drawHitFromCache",value:function(){var e,t,n,r,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=this._getCanvasCache(),s=this._getCachedSceneCanvas(),l=a.hit,u=l.getContext(),c=l.getWidth(),d=l.getHeight();u.clear(),u.drawImage(s._canvas,0,0,c,d);try{for(n=(t=(e=u.getImageData(0,0,c,d)).data).length,r=Ite._hexToRgb(this.colorKey),o=0;oi?(t[o]=r.r,t[o+1]=r.g,t[o+2]=r.b,t[o+3]=255):t[o+3]=0;u.putImageData(e,0,0)}catch(Dhe){Ite.error("Unable to draw hit graph from cached scene canvas. "+Dhe.message)}return this}},{key:"hasPointerCapture",value:function(e){return Sne(e,this)}},{key:"setPointerCapture",value:function(e){Cne(e,this)}},{key:"releaseCapture",value:function(e){_ne(e)}}]),n}(gne);sre.prototype._fillFunc=function(e){e.fill()},sre.prototype._strokeFunc=function(e){e.stroke()},sre.prototype._fillFuncHit=function(e){e.fill()},sre.prototype._strokeFuncHit=function(e){e.stroke()},sre.prototype._centroid=!1,sre.prototype.nodeType="Shape",Cte(sre),sre.prototype.eventListeners={},sre.prototype.on.call(sre.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(ere)})),sre.prototype.on.call(sre.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(tre)})),sre.prototype.on.call(sre.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(nre)})),sre.prototype.on.call(sre.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(rre)})),sre.prototype.on.call(sre.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(ore)})),Ute.addGetterSetter(sre,"stroke",void 0,Fte()),Ute.addGetterSetter(sre,"strokeWidth",2,Dte()),Ute.addGetterSetter(sre,"fillAfterStrokeEnabled",!1),Ute.addGetterSetter(sre,"hitStrokeWidth","auto",jte()),Ute.addGetterSetter(sre,"strokeHitEnabled",!0,Hte()),Ute.addGetterSetter(sre,"perfectDrawEnabled",!0,Hte()),Ute.addGetterSetter(sre,"shadowForStrokeEnabled",!0,Hte()),Ute.addGetterSetter(sre,"lineJoin"),Ute.addGetterSetter(sre,"lineCap"),Ute.addGetterSetter(sre,"sceneFunc"),Ute.addGetterSetter(sre,"hitFunc"),Ute.addGetterSetter(sre,"dash"),Ute.addGetterSetter(sre,"dashOffset",0,Dte()),Ute.addGetterSetter(sre,"shadowColor",void 0,Bte()),Ute.addGetterSetter(sre,"shadowBlur",0,Dte()),Ute.addGetterSetter(sre,"shadowOpacity",1,Dte()),Ute.addComponentsGetterSetter(sre,"shadowOffset",["x","y"]),Ute.addGetterSetter(sre,"shadowOffsetX",0,Dte()),Ute.addGetterSetter(sre,"shadowOffsetY",0,Dte()),Ute.addGetterSetter(sre,"fillPatternImage"),Ute.addGetterSetter(sre,"fill",void 0,Fte()),Ute.addGetterSetter(sre,"fillPatternX",0,Dte()),Ute.addGetterSetter(sre,"fillPatternY",0,Dte()),Ute.addGetterSetter(sre,"fillLinearGradientColorStops"),Ute.addGetterSetter(sre,"strokeLinearGradientColorStops"),Ute.addGetterSetter(sre,"fillRadialGradientStartRadius",0),Ute.addGetterSetter(sre,"fillRadialGradientEndRadius",0),Ute.addGetterSetter(sre,"fillRadialGradientColorStops"),Ute.addGetterSetter(sre,"fillPatternRepeat","repeat"),Ute.addGetterSetter(sre,"fillEnabled",!0),Ute.addGetterSetter(sre,"strokeEnabled",!0),Ute.addGetterSetter(sre,"shadowEnabled",!0),Ute.addGetterSetter(sre,"dashEnabled",!0),Ute.addGetterSetter(sre,"strokeScaleEnabled",!0),Ute.addGetterSetter(sre,"fillPriority","color"),Ute.addComponentsGetterSetter(sre,"fillPatternOffset",["x","y"]),Ute.addGetterSetter(sre,"fillPatternOffsetX",0,Dte()),Ute.addGetterSetter(sre,"fillPatternOffsetY",0,Dte()),Ute.addComponentsGetterSetter(sre,"fillPatternScale",["x","y"]),Ute.addGetterSetter(sre,"fillPatternScaleX",1,Dte()),Ute.addGetterSetter(sre,"fillPatternScaleY",1,Dte()),Ute.addComponentsGetterSetter(sre,"fillLinearGradientStartPoint",["x","y"]),Ute.addComponentsGetterSetter(sre,"strokeLinearGradientStartPoint",["x","y"]),Ute.addGetterSetter(sre,"fillLinearGradientStartPointX",0),Ute.addGetterSetter(sre,"strokeLinearGradientStartPointX",0),Ute.addGetterSetter(sre,"fillLinearGradientStartPointY",0),Ute.addGetterSetter(sre,"strokeLinearGradientStartPointY",0),Ute.addComponentsGetterSetter(sre,"fillLinearGradientEndPoint",["x","y"]),Ute.addComponentsGetterSetter(sre,"strokeLinearGradientEndPoint",["x","y"]),Ute.addGetterSetter(sre,"fillLinearGradientEndPointX",0),Ute.addGetterSetter(sre,"strokeLinearGradientEndPointX",0),Ute.addGetterSetter(sre,"fillLinearGradientEndPointY",0),Ute.addGetterSetter(sre,"strokeLinearGradientEndPointY",0),Ute.addComponentsGetterSetter(sre,"fillRadialGradientStartPoint",["x","y"]),Ute.addGetterSetter(sre,"fillRadialGradientStartPointX",0),Ute.addGetterSetter(sre,"fillRadialGradientStartPointY",0),Ute.addComponentsGetterSetter(sre,"fillRadialGradientEndPoint",["x","y"]),Ute.addGetterSetter(sre,"fillRadialGradientEndPointX",0),Ute.addGetterSetter(sre,"fillRadialGradientEndPointY",0),Ute.addGetterSetter(sre,"fillPatternRotation",0),Ute.backCompat(sre,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var lre=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],ure=lre.length,cre=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).canvas=new Qte,r.hitCanvas=new Jte({pixelRatio:1}),r._waitingForDraw=!1,r.on("visibleChange.konva",r._checkVisibility),r._checkVisibility(),r.on("imageSmoothingEnabledChange.konva",r._setSmoothEnabled),r._setSmoothEnabled(),r}return on(n,[{key:"createPNGStream",value:function(){return this.canvas._canvas.createPNGStream()}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getNativeCanvasElement",value:function(){return this.canvas._canvas}},{key:"getHitCanvas",value:function(){return this.hitCanvas}},{key:"getContext",value:function(){return this.getCanvas().getContext()}},{key:"clear",value:function(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}},{key:"setZIndex",value:function(e){Yt(nn(n.prototype),"setZIndex",this).call(this,e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e0?{antialiased:!0}:{}}},{key:"drawScene",value:function(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),yne.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}},{key:"drawHit",value:function(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),yne.prototype.drawHit.call(this,r,t),this}},{key:"enableHitGraph",value:function(){return this.hitGraphEnabled(!0),this}},{key:"disableHitGraph",value:function(){return this.hitGraphEnabled(!1),this}},{key:"setHitGraphEnabled",value:function(e){Ite.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}},{key:"getHitGraphEnabled",value:function(e){return Ite.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}},{key:"toggleHitCanvas",value:function(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}},{key:"destroy",value:function(){return Ite.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),Yt(nn(n.prototype),"destroy",this).call(this)}}]),n}(yne);cre.prototype.nodeType="Layer",Cte(cre),Ute.addGetterSetter(cre,"imageSmoothingEnabled",!0),Ute.addGetterSetter(cre,"clearBeforeDraw",!0),Ute.addGetterSetter(cre,"hitGraphEnabled",!0,Hte());var dre=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).listening(!1),Ite.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.'),r}return on(n)}(cre);dre.prototype.nodeType="FastLayer",Cte(dre);var fre=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_validateAdd",value:function(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&Ite.throw("You may only add groups and shapes to groups.")}}]),n}(yne);fre.prototype.nodeType="Group",Cte(fre);var hre=xte.performance&&xte.performance.now?function(){return xte.performance.now()}:function(){return(new Date).getTime()},pre=function(){function e(t,n){an(this,e),this.id=e.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:hre(),frameRate:0},this.func=t,this.setLayers(n)}return on(e,[{key:"setLayers",value:function(e){var t=[];return t=e?e.length>0?e:[e]:[],this.layers=t,this}},{key:"getLayers",value:function(){return this.layers}},{key:"addLayer",value:function(e){var t,n=this.layers,r=n.length;for(t=0;tthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}},{key:"getTime",value:function(){return this._time}},{key:"setPosition",value:function(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}},{key:"getPosition",value:function(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}},{key:"play",value:function(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}},{key:"reverse",value:function(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}},{key:"seek",value:function(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}},{key:"reset",value:function(){this.pause(),this._time=0,this.update(),this.fire("onReset")}},{key:"finish",value:function(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}},{key:"update",value:function(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}},{key:"onEnterFrame",value:function(){var e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}},{key:"pause",value:function(){this.state=1,this.fire("onPause")}},{key:"getTimer",value:function(){return(new Date).getTime()}}]),e}(),bre=function(){function e(t){an(this,e);var n,r,o=this,i=t.node,a=i._id,s=t.easing||wre.Linear,l=!!t.yoyo;n=void 0===t.duration?.3:0===t.duration?.001:t.duration,this.node=i,this._id=gre++;var u=i.getLayer()||(i instanceof Ste.Stage?i.getLayers():null);for(r in u||Ite.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new pre((function(){o.tween.onEnterFrame()}),u),this.tween=new yre(r,(function(e){o._tweenFunc(e)}),s,0,1,1e3*n,l),this._addListeners(),e.attrs[a]||(e.attrs[a]={}),e.attrs[a][this._id]||(e.attrs[a][this._id]={}),e.tweens[a]||(e.tweens[a]={}),t)void 0===vre[r]&&this._addAttr(r,t[r]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}return on(e,[{key:"_addAttr",value:function(t,n){var r,o,i,a,s,l,u,c,d=this.node,f=d._id;if((i=e.tweens[f][t])&&delete e.attrs[f][i][t],r=d.getAttr(t),Ite._isArray(n))if(o=[],s=Math.max(n.length,r.length),"points"===t&&n.length!==r.length&&(n.length>r.length?(u=r,r=Ite._prepareArrayForTween(r,n,d.closed())):(l=n,n=Ite._prepareArrayForTween(n,r,d.closed()))),0===t.indexOf("fill"))for(a=0;a0?e:t),l=i*(i>0?e:t),u=a*(a>0?t:e);return{x:s,y:n?-1*u:l,width:1*t-s,height:u-l}}}]),n}(sre);function Sre(e,t,n,r,o,i,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2)),u=a*s/(s+l),c=a*l/(s+l);return[n-u*(o-e),r-u*(i-t),n+c*(o-e),r+c*(i-t)]}function Cre(e,t){var n,r,o=e.length,i=[];for(n=2;n4){for(n=(t=this.getTensionPoints()).length,r=s?0:4,s||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);ru?l:u,v=l>u?1:l/u,g=l>u?u/l:1;e.translate(a,s),e.rotate(f),e.scale(v,g),e.arc(0,0,p,c,c+d,1-h),e.scale(1/v,1/g),e.rotate(-f),e.translate(-a,-s);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}},{key:"getSelfRect",value:function(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var r=t.points[4],o=t.points[5],i=t.points[4]+o,a=Math.PI/180;if(Math.abs(r-i)i;s-=a){var l=n.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],s,0);e.push(l.x,l.y)}else for(var u=r+a;uthis.dataArray[r].pathLength;)e-=this.dataArray[r].pathLength,++r;if(r===o)return{x:(t=this.dataArray[r-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[r].points.slice(0,2))[0],y:t[1]};var i=this.dataArray[r],a=i.points;switch(i.command){case"L":return n.getPointOnLine(e,i.start.x,i.start.y,a[0],a[1]);case"C":return n.getPointOnCubicBezier(e/i.pathLength,i.start.x,i.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return n.getPointOnQuadraticBezier(e/i.pathLength,i.start.x,i.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],c=a[3],d=a[4],f=a[5],h=a[6];return d+=f*e/i.pathLength,n.getPointOnEllipticalArc(s,l,u,c,d,h)}return null}}],[{key:"getLineLength",value:function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}},{key:"getPointOnLine",value:function(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var s=(o-n)/(r-t+1e-8),l=Math.sqrt(e*e/(1+s*s));r0&&!isNaN(h[0]);){var m,y,b,w,k,x,S,C,_,E,P=null,L=[],O=l,A=u;switch(f){case"l":l+=h.shift(),u+=h.shift(),P="L",L.push(l,u);break;case"L":l=h.shift(),u=h.shift(),L.push(l,u);break;case"m":var M=h.shift(),T=h.shift();if(l+=M,u+=T,P="M",a.length>2&&"z"===a[a.length-1].command)for(var I=a.length-2;I>=0;I--)if("M"===a[I].command){l=a[I].points[0]+M,u=a[I].points[1]+T;break}L.push(l,u),f="l";break;case"M":l=h.shift(),u=h.shift(),P="M",L.push(l,u),f="L";break;case"h":l+=h.shift(),P="L",L.push(l,u);break;case"H":l=h.shift(),P="L",L.push(l,u);break;case"v":u+=h.shift(),P="L",L.push(l,u);break;case"V":u=h.shift(),P="L",L.push(l,u);break;case"C":L.push(h.shift(),h.shift(),h.shift(),h.shift()),l=h.shift(),u=h.shift(),L.push(l,u);break;case"c":L.push(l+h.shift(),u+h.shift(),l+h.shift(),u+h.shift()),l+=h.shift(),u+=h.shift(),P="C",L.push(l,u);break;case"S":y=l,b=u,"C"===(m=a[a.length-1]).command&&(y=l+(l-m.points[2]),b=u+(u-m.points[3])),L.push(y,b,h.shift(),h.shift()),l=h.shift(),u=h.shift(),P="C",L.push(l,u);break;case"s":y=l,b=u,"C"===(m=a[a.length-1]).command&&(y=l+(l-m.points[2]),b=u+(u-m.points[3])),L.push(y,b,l+h.shift(),u+h.shift()),l+=h.shift(),u+=h.shift(),P="C",L.push(l,u);break;case"Q":L.push(h.shift(),h.shift()),l=h.shift(),u=h.shift(),L.push(l,u);break;case"q":L.push(l+h.shift(),u+h.shift()),l+=h.shift(),u+=h.shift(),P="Q",L.push(l,u);break;case"T":y=l,b=u,"Q"===(m=a[a.length-1]).command&&(y=l+(l-m.points[0]),b=u+(u-m.points[1])),l=h.shift(),u=h.shift(),P="Q",L.push(y,b,l,u);break;case"t":y=l,b=u,"Q"===(m=a[a.length-1]).command&&(y=l+(l-m.points[0]),b=u+(u-m.points[1])),l+=h.shift(),u+=h.shift(),P="Q",L.push(y,b,l,u);break;case"A":w=h.shift(),k=h.shift(),x=h.shift(),S=h.shift(),C=h.shift(),_=l,E=u,l=h.shift(),u=h.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,u,S,C,w,k,x);break;case"a":w=h.shift(),k=h.shift(),x=h.shift(),S=h.shift(),C=h.shift(),_=l,E=u,l+=h.shift(),u+=h.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,u,S,C,w,k,x)}a.push({command:P||f,points:L,start:{x:O,y:A},pathLength:this.calcLength(O,A,P||f,L)})}"z"!==f&&"Z"!==f||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}},{key:"calcLength",value:function(e,t,r,o){var i,a,s,l,u=n;switch(r){case"L":return u.getLineLength(e,t,o[0],o[1]);case"C":for(i=0,a=u.getPointOnCubicBezier(0,e,t,o[0],o[1],o[2],o[3],o[4],o[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,e,t,o[0],o[1],o[2],o[3],o[4],o[5]),i+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case"Q":for(i=0,a=u.getPointOnQuadraticBezier(0,e,t,o[0],o[1],o[2],o[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,e,t,o[0],o[1],o[2],o[3]),i+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case"A":i=0;var c=o[4],d=o[5],f=o[4]+d,h=Math.PI/180;if(Math.abs(c-f)f;l-=h)s=u.getPointOnEllipticalArc(o[0],o[1],o[2],o[3],l,0),i+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=c+h;l1&&(a*=Math.sqrt(f),s*=Math.sqrt(f));var h=Math.sqrt((a*a*(s*s)-a*a*(d*d)-s*s*(c*c))/(a*a*(d*d)+s*s*(c*c)));o===i&&(h*=-1),isNaN(h)&&(h=0);var p=h*a*d/s,v=h*-s*c/a,g=(e+n)/2+Math.cos(u)*p-Math.sin(u)*v,m=(t+r)/2+Math.sin(u)*p+Math.cos(u)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(C=0),0===i&&C>0&&(C-=2*Math.PI),1===i&&C<0&&(C+=2*Math.PI),[g,m,a,s,k,C,u,i]}}]),n}(sre);Ere.prototype.className="Path",Ere.prototype._attrsAffectingSize=["data"],Cte(Ere),Ute.addGetterSetter(Ere,"data");var Pre=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_sceneFunc",value:function(e){Yt(nn(n.prototype),"_sceneFunc",this).call(this,e);var t=2*Math.PI,r=this.points(),o=r,i=0!==this.tension()&&r.length>4;i&&(o=this.getTensionPoints());var a,s,l=this.pointerLength(),u=r.length;if(i){var c=[o[o.length-4],o[o.length-3],o[o.length-2],o[o.length-1],r[u-2],r[u-1]],d=Ere.calcLength(o[o.length-4],o[o.length-3],"C",c),f=Ere.getPointOnQuadraticBezier(Math.min(1,1-l/d),c[0],c[1],c[2],c[3],c[4],c[5]);a=r[u-2]-f.x,s=r[u-1]-f.y}else a=r[u-2]-r[u-4],s=r[u-1]-r[u-3];var h=(Math.atan2(s,a)+t)%t,p=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[u-2],r[u-1]),e.rotate(h),e.moveTo(0,0),e.lineTo(-l,p/2),e.lineTo(-l,-p/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),i?(a=(o[0]+o[2])/2-r[0],s=(o[1]+o[3])/2-r[1]):(a=r[2]-r[0],s=r[3]-r[1]),e.rotate((Math.atan2(-s,-a)+t)%t),e.moveTo(0,0),e.lineTo(-l,p/2),e.lineTo(-l,-p/2),e.closePath(),e.restore(),this.__fillStroke(e))}},{key:"__fillStroke",value:function(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}},{key:"getSelfRect",value:function(){var e=Yt(nn(n.prototype),"getSelfRect",this).call(this),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}]),n}(_re);Pre.prototype.className="Arrow",Cte(Pre),Ute.addGetterSetter(Pre,"pointerLength",10,Dte()),Ute.addGetterSetter(Pre,"pointerWidth",10,Dte()),Ute.addGetterSetter(Pre,"pointerAtBeginning",!1),Ute.addGetterSetter(Pre,"pointerAtEnding",!0);var Lre=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_sceneFunc",value:function(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){return 2*this.radius()}},{key:"getHeight",value:function(){return 2*this.radius()}},{key:"setWidth",value:function(e){this.radius()!==e/2&&this.radius(e/2)}},{key:"setHeight",value:function(e){this.radius()!==e/2&&this.radius(e/2)}}]),n}(sre);Lre.prototype._centroid=!0,Lre.prototype.className="Circle",Lre.prototype._attrsAffectingSize=["radius"],Cte(Lre),Ute.addGetterSetter(Lre,"radius",0,Dte());var Ore=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_sceneFunc",value:function(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){return 2*this.radiusX()}},{key:"getHeight",value:function(){return 2*this.radiusY()}},{key:"setWidth",value:function(e){this.radiusX(e/2)}},{key:"setHeight",value:function(e){this.radiusY(e/2)}}]),n}(sre);Ore.prototype.className="Ellipse",Ore.prototype._centroid=!0,Ore.prototype._attrsAffectingSize=["radiusX","radiusY"],Cte(Ore),Ute.addComponentsGetterSetter(Ore,"radius",["x","y"]),Ute.addGetterSetter(Ore,"radiusX",0,Dte()),Ute.addGetterSetter(Ore,"radiusY",0,Dte());var Are=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).on("imageChange.konva",(function(){r._setImageLoad()})),r._setImageLoad(),r}return on(n,[{key:"_setImageLoad",value:function(){var e=this,t=this.image();t&&t.complete||t&&4===t.readyState||t&&t.addEventListener&&t.addEventListener("load",(function(){e._requestDraw()}))}},{key:"_useBufferCanvas",value:function(){return Yt(nn(n.prototype),"_useBufferCanvas",this).call(this,!0)}},{key:"_sceneFunc",value:function(e){var t,n=this.getWidth(),r=this.getHeight(),o=this.attrs.image;if(o){var i=this.attrs.cropWidth,a=this.attrs.cropHeight;t=i&&a?[o,this.cropX(),this.cropY(),i,a,0,0,n,r]:[o,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),o&&e.drawImage.apply(e,t)}},{key:"_hitFunc",value:function(e){var t=this.width(),n=this.height();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}},{key:"getHeight",value:function(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}}],[{key:"fromURL",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=Ite.createImageElement();o.onload=function(){var e=new n({image:o});t(e)},o.onerror=r,o.crossOrigin="Anonymous",o.src=e}}]),n}(sre);Are.prototype.className="Image",Cte(Are),Ute.addGetterSetter(Are,"image"),Ute.addComponentsGetterSetter(Are,"crop",["x","y","width","height"]),Ute.addGetterSetter(Are,"cropX",0,Dte()),Ute.addGetterSetter(Are,"cropY",0,Dte()),Ute.addGetterSetter(Are,"cropWidth",0,Dte()),Ute.addGetterSetter(Are,"cropHeight",0,Dte());var Mre=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Tre="up",Ire="right",Rre="down",Nre="left",Dre=Mre.length,zre=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).on("add.konva",(function(e){this._addListeners(e.child),this._sync()})),r}return on(n,[{key:"getText",value:function(){return this.find("Text")[0]}},{key:"getTag",value:function(){return this.find("Tag")[0]}},{key:"_addListeners",value:function(e){var t,n=this,r=function(){n._sync()};for(t=0;t1&&(g+=a)}}}},{key:"_hitFunc",value:function(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}},{key:"setText",value:function(e){var t=Ite._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}},{key:"getWidth",value:function(){return this.attrs.width===Yre||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}},{key:"getHeight",value:function(){return this.attrs.height===Yre||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}},{key:"getTextWidth",value:function(){return this.textWidth}},{key:"getTextHeight",value:function(){return Ite.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}},{key:"measureSize",value:function(e){var t,n=noe(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}},{key:"_getContextFont",value:function(){return this.fontStyle()+Qre+this.fontVariant()+Qre+(this.fontSize()+"px ")+this.fontFamily().split(",").map((function(e){var t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e='"'.concat(e,'"')),e})).join(", ")}},{key:"_addTextLine",value:function(e){this.align()===Zre&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}},{key:"_getTextWidth",value:function(e){var t=this.letterSpacing(),n=e.length;return noe().measureText(e).width+(n?t*(n-1):0)}},{key:"_setTextData",value:function(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==Yre&&void 0!==o,s=i!==Yre&&void 0!==i,l=this.padding(),u=o-2*l,c=i-2*l,d=0,f=this.wrap(),h="char"!==f&&f!==Jre,p=this.ellipsis();this.textArr=[],noe().font=this._getContextFont();for(var v=p?this._getTextWidth("…"):0,g=0,m=e.length;gu)for(;y.length>0;){for(var w=0,k=y.length,x="",S=0;w>>1,_=y.slice(0,C+1),E=this._getTextWidth(_)+v;E<=u?(w=C+1,x=_,S=E):k=C}if(!x)break;if(h){var P,L=y[x.length];(P=(L===Qre||"-"===L)&&S<=u?x.length:Math.max(x.lastIndexOf(Qre),x.lastIndexOf("-"))+1)>0&&(w=P,x=x.slice(0,w),S=this._getTextWidth(x))}if(x=x.trimRight(),this._addTextLine(x),n=Math.max(n,S),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((y=(y=y.slice(w)).trimLeft()).length>0&&(b=this._getTextWidth(y))<=u){this._addTextLine(y),d+=r,n=Math.max(n,b);break}}else this._addTextLine(y),d+=r,n=Math.max(n,b),this._shouldHandleEllipsis(d)&&gc)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=t,this.textWidth=n}},{key:"_shouldHandleEllipsis",value:function(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,o=r!==Yre&&void 0!==r,i=r-2*this.padding();return!(this.wrap()!==Jre)||o&&e+n>i}},{key:"_tryToAddEllipsisToLastLine",value:function(){var e=this.attrs.width,t=e!==Yre&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(o&&r){if(t)this._getTextWidth(o.text+"…")=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[s].pathLength);var l=0;"center"===r&&(l=Math.max(0,a/2-i/2)),"right"===r&&(l=Math.max(0,a-i));for(var u,c,d,f=Gre(this.text()),h=this.text().split(" ").length-1,p=-1,v=0,g=function(){v=0;for(var t=e.dataArray,n=p+1;n0)return p=n,t[n];"M"===t[n].command&&(u={x:t[n].points[0],y:t[n].points[1]})}return{}},m=function(t){var o=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(o+=(a-i)/h);var s=0,l=0;for(c=void 0;Math.abs(o-s)/o>.01&&l<20;){l++;for(var f=s;void 0===d;)(d=g())&&f+d.pathLengtho?c=Ere.getPointOnLine(o,u.x,u.y,d.points[0],d.points[1],u.x,u.y):d=void 0;break;case"A":var m=d.points[4],y=d.points[5],b=d.points[4]+y;0===v?v=m+1e-8:o>s?v+=Math.PI/180*y/Math.abs(y):v-=Math.PI/360*y/Math.abs(y),(y<0&&v=0&&v>b)&&(v=b,p=!0),c=Ere.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],v,d.points[6]);break;case"C":0===v?v=o>d.pathLength?1e-8:o/d.pathLength:o>s?v+=(o-s)/d.pathLength/2:v=Math.max(v-(s-o)/d.pathLength/2,0),v>1&&(v=1,p=!0),c=Ere.getPointOnCubicBezier(v,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);break;case"Q":0===v?v=o/d.pathLength:o>s?v+=(o-s)/d.pathLength:v-=(s-o)/d.pathLength,v>1&&(v=1,p=!0),c=Ere.getPointOnQuadraticBezier(v,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3])}void 0!==c&&(s=Ere.getLineLength(u.x,u.y,c.x,c.y)),p&&(p=!1,d=void 0)}},y=l/(e._getTextSize("C").width+n)-1,b=0;b0&&void 0!==arguments[0]?arguments[0]:[];this._nodes&&this._nodes.length&&this.detach(),this._nodes=t,1===t.length&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((function(t){var n=function(){1===e.nodes().length&&e.useSingleNodeRotation()&&e.rotation(e.nodes()[0].getAbsoluteRotation()),e._resetTransformCache(),e._transforming||e.isDragging()||e.update()},r=t._attrsAffectingSize.map((function(t){return t+"Change."+e._getEventNamespace()})).join(" ");t.on(r,n),t.on(doe.map((function(t){return t+".".concat(e._getEventNamespace())})).join(" "),n),t.on("absoluteTransformChange.".concat(e._getEventNamespace()),n),e._proxyDrag(t)})),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}},{key:"_proxyDrag",value:function(e){var t,n=this;e.on("dragstart.".concat(this._getEventNamespace()),(function(r){t=e.getAbsolutePosition(),n.isDragging()||e===n.findOne(".back")||n.startDrag(r,!1)})),e.on("dragmove.".concat(this._getEventNamespace()),(function(r){if(t){var o=e.getAbsolutePosition(),i=o.x-t.x,a=o.y-t.y;n.nodes().forEach((function(t){if(t!==e&&!t.isDragging()){var n=t.getAbsolutePosition();t.setAbsolutePosition({x:n.x+i,y:n.y+a}),t.startDrag(r)}})),t=null}}))}},{key:"getNodes",value:function(){return this._nodes||[]}},{key:"getActiveAnchor",value:function(){return this._movingAnchorName}},{key:"detach",value:function(){var e=this;this._nodes&&this._nodes.forEach((function(t){t.off("."+e._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}},{key:"_resetTransformCache",value:function(){this._clearCache(coe),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}},{key:"_getNodeRect",value:function(){return this._getCache(coe,this.__getNodeRect)}},{key:"__getNodeShape",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rotation(),n=arguments.length>2?arguments[2]:void 0,r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),a=r.x*o.x-e.offsetX()*o.x,s=r.y*o.y-e.offsetY()*o.y,l=(Ste.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI),u={x:i.x+a*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+a*Math.sin(l),width:r.width*o.x,height:r.height*o.y,rotation:l};return voe(u,-Ste.getAngle(t),{x:0,y:0})}},{key:"__getNodeRect",value:function(){var e=this;if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};var t=[];this.nodes().map((function(n){var r=n.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:e.ignoreStroke()}),o=[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}],i=n.getAbsoluteTransform();o.forEach((function(e){var n=i.point(e);t.push(n)}))}));var n,r,o,i,a=new _te;a.rotate(-Ste.getAngle(this.rotation())),t.forEach((function(e){var t=a.point(e);void 0===n&&(n=o=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),i=Math.max(i,t.y)})),a.invert();var s=a.point({x:n,y:r});return{x:s.x,y:s.y,width:o-n,height:i-r,rotation:Ste.getAngle(this.rotation())}}},{key:"getX",value:function(){return this._getNodeRect().x}},{key:"getY",value:function(){return this._getNodeRect().y}},{key:"getWidth",value:function(){return this._getNodeRect().width}},{key:"getHeight",value:function(){return this._getNodeRect().height}},{key:"_createElements",value:function(){this._createBack(),poe.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}},{key:"_createAnchor",value:function(e){var t=this,n=new Bre({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:hoe?10:"auto"}),r=this;n.on("mousedown touchstart",(function(e){r._handleMouseDown(e)})),n.on("dragstart",(function(e){n.stopDrag(),e.cancelBubble=!0})),n.on("dragend",(function(e){e.cancelBubble=!0})),n.on("mouseenter",(function(){var r=Ste.getAngle(t.rotation()),o=function(e,t){if("rotater"===e)return"crosshair";t+=Ite.degToRad(foe[e]||0);var n=(Ite.radToDeg(t)%360+360)%360;return Ite._inRange(n,337.5,360)||Ite._inRange(n,0,22.5)?"ns-resize":Ite._inRange(n,22.5,67.5)?"nesw-resize":Ite._inRange(n,67.5,112.5)?"ew-resize":Ite._inRange(n,112.5,157.5)?"nwse-resize":Ite._inRange(n,157.5,202.5)?"ns-resize":Ite._inRange(n,202.5,247.5)?"nesw-resize":Ite._inRange(n,247.5,292.5)?"ew-resize":Ite._inRange(n,292.5,337.5)?"nwse-resize":(Ite.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,r);n.getStage().content&&(n.getStage().content.style.cursor=o),t._cursorChange=!0})),n.on("mouseout",(function(){n.getStage().content&&(n.getStage().content.style.cursor=""),t._cursorChange=!1})),this.add(n)}},{key:"_createBack",value:function(){var e=this,t=new sre({name:"back",width:0,height:0,draggable:!0,sceneFunc:function(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*Ite._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:function(t,n){if(e.shouldOverdrawWholeArea()){var r=e.padding();t.beginPath(),t.rect(-r,-r,n.width()+2*r,n.height()+2*r),t.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",(function(e){e.cancelBubble=!0})),t.on("dragmove",(function(e){e.cancelBubble=!0})),t.on("dragend",(function(e){e.cancelBubble=!0})),this.on("dragmove",(function(t){e.update()}))}},{key:"_handleMouseDown",value:function(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,o=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/o),this.cos=Math.abs(n/o),"undefined"!=typeof window&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var i=e.target.getAbsolutePosition(),a=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-i.x,y:a.y-i.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((function(t){t._fire("transformstart",{evt:e.evt,target:t})}))}},{key:"_handleMouseMove",value:function(e){var t,n,r,o=this.findOne("."+this._movingAnchorName),i=o.getStage();i.setPointersPositions(e);var a=i.getPointerPosition(),s={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y},l=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,e)),o.setAbsolutePosition(s);var u=o.getAbsolutePosition();if(l.x!==u.x||l.y!==u.y)if("rotater"!==this._movingAnchorName){var c=this.keepRatio()||e.shiftKey,d=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(c){var f=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(f.x-o.x(),2)+Math.pow(f.y-o.y(),2));var h=this.findOne(".top-left").x()>f.x?-1:1,p=this.findOne(".top-left").y()>f.y?-1:1;t=r*this.cos*h,n=r*this.sin*p,this.findOne(".top-left").x(f.x-t),this.findOne(".top-left").y(f.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(o.y());else if("top-right"===this._movingAnchorName){if(c){f=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(o.x()-f.x,2)+Math.pow(f.y-o.y(),2));h=this.findOne(".top-right").x()f.y?-1:1;t=r*this.cos*h,n=r*this.sin*p,this.findOne(".top-right").x(f.x+t),this.findOne(".top-right").y(f.y-n)}var v=o.position();this.findOne(".top-left").y(v.y),this.findOne(".bottom-right").x(v.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(o.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(o.x());else if("bottom-left"===this._movingAnchorName){if(c){f=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(f.x-o.x(),2)+Math.pow(o.y()-f.y,2));h=f.x=0){var a=i.point({x:2*-this.padding(),y:0});if(e.x+=a.x,e.y+=a.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=a.x,this._anchorDragOffset.y-=a.y,!o)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){var s=i.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=s.x,this._anchorDragOffset.y-=s.y,e.width+=2*this.padding(),!o)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){var l=i.point({x:0,y:2*-this.padding()});if(e.x+=l.x,e.y+=l.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=l.x,this._anchorDragOffset.y-=l.y,e.height+=2*this.padding(),!o)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){var u=i.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y,e.height+=2*this.padding(),!o)return void this.update()}if(this.boundBoxFunc()){var c=this.boundBoxFunc()(r,e);c?e=c:Ite.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}var d=1e7,f=new _te;f.translate(r.x,r.y),f.rotate(r.rotation),f.scale(r.width/d,r.height/d);var h=new _te;h.translate(e.x,e.y),h.rotate(e.rotation),h.scale(e.width/d,e.height/d);var p=h.multiply(f.invert());this._nodes.forEach((function(e){var r,o=e.getParent().getAbsoluteTransform(),i=e.getTransform().copy();i.translate(e.offsetX(),e.offsetY());var a=new _te;a.multiply(o.copy().invert()).multiply(p).multiply(o).multiply(i);var s=a.decompose();e.setAttrs(s),n._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(r=e.getLayer())||void 0===r||r.batchDraw()})),this.rotation(Ite._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}}},{key:"forceUpdate",value:function(){this._resetTransformCache(),this.update()}},{key:"_batchChangeChild",value:function(e,t){this.findOne(e).setAttrs(t)}},{key:"update",value:function(){var e,t=this,n=this._getNodeRect();this.rotation(Ite._getRotation(n.rotation));var r=n.width,o=n.height,i=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach((function(e){e.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:t.anchorStroke(),strokeWidth:t.anchorStrokeWidth(),fill:t.anchorFill(),cornerRadius:t.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&i.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&i.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&i.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:o/2,offsetX:l/2+s,visible:a&&i.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:o/2,offsetX:l/2-s,visible:a&&i.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:o,offsetX:l/2+s,offsetY:l/2-s,visible:a&&i.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:o,offsetY:l/2-s,visible:a&&i.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:o,offsetX:l/2-s,offsetY:l/2-s,visible:a&&i.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*Ite._sign(o)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:o,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}},{key:"isTransforming",value:function(){return this._transforming}},{key:"stopTransform",value:function(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}},{key:"destroy",value:function(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),fre.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}},{key:"toObject",value:function(){return gne.prototype.toObject.call(this)}},{key:"getClientRect",value:function(){return this.nodes().length>0?Yt(nn(n.prototype),"getClientRect",this).call(this):{x:0,y:0,width:0,height:0}}}]),n}(fre);moe.prototype.className="Transformer",Cte(moe),Ute.addGetterSetter(moe,"enabledAnchors",poe,(function(e){return e instanceof Array||Ite.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===poe.indexOf(e)&&Ite.warn("Unknown anchor name: "+e+". Available names are: "+poe.join(", "))})),e||[]})),Ute.addGetterSetter(moe,"flipEnabled",!0,Hte()),Ute.addGetterSetter(moe,"resizeEnabled",!0),Ute.addGetterSetter(moe,"anchorSize",10,Dte()),Ute.addGetterSetter(moe,"rotateEnabled",!0),Ute.addGetterSetter(moe,"rotationSnaps",[]),Ute.addGetterSetter(moe,"rotateAnchorOffset",50,Dte()),Ute.addGetterSetter(moe,"rotationSnapTolerance",5,Dte()),Ute.addGetterSetter(moe,"borderEnabled",!0),Ute.addGetterSetter(moe,"anchorStroke","rgb(0, 161, 255)"),Ute.addGetterSetter(moe,"anchorStrokeWidth",1,Dte()),Ute.addGetterSetter(moe,"anchorFill","white"),Ute.addGetterSetter(moe,"anchorCornerRadius",0,Dte()),Ute.addGetterSetter(moe,"borderStroke","rgb(0, 161, 255)"),Ute.addGetterSetter(moe,"borderStrokeWidth",1,Dte()),Ute.addGetterSetter(moe,"borderDash"),Ute.addGetterSetter(moe,"keepRatio",!0),Ute.addGetterSetter(moe,"centeredScaling",!1),Ute.addGetterSetter(moe,"ignoreStroke",!1),Ute.addGetterSetter(moe,"padding",0,Dte()),Ute.addGetterSetter(moe,"node"),Ute.addGetterSetter(moe,"nodes"),Ute.addGetterSetter(moe,"boundBoxFunc"),Ute.addGetterSetter(moe,"anchorDragBoundFunc"),Ute.addGetterSetter(moe,"shouldOverdrawWholeArea",!1),Ute.addGetterSetter(moe,"useSingleNodeRotation",!0),Ute.backCompat(moe,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var yoe=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_sceneFunc",value:function(e){e.beginPath(),e.arc(0,0,this.radius(),0,Ste.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){return 2*this.radius()}},{key:"getHeight",value:function(){return 2*this.radius()}},{key:"setWidth",value:function(e){this.radius(e/2)}},{key:"setHeight",value:function(e){this.radius(e/2)}}]),n}(sre);function boe(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}yoe.prototype.className="Wedge",yoe.prototype._centroid=!0,yoe.prototype._attrsAffectingSize=["radius"],Cte(yoe),Ute.addGetterSetter(yoe,"radius",0,Dte()),Ute.addGetterSetter(yoe,"angle",0,Dte()),Ute.addGetterSetter(yoe,"clockwise",!1),Ute.backCompat(yoe,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var woe=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],koe=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];Ute.addGetterSetter(gne,"blurRadius",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"brightness",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"contrast",0,Dte(),Ute.afterSetFilter);function xoe(e,t,n,r,o){var i=n-t,a=o-r;return 0===i?r+a/2:0===a?r:a*((e-t)/i)+r}Ute.addGetterSetter(gne,"embossStrength",.5,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"embossWhiteLevel",.5,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"embossDirection","top-left",null,Ute.afterSetFilter),Ute.addGetterSetter(gne,"embossBlend",!1,null,Ute.afterSetFilter);Ute.addGetterSetter(gne,"enhance",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"hue",0,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"saturation",0,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"luminance",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"hue",0,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"saturation",0,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"value",0,Dte(),Ute.afterSetFilter);function Soe(e,t,n){var r=4*(n*e.width+t),o=[];return o.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),o}function Coe(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}Ute.addGetterSetter(gne,"kaleidoscopePower",2,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"kaleidoscopeAngle",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"threshold",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"noise",.2,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"pixelSize",8,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"levels",.5,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),Ute.addGetterSetter(gne,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),Ute.addGetterSetter(gne,"blue",0,Nte,Ute.afterSetFilter);Ute.addGetterSetter(gne,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),Ute.addGetterSetter(gne,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),Ute.addGetterSetter(gne,"blue",0,Nte,Ute.afterSetFilter),Ute.addGetterSetter(gne,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}));Ute.addGetterSetter(gne,"threshold",.5,Dte(),Ute.afterSetFilter);var _oe=kre.Util._assign(kre,{Arc:xre,Arrow:Pre,Circle:Lre,Ellipse:Ore,Image:Are,Label:zre,Tag:jre,Line:_re,Path:Ere,Rect:Bre,RegularPolygon:Fre,Ring:Vre,Sprite:Wre,Star:Ure,Text:roe,TextPath:soe,Transformer:moe,Wedge:yoe,Filters:{Blur:function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S,C,_,E=e.data,P=e.width,L=e.height,O=t+t+1,A=P-1,M=L-1,T=t+1,I=T*(T+1)/2,R=new boe,N=null,D=R,z=null,j=null,B=woe[t],F=koe[t];for(o=1;o>F,0!==C?(C=255/C,E[s]=(u*B>>F)*C,E[s+1]=(c*B>>F)*C,E[s+2]=(d*B>>F)*C):E[s]=E[s+1]=E[s+2]=0,u-=h,c-=p,d-=v,f-=g,h-=z.r,p-=z.g,v-=z.b,g-=z.a,i=l+((i=n+t+1)>F,C>0?(C=255/C,E[i]=(u*B>>F)*C,E[i+1]=(c*B>>F)*C,E[i+2]=(d*B>>F)*C):E[i]=E[i+1]=E[i+2]=0,u-=h,c-=p,d-=v,f-=g,h-=z.r,p-=z.g,v-=z.b,g-=z.a,i=n+((i=r+T)255?255:i,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r[t]=i,r[t+1]=a,r[t+2]=s},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),o=this.embossBlend(),i=0,a=0,s=e.data,l=e.width,u=e.height,c=4*l,d=u;switch(r){case"top-left":i=-1,a=-1;break;case"top":i=-1,a=0;break;case"top-right":i=-1,a=1;break;case"right":i=0,a=1;break;case"bottom-right":i=1,a=1;break;case"bottom":i=1,a=0;break;case"bottom-left":i=1,a=-1;break;case"left":i=0,a=-1;break;default:Ite.error("Unknown emboss direction: "+r)}do{var f=(d-1)*c,h=i;d+h<1&&(h=0),d+h>u&&(h=0);var p=(d-1+h)*l*4,v=l;do{var g=f+4*(v-1),m=a;v+m<1&&(m=0),v+m>l&&(m=0);var y=p+4*(v-1+m),b=s[g]-s[y],w=s[g+1]-s[y+1],k=s[g+2]-s[y+2],x=b,S=x>0?x:-x;if((w>0?w:-w)>S&&(x=w),(k>0?k:-k)>S&&(x=k),x*=t,o){var C=s[g]+x,_=s[g+1]+x,E=s[g+2]+x;s[g]=C>255?255:C<0?0:C,s[g+1]=_>255?255:_<0?0:_,s[g+2]=E>255?255:E<0?0:E}else{var P=n-x;P<0?P=0:P>255&&(P=255),s[g]=s[g+1]=s[g+2]=P}}while(--v)}while(--d)},Enhance:function(e){var t,n,r,o,i=e.data,a=i.length,s=i[0],l=s,u=i[1],c=u,d=i[2],f=d,h=this.enhance();if(0!==h){for(o=0;ol&&(l=t),(n=i[o+1])c&&(c=n),(r=i[o+2])f&&(f=r);var p,v,g,m,y,b,w,k,x;for(l===s&&(l=255,s=0),c===u&&(c=255,u=0),f===d&&(f=255,d=0),h>0?(v=l+h*(255-l),g=s-h*(s-0),y=c+h*(255-c),b=u-h*(u-0),k=f+h*(255-f),x=d-h*(d-0)):(v=l+h*(l-(p=.5*(l+s))),g=s+h*(s-p),y=c+h*(c-(m=.5*(c+u))),b=u+h*(u-m),k=f+h*(f-(w=.5*(f+d))),x=d+h*(d-w)),o=0;om?a:m;var y,b,w,k,x=c,S=u,C=360/S*Math.PI/180;for(b=0;bc&&(b=y,w=0,k=-1),n=0;nb?l:b;var w,k,x,S=f,C=d,_=n.polarRotation||0;for(o=0;o=0&&h=0&&p=0&&h=0&&p=1020?255:0}return a}(t,e.width,e.height),t=function(e,t,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],o=Math.round(Math.sqrt(r.length)),i=Math.floor(o/2),a=[],s=0;s=0&&h=0&&p=g))for(n=c;n=m||(o+=w[(r=4*(g*n+t))+0],i+=w[r+1],a+=w[r+2],s+=w[r+3],p+=1);for(o/=p,i/=p,a/=p,s/=p,t=l;t=g))for(n=c;n=m||(w[(r=4*(g*n+t))+0]=o,w[r+1]=i,w[r+2]=a,w[r+3]=s)}},Posterize:function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,o=r.length,i=255/n;for(t=0;t127&&(l=255-l),u>127&&(u=255-u),c>127&&(c=255-c),t[s]=l,t[s+1]=u,t[s+2]=c}while(--a)}while(--o)},Threshold:function(e){var t,n=255*this.threshold(),r=e.data,o=r.length;for(t=0;t"),t.document.write(n.outerHTML),t.document.write("

")}))}([{base64:re,caption:"mask sent as init_mask"},{base64:ae,caption:"image sent as init_img"}]),n.scale(oe),G.init_img=ae,G.progress_images=!1,"none"!==ee&&(G.inpaint_width=te.width,G.inpaint_height=te.height),G.seam_size=O,G.seam_blur=P,G.seam_strength=M,G.seam_steps=A,G.tile_size=B,G.infill_method=w,G.force_outpaint=!1}return N?(G.variation_amount=F,I&&(G.with_variations=(t=I.split(",").map((function(e){return e.split(":")})),t.map((function(e){return[parseInt(e[0],10),parseFloat(e[1])]}))))):G.variation_amount=0,U&&(G.enable_image_debugging=U),{generationParameters:G,esrganParameters:q,facetoolParameters:Y}},Toe=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Ioe=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Roe=/[^-+\dA-Z]/g;function Noe(e,t,n,r){if(1!==arguments.length||"string"!=typeof e||/\d/.test(e)||(t=e,e=void 0),(e=e||0===e?e:new Date)instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");var o=(t=String(zoe[t]||t||zoe.default)).slice(0,4);"UTC:"!==o&&"GMT:"!==o||(t=t.slice(4),n=!0,"GMT:"===o&&(r=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},s=function(){return e[i()+"Day"]()},l=function(){return e[i()+"Month"]()},u=function(){return e[i()+"FullYear"]()},c=function(){return e[i()+"Hours"]()},d=function(){return e[i()+"Minutes"]()},f=function(){return e[i()+"Seconds"]()},h=function(){return e[i()+"Milliseconds"]()},p=function(){return n?0:e.getTimezoneOffset()},v=function(){return Hoe(e)},g=function(){return Voe(e)},m={d:function(){return a()},dd:function(){return Boe(a())},ddd:function(){return joe.dayNames[s()]},DDD:function(){return Foe({y:u(),m:l(),d:a(),_:i(),dayName:joe.dayNames[s()],short:!0})},dddd:function(){return joe.dayNames[s()+7]},DDDD:function(){return Foe({y:u(),m:l(),d:a(),_:i(),dayName:joe.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Boe(l()+1)},mmm:function(){return joe.monthNames[l()]},mmmm:function(){return joe.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Boe(u(),4)},h:function(){return c()%12||12},hh:function(){return Boe(c()%12||12)},H:function(){return c()},HH:function(){return Boe(c())},M:function(){return d()},MM:function(){return Boe(d())},s:function(){return f()},ss:function(){return Boe(f())},l:function(){return Boe(h(),3)},L:function(){return Boe(Math.floor(h()/10))},t:function(){return c()<12?joe.timeNames[0]:joe.timeNames[1]},tt:function(){return c()<12?joe.timeNames[2]:joe.timeNames[3]},T:function(){return c()<12?joe.timeNames[4]:joe.timeNames[5]},TT:function(){return c()<12?joe.timeNames[6]:joe.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":Woe(e)},o:function(){return(p()>0?"-":"+")+Boe(100*Math.floor(Math.abs(p())/60)+Math.abs(p())%60,4)},p:function(){return(p()>0?"-":"+")+Boe(Math.floor(Math.abs(p())/60),2)+":"+Boe(Math.floor(Math.abs(p())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return v()},WW:function(){return Boe(v())},N:function(){return g()}};return t.replace(Toe,(function(e){return e in m?m[e]():e.slice(1,e.length-1)}))}var Doe,zoe={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},joe={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Boe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")},Foe=function(e){var t=e.y,n=e.m,r=e.d,o=e._,i=e.dayName,a=e.short,s=void 0!==a&&a,l=new Date,u=new Date;u.setDate(u[o+"Date"]()-1);var c=new Date;c.setDate(c[o+"Date"]()+1);return l[o+"FullYear"]()===t&&l[o+"Month"]()===n&&l[o+"Date"]()===r?s?"Tdy":"Today":u[o+"FullYear"]()===t&&u[o+"Month"]()===n&&u[o+"Date"]()===r?s?"Ysd":"Yesterday":c[o+"FullYear"]()===t&&c[o+"Month"]()===n&&c[o+"Date"]()===r?s?"Tmw":"Tomorrow":i},Hoe=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var o=(t-n)/6048e5;return 1+Math.floor(o)},Voe=function(e){var t=e.getDay();return 0===t&&(t=7),t},Woe=function(e){return(String(e).match(Ioe)||[""]).pop().replace(Roe,"").replace(/GMT\+0000/g,"UTC")},Uoe=new Uint8Array(16);function Goe(){if(!Doe&&!(Doe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Doe(Uoe)}for(var qoe=[],Yoe=0;Yoe<256;++Yoe)qoe.push((Yoe+256).toString(16).slice(1));var Zoe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Xoe(e,t,n){if(Zoe.randomUUID&&!t&&!e)return Zoe.randomUUID();var r=(e=e||{}).random||(e.rng||Goe)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(qoe[e[t+0]]+qoe[e[t+1]]+qoe[e[t+2]]+qoe[e[t+3]]+"-"+qoe[e[t+4]]+qoe[e[t+5]]+"-"+qoe[e[t+6]]+qoe[e[t+7]]+"-"+qoe[e[t+8]]+qoe[e[t+9]]+"-"+qoe[e[t+10]]+qoe[e[t+11]]+qoe[e[t+12]]+qoe[e[t+13]]+qoe[e[t+14]]+qoe[e[t+15]]).toLowerCase()}(r)}var $oe,Koe=b$("socketio/generateImage"),Qoe=b$("socketio/runESRGAN"),Joe=b$("socketio/runFacetool"),eie=b$("socketio/deleteImage"),tie=b$("socketio/requestImages"),nie=b$("socketio/requestNewImages"),rie=b$("socketio/cancelProcessing"),oie=b$("socketio/requestSystemConfig"),iie=b$("socketio/searchForModels"),aie=b$("socketio/addNewModel"),sie=b$("socketio/deleteModel"),lie=b$("socketio/requestModelChange"),uie=b$("socketio/saveStagingAreaImageToGallery"),cie=b$("socketio/requestEmptyTempFolder"),die=function(){var e=fte(new URL(window.location.href).origin,{timeout:6e4,path:"".concat(window.location.pathname,"socket.io")}),t=!1;return function(n){return function(r){return function(o){var i=function(e){var t=e.dispatch,n=e.getState;return{onConnect:function(){try{t(d8(!0)),t(v8(A7.t("common:statusConnected"))),t(oie());var e=n().gallery;e.categories.result.latest_mtime?t(nie("result")):t(tie("result")),e.categories.user.latest_mtime?t(nie("user")):t(tie("user"))}catch(Dhe){console.error(Dhe)}},onDisconnect:function(){try{t(d8(!1)),t(v8(A7.t("common:statusDisconnected"))),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(Dhe){console.error(Dhe)}},onGenerationResult:function(e){try{var r=n(),o=r.ui.activeTab,i=r.postprocessing.shouldLoopback,a=(e.boundingBox,e.generationMode),s=sn(e,ct),l=un({uuid:Xoe()},s);if(["txt2img","img2img"].includes(a)&&t(Z3({category:"result",image:un(un({},l),{},{category:"result"})})),"unifiedCanvas"===a&&e.boundingBox){var u=e.boundingBox;t(q5({image:un(un({},l),{},{category:"temp"}),boundingBox:u})),r.canvas.shouldAutoSave&&t(Z3({image:un(un({},l),{},{category:"result"}),category:"result"}))}i&&"img2img"===R8[o]&&t(M4(l)),t(X3()),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Image generated: ".concat(e.url)}))}catch(Dhe){console.error(Dhe)}},onIntermediateResult:function(e){try{t(J3(un(un({uuid:Xoe()},e),{},{category:"result"}))),e.isBase64||t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Intermediate image generated: ".concat(e.url)}))}catch(Dhe){console.error(Dhe)}},onPostprocessingResult:function(e){try{t(Z3({category:"result",image:un(un({uuid:Xoe()},e),{},{category:"result"})})),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Postprocessed: ".concat(e.url)}))}catch(Dhe){console.error(Dhe)}},onProgressUpdate:function(e){try{t(l8(!0)),t(p8(e))}catch(Dhe){console.error(Dhe)}},onError:function(e){var n=e.message;e.additionalData;try{t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Server error: ".concat(n),level:"error"})),t(b8()),t(X3())}catch(Dhe){console.error(Dhe)}},onGalleryImages:function(e){var n=e.images,r=e.areMoreImagesAvailable,o=e.category,i=n.map((function(e){return un({uuid:Xoe()},e)}));t(Q3({images:i,areMoreImagesAvailable:r,category:o})),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Loaded ".concat(n.length," images")}))},onProcessingCanceled:function(){t(y8());var e=n().gallery.intermediateImage;e&&(e.isBase64||(t(Z3({category:"result",image:e})),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Intermediate image saved: ".concat(e.url)}))),t(X3())),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:function(e){var r=e.url;t($3(e));var o=n().generation,i=o.initialImage,a=o.maskPath;i!==r&&(null==i?void 0:i.url)!==r||t(C4()),a===r&&t(I4("")),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Image deleted: ".concat(r)}))},onSystemConfig:function(e){t(g8(e)),e.infill_methods.includes("patchmatch")||t(A4(e.infill_methods[0]))},onFoundModels:function(e){var n=e.search_folder,r=e.found_models;t(A8(n)),t(M8(r))},onNewModelAdded:function(e){var n=e.new_model_name,r=e.model_list,o=e.update;t(k8(r)),t(l8(!1)),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Model Added: ".concat(n),level:"info"})),t(P8({title:o?"".concat(A7.t("modelmanager:modelUpdated"),": ").concat(n):"".concat(A7.t("modelmanager:modelAdded"),": ").concat(n),status:"success",duration:2500,isClosable:!0}))},onModelDeleted:function(e){var n=e.deleted_model_name,r=e.model_list;t(k8(r)),t(l8(!1)),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"".concat(A7.t("modelmanager:modelAdded"),": ").concat(n),level:"info"})),t(P8({title:"".concat(A7.t("modelmanager:modelEntryDeleted"),": ").concat(n),status:"success",duration:2500,isClosable:!0}))},onModelChanged:function(e){var n=e.model_name,r=e.model_list;t(k8(r)),t(v8(A7.t("common:statusModelChanged"))),t(l8(!1)),t(x8(!0)),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Model changed: ".concat(n),level:"info"}))},onModelChangeFailed:function(e){var n=e.model_name,r=e.model_list;t(k8(r)),t(l8(!1)),t(x8(!0)),t(b8()),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Model change failed: ".concat(n),level:"error"}))},onTempFolderEmptied:function(){t(P8({title:A7.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}}(n),a=i.onConnect,s=i.onDisconnect,l=i.onError,u=i.onPostprocessingResult,c=i.onGenerationResult,d=i.onIntermediateResult,f=i.onProgressUpdate,h=i.onGalleryImages,p=i.onProcessingCanceled,v=i.onImageDeleted,g=i.onSystemConfig,m=i.onModelChanged,y=i.onFoundModels,b=i.onNewModelAdded,w=i.onModelDeleted,k=i.onModelChangeFailed,x=i.onTempFolderEmptied,S=function(e,t){var n=e.dispatch,r=e.getState;return{emitGenerateImage:function(e){n(l8(!0));var o=r(),i=o.generation,a=o.postprocessing,s=o.system,l={generationMode:e,generationState:i,postprocessingState:a,canvasState:o.canvas,systemState:s};n(E8());var u=Moe(l),c=u.generationParameters,d=u.esrganParameters,f=u.facetoolParameters;t.emit("generateImage",c,d,f),c.init_mask&&(c.init_mask=c.init_mask.substr(0,64).concat("...")),c.init_img&&(c.init_img=c.init_img.substr(0,64).concat("...")),n(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Image generation requested: ".concat(JSON.stringify(un(un(un({},c),d),f)))}))},emitRunESRGAN:function(e){n(l8(!0));var o=r().postprocessing,i={upscale:[o.upscalingLevel,o.upscalingStrength]};t.emit("runPostprocessing",e,un({type:"esrgan"},i)),n(u8({timestamp:Noe(new Date,"isoDateTime"),message:"ESRGAN upscale requested: ".concat(JSON.stringify(un({file:e.url},i)))}))},emitRunFacetool:function(e){n(l8(!0));var o=r().postprocessing,i=o.facetoolType,a=o.facetoolStrength,s=o.codeformerFidelity,l={facetool_strength:a};"codeformer"===i&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",e,un({type:i},l)),n(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Face restoration (".concat(i,") requested: ").concat(JSON.stringify(un({file:e.url},l)))}))},emitDeleteImage:function(e){var r=e.url,o=e.uuid,i=e.category,a=e.thumbnail;n($3(e)),t.emit("deleteImage",r,a,o,i)},emitRequestImages:function(e){var n=r().gallery.categories[e].earliest_mtime;t.emit("requestImages",e,n)},emitRequestNewImages:function(e){var n=r().gallery.categories[e].latest_mtime;t.emit("requestLatestImages",e,n)},emitCancelProcessing:function(){t.emit("cancel")},emitRequestSystemConfig:function(){t.emit("requestSystemConfig")},emitSearchForModels:function(e){t.emit("searchForModels",e)},emitAddNewModel:function(e){t.emit("addNewModel",e)},emitDeleteModel:function(e){t.emit("deleteModel",e)},emitRequestModelChange:function(e){n(S8()),t.emit("requestModelChange",e)},emitSaveStagingAreaImageToGallery:function(e){t.emit("requestSaveStagingAreaImageToGallery",e)},emitRequestEmptyTempFolder:function(){t.emit("requestEmptyTempFolder")}}}(n,e),C=S.emitGenerateImage,_=S.emitRunESRGAN,E=S.emitRunFacetool,P=S.emitDeleteImage,L=S.emitRequestImages,O=S.emitRequestNewImages,A=S.emitCancelProcessing,M=S.emitRequestSystemConfig,T=S.emitSearchForModels,I=S.emitAddNewModel,R=S.emitDeleteModel,N=S.emitRequestModelChange,D=S.emitSaveStagingAreaImageToGallery,z=S.emitRequestEmptyTempFolder;switch(t||(e.on("connect",(function(){return a()})),e.on("disconnect",(function(){return s()})),e.on("error",(function(e){return l(e)})),e.on("generationResult",(function(e){return c(e)})),e.on("postprocessingResult",(function(e){return u(e)})),e.on("intermediateResult",(function(e){return d(e)})),e.on("progressUpdate",(function(e){return f(e)})),e.on("galleryImages",(function(e){return h(e)})),e.on("processingCanceled",(function(){p()})),e.on("imageDeleted",(function(e){v(e)})),e.on("systemConfig",(function(e){g(e)})),e.on("foundModels",(function(e){y(e)})),e.on("newModelAdded",(function(e){b(e)})),e.on("modelDeleted",(function(e){w(e)})),e.on("modelChanged",(function(e){m(e)})),e.on("modelChangeFailed",(function(e){k(e)})),e.on("tempFolderEmptied",(function(){x()})),t=!0),o.type){case"socketio/generateImage":C(o.payload);break;case"socketio/runESRGAN":_(o.payload);break;case"socketio/runFacetool":E(o.payload);break;case"socketio/deleteImage":P(o.payload);break;case"socketio/requestImages":L(o.payload);break;case"socketio/requestNewImages":O(o.payload);break;case"socketio/cancelProcessing":A();break;case"socketio/requestSystemConfig":M();break;case"socketio/searchForModels":T(o.payload);break;case"socketio/addNewModel":I(o.payload);break;case"socketio/deleteModel":R(o.payload);break;case"socketio/requestModelChange":N(o.payload);break;case"socketio/saveStagingAreaImageToGallery":D(o.payload);break;case"socketio/requestEmptyTempFolder":z()}r(o)}}}},fie=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map((function(e){return"canvas.".concat(e)})),hie=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map((function(e){return"system.".concat(e)})),pie=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map((function(e){return"gallery.".concat(e)})),vie=UX({generation:J4,postprocessing:h6,gallery:f4,system:I8,canvas:G3,ui:Z8,lightbox:v4}),gie=function(e,t){var n=void 0!==e.version?e.version:-1;e.debug;var r=void 0===e.stateReconciler?j$:e.stateReconciler,o=e.getStoredState||H$,i=void 0!==e.timeout?e.timeout:5e3,a=null,s=!1,l=!0,u=function(e){return e._persist.rehydrated&&a&&!l&&a.update(e),e};return function(c,d){var f=c||{},h=f._persist,p=Y$(f,["_persist"]);if(d.type===T$){var v=!1,g=function(t,n){v||(d.rehydrate(e.key,t,n),v=!0)};if(i&&setTimeout((function(){!v&&g(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))}),i),l=!1,a||(a=B$(e)),h)return G$({},t(p,d),{_persist:h});if("function"!=typeof d.rehydrate||"function"!=typeof d.register)throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return d.register(e.key),o(e).then((function(t){var r=e.migrate||function(e,t){return Promise.resolve(e)};r(t,n).then((function(e){g(e)}),(function(e){g(void 0,e)}))}),(function(e){g(void 0,e)})),G$({},t(p,d),{_persist:{version:n,rehydrated:!1}})}if(d.type===I$)return s=!0,d.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:L$).concat(e.key);return t.removeItem(n,W$)}(e)),G$({},t(p,d),{_persist:h});if(d.type===O$)return d.result(a&&a.flush()),G$({},t(p,d),{_persist:h});if(d.type===M$)l=!0;else if(d.type===A$){if(s)return G$({},p,{_persist:G$({},h,{rehydrated:!0})});if(d.key===e.key){var m=t(p,d),y=d.payload,b=G$({},!1!==r&&void 0!==y?r(y,c,m,e):m,{_persist:G$({},h,{rehydrated:!0})});return u(b)}}if(!h)return t(c,d);var w=t(p,d);return w===p?c:u(G$({},w,{_persist:h}))}}(uK.getPersistConfig({key:"root",storage:sK,rootReducer:vie,blacklist:[].concat(cn(fie),cn(hie),cn(pie)),debounce:300}),vie),mie=function(e){var t,n=y$(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,l=r.devTools,u=void 0===l||l,c=r.preloadedState,d=void 0===c?void 0:c,f=r.enhancers,h=void 0===f?void 0:f;if("function"==typeof i)t=i;else{if(!function(e){if("object"!==kn(e)||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=UX(i)}var p=s;"function"==typeof p&&(p=p(n));var v=qX.apply(void 0,p),g=GX;u&&(g=v$(h$({trace:!1},"object"===kn(u)&&u)));var m=[v];return Array.isArray(h)?m=i$([v],h):"function"==typeof h&&(m=h(m)),WX(t,d,g.apply(void 0,m))}({reducer:gie,middleware:function(e){return e({immutableCheck:!1,serializableCheck:!1}).concat(die())},devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),yie=function(e,t,n){var r=n||!1,o=WX(J$,Q$,t&&t.enhancer?t.enhancer:void 0),i=function(e){o.dispatch({type:R$,key:e})},a=function(t,n,i){var a={type:A$,payload:n,err:i,key:t};e.dispatch(a),o.dispatch(a),r&&s.getState().bootstrapped&&(r(),r=!1)},s=$$({},o,{purge:function(){var t=[];return e.dispatch({type:I$,result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:O$,result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:M$})},persist:function(){e.dispatch({type:T$,register:i,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}(mie),bie=cr.createContext(null),wie=OZ,kie=nZ,xie=function(){return{setOpenUploader:function(e){e&&($oe=e)},openUploader:$oe}};var Sie=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var Cie=function(e){return this.__data__.has(e)},_ie=RJ,Eie=Sie,Pie=Cie;function Lie(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new _ie;++ts))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,h=2&n?new Mie:void 0;for(i.set(e,t),i.set(t,e);++d-1}})),Hle=Ile((function(e,t){var n=zle();t.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}})),Vle=Ile((function(e,t){var n=Nle(),r=jle(),o=Ble(),i=Fle(),a=Hle();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tc))return!1;var f=l.get(e),h=l.get(t);if(f&&h)return f==t&&h==e;var p=-1,v=!0,g=2&i?new n:void 0;for(l.set(e,t),l.set(t,e);++p-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}})),Xue=Ile((function(e,t){var n=Qle(),r=Zue(),o=Vue(),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&r(e.length)&&!!i[n(e)]}})),$ue=Ile((function(e,t){t.exports=function(e){return function(t){return e(t)}}})),Kue=Ile((function(e,t){var n=Yle(),r="object"==kn(e)&&e&&!e.nodeType&&e,o=r&&"object"==kn(t)&&t&&!t.nodeType&&t,i=o&&o.exports===r&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();t.exports=a})),Que=Ile((function(e,t){var n=Xue(),r=$ue(),o=Kue(),i=o&&o.isTypedArray,a=i?r(i):n;t.exports=a})),Jue=Ile((function(e,t){var n=Hue(),r=Uue(),o=Due(),i=que(),a=Yue(),s=Que(),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var u=o(e),c=!u&&r(e),d=!u&&!c&&i(e),f=!u&&!c&&!d&&s(e),h=u||c||d||f,p=h?n(e.length,String):[],v=p.length;for(var g in e)(t||l.call(e,g))&&(!h||!("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,v)))&&p.push(g);return p}})),ece=Ile((function(e,t){var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}})),tce=Ile((function(e,t){t.exports=function(e,t){return function(n){return e(t(n))}}})),nce=Ile((function(e,t){var n=tce()(Object.keys,Object);t.exports=n})),rce=Ile((function(e,t){var n=ece(),r=nce(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return r(e);var t=[];for(var i in Object(e))o.call(e,i)&&"constructor"!=i&&t.push(i);return t}})),oce=Ile((function(e,t){var n=eue(),r=Zue();t.exports=function(e){return null!=e&&r(e.length)&&!n(e)}})),ice=Ile((function(e,t){var n=Jue(),r=rce(),o=oce();t.exports=function(e){return o(e)?n(e):r(e)}})),ace=Ile((function(e,t){var n=zue(),r=Fue(),o=ice();t.exports=function(e){return n(e,o,r)}})),sce=Ile((function(e,t){var n=ace(),r=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,i,a,s){var l=1&o,u=n(e),c=u.length;if(c!=n(t).length&&!l)return!1;for(var d=c;d--;){var f=u[d];if(!(l?f in t:r.call(t,f)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=l;++d1&&void 0!==arguments[1]?arguments[1]:",";return"string"==typeof e?e.split(t):e}function bce(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+",n=e.toLocaleLowerCase().split(t).map((function(e){return e.trim()})).map((function(e){return mce[e]||e})),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter((function(e){return!gce.includes(e)}));return un(un({},r),{},{keys:o})}function wce(e){var t=e.target,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t&&t.tagName;return n instanceof Array?Boolean(r&&n&&n.some((function(e){return e.toLowerCase()===r.toLowerCase()}))):Boolean(r&&n&&!0===n)}var kce=cr.createContext(void 0),xce=cr.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),Sce=Rle(vce());var Cce=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function _ce(e,t,n,r){var o=cr.useRef(null),i=cr.useRef(new Set).current,a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=cr.useCallback(t,cn(s)),u=function(e){var t=cr.useRef(void 0);return(0,Sce.default)(t.current,e)||(t.current=e),t.current}(a),c=cr.useContext(xce).enabledScopes,d=cr.useContext(kce);return cr.useLayoutEffect((function(){if(!1!==(null==u?void 0:u.enabled)&&function(e,t){return 0===e.length&&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 '),!0):!t||e.some((function(e){return t.includes(e)}))||e.includes("*")}(c,null==u?void 0:u.scopes)){var t=function(t){if(!function(e){return wce(e,["input","textarea","select"])}(t)||wce(t,null==u?void 0:u.enableOnFormTags)){var n;if(null!==o.current&&document.activeElement!==o.current&&!o.current.contains(document.activeElement))return void Cce(t);(null===(n=t.target)||void 0===n?void 0:n.isContentEditable)&&(null==u||!u.enableOnContentEditable)||yce(e,null==u?void 0:u.splitKey).forEach((function(e){var n,r=bce(e,null==u?void 0:u.combinationKey);if(function(e,t,n){var r=t.alt,o=t.ctrl,i=t.meta,a=t.mod,s=t.shift,l=t.keys,u=e.altKey,c=e.ctrlKey,d=e.metaKey,f=e.shiftKey,h=e.key,p=e.code.toLowerCase().replace("key",""),v=h.toLowerCase();if(u!==r&&"alt"!==v||f!==s&&"shift"!==v)return!1;if(a){if(!d&&!c)return!1}else if(d!==i&&"meta"!==p||c!==o&&"ctrl"!==p)return!1;return!(!l||1!==l.length||!l.includes(v)&&!l.includes(p))||(l?l.every((function(e){return n.has(e)})):!l)}(t,r,i)||null!==(n=r.keys)&&void 0!==n&&n.includes("*")){if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(t,r,null==u?void 0:u.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(t,r,null==u?void 0:u.enabled))return void Cce(t);l(t,r)}}))}},n=function(e){i.add(e.key.toLowerCase()),(void 0===(null==u?void 0:u.keydown)&&!0!==(null==u?void 0:u.keyup)||(null==u?void 0:u.keydown))&&t(e)},r=function(e){"meta"!==e.key.toLowerCase()?i.delete(e.key.toLowerCase()):i.clear(),(null==u?void 0:u.keyup)&&t(e)};return(o.current||document).addEventListener("keyup",r),(o.current||document).addEventListener("keydown",n),d&&yce(e,null==u?void 0:u.splitKey).forEach((function(e){return d.addHotkey(bce(e,null==u?void 0:u.combinationKey))})),function(){(o.current||document).removeEventListener("keyup",r),(o.current||document).removeEventListener("keydown",n),d&&yce(e,null==u?void 0:u.splitKey).forEach((function(e){return d.removeHotkey(bce(e,null==u?void 0:u.combinationKey))}))}}}),[e,l,u,c]),o}Rle(vce());var Ece=new Set;window.addEventListener("DOMContentLoaded",(function(){document.addEventListener("keydown",(function(e){!function(e){(Array.isArray(e)?e:[e]).forEach((function(e){return Ece.add(bce(e))}))}(e.key)})),document.addEventListener("keyup",(function(e){!function(e){(Array.isArray(e)?e:[e]).forEach((function(e){var t,n=bce(e),r=xn(Ece);try{for(r.s();!(t=r.n()).done;){var o,i=t.value;(null===(o=i.keys)||void 0===o?void 0:o.every((function(e){var t;return null===(t=n.keys)||void 0===t?void 0:t.includes(e)})))&&Ece.delete(i)}}catch(COe){r.e(COe)}finally{r.f()}}))}(e.key)}))}));var Pce={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Lce=qr.createContext&&qr.createContext(Pce),Oce=globalThis&&globalThis.__assign||function(){return Oce=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0||"unifiedCanvas"===t&&n.isProcessing})),Ade=function(e){return e.canvas.layerState.objects.find(B5)},Mde=function(e){return e.gallery},Tde=QX([Mde,Lae,Ode,fae],(function(e,t,n,r){var o=e.categories,i=e.currentCategory,a=e.currentImageUuid,s=e.shouldPinGallery,l=e.shouldShowGallery,u=e.galleryScrollPosition,c=e.galleryImageMinimumWidth,d=e.galleryImageObjectFit,f=e.shouldHoldGalleryOpen,h=e.shouldAutoSwitchToNewImages,p=e.galleryWidth,v=e.shouldUseSingleGalleryColumn,g=t.isLightboxOpen;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:c,galleryImageObjectFit:d,galleryGridTemplateColumns:v?"auto":"repeat(auto-fill, minmax(".concat(c,"px, auto))"),activeTabName:r,shouldHoldGalleryOpen:f,shouldAutoSwitchToNewImages:h,images:o[i].images,areMoreImagesAvailable:o[i].areMoreImagesAvailable,currentCategory:i,galleryWidth:p,isLightboxOpen:g,isStaging:n,shouldEnableResize:!(g||"unifiedCanvas"===r&&s),shouldUseSingleGalleryColumn:v}}),{memoizeOptions:{resultEqualityCheck:dae}}),Ide=QX([Mde,wle,Lae,fae],(function(e,t,n,r){return{mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}}),{memoizeOptions:{resultEqualityCheck:dae}}),Rde=QX(wle,(function(e){return{shouldConfirmOnDelete:e.shouldConfirmOnDelete,isConnected:e.isConnected,isProcessing:e.isProcessing}}),{memoizeOptions:{resultEqualityCheck:dae}}),Nde=cr.forwardRef((function(e,t){var n=e.image,r=e.children,o=GE(),i=o.isOpen,a=o.onOpen,s=o.onClose,l=wie(),u=kie(Rde),c=u.shouldConfirmOnDelete,d=u.isConnected,f=u.isProcessing,h=cr.useRef(null),p=function(){d&&!f&&n&&l(eie(n)),s()};_ce("delete",(function(){c?a():p()}),[n,c]);return ro(to,{children:[cr.cloneElement(r,{onClick:n?function(e){e.stopPropagation(),c?a():p()}:void 0,ref:t}),no(oU,{isOpen:i,leastDestructiveRef:h,onClose:s,children:no(rU,{children:ro(iU,{className:"modal",children:[no(tU,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),no(YW,{children:ro(yP,{direction:"column",gap:5,children:[no(jP,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),no(I_,{children:ro(yP,{alignItems:"center",children:[no(V_,{mb:0,children:"Don't ask me again"}),no(Cq,{checked:!c,onChange:function(e){return l(f8(!e.target.checked))}})]})})]})}),ro(eU,{children:[no(b_,{ref:h,onClick:s,className:"modal-close-btn",children:"Cancel"}),no(b_,{colorScheme:"red",onClick:p,ml:3,children:"Delete"})]})]})})})]})}));Nde.displayName="DeleteImageModal";var Dde=QX([wle,Mde,Tae,pae,Lae,fae],(function(e,t,n,r,o,i){var a=e.isProcessing,s=e.isConnected,l=e.isGFPGANAvailable,u=e.isESRGANAvailable,c=n.upscalingLevel,d=n.facetoolStrength,f=o.isLightboxOpen,h=r.shouldShowImageDetails,p=t.intermediateImage,v=t.currentImage;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:c,facetoolStrength:d,shouldDisableToolbarButtons:Boolean(p)||!v,currentImage:v,shouldShowImageDetails:h,activeTabName:i,isLightboxOpen:f}}),{memoizeOptions:{resultEqualityCheck:dae}}),zde=function(){var e,t,n,r,o,i,a=wie(),s=kie(Dde),l=s.isProcessing,u=s.isConnected,c=s.isGFPGANAvailable,d=s.isESRGANAvailable,f=s.upscalingLevel,h=s.facetoolStrength,p=s.shouldDisableToolbarButtons,v=s.shouldShowImageDetails,g=s.currentImage,m=s.isLightboxOpen,y=s.activeTabName,b=cY(),w=o8().t,k=function(){g&&(m&&a(p4(!1)),a(M4(g)),a(z8("img2img")))},x=function(){var e=qt(Ut().mark((function e(){var t,n;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,fetch(g.url).then((function(e){return e.blob()}));case 4:return t=e.sent,n=[new ClipboardItem(gn({},t.type,t))],e.next=8,navigator.clipboard.write(n);case 8:b({title:w("toast:imageCopied"),status:"success",duration:2500,isClosable:!0});case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();_ce("shift+i",(function(){g?(k(),b({title:w("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):b({title:w("toast:imageNotLoaded"),description:w("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})}),[g]);var S=function(){var e,t;g&&(g.metadata&&a(E4(g.metadata)),"img2img"===(null===(e=g.metadata)||void 0===e?void 0:e.image.type)?a(z8("img2img")):"txt2img"===(null===(t=g.metadata)||void 0===t?void 0:t.image.type)&&a(z8("txt2img")))};_ce("a",(function(){var e,t;["txt2img","img2img"].includes(null==g||null===(e=g.metadata)||void 0===e||null===(t=e.image)||void 0===t?void 0:t.type)?(S(),b({title:w("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):b({title:w("toast:parametersNotSet"),description:w("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[g]);var C=function(){(null==g?void 0:g.metadata)&&a(W4(g.metadata.image.seed))};_ce("s",(function(){var e,t;null!=g&&null!==(e=g.metadata)&&void 0!==e&&null!==(t=e.image)&&void 0!==t&&t.seed?(C(),b({title:w("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):b({title:w("toast:seedNotSet"),description:w("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[g]);var _=function(){var e,t;if(null!=g&&null!==(e=g.metadata)&&void 0!==e&&null!==(t=e.image)&&void 0!==t&&t.prompt){var n,r,o=yn(m4(null==g||null===(n=g.metadata)||void 0===n||null===(r=n.image)||void 0===r?void 0:r.prompt),2),i=o[0],s=o[1];i&&a(N4(i)),a(D4(s||""))}};_ce("p",(function(){var e,t;null!=g&&null!==(e=g.metadata)&&void 0!==e&&null!==(t=e.image)&&void 0!==t&&t.prompt?(_(),b({title:w("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):b({title:w("toast:promptNotSet"),description:w("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[g]);var E=function(){g&&a(Qoe(g))};_ce("Shift+U",(function(){d&&!p&&u&&!l&&f?E():b({title:w("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})}),[g,d,p,u,l,f]);var P=function(){g&&a(Joe(g))};_ce("Shift+R",(function(){c&&!p&&u&&!l&&h?P():b({title:w("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})}),[g,c,p,u,l,h]);var L=function(){return a(U8(!v))};_ce("i",(function(){g?L():b({title:w("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})}),[g,v]);return ro("div",{className:"current-image-options",children:[ro(k_,{isAttached:!0,children:[no(Pae,{trigger:"hover",triggerComponent:no(_ae,{"aria-label":"".concat(w("parameters:sendTo"),"..."),icon:no(bde,{})}),children:ro("div",{className:"current-image-send-to-popover",children:[no(Eae,{size:"sm",onClick:k,leftIcon:no(wde,{}),children:w("parameters:sendToImg2Img")}),no(Eae,{size:"sm",onClick:function(){g&&(m&&a(p4(!1)),a(y3(g)),a(m3(!0)),"unifiedCanvas"!==y&&a(z8("unifiedCanvas")),b({title:w("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},leftIcon:no(wde,{}),children:w("parameters:sendToUnifiedCanvas")}),no(Eae,{size:"sm",onClick:x,leftIcon:no(qce,{}),children:w("parameters:copyImage")}),no(Eae,{size:"sm",onClick:function(){navigator.clipboard.writeText(g?window.location.toString()+g.url:"").then((function(){b({title:w("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})}))},leftIcon:no(qce,{}),children:w("parameters:copyImageToLink")}),no(CP,{download:!0,href:null==g?void 0:g.url,children:no(Eae,{leftIcon:no(Xce,{}),size:"sm",w:"100%",children:w("parameters:downloadImage")})})]})}),no(_ae,{icon:no(Qce,{}),tooltip:"".concat(w(m?"parameters:closeViewer":"parameters:openInViewer")," (Z)"),"aria-label":"".concat(w(m?"parameters:closeViewer":"parameters:openInViewer")," (Z)"),"data-selected":m,onClick:function(){a(p4(!m))}})]}),ro(k_,{isAttached:!0,children:[no(_ae,{icon:no(pde,{}),tooltip:"".concat(w("parameters:usePrompt")," (P)"),"aria-label":"".concat(w("parameters:usePrompt")," (P)"),isDisabled:!(null!=g&&null!==(e=g.metadata)&&void 0!==e&&null!==(t=e.image)&&void 0!==t&&t.prompt),onClick:_}),no(_ae,{icon:no(yde,{}),tooltip:"".concat(w("parameters:useSeed")," (S)"),"aria-label":"".concat(w("parameters:useSeed")," (S)"),isDisabled:!(null!=g&&null!==(n=g.metadata)&&void 0!==n&&null!==(r=n.image)&&void 0!==r&&r.seed),onClick:C}),no(_ae,{icon:no(Vce,{}),tooltip:"".concat(w("parameters:useAll")," (A)"),"aria-label":"".concat(w("parameters:useAll")," (A)"),isDisabled:!["txt2img","img2img"].includes(null==g||null===(o=g.metadata)||void 0===o||null===(i=o.image)||void 0===i?void 0:i.type),onClick:S})]}),ro(k_,{isAttached:!0,children:[no(Pae,{trigger:"hover",triggerComponent:no(_ae,{icon:no(rde,{}),"aria-label":w("parameters:restoreFaces")}),children:ro("div",{className:"current-image-postprocessing-popover",children:[no(Cle,{}),no(Eae,{isDisabled:!(c&&g&&u&&!l&&h),onClick:P,children:w("parameters:restoreFaces")})]})}),no(Pae,{trigger:"hover",triggerComponent:no(_ae,{icon:no(Kce,{}),"aria-label":w("parameters:upscale")}),children:ro("div",{className:"current-image-postprocessing-popover",children:[no(Ele,{}),no(Eae,{isDisabled:!(d&&g&&u&&!l&&f),onClick:E,children:w("parameters:upscaleImage")})]})})]}),no(k_,{isAttached:!0,children:no(_ae,{icon:no(Gce,{}),tooltip:"".concat(w("parameters:info")," (I)"),"aria-label":"".concat(w("parameters:info")," (I)"),"data-selected":v,onClick:L})}),no(Nde,{image:g,children:no(_ae,{icon:no(Sde,{}),tooltip:"".concat(w("parameters:deleteImage")," (Del)"),"aria-label":"".concat(w("parameters:deleteImage")," (Del)"),isDisabled:!g||!u||l,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};qv({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"}),qv({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"}),qv({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"}),qv({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"}),qv({displayName:"SunIcon",path:qr.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},qr.createElement("circle",{cx:"12",cy:"12",r:"5"}),qr.createElement("path",{d:"M12 1v2"}),qr.createElement("path",{d:"M12 21v2"}),qr.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),qr.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),qr.createElement("path",{d:"M1 12h2"}),qr.createElement("path",{d:"M21 12h2"}),qr.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),qr.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))}),qv({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"}),qv({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:qr.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})}),qv({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"}),qv({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}),qv({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"}),qv({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"}),qv({displayName:"ViewIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),qr.createElement("circle",{cx:"12",cy:"12",r:"2"}))}),qv({displayName:"ViewOffIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),qr.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))}),qv({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var jde=qv({displayName:"DeleteIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"}))});qv({displayName:"RepeatIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),qr.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))}),qv({displayName:"RepeatClockIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),qr.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var Bde=qv({displayName:"EditIcon",path:qr.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},qr.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),qr.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});qv({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),qv({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}),qv({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),qv({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),qv({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"}),qv({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"}),qv({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"}),qv({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"}),qv({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var Fde=qv({displayName:"ExternalLinkIcon",path:qr.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},qr.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),qr.createElement("path",{d:"M15 3h6v6"}),qr.createElement("path",{d:"M10 14L21 3"}))});function Hde(e){return Tce({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}qv({displayName:"LinkIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),qr.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))}),qv({displayName:"PlusSquareIcon",path:qr.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},qr.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),qr.createElement("path",{d:"M12 8v8"}),qr.createElement("path",{d:"M8 12h8"}))}),qv({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"}),qv({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"}),qv({displayName:"TimeIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),qr.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))}),qv({displayName:"ArrowRightIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),qr.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))}),qv({displayName:"ArrowLeftIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),qr.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))}),qv({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"}),qv({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"}),qv({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"}),qv({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"}),qv({displayName:"EmailIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),qr.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))}),qv({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"}),qv({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"}),qv({displayName:"SpinnerIcon",path:qr.createElement(qr.Fragment,null,qr.createElement("defs",null,qr.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},qr.createElement("stop",{stopColor:"currentColor",offset:"0%"}),qr.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),qr.createElement("g",{transform:"translate(2)",fill:"none"},qr.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),qr.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),qr.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))}),qv({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),qv({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:qr.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})}),qv({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"}),qv({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"}),qv({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"}),qv({displayName:"InfoOutlineIcon",path:qr.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},qr.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),qr.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),qr.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))}),qv({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}),qv({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}),qv({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"}),qv({displayName:"QuestionOutlineIcon",path:qr.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},qr.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),qr.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),qr.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))}),qv({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"}),qv({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),qv({viewBox:"0 0 14 14",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))}),qv({displayName:"MinusIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))}),qv({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});var Vde=function(e){var t=e.label,n=e.value,r=e.onClick,o=e.isLink,i=e.labelPosition,a=e.withCopy,s=void 0!==a&&a;return ro(yP,{gap:2,children:[r&&no(kY,{label:"Recall ".concat(t),children:no(x_,{"aria-label":"Use this parameter",icon:no(Hde,{}),size:"xs",variant:"ghost",fontSize:20,onClick:r})}),s&&no(kY,{label:"Copy ".concat(t),children:no(x_,{"aria-label":"Copy ".concat(t),icon:no(qce,{}),size:"xs",variant:"ghost",fontSize:14,onClick:function(){return navigator.clipboard.writeText(n.toString())}})}),ro(yP,{direction:i?"column":"row",children:[ro(jP,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[t,":"]}),o?ro(CP,{href:n.toString(),isExternal:!0,wordBreak:"break-all",children:[n.toString()," ",no(Fde,{mx:"2px"})]}):no(jP,{overflowY:"scroll",wordBreak:"break-all",children:n.toString()})]})]})},Wde=cr.memo((function(e){var t,n,r=e.image,o=e.styleClass,i=wie();_ce("esc",(function(){i(U8(!1))}));var a=(null==r||null===(t=r.metadata)||void 0===t?void 0:t.image)||{},s=null==r?void 0:r.dreamPrompt,l=a.cfg_scale,u=a.fit,c=a.height,d=a.hires_fix,f=a.init_image_path,h=a.mask_image_path,p=a.orig_path,v=a.perlin,g=a.postprocessing,m=a.prompt,y=a.sampler,b=a.scale,w=a.seamless,k=a.seed,x=a.steps,S=a.strength,C=a.threshold,_=a.type,E=a.variations,P=a.width,L=JSON.stringify(r.metadata,null,2);return no("div",{className:"image-metadata-viewer ".concat(o),children:ro(yP,{gap:1,direction:"column",width:"100%",children:[ro(yP,{gap:2,children:[no(jP,{fontWeight:"semibold",children:"File:"}),ro(CP,{href:r.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[r.url.length>64?r.url.substring(0,64).concat("..."):r.url,no(Fde,{mx:"2px"})]})]}),Object.keys(a).length>0?ro(to,{children:[_&&no(Vde,{label:"Generation type",value:_}),(null===(n=r.metadata)||void 0===n?void 0:n.model_weights)&&no(Vde,{label:"Model",value:r.metadata.model_weights}),["esrgan","gfpgan"].includes(_)&&no(Vde,{label:"Original image",value:p}),"gfpgan"===_&&void 0!==S&&no(Vde,{label:"Fix faces strength",value:S,onClick:function(){return i(o6(S))}}),"esrgan"===_&&void 0!==b&&no(Vde,{label:"Upscaling scale",value:b,onClick:function(){return i(d6(b))}}),"esrgan"===_&&void 0!==S&&no(Vde,{label:"Upscaling strength",value:S,onClick:function(){return i(f6(S))}}),m&&no(Vde,{label:"Prompt",labelPosition:"top",value:g4(m),onClick:function(){return i(N4(m))}}),void 0!==k&&no(Vde,{label:"Seed",value:k,onClick:function(){return i(W4(k))}}),void 0!==C&&no(Vde,{label:"Noise Threshold",value:C,onClick:function(){return i(X4(C))}}),void 0!==v&&no(Vde,{label:"Perlin Noise",value:v,onClick:function(){return i(R4(v))}}),y&&no(Vde,{label:"Sampler",value:y,onClick:function(){return i(z4(y))}}),x&&no(Vde,{label:"Steps",value:x,onClick:function(){return i(Z4(x))}}),void 0!==l&&no(Vde,{label:"CFG scale",value:l,onClick:function(){return i(P4(l))}}),E&&E.length>0&&no(Vde,{label:"Seed-weight pairs",value:w4(E),onClick:function(){return i(U4(w4(E)))}}),w&&no(Vde,{label:"Seamless",value:w,onClick:function(){return i(B4(w))}}),d&&no(Vde,{label:"High Resolution Optimization",value:d,onClick:function(){return i(a6(d))}}),P&&no(Vde,{label:"Width",value:P,onClick:function(){return i(Q4(P))}}),c&&no(Vde,{label:"Height",value:c,onClick:function(){return i(L4(c))}}),f&&no(Vde,{label:"Initial image",value:f,isLink:!0,onClick:function(){return i(M4(f))}}),h&&no(Vde,{label:"Mask image",value:h,isLink:!0,onClick:function(){return i(I4(h))}}),"img2img"===_&&S&&no(Vde,{label:"Image to image strength",value:S,onClick:function(){return i(O4(S))}}),u&&no(Vde,{label:"Image to image fit",value:u,onClick:function(){return i(G4(u))}}),g&&g.length>0&&ro(to,{children:[no(xP,{size:"sm",children:"Postprocessing"}),g.map((function(e,t){if("esrgan"===e.type){var n=e.scale,r=e.strength;return ro(yP,{pl:"2rem",gap:1,direction:"column",children:[no(jP,{size:"md",children:"".concat(t+1,": Upscale (ESRGAN)")}),no(Vde,{label:"Scale",value:n,onClick:function(){return i(d6(n))}}),no(Vde,{label:"Strength",value:r,onClick:function(){return i(f6(r))}})]},t)}if("gfpgan"===e.type){var o=e.strength;return ro(yP,{pl:"2rem",gap:1,direction:"column",children:[no(jP,{size:"md",children:"".concat(t+1,": Face restoration (GFPGAN)")}),no(Vde,{label:"Strength",value:o,onClick:function(){i(o6(o)),i(i6("gfpgan"))}})]},t)}if("codeformer"===e.type){var a=e.strength,s=e.fidelity;return ro(yP,{pl:"2rem",gap:1,direction:"column",children:[no(jP,{size:"md",children:"".concat(t+1,": Face restoration (Codeformer)")}),no(Vde,{label:"Strength",value:a,onClick:function(){i(o6(a)),i(i6("codeformer"))}}),s&&no(Vde,{label:"Fidelity",value:s,onClick:function(){i(r6(s)),i(i6("codeformer"))}})]},t)}}))]}),s&&no(Vde,{withCopy:!0,label:"Dream Prompt",value:s}),ro(yP,{gap:2,direction:"column",children:[ro(yP,{gap:2,children:[no(kY,{label:"Copy metadata JSON",children:no(x_,{"aria-label":"Copy metadata JSON",icon:no(qce,{}),size:"xs",variant:"ghost",fontSize:14,onClick:function(){return navigator.clipboard.writeText(L)}})}),no(jP,{fontWeight:"semibold",children:"Metadata JSON:"})]}),no("div",{className:"image-json-viewer",children:no("pre",{children:L})})]})]}):no(hP,{width:"100%",pt:10,children:no(jP,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})}),(function(e,t){return e.image.uuid===t.image.uuid}));Wde.displayName="ImageMetadataViewer";var Ude=QX([Mde,pae],(function(e,t){var n=e.currentCategory,r=e.currentImage,o=e.intermediateImage,i=t.shouldShowImageDetails,a=e.categories[r?r.category:"result"].images,s=a.findIndex((function(t){var n;return t.uuid===(null==e||null===(n=e.currentImage)||void 0===n?void 0:n.uuid)})),l=a.length;return{imageToDisplay:o||r,isIntermediate:Boolean(o),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:0===s,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:i,shouldShowPrevImageButton:0===s,shouldShowNextImageButton:!isNaN(s)&&s===l-1}}),{memoizeOptions:{resultEqualityCheck:dae}});function Gde(){var e=wie(),t=kie(Ude),n=t.isOnFirstImage,r=t.isOnLastImage,o=t.shouldShowImageDetails,i=t.imageToDisplay,a=t.isIntermediate,s=yn(cr.useState(!1),2),l=s[0],u=s[1],c=function(){u(!0)},d=function(){u(!1)};return ro("div",{className:"current-image-preview",children:[i&&no(c_,{src:i.url,width:i.width,height:i.height,style:{imageRendering:a?"pixelated":"initial"}}),!o&&ro("div",{className:"current-image-next-prev-buttons",children:[no("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:d,children:l&&!n&&no(x_,{"aria-label":"Previous image",icon:no(zce,{className:"next-prev-button"}),variant:"unstyled",onClick:function(){e(t4())}})}),no("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:d,children:l&&!r&&no(x_,{"aria-label":"Next image",icon:no(jce,{className:"next-prev-button"}),variant:"unstyled",onClick:function(){e(e4())}})})]}),o&&i&&no(Wde,{image:i,styleClass:"current-image-metadata"})]})}var qde,Yde,Zde=globalThis&&globalThis.__extends||(qde=function(e,t){return qde=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},qde(e,t)},function(e,t){function n(){this.constructor=e}qde(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Xde=globalThis&&globalThis.__assign||function(){return Xde=Object.assign||function(e){for(var t,n=1,r=arguments.length;n2&&void 0!==arguments[2]?arguments[2]:{},r=n.checkForDefaultPrevented,o=void 0===r||r;return function(n){if(null==e||e(n),!1===o||!n.defaultPrevented)return null==t?void 0:t(n)}}function Xfe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];function r(t,r){var o=cr.createContext(r),i=n.length;function a(t){var n=t.scope,r=t.children,a=sn(t,yt),s=(null==n?void 0:n[e][i])||o,l=cr.useMemo((function(){return a}),Object.values(a));return cr.createElement(s.Provider,{value:l},r)}return n=[].concat(cn(n),[r]),a.displayName=t+"Provider",[a,function(n,a){var s=(null==a?void 0:a[e][i])||o,l=cr.useContext(s);if(l)return l;if(void 0!==r)return r;throw new Error("`".concat(n,"` must be used within `").concat(t,"`"))}]}var o=function(){var t=n.map((function(e){return cr.createContext(e)}));return function(n){var r=(null==n?void 0:n[e])||t;return cr.useMemo((function(){return gn({},"__scope".concat(e),un(un({},n),{},gn({},e,r)))}),[n,r])}};return o.scopeName=e,[r,$fe.apply(void 0,[o].concat(cn(t)))]}function $fe(){for(var e=arguments.length,t=new Array(e),n=0;n1?cr.Children.only(null):cr.isValidElement(a)?a.props.children:null:e}));return cr.createElement(the,ps({},r,{ref:t}),cr.isValidElement(a)?cr.cloneElement(a,void 0,s):null)}return cr.createElement(the,ps({},r,{ref:t}),n)}));ehe.displayName="Slot";var the=cr.forwardRef((function(e,t){var n=e.children,r=sn(e,wt);return cr.isValidElement(n)?cr.cloneElement(n,un(un({},function(e,t){var n=un({},t),r=function(){var r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=function(){i.apply(void 0,arguments),r.apply(void 0,arguments)}:r&&(n[o]=r):"style"===o?n[o]=un(un({},r),i):"className"===o&&(n[o]=[r,i].filter(Boolean).join(" "))};for(var o in t)r();return un(un({},e),n)}(r,n.props)),{},{ref:Qfe(t,n.ref)})):cr.Children.count(n)>1?cr.Children.only(null):null}));the.displayName="SlotClone";var nhe=function(e){var t=e.children;return cr.createElement(cr.Fragment,null,t)};function rhe(e){return cr.isValidElement(e)&&e.type===nhe}var ohe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce((function(e,t){var n=cr.forwardRef((function(e,n){var r=e.asChild,o=sn(e,kt),i=r?ehe:t;return cr.useEffect((function(){window[Symbol.for("radix-ui")]=!0}),[]),cr.createElement(i,ps({},o,{ref:n}))}));return n.displayName="Primitive.".concat(t),un(un({},e),{},gn({},t,n))}),{});function ihe(e,t){e&&QO.flushSync((function(){return e.dispatchEvent(t)}))}function ahe(e){var t=e+"CollectionProvider",n=yn(Xfe(t),2),r=n[0],o=n[1],i=yn(r(t,{collectionRef:{current:null},itemMap:new Map}),2),a=i[0],s=i[1],l=e+"CollectionSlot",u=e+"CollectionItemSlot",c="data-radix-collection-item";return[{Provider:function(e){var t=e.scope,n=e.children,r=qr.useRef(null),o=qr.useRef(new Map).current;return qr.createElement(a,{scope:t,itemMap:o,collectionRef:r},n)},Slot:qr.forwardRef((function(e,t){var n=e.scope,r=e.children,o=Jfe(t,s(l,n).collectionRef);return qr.createElement(ehe,{ref:o},r)})),ItemSlot:qr.forwardRef((function(e,t){var n,r=e.scope,o=e.children,i=sn(e,xt),a=qr.useRef(null),l=Jfe(t,a),d=s(u,r);return qr.useEffect((function(){return d.itemMap.set(a,un({ref:a},i)),function(){d.itemMap.delete(a)}})),qr.createElement(ehe,(gn(n={},c,""),gn(n,"ref",l),n),o)}))},function(t){var n=s(e+"CollectionConsumer",t),r=qr.useCallback((function(){var e=n.collectionRef.current;if(!e)return[];var t=Array.from(e.querySelectorAll("[".concat(c,"]"))),r=Array.from(n.itemMap.values()).sort((function(e,n){return t.indexOf(e.ref.current)-t.indexOf(n.ref.current)}));return r}),[n.collectionRef,n.itemMap]);return r},o]}var she=cr.createContext(void 0);function lhe(e){var t=cr.useContext(she);return e||t||"ltr"}function uhe(e){var t=cr.useRef(e);return cr.useEffect((function(){t.current=e})),cr.useMemo((function(){return function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i0,S=k>=w,C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===globalThis||void 0===globalThis?void 0:globalThis.document,n=uhe(e),r=cr.useRef(!1),o=cr.useRef((function(){}));return cr.useEffect((function(){var e=function(e){if(e.target&&!r.current){var i=function(){mhe(fhe,n,a,{discrete:!0})},a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=i,t.addEventListener("click",o.current,{once:!0})):i()}r.current=!1},i=window.setTimeout((function(){t.addEventListener("pointerdown",e)}),0);return function(){window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:function(){return r.current=!0}}}((function(e){var t=e.target,n=cn(d.branches).some((function(e){return e.contains(t)}));S&&!n&&(null==a||a(e),null==l||l(e),e.defaultPrevented||null==u||u())}),v),_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===globalThis||void 0===globalThis?void 0:globalThis.document,n=uhe(e),r=cr.useRef(!1);return cr.useEffect((function(){var e=function(e){e.target&&!r.current&&mhe(hhe,n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),function(){return t.removeEventListener("focusin",e)}}),[t,n]),{onFocusCapture:function(){return r.current=!0},onBlurCapture:function(){return r.current=!1}}}((function(e){var t=e.target;cn(d.branches).some((function(e){return e.contains(t)}))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==u||u())}),v);return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===globalThis||void 0===globalThis?void 0:globalThis.document,n=uhe(e);cr.useEffect((function(){var e=function(e){"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),function(){return t.removeEventListener("keydown",e)}}),[n,t])}((function(e){k===d.layers.size-1&&(null==i||i(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))}),v),cr.useEffect((function(){if(h)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(che=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),ghe(),function(){o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(v.body.style.pointerEvents=che)}}),[h,v,o,d]),cr.useEffect((function(){return function(){h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),ghe())}}),[h,d]),cr.useEffect((function(){var e=function(){return g({})};return document.addEventListener(dhe,e),function(){return document.removeEventListener(dhe,e)}}),[]),cr.createElement(ohe.div,ps({},c,{ref:m,style:un({pointerEvents:x?S?"auto":"none":void 0},e.style),onFocusCapture:Zfe(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Zfe(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Zfe(e.onPointerDownCapture,C.onPointerDownCapture)}))}));function ghe(){var e=new CustomEvent(dhe);document.dispatchEvent(e)}function mhe(e,t,n,r){var o=r.discrete,i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),o?ihe(i,a):i.dispatchEvent(a)}var yhe=0;function bhe(){var 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 whe="focusScope.autoFocusOnMount",khe="focusScope.autoFocusOnUnmount",xhe={bubbles:!1,cancelable:!0},She=cr.forwardRef((function(e,t){var n=e.loop,r=void 0!==n&&n,o=e.trapped,i=void 0!==o&&o,a=e.onMountAutoFocus,s=e.onUnmountAutoFocus,l=sn(e,Ct),u=yn(cr.useState(null),2),c=u[0],d=u[1],f=uhe(a),h=uhe(s),p=cr.useRef(null),v=Jfe(t,(function(e){return d(e)})),g=cr.useRef({paused:!1,pause:function(){this.paused=!0},resume:function(){this.paused=!1}}).current;cr.useEffect((function(){if(i){var e=function(e){if(!g.paused&&c){var t=e.target;c.contains(t)?p.current=t:Lhe(p.current,{select:!0})}},t=function(e){!g.paused&&c&&(c.contains(e.relatedTarget)||Lhe(p.current,{select:!0}))};return document.addEventListener("focusin",e),document.addEventListener("focusout",t),function(){document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[i,c,g.paused]),cr.useEffect((function(){if(c){Ahe.add(g);var e=document.activeElement;if(!c.contains(e)){var t=new CustomEvent(whe,xhe);c.addEventListener(whe,f),c.dispatchEvent(t),t.defaultPrevented||(!function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.select,o=void 0!==r&&r,i=document.activeElement,a=xn(e);try{for(a.s();!(t=a.n()).done;){if(Lhe(t.value,{select:o}),document.activeElement!==i)return}}catch(COe){a.e(COe)}finally{a.f()}}((n=Che(c),n.filter((function(e){return"A"!==e.tagName}))),{select:!0}),document.activeElement===e&&Lhe(c))}return function(){c.removeEventListener(whe,f),setTimeout((function(){var t=new CustomEvent(khe,xhe);c.addEventListener(khe,h),c.dispatchEvent(t),t.defaultPrevented||Lhe(null!=e?e:document.body,{select:!0}),c.removeEventListener(khe,h),Ahe.remove(g)}),0)}}var n}),[c,f,h,g]);var m=cr.useCallback((function(e){if((r||i)&&!g.paused){var t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){var o=e.currentTarget,a=function(e){var t=Che(e),n=_he(t,e),r=_he(t.reverse(),e);return[n,r]}(o),s=yn(a,2),l=s[0],u=s[1];l&&u?e.shiftKey||n!==u?e.shiftKey&&n===l&&(e.preventDefault(),r&&Lhe(u,{select:!0})):(e.preventDefault(),r&&Lhe(l,{select:!0})):n===o&&e.preventDefault()}}}),[r,i,g.paused]);return cr.createElement(ohe.div,ps({tabIndex:-1},l,{ref:v,onKeyDown:m}))}));function Che(e){for(var t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){var t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});n.nextNode();)t.push(n.currentNode);return t}function _he(e,t){var n,r=xn(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!Ehe(o,{upTo:t}))return o}}catch(COe){r.e(COe)}finally{r.f()}}function Ehe(e,t){var n=t.upTo;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==n&&e===n)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Phe(e){return e instanceof HTMLInputElement&&"select"in e}function Lhe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.select,r=void 0!==n&&n;if(e&&e.focus){var o=document.activeElement;e.focus({preventScroll:!0}),e!==o&&Phe(e)&&r&&e.select()}}var Ohe,Ahe=(Ohe=[],{add:function(e){var t=Ohe[0];e!==t&&(null==t||t.pause()),(Ohe=Mhe(Ohe,e)).unshift(e)},remove:function(e){var t;null===(t=(Ohe=Mhe(Ohe,e))[0])||void 0===t||t.resume()}});function Mhe(e,t){var n=cn(e),r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var The=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?cr.useLayoutEffect:function(){},Ihe=Yr["useId".toString()]||function(){},Rhe=0;function Nhe(e){return e.split("-")[0]}function Dhe(e){return e.split("-")[1]}function zhe(e){return["top","bottom"].includes(Nhe(e))?"x":"y"}function jhe(e){return"y"===e?"height":"width"}function Bhe(e,t,n){var r,o=e.reference,i=e.floating,a=o.x+o.width/2-i.width/2,s=o.y+o.height/2-i.height/2,l=zhe(t),u=jhe(l),c=o[u]/2-i[u]/2,d="x"===l;switch(Nhe(t)){case"top":r={x:a,y:o.y-i.height};break;case"bottom":r={x:a,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:s};break;case"left":r={x:o.x-i.width,y:s};break;default:r={x:o.x,y:o.y}}switch(Dhe(t)){case"start":r[l]-=c*(n&&d?-1:1);break;case"end":r[l]+=c*(n&&d?-1:1)}return r}var Fhe=function(){var e=qt(Ut().mark((function e(t,n,r){var o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S,C,_,E,P,L;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.placement,i=void 0===o?"bottom":o,a=r.strategy,s=void 0===a?"absolute":a,l=r.middleware,u=void 0===l?[]:l,c=r.platform,e.next=9,null==c.isRTL?void 0:c.isRTL(n);case 9:return d=e.sent,e.next=12,c.getElementRects({reference:t,floating:n,strategy:s});case 12:f=e.sent,h=Bhe(f,i,d),p=h.x,v=h.y,g=i,m={},y=0,b=0;case 20:if(!(b0&&O!==A&&f.reference[y]<=f.floating[y],n.abrupt("return",(gn(o={},g,v[g]-(M?Ot.floating[i]&&(a=$he(a)),{main:a,cross:$he(a)}}var Qhe={start:"end",end:"start"};function Jhe(e){return e.replace(/start|end/g,(function(e){return Qhe[e]}))}var epe=["top","right","bottom","left"];epe.reduce((function(e,t){return e.concat(t,t+"-start",t+"-end")}),[]);var tpe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn:function(t){return qt(Ut().mark((function n(){var r,o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S,C,_,E,P,L,O,A,M,T,I,R,N,D;return Ut().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=t.placement,i=t.middlewareData,a=t.rects,s=t.initialPlacement,l=t.platform,u=t.elements,d=(c=e).mainAxis,f=void 0===d||d,h=c.crossAxis,p=void 0===h||h,v=c.fallbackPlacements,g=c.fallbackStrategy,m=void 0===g?"bestFit":g,y=c.flipAlignment,b=void 0===y||y,w=sn(c,_t),k=Nhe(o),x=v||(k!==s&&b?function(e){var t=$he(e);return[Jhe(e),t,Jhe(t)]}(s):[$he(s)]),S=[s].concat(cn(x)),n.next=22,Whe(t,w);case 22:if(C=n.sent,_=[],E=(null==(r=i.flip)?void 0:r.overflows)||[],f&&_.push(C[k]),!p){n.next=36;break}return n.t0=Khe,n.t1=o,n.t2=a,n.next=31,null==l.isRTL?void 0:l.isRTL(u.floating);case 31:n.t3=n.sent,P=(0,n.t0)(n.t1,n.t2,n.t3),L=P.main,O=P.cross,_.push(C[L],C[O]);case 36:if(E=[].concat(cn(E),[{placement:o,overflows:_}]),_.every((function(e){return e<=0}))){n.next=50;break}if(T=(null!=(A=null==(M=i.flip)?void 0:M.index)?A:0)+1,!(I=S[T])){n.next=40;break}return n.abrupt("return",{data:{index:T,overflows:E},reset:{placement:I}});case 40:R="bottom",n.t4=m,n.next="bestFit"===n.t4?44:"initialPlacement"===n.t4?47:48;break;case 44:return D=null==(N=E.map((function(e){return[e,e.overflows.filter((function(e){return e>0})).reduce((function(e,t){return e+t}),0)]})).sort((function(e,t){return e[1]-t[1]}))[0])?void 0:N[0].placement,D&&(R=D),n.abrupt("break",48);case 47:R=s;case 48:if(o===R){n.next=50;break}return n.abrupt("return",{reset:{placement:R}});case 50:return n.abrupt("return",{});case 51:case"end":return n.stop()}}),n)})))()}}};function npe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rpe(e){return epe.some((function(t){return e[t]>=0}))}var ope=function(e){var t=void 0===e?{}:e,n=t.strategy,r=void 0===n?"referenceHidden":n,o=sn(t,Et);return{name:"hide",fn:function(e){return qt(Ut().mark((function t(){var n,i,a;return Ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.rects,t.t0=r,t.next="referenceHidden"===t.t0?4:"escaped"===t.t0?11:18;break;case 4:return t.t1=npe,t.next=7,Whe(e,un(un({},o),{},{elementContext:"reference"}));case 7:return t.t2=t.sent,t.t3=n.reference,i=(0,t.t1)(t.t2,t.t3),t.abrupt("return",{data:{referenceHiddenOffsets:i,referenceHidden:rpe(i)}});case 11:return t.t4=npe,t.next=14,Whe(e,un(un({},o),{},{altBoundary:!0}));case 14:return t.t5=t.sent,t.t6=n.floating,a=(0,t.t4)(t.t5,t.t6),t.abrupt("return",{data:{escapedOffsets:a,escaped:rpe(a)}});case 18:return t.abrupt("return",{});case 19:case"end":return t.stop()}}),t)})))()}}},ipe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,fn:function(t){return qt(Ut().mark((function n(){var r,o,i;return Ut().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.x,o=t.y,n.next=4,function(){var e=qt(Ut().mark((function e(t,n){var r,o,i,a,s,l,u,c,d,f,h,p,v,g;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.placement,o=t.platform,i=t.elements,e.next=5,null==o.isRTL?void 0:o.isRTL(i.floating);case 5:return a=e.sent,s=Nhe(r),l=Dhe(r),u="x"===zhe(r),c=["left","top"].includes(s)?-1:1,d=a&&u?-1:1,f="function"==typeof n?n(t):n,h="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:un({mainAxis:0,crossAxis:0,alignmentAxis:null},f),p=h.mainAxis,v=h.crossAxis,g=h.alignmentAxis,e.abrupt("return",(l&&"number"==typeof g&&(v="end"===l?-1*g:g),u?{x:v*d,y:p*c}:{x:p*c,y:v*d}));case 14:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()(t,e);case 4:return i=n.sent,n.abrupt("return",{x:r+i.x,y:o+i.y,data:i});case 6:case"end":return n.stop()}}),n)})))()}}};function ape(e){return"x"===e?"y":"x"}var spe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn:function(t){return qt(Ut().mark((function n(){var r,o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S;return Ut().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=t.x,i=t.y,a=t.placement,l=(s=e).mainAxis,u=void 0===l||l,c=s.crossAxis,d=void 0!==c&&c,f=s.limiter,h=void 0===f?{fn:function(e){return{x:e.x,y:e.y}}}:f,p=sn(s,Pt),v={x:o,y:i},n.next=14,Whe(t,p);case 14:return g=n.sent,m=zhe(Nhe(a)),y=ape(m),b=v[m],w=v[y],u&&(k="y"===m?"bottom":"right",b=Yhe(b+g["y"===m?"top":"left"],b,b-g[k])),d&&(x="y"===y?"bottom":"right",w=Yhe(w+g["y"===y?"top":"left"],w,w-g[x])),S=h.fn(un(un({},t),{},(gn(r={},m,b),gn(r,y,w),r))),n.abrupt("return",un(un({},S),{},{data:{x:S.x-o,y:S.y-i}}));case 22:case"end":return n.stop()}}),n)})))()}}},lpe=function(e){return void 0===e&&(e={}),{options:e,fn:function(t){var n,r=t.x,o=t.y,i=t.placement,a=t.rects,s=t.middlewareData,l=e,u=l.offset,c=void 0===u?0:u,d=l.mainAxis,f=void 0===d||d,h=l.crossAxis,p=void 0===h||h,v={x:r,y:o},g=zhe(i),m=ape(g),y=v[g],b=v[m],w="function"==typeof c?c(un(un({},a),{},{placement:i})):c,k="number"==typeof w?{mainAxis:w,crossAxis:0}:un({mainAxis:0,crossAxis:0},w);if(f){var x="y"===g?"height":"width",S=a.reference[g]-a.floating[x]+k.mainAxis,C=a.reference[g]+a.reference[x]-k.mainAxis;yC&&(y=C)}if(p){var _,E,P,L,O="y"===g?"width":"height",A=["top","left"].includes(Nhe(i)),M=a.reference[m]-a.floating[O]+(A&&null!=(_=null==(E=s.offset)?void 0:E[m])?_:0)+(A?0:k.crossAxis),T=a.reference[m]+a.reference[O]+(A?0:null!=(P=null==(L=s.offset)?void 0:L[m])?P:0)-(A?k.crossAxis:0);bT&&(b=T)}return gn(n={},g,y),gn(n,m,b),n}}};function upe(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function cpe(e){if(null==e)return window;if(!upe(e)){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function dpe(e){return cpe(e).getComputedStyle(e)}function fpe(e){return upe(e)?"":e?(e.nodeName||"").toLowerCase():""}function hpe(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function ppe(e){return e instanceof cpe(e).HTMLElement}function vpe(e){return e instanceof cpe(e).Element}function gpe(e){return"undefined"!=typeof ShadowRoot&&(e instanceof cpe(e).ShadowRoot||e instanceof ShadowRoot)}function mpe(e){var t=dpe(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ype(e){return["table","td","th"].includes(fpe(e))}function bpe(e){var t=/firefox/i.test(hpe()),n=dpe(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function wpe(){return!/^((?!chrome|android).)*safari/i.test(hpe())}var kpe=Math.min,xpe=Math.max,Spe=Math.round;function Cpe(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);var s=e.getBoundingClientRect(),l=1,u=1;t&&ppe(e)&&(l=e.offsetWidth>0&&Spe(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&Spe(s.height)/e.offsetHeight||1);var c=vpe(e)?cpe(e):window,d=!wpe()&&n,f=(s.left+(d&&null!=(r=null==(o=c.visualViewport)?void 0:o.offsetLeft)?r:0))/l,h=(s.top+(d&&null!=(i=null==(a=c.visualViewport)?void 0:a.offsetTop)?i:0))/u,p=s.width/l,v=s.height/u;return{width:p,height:v,top:h,right:f+p,bottom:h+v,left:f,x:f,y:h}}function _pe(e){return(t=e,(t instanceof cpe(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function Epe(e){return vpe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ppe(e){return Cpe(_pe(e)).left+Epe(e).scrollLeft}function Lpe(e,t,n){var r=ppe(t),o=_pe(t),i=Cpe(e,r&&function(e){var t=Cpe(e);return Spe(t.width)!==e.offsetWidth||Spe(t.height)!==e.offsetHeight}(t),"fixed"===n),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==fpe(t)||mpe(o))&&(a=Epe(t)),ppe(t)){var l=Cpe(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else o&&(s.x=Ppe(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function Ope(e){return"html"===fpe(e)?e:e.assignedSlot||e.parentNode||(gpe(e)?e.host:null)||_pe(e)}function Ape(e){return ppe(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function Mpe(e){for(var t=cpe(e),n=Ape(e);n&&ype(n)&&"static"===getComputedStyle(n).position;)n=Ape(n);return n&&("html"===fpe(n)||"body"===fpe(n)&&"static"===getComputedStyle(n).position&&!bpe(n))?t:n||function(e){var t=Ope(e);for(gpe(t)&&(t=t.host);ppe(t)&&!["html","body"].includes(fpe(t));){if(bpe(t))return t;t=t.parentNode}return null}(e)||t}function Tpe(e){if(ppe(e))return{width:e.offsetWidth,height:e.offsetHeight};var t=Cpe(e);return{width:t.width,height:t.height}}function Ipe(e){var t=Ope(e);return["html","body","#document"].includes(fpe(t))?e.ownerDocument.body:ppe(t)&&mpe(t)?t:Ipe(t)}function Rpe(e,t){var n;void 0===t&&(t=[]);var r=Ipe(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=cpe(r),a=o?[i].concat(i.visualViewport||[],mpe(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Rpe(a))}function Npe(e,t,n){return"viewport"===t?Vhe(function(e,t){var n=cpe(e),r=_pe(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=wpe();(u||!u&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n)):vpe(t)?function(e,t){var n=Cpe(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):Vhe(function(e){var t,n=_pe(e),r=Epe(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=xpe(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=xpe(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Ppe(e),l=-r.scrollTop;return"rtl"===dpe(o||n).direction&&(s+=xpe(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(_pe(e)))}function Dpe(e){var t=Rpe(e),n=["absolute","fixed"].includes(dpe(e).position)&&ppe(e)?Mpe(e):e;return vpe(n)?t.filter((function(e){return vpe(e)&&function(e,t){var n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&gpe(n)){var r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}(e,n)&&"body"!==fpe(e)})):[]}var zpe={getClippingRect:function(e){var t=e.element,n=e.boundary,r=e.rootBoundary,o=e.strategy,i=[].concat(cn("clippingAncestors"===n?Dpe(t):[].concat(n)),[r]),a=i[0],s=i.reduce((function(e,n){var r=Npe(t,n,o);return e.top=xpe(r.top,e.top),e.right=kpe(r.right,e.right),e.bottom=kpe(r.bottom,e.bottom),e.left=xpe(r.left,e.left),e}),Npe(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){var t=e.rect,n=e.offsetParent,r=e.strategy,o=ppe(n),i=_pe(n);if(n===i)return t;var a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==fpe(n)||mpe(i))&&(a=Epe(n)),ppe(n))){var l=Cpe(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return un(un({},t),{},{x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y})},isElement:vpe,getDimensions:Tpe,getOffsetParent:Mpe,getDocumentElement:_pe,getElementRects:function(e){var t=e.reference,n=e.floating,r=e.strategy;return{reference:Lpe(t,Mpe(n),r),floating:un(un({},Tpe(n)),{},{x:0,y:0})}},getClientRects:function(e){return Array.from(e.getClientRects())},isRTL:function(e){return"rtl"===dpe(e).direction}};function jpe(e,t,n,r){void 0===r&&(r={});var o=r,i=o.ancestorScroll,a=void 0===i||i,s=o.ancestorResize,l=void 0===s||s,u=o.elementResize,c=void 0===u||u,d=o.animationFrame,f=void 0!==d&&d,h=a&&!f,p=l&&!f,v=h||p?[].concat(cn(vpe(e)?Rpe(e):[]),cn(Rpe(t))):[];v.forEach((function(e){h&&e.addEventListener("scroll",n,{passive:!0}),p&&e.addEventListener("resize",n)}));var g,m=null;if(c){var y=!0;m=new ResizeObserver((function(){y||n(),y=!1})),vpe(e)&&!f&&m.observe(e),m.observe(t)}var b=f?Cpe(e):null;return f&&function t(){var r=Cpe(e);!b||r.x===b.x&&r.y===b.y&&r.width===b.width&&r.height===b.height||n(),b=r,g=requestAnimationFrame(t)}(),n(),function(){var e;v.forEach((function(e){h&&e.removeEventListener("scroll",n),p&&e.removeEventListener("resize",n)})),null==(e=m)||e.disconnect(),m=null,f&&cancelAnimationFrame(g)}}var Bpe="undefined"!=typeof document?cr.useLayoutEffect:cr.useEffect;function Fpe(e,t){if(e===t)return!0;if(kn(e)!==kn(t))return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;var n,r,o;if(e&&t&&"object"==kn(e)){if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!Fpe(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){var i=o[r];if(("_owner"!==i||!e.$$typeof)&&!Fpe(e[i],t[i]))return!1}return!0}return e!=e&&t!=t}function Hpe(e){var t=void 0===e?{}:e,n=t.middleware,r=t.placement,o=void 0===r?"bottom":r,i=t.strategy,a=void 0===i?"absolute":i,s=t.whileElementsMounted,l=cr.useRef(null),u=cr.useRef(null),c=function(e){var t=cr.useRef(e);return Bpe((function(){t.current=e})),t}(s),d=cr.useRef(null),f=yn(cr.useState({x:null,y:null,strategy:a,placement:o,middlewareData:{}}),2),h=f[0],p=f[1],v=yn(cr.useState(n),2),g=v[0],m=v[1];Fpe(null==g?void 0:g.map((function(e){return e.options})),null==n?void 0:n.map((function(e){return e.options})))||m(n);var y=cr.useCallback((function(){l.current&&u.current&&function(e,t,n){return Fhe(e,t,un({platform:zpe},n))}(l.current,u.current,{middleware:g,placement:o,strategy:a}).then((function(e){b.current&&QO.flushSync((function(){p(e)}))}))}),[g,o,a]);Bpe((function(){b.current&&y()}),[y]);var b=cr.useRef(!1);Bpe((function(){return b.current=!0,function(){b.current=!1}}),[]);var w=cr.useCallback((function(){if("function"==typeof d.current&&(d.current(),d.current=null),l.current&&u.current)if(c.current){var e=c.current(l.current,u.current,y);d.current=e}else y()}),[y,c]),k=cr.useCallback((function(e){l.current=e,w()}),[w]),x=cr.useCallback((function(e){u.current=e,w()}),[w]),S=cr.useMemo((function(){return{reference:l,floating:u}}),[]);return cr.useMemo((function(){return un(un({},h),{},{update:y,refs:S,reference:k,floating:x})}),[h,y,S,k,x])}var Vpe=function(e){var t=e.element,n=e.padding;return{name:"arrow",options:e,fn:function(e){return function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?Zhe({element:t.current,padding:n}).fn(e):{}:t?Zhe({element:t,padding:n}).fn(e):{}}}};var Wpe="Popper",Upe=yn(Xfe(Wpe),2),Gpe=Upe[0],qpe=Upe[1],Ype=yn(Gpe(Wpe),2),Zpe=Ype[0],Xpe=Ype[1],$pe=cr.forwardRef((function(e,t){var n=e.__scopePopper,r=e.virtualRef,o=sn(e,Lt),i=Xpe("PopperAnchor",n),a=cr.useRef(null),s=Jfe(t,a);return cr.useEffect((function(){i.onAnchorChange((null==r?void 0:r.current)||a.current)})),r?null:cr.createElement(ohe.div,ps({},o,{ref:s}))})),Kpe="PopperContent",Qpe=yn(Gpe(Kpe),2),Jpe=Qpe[0],eve=(Qpe[1],yn(Gpe(Kpe,{hasParent:!1,positionUpdateFns:new Set}),2)),tve=eve[0],nve=eve[1],rve=cr.forwardRef((function(e,t){var n,r,o,i,a,s,l,u,c=e.__scopePopper,d=e.side,f=void 0===d?"bottom":d,h=e.sideOffset,p=void 0===h?0:h,v=e.align,g=void 0===v?"center":v,m=e.alignOffset,y=void 0===m?0:m,b=e.arrowPadding,w=void 0===b?0:b,k=e.collisionBoundary,x=void 0===k?[]:k,S=e.collisionPadding,C=void 0===S?0:S,_=e.sticky,E=void 0===_?"partial":_,P=e.hideWhenDetached,L=void 0!==P&&P,O=e.avoidCollisions,A=void 0===O||O,M=sn(e,Ot),T=Xpe(Kpe,c),I=yn(cr.useState(null),2),R=I[0],N=I[1],D=Jfe(t,(function(e){return N(e)})),z=yn(cr.useState(null),2),j=z[0],B=z[1],F=function(e){var t=yn(cr.useState(void 0),2),n=t[0],r=t[1];return The((function(){if(e){r({width:e.offsetWidth,height:e.offsetHeight});var t=new ResizeObserver((function(t){if(Array.isArray(t)&&t.length){var n,o,i=t[0];if("borderBoxSize"in i){var a=i.borderBoxSize,s=Array.isArray(a)?a[0]:a;n=s.inlineSize,o=s.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})}}));return t.observe(e,{box:"border-box"}),function(){return t.unobserve(e)}}r(void 0)}),[e]),n}(j),H=null!==(n=null==F?void 0:F.width)&&void 0!==n?n:0,V=null!==(r=null==F?void 0:F.height)&&void 0!==r?r:0,W=f+("center"!==g?"-"+g:""),U="number"==typeof C?C:un({top:0,right:0,bottom:0,left:0},C),G=Array.isArray(x)?x:[x],q=G.length>0,Y={padding:U,boundary:G.filter(ive),altBoundary:q},Z=Hpe({strategy:"fixed",placement:W,whileElementsMounted:jpe,middleware:[ipe({mainAxis:p+V,alignmentAxis:y}),A?spe(un({mainAxis:!0,crossAxis:!1,limiter:"partial"===E?lpe():void 0},Y)):void 0,j?Vpe({element:j,padding:w}):void 0,A?tpe(un({},Y)):void 0,ave({arrowWidth:H,arrowHeight:V}),L?ope({strategy:"referenceHidden"}):void 0].filter(ove)}),X=Z.reference,$=Z.floating,K=Z.strategy,Q=Z.x,J=Z.y,ee=Z.placement,te=Z.middlewareData,ne=Z.update;The((function(){X(T.anchor)}),[X,T.anchor]);var re=null!==Q&&null!==J,oe=yn(sve(ee),2),ie=oe[0],ae=oe[1],se=null===(o=te.arrow)||void 0===o?void 0:o.x,le=null===(i=te.arrow)||void 0===i?void 0:i.y,ue=0!==(null===(a=te.arrow)||void 0===a?void 0:a.centerOffset),ce=yn(cr.useState(),2),de=ce[0],fe=ce[1];The((function(){R&&fe(window.getComputedStyle(R).zIndex)}),[R]);var he=nve(Kpe,c),pe=he.hasParent,ve=he.positionUpdateFns,ge=!pe;cr.useLayoutEffect((function(){if(!ge)return ve.add(ne),function(){ve.delete(ne)}}),[ge,ve,ne]),cr.useLayoutEffect((function(){ge&&re&&Array.from(ve).reverse().forEach((function(e){return requestAnimationFrame(e)}))}),[ge,re,ve]);var me=un(un({"data-side":ie,"data-align":ae},M),{},{ref:D,style:un(un({},M.style),{},{animation:re?void 0:"none",opacity:null!==(s=te.hide)&&void 0!==s&&s.referenceHidden?0:void 0})});return cr.createElement("div",{ref:$,"data-radix-popper-content-wrapper":"",style:gn({position:K,left:0,top:0,transform:re?"translate3d(".concat(Math.round(Q),"px, ").concat(Math.round(J),"px, 0)"):"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:de},"--radix-popper-transform-origin",[null===(l=te.transformOrigin)||void 0===l?void 0:l.x,null===(u=te.transformOrigin)||void 0===u?void 0:u.y].join(" "))},cr.createElement(Jpe,{scope:c,placedSide:ie,onArrowChange:B,arrowX:se,arrowY:le,shouldHideArrow:ue},ge?cr.createElement(tve,{scope:c,hasParent:!0,positionUpdateFns:ve},cr.createElement(ohe.div,me)):cr.createElement(ohe.div,me)))}));function ove(e){return void 0!==e}function ive(e){return null!==e}var ave=function(e){return{name:"transformOrigin",options:e,fn:function(t){var n,r,o,i,a,s=t.placement,l=t.rects,u=t.middlewareData,c=0!==(null===(n=u.arrow)||void 0===n?void 0:n.centerOffset),d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,h=yn(sve(s),2),p=h[0],v={start:"0%",center:"50%",end:"100%"}[h[1]],g=(null!==(r=null===(o=u.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+d/2,m=(null!==(i=null===(a=u.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+f/2,y="",b="";return"bottom"===p?(y=c?v:"".concat(g,"px"),b="".concat(-f,"px")):"top"===p?(y=c?v:"".concat(g,"px"),b="".concat(l.floating.height+f,"px")):"right"===p?(y="".concat(-f,"px"),b=c?v:"".concat(m,"px")):"left"===p&&(y="".concat(l.floating.width+f,"px"),b=c?v:"".concat(m,"px")),{data:{x:y,y:b}}}}};function sve(e){var t=yn(e.split("-"),2),n=t[0],r=t[1];return[n,void 0===r?"center":r]}var lve=function(e){var t=e.__scopePopper,n=e.children,r=yn(cr.useState(null),2),o=r[0],i=r[1];return cr.createElement(Zpe,{scope:t,anchor:o,onAnchorChange:i},n)},uve=$pe,cve=rve;var dve=function(e){var t=e.present,n=e.children,r=function(e){var t=yn(cr.useState(),2),n=t[0],r=t[1],o=cr.useRef({}),i=cr.useRef(e),a=cr.useRef("none"),s=e?"mounted":"unmounted",l=function(e,t){return cr.useReducer((function(e,n){var r=t[e][n];return null!=r?r:e}),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=yn(l,2),c=u[0],d=u[1];return cr.useEffect((function(){var e=fve(o.current);a.current="mounted"===c?e:"none"}),[c]),The((function(){var t=o.current,n=i.current;if(n!==e){var r=a.current,s=fve(t);if(e)d("MOUNT");else if("none"===s||"none"===(null==t?void 0:t.display))d("UNMOUNT");else{d(n&&r!==s?"ANIMATION_OUT":"UNMOUNT")}i.current=e}}),[e,d]),The((function(){if(n){var e=function(e){var t=fve(o.current).includes(e.animationName);e.target===n&&t&&QO.flushSync((function(){return d("ANIMATION_END")}))},t=function(e){e.target===n&&(a.current=fve(o.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),function(){n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}d("ANIMATION_END")}),[n,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:cr.useCallback((function(e){e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):cr.Children.only(n),i=Jfe(r.ref,o.ref);return"function"==typeof n||r.isPresent?cr.cloneElement(o,{ref:i}):null};function fve(e){return(null==e?void 0:e.animationName)||"none"}function hve(e){var t=e.prop,n=e.defaultProp,r=e.onChange,o=void 0===r?function(){}:r,i=function(e){var t=e.defaultProp,n=e.onChange,r=cr.useState(t),o=yn(r,1)[0],i=cr.useRef(o),a=uhe(n);return cr.useEffect((function(){i.current!==o&&(a(o),i.current=o)}),[o,i,a]),r}({defaultProp:n,onChange:o}),a=yn(i,2),s=a[0],l=a[1],u=void 0!==t,c=u?t:s,d=uhe(o);return[c,cr.useCallback((function(e){if(u){var n="function"==typeof e?e(t):e;n!==t&&d(n)}else l(e)}),[u,t,l,d])]}dve.displayName="Presence";var pve="rovingFocusGroup.onEntryFocus",vve={bubbles:!1,cancelable:!0},gve="RovingFocusGroup",mve=yn(ahe(gve),3),yve=mve[0],bve=mve[1],wve=yn(Xfe(gve,[mve[2]]),2),kve=wve[0],xve=wve[1],Sve=yn(kve(gve),2),Cve=Sve[0],_ve=Sve[1],Eve=cr.forwardRef((function(e,t){return cr.createElement(yve.Provider,{scope:e.__scopeRovingFocusGroup},cr.createElement(yve.Slot,{scope:e.__scopeRovingFocusGroup},cr.createElement(Pve,ps({},e,{ref:t}))))})),Pve=cr.forwardRef((function(e,t){var n=e.__scopeRovingFocusGroup,r=e.orientation,o=e.loop,i=void 0!==o&&o,a=e.dir,s=e.currentTabStopId,l=e.defaultCurrentTabStopId,u=e.onCurrentTabStopIdChange,c=e.onEntryFocus,d=sn(e,At),f=cr.useRef(null),h=Jfe(t,f),p=lhe(a),v=yn(hve({prop:s,defaultProp:l,onChange:u}),2),g=v[0],m=void 0===g?null:g,y=v[1],b=yn(cr.useState(!1),2),w=b[0],k=b[1],x=uhe(c),S=bve(n),C=cr.useRef(!1),_=yn(cr.useState(0),2),E=_[0],P=_[1];return cr.useEffect((function(){var e=f.current;if(e)return e.addEventListener(pve,x),function(){return e.removeEventListener(pve,x)}}),[x]),cr.createElement(Cve,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:m,onItemFocus:cr.useCallback((function(e){return y(e)}),[y]),onItemShiftTab:cr.useCallback((function(){return k(!0)}),[]),onFocusableItemAdd:cr.useCallback((function(){return P((function(e){return e+1}))}),[]),onFocusableItemRemove:cr.useCallback((function(){return P((function(e){return e-1}))}),[])},cr.createElement(ohe.div,ps({tabIndex:w||0===E?-1:0,"data-orientation":r},d,{ref:h,style:un({outline:"none"},e.style),onMouseDown:Zfe(e.onMouseDown,(function(){C.current=!0})),onFocus:Zfe(e.onFocus,(function(e){var t=!C.current;if(e.target===e.currentTarget&&t&&!w){var n=new CustomEvent(pve,vve);if(e.currentTarget.dispatchEvent(n),!n.defaultPrevented){var r=S().filter((function(e){return e.focusable}));Ave([r.find((function(e){return e.active})),r.find((function(e){return e.id===m}))].concat(cn(r)).filter(Boolean).map((function(e){return e.ref.current})))}}C.current=!1})),onBlur:Zfe(e.onBlur,(function(){return k(!1)}))})))})),Lve=cr.forwardRef((function(e,t){var n=e.__scopeRovingFocusGroup,r=e.focusable,o=void 0===r||r,i=e.active,a=void 0!==i&&i,s=sn(e,Mt),l=function(e){var t=yn(cr.useState(Ihe()),2),n=t[0],r=t[1];return The((function(){e||r((function(e){return null!=e?e:String(Rhe++)}))}),[e]),e||(n?"radix-".concat(n):"")}(),u=_ve("RovingFocusGroupItem",n),c=u.currentTabStopId===l,d=bve(n),f=u.onFocusableItemAdd,h=u.onFocusableItemRemove;return cr.useEffect((function(){if(o)return f(),function(){return h()}}),[o,f,h]),cr.createElement(yve.ItemSlot,{scope:n,id:l,focusable:o,active:a},cr.createElement(ohe.span,ps({tabIndex:c?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:Zfe(e.onMouseDown,(function(e){o?u.onItemFocus(l):e.preventDefault()})),onFocus:Zfe(e.onFocus,(function(){return u.onItemFocus(l)})),onKeyDown:Zfe(e.onKeyDown,(function(e){if("Tab"===e.key&&e.shiftKey)u.onItemShiftTab();else if(e.target===e.currentTarget){var t,n,r=function(e,t,n){var r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Ove[r]}(e,u.orientation,u.dir);if(void 0!==r){e.preventDefault();var o=d().filter((function(e){return e.focusable})).map((function(e){return e.ref.current}));if("last"===r)o.reverse();else if("prev"===r||"next"===r){"prev"===r&&o.reverse();var i=o.indexOf(e.currentTarget);o=u.loop?(n=i+1,(t=o).map((function(e,r){return t[(n+r)%t.length]}))):o.slice(i+1)}setTimeout((function(){return Ave(o)}))}}}))})))})),Ove={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ave(e){var t,n=document.activeElement,r=xn(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o===n)return;if(o.focus(),document.activeElement!==n)return}}catch(COe){r.e(COe)}finally{r.f()}}var Mve=Eve,Tve=Lve,Ive=["Enter"," "],Rve=["ArrowUp","PageDown","End"],Nve=[].concat(["ArrowDown","PageUp","Home"],Rve),Dve="Menu",zve=yn(ahe(Dve),3),jve=zve[0],Bve=zve[1],Fve=yn(Xfe(Dve,[zve[2],qpe,xve]),2),Hve=Fve[0],Vve=Fve[1],Wve=qpe(),Uve=xve(),Gve=yn(Hve(Dve),2),qve=Gve[0],Yve=Gve[1],Zve=yn(Hve(Dve),2),Xve=Zve[0],$ve=Zve[1],Kve=cr.forwardRef((function(e,t){var n=e.__scopeMenu,r=sn(e,Tt),o=Wve(n);return cr.createElement(uve,ps({},o,r,{ref:t}))})),Qve=yn(Hve("MenuPortal",{forceMount:void 0}),2),Jve=(Qve[0],Qve[1]),ege="MenuContent",tge=yn(Hve(ege),2),nge=tge[0],rge=tge[1],oge=cr.forwardRef((function(e,t){var n=Jve(ege,e.__scopeMenu),r=e.forceMount,o=void 0===r?n.forceMount:r,i=sn(e,It),a=Yve(ege,e.__scopeMenu),s=$ve(ege,e.__scopeMenu);return cr.createElement(jve.Provider,{scope:e.__scopeMenu},cr.createElement(dve,{present:o||a.open},cr.createElement(jve.Slot,{scope:e.__scopeMenu},s.modal?cr.createElement(ige,ps({},i,{ref:t})):cr.createElement(age,ps({},i,{ref:t})))))})),ige=cr.forwardRef((function(e,t){var n=Yve(ege,e.__scopeMenu),r=cr.useRef(null),o=Jfe(t,r);return cr.useEffect((function(){var e=r.current;if(e)return SH(e)}),[]),cr.createElement(sge,ps({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Zfe(e.onFocusOutside,(function(e){return e.preventDefault()}),{checkForDefaultPrevented:!1}),onDismiss:function(){return n.onOpenChange(!1)}}))})),age=cr.forwardRef((function(e,t){var n=Yve(ege,e.__scopeMenu);return cr.createElement(sge,ps({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:function(){return n.onOpenChange(!1)}}))})),sge=cr.forwardRef((function(e,t){var n=e.__scopeMenu,r=e.loop,o=void 0!==r&&r,i=e.trapFocus,a=e.onOpenAutoFocus,s=e.onCloseAutoFocus,l=e.disableOutsidePointerEvents,u=e.onEscapeKeyDown,c=e.onPointerDownOutside,d=e.onFocusOutside,f=e.onInteractOutside,h=e.onDismiss,p=e.disableOutsideScroll,v=sn(e,Rt),g=Yve(ege,n),m=$ve(ege,n),y=Wve(n),b=Uve(n),w=Bve(n),k=yn(cr.useState(null),2),x=k[0],S=k[1],C=cr.useRef(null),_=Jfe(t,C,g.onContentChange),E=cr.useRef(0),P=cr.useRef(""),L=cr.useRef(0),O=cr.useRef(null),A=cr.useRef("right"),M=cr.useRef(0),T=p?NW:cr.Fragment,I=p?{as:ehe,allowPinchZoom:!0}:void 0,R=function(e){var t,n,r=P.current+e,o=w().filter((function(e){return!e.disabled})),i=document.activeElement,a=null===(t=o.find((function(e){return e.ref.current===i})))||void 0===t?void 0:t.textValue,s=function(e,t,n){var r=t.length>1&&Array.from(t).every((function(e){return e===t[0]})),o=r?t[0]:t,i=n?e.indexOf(n):-1,a=(s=e,l=Math.max(i,0),s.map((function(e,t){return s[(l+t)%s.length]})));var s,l;1===o.length&&(a=a.filter((function(e){return e!==n})));var u=a.find((function(e){return e.toLowerCase().startsWith(o.toLowerCase())}));return u!==n?u:void 0}(o.map((function(e){return e.textValue})),r,a),l=null===(n=o.find((function(e){return e.textValue===s})))||void 0===n?void 0:n.ref.current;!function e(t){P.current=t,window.clearTimeout(E.current),""!==t&&(E.current=window.setTimeout((function(){return e("")}),1e3))}(r),l&&setTimeout((function(){return l.focus()}))};cr.useEffect((function(){return function(){return window.clearTimeout(E.current)}}),[]),cr.useEffect((function(){var e,t,n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:bhe()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:bhe()),yhe++,function(){1===yhe&&document.querySelectorAll("[data-radix-focus-guard]").forEach((function(e){return e.remove()})),yhe--}}),[]);var N,D=cr.useCallback((function(e){var t,n;return A.current===(null===(t=O.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;var n={x:e.clientX,y:e.clientY};return function(e,t){for(var n=e.x,r=e.y,o=!1,i=0,a=t.length-1;ir!=c>r&&n<(u-s)*(r-l)/(c-l)+s&&(o=!o)}return o}(n,t)}(e,null===(n=O.current)||void 0===n?void 0:n.area)}),[]);return cr.createElement(nge,{scope:n,searchRef:P,onItemEnter:cr.useCallback((function(e){D(e)&&e.preventDefault()}),[D]),onItemLeave:cr.useCallback((function(e){var t;D(e)||(null===(t=C.current)||void 0===t||t.focus(),S(null))}),[D]),onTriggerLeave:cr.useCallback((function(e){D(e)&&e.preventDefault()}),[D]),pointerGraceTimerRef:L,onPointerGraceIntentChange:cr.useCallback((function(e){O.current=e}),[])},cr.createElement(T,I,cr.createElement(She,{asChild:!0,trapped:i,onMountAutoFocus:Zfe(a,(function(e){var t;e.preventDefault(),null===(t=C.current)||void 0===t||t.focus()})),onUnmountAutoFocus:s},cr.createElement(vhe,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:h},cr.createElement(Mve,ps({asChild:!0},b,{dir:m.dir,orientation:"vertical",loop:o,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:function(e){m.isUsingKeyboardRef.current||e.preventDefault()}}),cr.createElement(cve,ps({role:"menu","aria-orientation":"vertical","data-state":(N=g.open,N?"open":"closed"),"data-radix-menu-content":"",dir:m.dir},y,v,{ref:_,style:un({outline:"none"},v.style),onKeyDown:Zfe(v.onKeyDown,(function(e){var t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&R(e.key));var o=C.current;if(e.target===o&&Nve.includes(e.key)){e.preventDefault();var i=w().filter((function(e){return!e.disabled})).map((function(e){return e.ref.current}));Rve.includes(e.key)&&i.reverse(),function(e){var t,n=document.activeElement,r=xn(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o===n)return;if(o.focus(),document.activeElement!==n)return}}catch(COe){r.e(COe)}finally{r.f()}}(i)}})),onBlur:Zfe(e.onBlur,(function(e){e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),P.current="")})),onPointerMove:Zfe(e.onPointerMove,fge((function(e){var t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){var r=e.clientX>M.current?"right":"left";A.current=r,M.current=e.clientX}})))})))))))})),lge="MenuItem",uge="menu.itemSelect",cge=cr.forwardRef((function(e,t){var n=e.disabled,r=void 0!==n&&n,o=e.onSelect,i=sn(e,Nt),a=cr.useRef(null),s=$ve(lge,e.__scopeMenu),l=rge(lge,e.__scopeMenu),u=Jfe(t,a),c=cr.useRef(!1);return cr.createElement(dge,ps({},i,{ref:u,disabled:r,onClick:Zfe(e.onClick,(function(){var e=a.current;if(!r&&e){var t=new CustomEvent(uge,{bubbles:!0,cancelable:!0});e.addEventListener(uge,(function(e){return null==o?void 0:o(e)}),{once:!0}),ihe(e,t),t.defaultPrevented?c.current=!1:s.onClose()}})),onPointerDown:function(t){var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),c.current=!0},onPointerUp:Zfe(e.onPointerUp,(function(e){var t;c.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:Zfe(e.onKeyDown,(function(e){var t=""!==l.searchRef.current;r||t&&" "===e.key||Ive.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),dge=cr.forwardRef((function(e,t){var n=e.__scopeMenu,r=e.disabled,o=void 0!==r&&r,i=e.textValue,a=sn(e,Dt),s=rge(lge,n),l=Uve(n),u=cr.useRef(null),c=Jfe(t,u),d=yn(cr.useState(!1),2),f=d[0],h=d[1],p=yn(cr.useState(""),2),v=p[0],g=p[1];return cr.useEffect((function(){var e,t=u.current;t&&g((null!==(e=t.textContent)&&void 0!==e?e:"").trim())}),[a.children]),cr.createElement(jve.ItemSlot,{scope:n,disabled:o,textValue:null!=i?i:v},cr.createElement(Tve,ps({asChild:!0},l,{focusable:!o}),cr.createElement(ohe.div,ps({role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0},a,{ref:c,onPointerMove:Zfe(e.onPointerMove,fge((function(e){o?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus())}))),onPointerLeave:Zfe(e.onPointerLeave,fge((function(e){return s.onItemLeave(e)}))),onFocus:Zfe(e.onFocus,(function(){return h(!0)})),onBlur:Zfe(e.onBlur,(function(){return h(!1)}))}))))}));Hve("MenuRadioGroup",{value:void 0,onValueChange:function(){}});Hve("MenuItemIndicator",{checked:!1});function fge(e){return function(t){return"mouse"===t.pointerType?e(t):void 0}}Hve("MenuSub");var hge=function(e){var t=e.__scopeMenu,n=e.open,r=void 0!==n&&n,o=e.children,i=e.dir,a=e.onOpenChange,s=e.modal,l=void 0===s||s,u=Wve(t),c=yn(cr.useState(null),2),d=c[0],f=c[1],h=cr.useRef(!1),p=uhe(a),v=lhe(i);return cr.useEffect((function(){var e=function(){h.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=function(){return h.current=!1};return document.addEventListener("keydown",e,{capture:!0}),function(){document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),cr.createElement(lve,u,cr.createElement(qve,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f},cr.createElement(Xve,{scope:t,onClose:cr.useCallback((function(){return p(!1)}),[p]),isUsingKeyboardRef:h,dir:v,modal:l},o)))},pge=Kve,vge=oge,gge=cge,mge="ContextMenu",yge=yn(Xfe(mge,[Vve]),2),bge=yge[0],wge=(yge[1],Vve()),kge=yn(bge(mge),2),xge=kge[0],Sge=kge[1];function Cge(e){return function(t){return"mouse"!==t.pointerType?e(t):void 0}}var _ge=function(e){var t=e.__scopeContextMenu,n=e.children,r=e.onOpenChange,o=e.dir,i=e.modal,a=void 0===i||i,s=yn(cr.useState(!1),2),l=s[0],u=s[1],c=wge(t),d=uhe(r),f=cr.useCallback((function(e){u(e),d(e)}),[d]);return cr.createElement(xge,{scope:t,open:l,onOpenChange:f,modal:a},cr.createElement(hge,ps({},c,{dir:o,open:l,onOpenChange:f,modal:a}),n))},Ege=cr.forwardRef((function(e,t){var n=e.__scopeContextMenu,r=sn(e,zt),o=Sge("ContextMenuTrigger",n),i=wge(n),a=cr.useRef({x:0,y:0}),s=cr.useRef({getBoundingClientRect:function(){return DOMRect.fromRect(un({width:0,height:0},a.current))}}),l=cr.useRef(0),u=cr.useCallback((function(){return window.clearTimeout(l.current)}),[]),c=function(e){a.current={x:e.clientX,y:e.clientY},o.onOpenChange(!0)};return cr.useEffect((function(){return u}),[u]),cr.createElement(cr.Fragment,null,cr.createElement(pge,ps({},i,{virtualRef:s})),cr.createElement(ohe.span,ps({"data-state":o.open?"open":"closed"},r,{ref:t,style:un({WebkitTouchCallout:"none"},e.style),onContextMenu:Zfe(e.onContextMenu,(function(e){u(),c(e),e.preventDefault()})),onPointerDown:Zfe(e.onPointerDown,Cge((function(e){u(),l.current=window.setTimeout((function(){return c(e)}),700)}))),onPointerMove:Zfe(e.onPointerMove,Cge(u)),onPointerCancel:Zfe(e.onPointerCancel,Cge(u)),onPointerUp:Zfe(e.onPointerUp,Cge(u))})))})),Pge=cr.forwardRef((function(e,t){var n=e.__scopeContextMenu,r=sn(e,jt),o=Sge("ContextMenuContent",n),i=wge(n),a=cr.useRef(!1);return cr.createElement(vge,ps({},i,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:function(t){var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&a.current&&t.preventDefault(),a.current=!1},onInteractOutside:function(t){var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||o.modal||(a.current=!0)},style:un(un({},e.style),{},gn({},"--radix-context-menu-content-transform-origin","var(--radix-popper-transform-origin)"))}))})),Lge=cr.forwardRef((function(e,t){var n=e.__scopeContextMenu,r=sn(e,Bt),o=wge(n);return cr.createElement(gge,ps({},o,r,{ref:t}))})),Oge=cr.memo((function(e){var t,n,r,o,i,a,s,l,u=wie(),c=kie(Ide),d=c.activeTabName,f=c.galleryImageObjectFit,h=c.galleryImageMinimumWidth,p=c.mayDeleteImage,v=c.shouldUseSingleGalleryColumn,g=e.image,m=e.isSelected,y=g.url,b=g.thumbnail,w=g.uuid,k=g.metadata,x=yn(cr.useState(!1),2),S=x[0],C=x[1],_=cY(),E=o8().t,P=function(){var e=qt(Ut().mark((function e(){var t;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==k||null===(t=k.image)||void 0===t||!t.init_image_path){e.next=9;break}return e.next=3,fetch(k.image.init_image_path);case 3:if(!e.sent.ok){e.next=9;break}return u(z8("img2img")),u(_4(k)),_({title:E("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0}),e.abrupt("return");case 9:_({title:E("toast:initialImageNotSet"),description:E("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return ro(_ge,{onOpenChange:function(e){u(s4(e))},children:[no(Ege,{children:ro(cP,{position:"relative",className:"hoverable-image",onMouseOver:function(){return C(!0)},onMouseOut:function(){return C(!1)},userSelect:"none",draggable:!0,onDragStart:function(e){e.dataTransfer.setData("invokeai/imageUuid",w),e.dataTransfer.effectAllowed="move"},children:[no(c_,{className:"hoverable-image-image",objectFit:v?"contain":f,rounded:"md",src:b||y,loading:"lazy"}),no("div",{className:"hoverable-image-content",onClick:function(){return u(K3(g))},children:m&&no(Gv,{width:"50%",height:"50%",as:Uce,className:"hoverable-image-check"})}),S&&h>=64&&no("div",{className:"hoverable-image-delete-button",children:no(Nde,{image:g,children:no(x_,{"aria-label":E("parameters:deleteImage"),icon:no(xde,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!p})})})]},w)}),ro(Pge,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:function(e){e.detail.originalEvent.preventDefault()},children:[no(Lge,{onClickCapture:function(){u(K3(g))},children:E("parameters:openInViewer")}),no(Lge,{onClickCapture:function(){if(g.metadata){var e,t,n=yn(m4(null===(e=g.metadata)||void 0===e||null===(t=e.image)||void 0===t?void 0:t.prompt),2),r=n[0],o=n[1];r&&u(N4(r)),u(D4(o||""))}_({title:E("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===(null==g||null===(t=g.metadata)||void 0===t||null===(n=t.image)||void 0===n?void 0:n.prompt),children:E("parameters:usePrompt")}),no(Lge,{onClickCapture:function(){g.metadata&&u(W4(g.metadata.image.seed)),_({title:E("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===(null==g||null===(r=g.metadata)||void 0===r||null===(o=r.image)||void 0===o?void 0:o.seed),children:E("parameters:useSeed")}),no(Lge,{onClickCapture:function(){k&&u(E4(k)),_({title:E("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},disabled:!["txt2img","img2img"].includes(null==g||null===(i=g.metadata)||void 0===i||null===(a=i.image)||void 0===a?void 0:a.type),children:E("parameters:useAll")}),no(Lge,{onClickCapture:P,disabled:"img2img"!==(null==g||null===(s=g.metadata)||void 0===s||null===(l=s.image)||void 0===l?void 0:l.type),children:E("parameters:useInitImg")}),no(Lge,{onClickCapture:function(){u(M4(g)),"img2img"!==d&&u(z8("img2img")),_({title:E("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},children:E("parameters:sendToImg2Img")}),no(Lge,{onClickCapture:function(){u(y3(g)),u(s3()),"unifiedCanvas"!==d&&u(z8("unifiedCanvas")),_({title:E("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},children:E("parameters:sendToUnifiedCanvas")}),no(Lge,{"data-warning":!0,children:no(Nde,{image:g,children:no("p",{children:E("parameters:deleteImage")})})})]})]})}),(function(e,t){return e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected}));Oge.displayName="HoverableImage";var Age=320,Mge={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}};function Tge(){var e=wie(),t=o8().t,n=kie(Tde),r=n.images,o=n.currentCategory,i=n.currentImageUuid,a=n.shouldPinGallery,s=n.shouldShowGallery,l=n.galleryScrollPosition,u=n.galleryImageMinimumWidth,c=n.galleryGridTemplateColumns,d=n.activeTabName,f=n.galleryImageObjectFit,h=n.shouldHoldGalleryOpen,p=n.shouldAutoSwitchToNewImages,v=n.areMoreImagesAvailable,g=n.galleryWidth,m=n.isLightboxOpen,y=n.isStaging,b=n.shouldEnableResize,w=n.shouldUseSingleGalleryColumn,k=m?{galleryMinWidth:400,galleryMaxWidth:400}:Mge[d],x=k.galleryMinWidth,S=k.galleryMaxWidth,C=yn(cr.useState(g>=Age),2),_=C[0],E=C[1],P=yn(cr.useState(!1),2),L=P[0],O=P[1],A=yn(cr.useState(0),2),M=A[0],T=A[1],I=cr.useRef(null),R=cr.useRef(null),N=cr.useRef(null);cr.useEffect((function(){g>=Age&&E(!1)}),[g]);var D=function(){e(n4(!a)),e(m3(!0))},z=function(){e(r4(!0)),a&&e(m3(!0))},j=cr.useCallback((function(){e(r4(!1)),e(s4(!1)),e(o4(R.current?R.current.scrollTop:0)),setTimeout((function(){return a&&e(m3(!0))}),400)}),[e,a]),B=function(){N.current&&window.clearTimeout(N.current)};_ce("g",(function(){s?j():z()}),[s,a]),_ce("left",(function(){e(t4())}),{enabled:!y||"unifiedCanvas"!==d},[y]),_ce("right",(function(){e(e4())}),{enabled:!y||"unifiedCanvas"!==d},[y]),_ce("shift+g",(function(){D()}),[a]),_ce("esc",(function(){e(r4(!1))}),{enabled:function(){return!a},preventDefault:!0},[a]);return _ce("shift+up",(function(){if(u<256){var t=JK(u+32,32,256);e(i4(t))}}),[u]),_ce("shift+down",(function(){if(u>32){var t=JK(u-32,32,256);e(i4(t))}}),[u]),cr.useEffect((function(){R.current&&(R.current.scrollTop=l)}),[l,s]),cr.useEffect((function(){function e(e){a||!I.current||I.current.contains(e.target)||j()}return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[j,a]),no(Yfe,{nodeRef:I,in:s||h,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:ro("div",{className:"image-gallery-wrapper",style:{zIndex:a?1:100},"data-pinned":a,ref:I,onMouseLeave:a?void 0:function(){h||(N.current=window.setTimeout((function(){return j()}),500))},onMouseEnter:a?void 0:B,onMouseOver:a?void 0:B,children:[ro(hfe,{minWidth:x,maxWidth:a?S:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:b},size:{width:g,height:a?"100%":"100vh"},onResizeStart:function(e,t,n){T(n.clientHeight),n.style.height="".concat(n.clientHeight,"px"),a&&(n.style.position="fixed",n.style.right="1rem",O(!0))},onResizeStop:function(t,n,r,o){var i=a?JK(Number(g)+o.width,x,Number(S)):Number(g)+o.width;e(c4(i)),r.removeAttribute("data-resize-alert"),a&&(r.style.position="relative",r.style.removeProperty("right"),r.style.setProperty("height",a?"100%":"100vh"),O(!1),e(m3(!0)))},onResize:function(t,n,r,o){var i=JK(Number(g)+o.width,x,Number(a?S:.95*window.innerWidth));i>=Age&&!_?E(!0):ii-40&&e(i4(i-40)),a&&(i>=S?r.setAttribute("data-resize-alert","true"):r.removeAttribute("data-resize-alert")),r.style.height="".concat(M,"px")},children:[ro("div",{className:"image-gallery-header",children:[no(k_,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:ro(to,_?{children:[no(Eae,{size:"sm","data-selected":"result"===o,onClick:function(){return e(u4("result"))},children:t("gallery:generations")}),no(Eae,{size:"sm","data-selected":"user"===o,onClick:function(){return e(u4("user"))},children:t("gallery:uploads")})]}:{children:[no(_ae,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":"result"===o,icon:no(ode,{}),onClick:function(){return e(u4("result"))}}),no(_ae,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":"user"===o,icon:no(Ede,{}),onClick:function(){return e(u4("user"))}})]})}),ro("div",{className:"image-gallery-header-right-icons",children:[no(Pae,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:no(_ae,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:no(Pde,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:ro("div",{className:"image-gallery-settings-popover",children:[ro("div",{children:[no(xfe,{value:u,onChange:function(t){e(i4(t))},min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),no(_ae,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:function(){return e(i4(64))},icon:no(mfe,{}),"data-selected":a,styleClass:"image-gallery-icon-btn"})]}),no("div",{children:no(pfe,{label:t("gallery:maintainAspectRatio"),isChecked:"contain"===f,onChange:function(){return e(a4("contain"===f?"cover":"contain"))}})}),no("div",{children:no(pfe,{label:t("gallery:autoSwitchNewImages"),isChecked:p,onChange:function(t){return e(l4(t.target.checked))}})}),no("div",{children:no(pfe,{label:t("gallery:singleColumnLayout"),isChecked:w,onChange:function(t){return e(d4(t.target.checked))}})})]})}),no(_ae,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:"".concat(t("gallery:pinGallery")," (Shift+G)"),onClick:D,icon:no(a?Sfe:Cfe,{})})]})]}),no("div",{className:"image-gallery-container",ref:R,children:r.length||v?ro(to,{children:[no("div",{className:"image-gallery",style:{gridTemplateColumns:c},children:r.map((function(e){var t=e.uuid;return no(Oge,{image:e,isSelected:i===t},t)}))}),no(b_,{onClick:function(){e(tie(o))},isDisabled:!v,className:"image-gallery-load-more-btn",children:t(v?"gallery:loadMore":"gallery:allImagesLoaded")})]}):ro("div",{className:"image-gallery-container-placeholder",children:[no(Ofe,{}),no("p",{children:t("gallery:noImagesInGallery")})]})})]}),L&&no("div",{style:{width:"".concat(g,"px"),height:"100%"}})]})})} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Ige=function(e,t){return Ige=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ige(e,t)};var Rge=function(){return Rge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n?(r(1),e.animation=null):e.animation&&(r(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Vge(e,t,n,r){var o=function(e){var t=e.scale,n=e.positionX,r=e.positionY;if(isNaN(t)||isNaN(n)||isNaN(r))return!1;return!0}(t);if(e.mounted&&o){var i=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,c=t.scale-s,d=t.positionX-l,f=t.positionY-u;0===n?i(t.scale,t.positionX,t.positionY):Hge(e,r,n,(function(e){i(s+c*e,l+d*e,u+f*e)}))}}var Wge=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=function(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:i,newDiffWidth:r-i,newContentHeight:a,newDiffHeight:o-a}}(n,r,t),a=i.wrapperWidth,s=i.wrapperHeight,l=function(e,t,n,r,o,i,a){var s=e>t?n*(a?1:.5):0,l=r>o?i*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-o-l,maxPositionY:l}}(a,i.newContentWidth,i.newDiffWidth,s,i.newContentHeight,i.newDiffHeight,Boolean(o));return l},Uge=function(e,t){var n=Wge(e,t);return e.bounds=n,n};function Gge(e,t,n,r,o,i,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,c=n.maxPositionY,d=0,f=0;return a&&(d=o,f=i),{x:qge(e,s-d,u+d,r),y:qge(t,l-f,c+f,r)}}var qge=function(e,t,n,r){return Dge(r?en?n:e:e,2)};function Yge(e,t,n,r,o,i){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,c=r-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:u}):Gge(l-t*c,u-n*c,o,i,0,0,null)}function Zge(e,t,n,r,o){var i=t-(o?r:0);return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=i?i:e}var Xge=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,a=null==o?void 0:o.contains(i);return!!(r&&i&&a)&&!xme(i,n)},$ge=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!(!t||!n||r)};var Kge=function(e,t){var n=e.setup,r=e.transformState.scale,o=n.minScale;return t>0&&r>=o?t:0};function Qge(e,t,n,r,o,i,a,s,l,u){if(o){var c;if(t>a&&n>a)return(c=a+(e-a)*u)>l?l:ci?i:c}return r?t:qge(e,i,a,o)}function Jge(e,t){var n=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale;return!(o.disabled&&!(i>1)&&r&&!t)}(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,a=e.wrapperComponent,s=i.velocityAnimation.equalToMove,l=Date.now();if(r&&o&&a){var u=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),c=t.x-r.x,d=t.y-r.y,f=c/u,h=d/u,p=l-o,v=c*c+d*d,g=Math.sqrt(v)/p;e.velocity={velocityX:f,velocityY:h,total:g}}e.lastMousePosition=t,e.velocityTime=l}}function eme(e,t){var n=e.transformState.scale;Fge(e),Uge(e,n),t.touches?function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-i}}}(e,t):function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,a=t.clientY;e.startCoords={x:i-r,y:a-o}}(e,t)}function tme(e,t,n){var r=e.startCoords,o=e.setup.alignmentAnimation,i=o.sizeX,a=o.sizeY;if(r){var s=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,a=i.lockAxisX,s=i.lockAxisY,l=o.positionX,u=o.positionY;if(!r)return{x:l,y:u};var c=t-r.x,d=n-r.y;return{x:a?l:c,y:s?u:d}}(e,t,n),l=s.x,u=s.y,c=Kge(e,i),d=Kge(e,a);Jge(e,{x:l,y:u}),function(e,t,n,r,o){var i=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,c=l.positionX,d=l.positionY;if(a&&t!==c&&n!==d&&s){var f=Gge(t,n,s,i,r,o,a),h=f.x,p=f.y;e.setTransformState(u,h,p)}}(e,l,u,c,d)}}function nme(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=null==r?void 0:r.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==i?void 0:i.width)||0,l=(null==i?void 0:i.height)||0,u=(null==a?void 0:a.width)||0,c=(null==a?void 0:a.height)||0,d=s.1&&d?function(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&i&&!t||!n||!r)}(e);if(i&&t&&n&&o){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,c=n.minPositionX,d=n.maxPositionY,f=n.minPositionY,h=r.limitToBounds,p=r.alignmentAnimation,v=r.zoomAnimation,g=r.panning,m=g.lockAxisY,y=g.lockAxisX,b=v.animationType,w=p.sizeX,k=p.sizeY,x=p.velocityAlignmentTime,S=function(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}(e,l),C=Math.max(S,x),_=Kge(e,w),E=Kge(e,k),P=_*o.offsetWidth/100,L=E*o.offsetHeight/100,O=u+P,A=c-P,M=d+L,T=f-L,I=e.transformState,R=(new Date).getTime();Hge(e,b,C,(function(t){var n=e.transformState,r=n.scale,o=n.positionX,i=n.positionY,l=((new Date).getTime()-R)/x,v=1-(0,jge[p.animationType])(Math.min(1,l)),g=1-t,b=o+a*g,w=i+s*g,k=Qge(b,I.positionX,o,y,h,c,u,A,O,v),S=Qge(w,I.positionY,i,m,h,f,d,T,M,v);o===b&&i===w||e.setTransformState(r,k,S)}))}}(e):rme(e)}}function rme(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,a=o.sizeX,s=o.sizeY,l=o.animationTime,u=o.animationType;if(!(i||td||nh||rd?u.offsetWidth:e.setup.minPositionX||0,r>h?u.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||l),y=m.x,b=m.y;return{scale:o,positionX:v?y:n,positionY:g?b:r}}}(e);c&&Vge(e,c,l,u)}}function ome(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.minScale,s=i.limitToBounds,l=i.zoomAnimation,u=l.disabled,c=l.animationTime,d=l.animationType,f=u||r>=a;if((r>=1||s)&&rme(e),!f&&o&&e.mounted){var h=ime(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);h&&Vge(e,h,c,d)}}function ime(e,t,n,r){var o=e.setup,i=o.minScale,a=o.maxScale,s=o.limitToBounds,l=Zge(Dge(t,2),i,a,0,!1),u=Yge(e,n,r,l,Uge(e,l),s);return{scale:l,positionX:u.x,positionY:u.y}}var ame={previousScale:1,scale:1,positionX:0,positionY:0},sme=Rge(Rge({},ame),{setComponents:function(){},contextInstance:null}),lme={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,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}},ume=function(e){var t,n,r,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:ame.scale,scale:null!==(n=e.initialScale)&&void 0!==n?n:ame.scale,positionX:null!==(r=e.initialPositionX)&&void 0!==r?r:ame.positionX,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:ame.positionY}},cme=function(e){var t=Rge({},lme);return Object.keys(e).forEach((function(n){var r=void 0!==e[n];if(void 0!==lme[n]&&r){var o=Object.prototype.toString.call(lme[n]),i="[object Object]"===o,a="[object Array]"===o;t[n]=i?Rge(Rge({},lme[n]),e[n]):a?Nge(Nge([],lme[n]),e[n]):e[n]}})),t},dme=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.maxScale,s=i.minScale,l=i.zoomAnimation.size;if(!o)throw new Error("Wrapper is not mounted");var u=r*Math.exp(t*n);return Zge(Dge(u,3),s,a,l,!1)};function fme(e,t,n,r,o){var i=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!i)return console.error("No WrapperComponent found");var c=(i.offsetWidth/2-l)/s,d=(i.offsetHeight/2-u)/s,f=ime(e,dme(e,t,n),c,d);if(!f)return console.error("Error during zoom event. New transformation state was not calculated.");Vge(e,f,r,o)}function hme(e,t,n){var r=e.setup,o=e.wrapperComponent,i=r.limitToBounds,a=ume(e.props),s=e.transformState,l=s.scale,u=s.positionX,c=s.positionY;if(o){var d=Wge(e,a.scale),f=Gge(a.positionX,a.positionY,d,i,0,0,o),h={scale:a.scale,positionX:f.x,positionY:f.y};l===a.scale&&u===a.positionX&&c===a.positionY||Vge(e,h,t,n)}}var pme=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),fme(e,1,t,n,r)}},vme=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),fme(e,-1,t,n,r)}},gme=function(e){return function(t,n,r,o,i){void 0===o&&(o=300),void 0===i&&(i="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,c=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&c&&d){var f={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Vge(e,f,o,i)}}},mme=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),hme(e,t,n)}},yme=function(e){return function(t,n,r){void 0===n&&(n=200),void 0===r&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,a=e.contentComponent;if(i&&a){var s=_me(t||o.scale,i,a);Vge(e,s,n,r)}}},bme=function(e){return function(t,n,r,o){void 0===r&&(r=600),void 0===o&&(o="easeOut"),Fge(e);var i=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(i&&function(e){return e?void 0!==(null==e?void 0:e.offsetWidth)&&void 0!==(null==e?void 0:e.offsetHeight)||(console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1):(console.error("Zoom node not found"),!1)}(a)&&a&&i.contains(a)){var s=function(e,t,n){var r=e.wrapperComponent,o=e.setup,i=o.limitToBounds,a=o.minScale,s=o.maxScale;if(!r)return ame;var l=r.getBoundingClientRect(),u=function(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}(t),c=u.x,d=u.y,f=t.offsetWidth,h=t.offsetHeight,p=r.offsetWidth/f,v=r.offsetHeight/h,g=Zge(n||Math.min(p,v),a,s,0,!1),m=(l.width-f*g)/2,y=(l.height-h*g)/2,b=Gge((l.left-c)*g+m,(l.top-d)*g+y,Wge(e,g),i,0,0,r);return{positionX:b.x,positionY:b.y,scale:g}}(e,a,n);Vge(e,s,r,o)}}},wme=function(e){return{instance:e,state:e.transformState,zoomIn:pme(e),zoomOut:vme(e),setTransform:gme(e),resetTransform:mme(e),centerView:yme(e),zoomToElement:bme(e)}};function kme(){try{return{get passive(){return!0,!1}}}catch(COe){return!1}}var xme=function(e,t){var n=e.tagName.toUpperCase();return!!t.find((function(e){return e.toUpperCase()===n}))||!!t.find((function(t){return e.classList.contains(t)}))},Sme=function(e){e&&clearTimeout(e)},Cme=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},_me=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-r)/2,positionY:(t.offsetHeight-o)/2}},Eme=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target;return!(!s||l||r||!u)&&(!(o&&!t.ctrlKey)&&((!i||!t.ctrlKey)&&!xme(u,a)))};function Pme(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 a=e.touches[0];o=(a.clientX-r.left)/n,i=(a.clientY-r.top)/n}return(isNaN(o)||isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var Lme=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,a=t.target;return!(!i||r||!a)&&!xme(a,o)},Ome=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||!r)},Ame=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))},Mme=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Fge(e),zge(wme(e),t,r),zge(wme(e),t,o))},Tme=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,u=a.centerZoomedOut,c=a.zoomAnimation,d=a.wheel,f=c.size,h=c.disabled,p=d.step;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var v=function(e,t){var n,r,o=e?e.deltaY<0?1:-1:0;return r=o,"number"==typeof(n=t)?n:r}(t,null),g=function(e,t,n,r,o){var i=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,c=s.zoomAnimation,d=c.size,f=c.disabled;if(!a)throw new Error("Wrapper is not mounted");var h=i+t*(i-i*n)*n;if(o)return h;var p=!r&&!f;return Zge(Dge(h,3),u,l,d,p)}(e,v,p,!t.ctrlKey);if(s!==g){var m=Uge(e,g),y=Pme(t,i,s),b=l&&(h||0===f||u),w=Yge(e,y.x,y.y,g,m,b),k=w.x,x=w.y;e.previousWheelEvent=t,e.setTransformState(g,k,x),zge(wme(e),t,r),zge(wme(e),t,o)}},Ime=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Sme(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(ome(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var i=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,a=o.minScale;return!!n&&(ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);i&&(Sme(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,zge(wme(e),t,r),zge(wme(e),t,o))}),160))},Rme=function(e,t){var n=Ame(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Fge(e)},Nme=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,a=i.limitToBounds,s=i.centerZoomedOut,l=i.zoomAnimation,u=l.disabled,c=l.size;if(null!==r&&n){var d=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=Dge(o[0].clientX-r.left,5),a=Dge(o[0].clientY-r.top,5);return{x:(i+Dge(o[1].clientX-r.left,5))/2/t,y:(a+Dge(o[1].clientY-r.top,5))/2/t}}(t,o,n);if(isFinite(d.x)&&isFinite(d.y)){var f=Ame(t),h=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,a=o.minScale,s=o.zoomAnimation,l=s.size,u=s.disabled;if(!n||null===r||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:Zge(Dge(t/r*n,2),a,i,l,!u)}(e,f);if(h!==o){var p=Uge(e,h),v=a&&(u||0===c||s),g=Yge(e,d.x,d.y,h,p,v),m=g.x,y=g.y;e.pinchMidpoint=d,e.lastDistance=f,e.setTransformState(h,m,y)}}}},Dme=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,ome(e,null==t?void 0:t.x,null==t?void 0:t.y)};function zme(e,t){var n=e.setup.doubleClick,r=n.disabled,o=n.mode,i=n.step,a=n.animationTime,s=n.animationType;if(!r){if("reset"===o)return hme(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var c=dme(e,"zoomOut"===o?-1:1,i),d=Pme(t,u,l),f=ime(e,c,d.x,d.y);if(!f)return console.error("Error during zoom event. New transformation state was not calculated.");Vge(e,f,a,s)}}var jme=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,a=i.disabled,s=i.excluded,l=t.target,u=null==o?void 0:o.contains(l),c=n&&l&&u&&!a;return!!c&&(!xme(l,s)&&!!c)},Bme=qr.createContext(sme),Fme=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mounted=!0,t.transformState=ume(t.props),t.setup=cme(t.props),t.wrapperComponent=null,t.contentComponent=null,t.isInitialized=!1,t.bounds=null,t.previousWheelEvent=null,t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.isPanning=!1,t.startCoords=null,t.lastTouch=null,t.distance=null,t.lastDistance=null,t.pinchStartDistance=null,t.pinchStartScale=null,t.pinchMidpoint=null,t.velocity=null,t.velocityTime=null,t.lastMousePosition=null,t.animate=!1,t.animation=null,t.maxBounds=null,t.pressedKeys={},t.handleInitializeWrapperEvents=function(e){var n=kme();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},t.handleInitialize=function(){var e=t.setup.centerOnInit;t.applyTransformation(),t.forceUpdate(),e&&(setTimeout((function(){t.mounted&&t.setCenter()}),50),setTimeout((function(){t.mounted&&t.setCenter()}),100),setTimeout((function(){t.mounted&&t.setCenter()}),200))},t.onWheelZoom=function(e){t.setup.disabled||Eme(t,e)&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(Mme(t,e),Tme(t,e),Ime(t,e))},t.onPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;n||Xge(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Fge(t),eme(t,e),zge(wme(t),e,r))},t.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||$ge(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),tme(t,e.clientX,e.clientY),zge(wme(t),e,r))},t.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(nme(t),zge(wme(t),e,n))},t.onPinchStart=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinchingStart,i=r.onZoomStart;n||Lme(t,e)&&(Rme(t,e),Fge(t),zge(wme(t),e,o),zge(wme(t),e,i))},t.onPinch=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinching,i=r.onZoom;n||Ome(t)&&(e.preventDefault(),e.stopPropagation(),Nme(t,e),zge(wme(t),e,o),zge(wme(t),e,i))},t.onPinchStop=function(e){var n=t.props,r=n.onPinchingStop,o=n.onZoomStop;t.pinchStartScale&&(Dme(t),zge(wme(t),e,r),zge(wme(t),e,o))},t.onTouchPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;if(!n&&Xge(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,Fge(t);var o=e.touches,i=1===o.length,a=2===o.length;i&&(Fge(t),eme(t,e),zge(wme(t),e,r)),a&&t.onPinchStart(e)}},t.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!$ge(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];tme(t,o.clientX,o.clientY),zge(wme(t),e,r)}else e.touches.length>1&&t.onPinch(e)},t.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},t.onDoubleClick=function(e){t.setup.disabled||jme(t,e)&&zme(t,e)},t.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},t.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},t.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},t.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},t.setComponents=function(e,n){t.wrapperComponent=e,t.contentComponent=n,Uge(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.handleRef(),t.isInitialized=!0,zge(wme(t),void 0,t.props.onInit)},t.setTransformState=function(e,n,r){isNaN(e)||isNaN(n)||isNaN(r)?console.error("Detected NaN set state values"):(e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=r,t.applyTransformation())},t.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=_me(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},t.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,r=e.positionX,o=e.positionY,i=Cme(r,o,n);t.contentComponent.style.transform=i,t.handleRef()}},t.handleRef=function(){t.props.setRef(wme(t))},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ige(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){var e=kme();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},t.prototype.componentWillUnmount=function(){var e=kme();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),Fge(this)},t.prototype.componentDidUpdate=function(e){e!==this.props&&(Uge(this,this.transformState.scale),this.setup=cme(this.props))},t.prototype.render=function(){var e=wme(this),t=this.props.children,n="function"==typeof t?t(e):t;return qr.createElement(Bme.Provider,{value:Rge(Rge({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},n)},t}(cr.Component),Hme=qr.forwardRef((function(e,t){var n=cr.useState(null),r=n[0],o=n[1];return cr.useImperativeHandle(t,(function(){return r}),[r]),qr.createElement(Fme,Rge({},e,{setRef:o}))}));var Vme="transform-component-module_wrapper__1_Fgj",Wme="transform-component-module_content__2jYgh";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__1_Fgj {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__2jYgh {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__2jYgh img {\n pointer-events: none;\n}\n");var Ume=function(e){var t=e.children,n=e.wrapperClass,r=void 0===n?"":n,o=e.contentClass,i=void 0===o?"":o,a=e.wrapperStyle,s=e.contentStyle,l=cr.useContext(Bme).setComponents,u=cr.useRef(null),c=cr.useRef(null);return cr.useEffect((function(){var e=u.current,t=c.current;null!==e&&null!==t&&l&&l(e,t)}),[]),qr.createElement("div",{ref:u,className:"react-transform-wrapper "+Vme+" "+r,style:a},qr.createElement("div",{ref:c,className:"react-transform-component "+Wme+" "+i,style:s},t))};function Gme(e){var t=e.image,n=e.alt,r=e.ref,o=e.styleClass,i=yn(cr.useState(0),2),a=i[0],s=i[1],l=yn(cr.useState(!1),2),u=l[0],c=l[1],d=function(){s(-3===a?0:a-1)},f=function(){s(3===a?0:a+1)},h=function(){c(!u)};return no(Hme,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:function(e){var i=e.zoomIn,l=e.zoomOut,p=e.resetTransform,v=e.centerView;return ro(to,{children:[ro("div",{className:"lightbox-image-options",children:[no(_ae,{icon:no(wfe,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:function(){return i()},fontSize:20}),no(_ae,{icon:no(kfe,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:function(){return l()},fontSize:20}),no(_ae,{icon:no(yfe,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:d,fontSize:20}),no(_ae,{icon:no(bfe,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:f,fontSize:20}),no(_ae,{icon:no(Lfe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:h,fontSize:20}),no(_ae,{icon:no(mfe,{}),"aria-label":"Reset",tooltip:"Reset",onClick:function(){p(),s(0),c(!1)},fontSize:20})]}),no(Ume,{wrapperStyle:{width:"100%",height:"100%"},children:no("img",{style:{transform:"rotate(".concat(90*a,"deg) scaleX(").concat(u?-1:1,")"),width:"100%"},src:t,alt:n,ref:r,className:o||"",onLoad:function(){return v(1,0,"easeOut")}})})]})}})}function qme(){var e=wie(),t=kie((function(e){return e.lightbox.isLightboxOpen})),n=kie(Ude),r=n.viewerImageToDisplay,o=n.shouldShowImageDetails,i=n.isOnFirstImage,a=n.isOnLastImage,s=yn(cr.useState(!1),2),l=s[0],u=s[1],c=function(){u(!0)},d=function(){u(!1)};return _ce("Esc",(function(){t&&e(p4(!1))}),[t]),ro("div",{className:"lightbox-container",children:[no(_ae,{icon:no(gfe,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:function(){e(p4(!1))},fontSize:20}),ro("div",{className:"lightbox-display-container",children:[ro("div",{className:"lightbox-preview-wrapper",children:[no(zde,{}),!o&&ro("div",{className:"current-image-next-prev-buttons",children:[no("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:d,children:l&&!i&&no(x_,{"aria-label":"Previous image",icon:no(zce,{className:"next-prev-button"}),variant:"unstyled",onClick:function(){e(t4())}})}),no("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:d,children:l&&!a&&no(x_,{"aria-label":"Next image",icon:no(jce,{className:"next-prev-button"}),variant:"unstyled",onClick:function(){e(e4())}})})]}),r&&ro(to,{children:[no(Gme,{image:r.url,styleClass:"lightbox-image"}),o&&no(Wde,{image:r})]})]}),no(Tge,{})]})]})}function Yme(e){return Tce({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}var Zme=QX(Mde,(function(e){return{resultImages:e.categories.result.images,userImages:e.categories.user.images}})),Xme=QX([pae,Lae,fae],(function(e,t,n){return{shouldShowDualDisplay:e.shouldShowDualDisplay,shouldPinParametersPanel:e.shouldPinParametersPanel,isLightboxOpen:t.isLightboxOpen,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}}),{memoizeOptions:{resultEqualityCheck:dae}}),$me=function(e){var t,n,r,o=wie(),i=e.optionsPanel,a=e.children,s=e.styleClass,l=kie(Xme),u=l.activeTabName,c=l.shouldShowDualDisplay,d=l.isLightboxOpen,f=l.shouldShowDualDisplayButton,h=(t=kie(Zme),n=t.resultImages,r=t.userImages,function(e){var t=n.find((function(t){return t.uuid===e}));return t||r.find((function(t){return t.uuid===e}))||void 0});return no("div",{className:s?"workarea-wrapper ".concat(s):"workarea-wrapper",children:ro("div",{className:"workarea-main",children:[i,ro("div",{className:"workarea-children-wrapper",onDrop:function(e){var t=e.dataTransfer.getData("invokeai/imageUuid"),n=h(t);n&&("img2img"===u?o(M4(n)):"unifiedCanvas"===u&&o(y3(n)))},children:[a,f&&no(kY,{label:"Toggle Split View",children:no("div",{className:"workarea-split-button","data-selected":c,onClick:function(){o(W8(!c)),o(m3(!0))},children:no(Yme,{})})})]}),!d&&no(Tge,{})]})})},Kme=function(e){var t=e.styleClass,n=cr.useContext(bie);return no("div",{className:"image-uploader-button-outer ".concat(t),onClick:function(){n&&n()},children:ro("div",{className:"image-upload-button",children:[no(_de,{}),no(xP,{size:"lg",children:"Click or Drag and Drop"})]})})},Qme=QX([Mde,pae,fae],(function(e,t,n){var r=e.currentImage,o=e.intermediateImage;return{activeTabName:n,shouldShowImageDetails:t.shouldShowImageDetails,hasAnImageToDisplay:r||o}}),{memoizeOptions:{resultEqualityCheck:dae}}),Jme=function(){var e=kie(Qme),t=e.hasAnImageToDisplay,n=e.activeTabName;return no("div",{className:"current-image-area","data-tab-name":n,children:t?ro(to,{children:[no(zde,{}),no(Gde,{})]}):no("div",{className:"current-image-display-placeholder",children:no(Afe,{})})})},eye=function(){var e=cr.useContext(bie);return no(_ae,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:no(_de,{}),onClick:e||void 0})};function tye(){var e=kie((function(e){return e.generation.initialImage})),t=o8().t,n=wie(),r=cY();return ro(to,{children:[ro("div",{className:"init-image-preview-header",children:[no("h2",{children:t("parameters:initialImage")}),no(eye,{})]}),e&&no("div",{className:"init-image-preview",children:no(c_,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:"string"==typeof e?e:e.url,onError:function(){r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(C4())}})})]})}var nye=function(){var e=kie((function(e){return e.generation.initialImage})),t=kie((function(e){return e.gallery})),n=t.currentImage;return ro("div",{className:"workarea-split-view",children:[no("div",{className:"workarea-split-view-left",children:e?no("div",{className:"image-to-image-area",children:no(tye,{})}):no(Kme,{})}),n&&no("div",{className:"workarea-split-view-right",children:no(Jme,{})})]})},rye=function(e){return e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e}(rye||{}),oye=function(e){var t=function(){var e=o8().t;return cr.useMemo((function(){var t;return gn(t={},0,{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,1,{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,2,{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,3,{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,4,{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,5,{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"}),gn(t,6,{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,7,{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,8,{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,9,{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,10,{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),t}),[e])}();return t[e]},iye=function(e){var t=e.label,n=e.isDisabled,r=void 0!==n&&n,o=e.width,i=void 0===o?"auto":o,a=e.formControlProps,s=e.formLabelProps,l=e.styleClass,u=sn(e,Ft);return ro(I_,un(un({isDisabled:r,width:i,className:"invokeai__switch-form-control ".concat(l),display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between"},a),{},{children:[no(V_,un(un({className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto"},s),{},{children:t})),no(Cq,un({className:"invokeai__switch-root"},u))]}))};function aye(){var e=kie((function(e){return e.system.isGFPGANAvailable})),t=kie((function(e){return e.postprocessing.shouldRunFacetool})),n=wie();return no(iye,{isDisabled:!e,isChecked:t,onChange:function(e){return n(c6(e.target.checked))}})}function sye(){var e=wie(),t=kie((function(e){return e.generation.shouldFitToWidthHeight})),n=o8().t;return no(iye,{label:n("parameters:imageFit"),isChecked:t,onChange:function(t){return e(G4(t.target.checked))}})}function lye(e){var t=o8().t,n=e.label,r=void 0===n?"".concat(t("parameters:strength")):n,o=e.styleClass,i=kie((function(e){return e.generation.img2imgStrength})),a=wie();return no(xfe,{label:r,step:.01,min:.01,max:.99,onChange:function(e){return a(O4(e))},value:i,isInteger:!1,styleClass:o,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:function(){a(O4(.75))}})}var uye=function(){var e=wie(),t=kie((function(e){return e.generation.seamless})),n=o8().t;return no(yP,{gap:2,direction:"column",children:no(iye,{label:n("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:function(t){return e(B4(t.target.checked))}})})},cye=function(){return no(yP,{gap:2,direction:"column",children:no(uye,{})})};function dye(){var e=wie(),t=kie((function(e){return e.generation.perlin})),n=o8().t;return no(Aae,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:function(t){return e(R4(t))},value:t,isInteger:!1})}function fye(){var e=wie(),t=o8().t,n=kie((function(e){return e.generation.shouldRandomizeSeed}));return no(iye,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:function(t){return e(Y4(t.target.checked))}})}function hye(){var e=kie((function(e){return e.generation.seed})),t=kie((function(e){return e.generation.shouldRandomizeSeed})),n=kie((function(e){return e.generation.shouldGenerateVariations})),r=o8().t,o=wie();return no(Aae,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:0,max:yte,isDisabled:t,isInvalid:e<0&&n,onChange:function(e){return o(W4(e))},value:e,width:"auto"})}function pye(){var e=wie(),t=kie((function(e){return e.generation.shouldRandomizeSeed})),n=o8().t;return no(b_,{size:"sm",isDisabled:t,onClick:function(){return e(W4(Aoe(0,yte)))},padding:"0 1.5rem",children:no("p",{children:n("parameters:shuffle")})})}function vye(){var e=wie(),t=kie((function(e){return e.generation.threshold})),n=o8().t;return no(Aae,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:function(t){return e(X4(t))},value:t,isInteger:!1})}var gye=function(){return ro(yP,{gap:2,direction:"column",children:[no(fye,{}),ro(yP,{gap:2,children:[no(hye,{}),no(pye,{})]}),no(yP,{gap:2,children:no(vye,{})}),no(yP,{gap:2,children:no(dye,{})})]})};function mye(){var e=kie((function(e){return e.system.isESRGANAvailable})),t=kie((function(e){return e.postprocessing.shouldRunESRGAN})),n=wie();return no(iye,{isDisabled:!e,isChecked:t,onChange:function(e){return n(u6(e.target.checked))}})}function yye(){var e=kie((function(e){return e.generation.shouldGenerateVariations})),t=wie();return no(iye,{isChecked:e,width:"auto",onChange:function(e){return t(q4(e.target.checked))}})}function bye(e){var t=e.label,n=void 0===t?"":t,r=e.styleClass,o=e.isDisabled,i=void 0!==o&&o,a=e.fontSize,s=void 0===a?"sm":a,l=e.width,u=e.size,c=void 0===u?"sm":u,d=e.isInvalid,f=sn(e,Ht);return ro(I_,{className:"input ".concat(r),isInvalid:d,isDisabled:i,children:[""!==n&&no(V_,{fontSize:s,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:n}),no(YE,un(un({},f),{},{className:"input-entry",size:c,width:l}))]})}function wye(){var e=kie((function(e){return e.generation.seedWeights})),t=kie((function(e){return e.generation.shouldGenerateVariations})),n=o8().t,r=wie();return no(bye,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(b4(e)||""===e),isDisabled:!t,onChange:function(e){return r(U4(e.target.value))}})}function kye(){var e=kie((function(e){return e.generation.variationAmount})),t=kie((function(e){return e.generation.shouldGenerateVariations})),n=o8().t,r=wie();return no(Aae,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:function(e){return r(K4(e))},isInteger:!1})}var xye=function(){return ro(yP,{gap:2,direction:"column",children:[no(kye,{}),no(wye,{})]})};function Sye(){var e=wie(),t=kie((function(e){return e.generation.cfgScale})),n=o8().t;return no(Aae,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:function(t){return e(P4(t))},value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function Cye(){var e=kie((function(e){return e.generation.height})),t=kie(fae),n=wie(),r=o8().t;return no(Mae,{isDisabled:"unifiedCanvas"===t,label:r("parameters:height"),value:e,flexGrow:1,onChange:function(e){return n(L4(Number(e.target.value)))},validValues:gte,styleClass:"main-settings-block"})}var _ye=QX([function(e){return e.generation}],(function(e){return{iterations:e.iterations}}),{memoizeOptions:{resultEqualityCheck:dae}});function Eye(){var e=wie(),t=kie(_ye).iterations,n=o8().t;return no(Aae,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:function(t){return e(T4(t))},value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function Pye(){var e=kie((function(e){return e.generation.sampler})),t=kie(xle),n=wie(),r=o8().t;return no(Mae,{label:r("parameters:sampler"),value:e,onChange:function(e){return n(z4(e.target.value))},validValues:"diffusers"===t.format?pte:hte,styleClass:"main-settings-block"})}function Lye(){var e=wie(),t=kie((function(e){return e.generation.steps})),n=o8().t;return no(Aae,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:function(t){return e(Z4(t))},value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function Oye(){var e=kie((function(e){return e.generation.width})),t=kie(fae),n=o8().t,r=wie();return no(Mae,{isDisabled:"unifiedCanvas"===t,label:n("parameters:width"),value:e,flexGrow:1,onChange:function(e){return r(Q4(Number(e.target.value)))},validValues:vte,styleClass:"main-settings-block"})}function Aye(){return no("div",{className:"main-settings",children:ro("div",{className:"main-settings-list",children:[ro("div",{className:"main-settings-row",children:[no(Eye,{}),no(Lye,{}),no(Sye,{})]}),ro("div",{className:"main-settings-row",children:[no(Oye,{}),no(Cye,{}),no(Pye,{})]})]})})}var Mye=QX(wle,(function(e){return e.shouldDisplayGuides})),Tye=function(e){var t=e.children,n=e.feature,r=kie(Mye),o=oye(n).text;return r?ro(qU,{trigger:"hover",children:[no(nG,{children:no(cP,{children:t})}),ro(eG,{className:"guide-popover-content",maxWidth:"400px",onClick:function(e){return e.preventDefault()},cursor:"initial",children:[no(YU,{className:"guide-popover-arrow"}),no("div",{className:"guide-popover-guide-content",children:o})]})]}):null},Iye=Cv((function(e,t){var n=e.feature,r=e.icon;return no(Tye,{feature:n,children:no(cP,{ref:t,children:no(Gv,{marginBottom:"-.15rem",as:void 0===r?Efe:r})})})}));function Rye(e){var t=e.header,n=e.feature,r=e.content,o=e.additionalHeaderComponents;return ro(GC,{className:"advanced-parameters-item",children:[no(jC,{className:"advanced-parameters-header",children:ro(yP,{width:"100%",gap:"0.5rem",align:"center",children:[no(cP,{flexGrow:1,textAlign:"left",children:t}),o,n&&no(Iye,{feature:n}),no(UC,{})]})}),no(qC,{className:"advanced-parameters-panel",children:r})]})}var Nye=function(e){var t,n=e.accordionInfo,r=kie((function(e){return e.system.openAccordions})),o=wie();return no(YC,{defaultIndex:r,allowMultiple:!0,reduceMotion:!0,onChange:function(e){return o(h8(e))},className:"advanced-parameters",children:(t=[],n&&Object.keys(n).forEach((function(e){var r=n[e],o=r.header,i=r.feature,a=r.content,s=r.additionalHeaderComponents;t.push(no(Rye,{header:o,feature:i,content:a,additionalHeaderComponents:s},e))})),t)})},Dye=QX(wle,(function(e){return{isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}}),{memoizeOptions:{resultEqualityCheck:dae}});function zye(e){var t=Object.assign({},(Kt(e),e)),n=wie(),r=kie(Dye),o=r.isProcessing,i=r.isConnected,a=r.isCancelable,s=function(){return n(rie())},l=o8().t;return _ce("shift+x",(function(){(i||o)&&a&&s()}),[i,o,a]),no(_ae,un({icon:no(Mfe,{}),tooltip:l("parameters:cancel"),"aria-label":l("parameters:cancel"),isDisabled:!i||!o||!a,onClick:s,styleClass:"cancel-btn"},t))}var jye=function(e){return e.generation};QX(jye,(function(e){var t=e.shouldRandomizeSeed,n=e.shouldGenerateVariations;return t||n}),{memoizeOptions:{resultEqualityCheck:dae}});var Bye=QX([jye,wle,Ade,fae],(function(e,t,n,r){var o=e.prompt,i=e.shouldGenerateVariations,a=e.seedWeights,s=e.initialImage,l=e.seed,u=t.isProcessing,c=t.isConnected,d=!0,f=[];return o&&!Boolean(o.match(/^[\s\r\n]+$/))||(d=!1,f.push("Missing prompt")),"img2img"!==r||s||(d=!1,f.push("No initial image selected")),u&&(d=!1,f.push("System Busy")),c||(d=!1,f.push("System Disconnected")),i&&(!b4(a)&&""!==a||-1===l)&&(d=!1,f.push("Seed-Weights badly formatted.")),{isReady:d,reasonsWhyNotReady:f}}),{memoizeOptions:{equalityCheck:dae,resultEqualityCheck:dae}});function Fye(e){var t=e.iconButton,n=void 0!==t&&t,r=sn(e,Vt),o=wie(),i=kie(Bye).isReady,a=kie(fae),s=function(){o(Koe(a))},l=o8().t;return _ce(["ctrl+enter","meta+enter"],(function(){o(Koe(a))}),{enabled:function(){return i},preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,a]),no("div",{style:{flexGrow:4},children:n?no(_ae,un({"aria-label":l("parameters:invoke"),type:"submit",icon:no(fde,{}),isDisabled:!i,onClick:s,className:"invoke-btn",tooltip:l("parameters:invoke"),tooltipProps:{placement:"bottom"}},r)):no(Eae,un(un({"aria-label":l("parameters:invoke"),type:"submit",isDisabled:!i,onClick:s,className:"invoke-btn"},r),{},{children:"Invoke"}))})}var Hye=QX(Tae,(function(e){return e.shouldLoopback})),Vye=function(){var e=wie(),t=kie(Hye),n=o8().t;return no(_ae,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:no(vde,{}),onClick:function(){e(l6(!t))}})},Wye=function(){var e=kie(fae);return ro("div",{className:"process-buttons",children:[no(Fye,{}),"img2img"===e&&no(Vye,{}),no(zye,{})]})},Uye=function(){var e=kie((function(e){return e.generation.negativePrompt})),t=wie(),n=o8().t;return no(I_,{children:no(Qq,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:function(e){return t(D4(e.target.value))},background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},Gye=QX([function(e){return e.generation},fae],(function(e,t){return{prompt:e.prompt,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:dae}}),qye=function(){var e=wie(),t=kie(Gye),n=t.prompt,r=t.activeTabName,o=kie(Bye).isReady,i=cr.useRef(null),a=o8().t;_ce("alt+a",(function(){var e;null===(e=i.current)||void 0===e||e.focus()}),[]);return no("div",{className:"prompt-bar",children:no(I_,{isInvalid:0===n.length||Boolean(n.match(/^[\s\r\n]+$/)),children:no(Qq,{id:"prompt",name:"prompt",placeholder:a("parameters:promptPlaceholder"),size:"lg",value:n,onChange:function(t){e(N4(t.target.value))},onKeyDown:function(t){"Enter"===t.key&&!1===t.shiftKey&&o&&(t.preventDefault(),e(Koe(r)))},resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},Yye=""+new URL("logo-13003d72.png",Zt.meta.url).href,Zye=QX(pae,(function(e){return{shouldShowParametersPanel:e.shouldShowParametersPanel,shouldHoldParametersPanelOpen:e.shouldHoldParametersPanelOpen,shouldPinParametersPanel:e.shouldPinParametersPanel,parametersPanelScrollPosition:e.parametersPanelScrollPosition}}),{memoizeOptions:{resultEqualityCheck:dae}}),Xye=function(e){var t=wie(),n=kie(Zye),r=n.shouldShowParametersPanel,o=n.shouldHoldParametersPanelOpen,i=n.shouldPinParametersPanel,a=cr.useRef(null),s=cr.useRef(null),l=cr.useRef(null),u=e.children;_ce("o",(function(){t(V8(!r)),i&&setTimeout((function(){return t(m3(!0))}),400)}),[r,i]),_ce("esc",(function(){t(V8(!1))}),{enabled:function(){return!i},preventDefault:!0},[i]),_ce("shift+o",(function(){f(),t(m3(!0))}),[i]);var c=cr.useCallback((function(){i||(t(B8(s.current?s.current.scrollTop:0)),t(V8(!1)),t(F8(!1)))}),[t,i]),d=function(){l.current&&window.clearTimeout(l.current)},f=function(){t(H8(!i)),t(m3(!0))};return cr.useEffect((function(){function e(e){a.current&&!a.current.contains(e.target)&&c()}return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[c]),no(Yfe,{nodeRef:a,in:r||o&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:no("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:a,onMouseEnter:i?void 0:d,onMouseOver:i?void 0:d,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:no("div",{className:"parameters-panel-margin",children:ro("div",{className:"parameters-panel",ref:s,onMouseLeave:function(e){e.target!==s.current?d():!i&&(l.current=window.setTimeout((function(){return c()}),500))},children:[no(kY,{label:"Pin Options Panel",children:no("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:f,children:no(i?Sfe:Cfe,{})})}),!i&&ro("div",{className:"invoke-ai-logo-wrapper",children:[no("img",{src:Yye,alt:"invoke-ai-logo"}),ro("h1",{children:["invoke ",no("strong",{children:"ai"})]})]}),u]})})})})};function $ye(){var e=o8().t,t={seed:{header:"".concat(e("parameters:seed")),feature:rye.SEED,content:no(gye,{})},variations:{header:"".concat(e("parameters:variations")),feature:rye.VARIATIONS,content:no(xye,{}),additionalHeaderComponents:no(yye,{})},face_restore:{header:"".concat(e("parameters:faceRestoration")),feature:rye.FACE_CORRECTION,content:no(Cle,{}),additionalHeaderComponents:no(aye,{})},upscale:{header:"".concat(e("parameters:upscaling")),feature:rye.UPSCALE,content:no(Ele,{}),additionalHeaderComponents:no(mye,{})},other:{header:"".concat(e("parameters:otherOptions")),feature:rye.OTHER,content:no(cye,{})}},n=wie(),r=kie(fae);return cr.useEffect((function(){if("img2img"===r){n(a6(!1))}}),[r,n]),ro(Xye,{children:[ro(yP,{flexDir:"column",rowGap:"0.5rem",children:[no(qye,{}),no(Uye,{})]}),no(Wye,{}),no(Aye,{}),no(lye,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),no(sye,{}),no(Nye,{accordionInfo:t})]})}function Kye(){return no($me,{optionsPanel:no($ye,{}),children:no(nye,{})})}var Qye=function(){return no("div",{className:"workarea-single-view",children:no("div",{className:"text-to-image-area",children:no(Jme,{})})})},Jye=QX([Tae],(function(e){return{hiresFix:e.hiresFix,hiresStrength:e.hiresStrength}}),{memoizeOptions:{resultEqualityCheck:dae}}),ebe=function(){var e=kie(Jye),t=e.hiresFix,n=e.hiresStrength,r=wie(),o=o8().t;return no(xfe,{label:o("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:function(e){r(s6(e))},value:n,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:function(){r(s6(.75))},isSliderDisabled:!t,isInputDisabled:!t,isResetDisabled:!t})},tbe=function(){var e=wie(),t=kie((function(e){return e.postprocessing.hiresFix})),n=o8().t;return ro(yP,{gap:2,direction:"column",children:[no(iye,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:function(t){return e(a6(t.target.checked))}}),no(ebe,{})]})},nbe=function(){return ro(yP,{gap:2,direction:"column",children:[no(uye,{}),no(tbe,{})]})};function rbe(){var e=o8().t,t={seed:{header:"".concat(e("parameters:seed")),feature:rye.SEED,content:no(gye,{})},variations:{header:"".concat(e("parameters:variations")),feature:rye.VARIATIONS,content:no(xye,{}),additionalHeaderComponents:no(yye,{})},face_restore:{header:"".concat(e("parameters:faceRestoration")),feature:rye.FACE_CORRECTION,content:no(Cle,{}),additionalHeaderComponents:no(aye,{})},upscale:{header:"".concat(e("parameters:upscaling")),feature:rye.UPSCALE,content:no(Ele,{}),additionalHeaderComponents:no(mye,{})},other:{header:"".concat(e("parameters:otherOptions")),feature:rye.OTHER,content:no(nbe,{})}};return ro(Xye,{children:[ro(yP,{flexDir:"column",rowGap:"0.5rem",children:[no(qye,{}),no(Uye,{})]}),no(Wye,{}),no(Aye,{}),no(Nye,{accordionInfo:t})]})}function obe(){return no($me,{optionsPanel:no(rbe,{}),children:no(Qye,{})})}var ibe={},abe={get exports(){return ibe},set exports(e){ibe=e}},sbe=function(e){var t={},n=cr,r=tA,o=Object.assign;function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{tt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?et(e):""}var rt=Object.prototype.hasOwnProperty,ot=[],it=-1;function at(e){return{current:e}}function st(e){0>it||(e.current=ot[it],ot[it]=null,it--)}function lt(e,t){it++,ot[it]=e.current,e.current=t}var ut={},ct=at(ut),dt=at(!1),ft=ut;function ht(e,t){var n=e.type.contextTypes;if(!n)return ut;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pt(e){return null!=(e=e.childContextTypes)}function vt(){st(dt),st(ct)}function gt(e,t,n){if(ct.current!==ut)throw Error(i(168));lt(ct,t),lt(dt,n)}function mt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(i(108,S(e)||"Unknown",a));return o({},n,r)}function yt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ut,ft=ct.current,lt(ct,e),lt(dt,dt.current),!0}function bt(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=mt(e,t,ft),r.__reactInternalMemoizedMergedChildContext=e,st(dt),st(ct),lt(ct,e)):st(dt),lt(dt,n)}var wt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(kt(e)/xt|0)|0},kt=Math.log,xt=Math.LN2;var St=64,Ct=4194304;function _t(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Et(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=_t(s):0!==(i&=a)&&(r=_t(i))}else 0!==(a=n&~o)?r=_t(a):0!==i&&(r=_t(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Mt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-wt(t)]=n}function Tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wt(n),o=1<>=a,o-=a,an=1<<32-wt(t)+o|n<f?(h=d,d=null):h=d.sibling;var p=g(o,d,s[f],l);if(null===p){null===d&&(d=h);break}e&&d&&null===p.alternate&&t(o,d),i=a(p,i,f),null===c?u=p:c.sibling=p,c=p,d=h}if(f===s.length)return n(o,d),pn&&ln(o,f),u;if(null===d){for(;fh?(p=f,f=null):p=f.sibling;var b=g(o,f,y.value,u);if(null===b){null===f&&(f=p);break}e&&f&&null===b.alternate&&t(o,f),s=a(b,s,h),null===d?c=b:d.sibling=b,d=b,f=p}if(y.done)return n(o,f),pn&&ln(o,h),c;if(null===f){for(;!y.done;h++,y=l.next())null!==(y=v(o,y.value,u))&&(s=a(y,s,h),null===d?c=y:d.sibling=y,d=y);return pn&&ln(o,h),c}for(f=r(o,f);!y.done;h++,y=l.next())null!==(y=m(f,o,h,y.value,u))&&(e&&null!==y.alternate&&f.delete(null===y.key?h:y.key),s=a(y,s,h),null===d?c=y:d.sibling=y,d=y);return e&&f.forEach((function(e){return t(o,e)})),pn&&ln(o,h),c}return function e(r,i,a,d){if("object"===kn(a)&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"===kn(a)&&null!==a){switch(a.$$typeof){case s:e:{for(var f=a.key,h=i;null!==h;){if(h.key===f){if((f=a.type)===u){if(7===h.tag){n(r,h.sibling),(i=o(h,a.props.children)).return=r,r=i;break e}}else if(h.elementType===f||"object"===kn(f)&&null!==f&&f.$$typeof===y&&ur(f)===h.type){n(r,h.sibling),(i=o(h,a.props)).ref=sr(r,h,a),i.return=r,r=i;break e}n(r,h);break}t(r,h),h=h.sibling}a.type===u?((i=fs(a.props.children,r.mode,d,a.key)).return=r,r=i):((d=ds(a.type,a.key,a.props,null,r.mode,d)).ref=sr(r,i,a),d.return=r,r=d)}return c(r);case l:e:{for(h=a.key;null!==i;){if(i.key===h){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=vs(a,r.mode,d)).return=r,r=i}return c(r);case y:return e(r,i,(h=a._init)(a._payload),d)}if(M(a))return b(r,i,a,d);if(k(a))return w(r,i,a,d);lr(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=ps(a,r.mode,d)).return=r,r=i),c(r)):n(r,i)}}var fr=dr(!0),hr=dr(!1),pr={},vr=at(pr),gr=at(pr),mr=at(pr);function yr(e){if(e===pr)throw Error(i(174));return e}function br(e,t){lt(mr,t),lt(gr,e),lt(vr,pr),e=I(t),st(vr),lt(vr,e)}function wr(){st(vr),st(gr),st(mr)}function kr(e){var t=yr(mr.current),n=yr(vr.current);n!==(t=R(n,e.type,t))&&(lt(gr,e),lt(vr,t))}function xr(e){gr.current===e&&(st(vr),st(gr))}var Sr=at(0);function Cr(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Ne(n)||De(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _r=[];function Er(){for(var e=0;e<_r.length;e++){var t=_r[e];q?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}_r.length=0}var Pr=a.ReactCurrentDispatcher,Lr=a.ReactCurrentBatchConfig,Or=0,Ar=null,Mr=null,Tr=null,Ir=!1,Rr=!1,Nr=0,Dr=0;function zr(){throw Error(i(321))}function jr(e,t){if(null===t)return!1;for(var n=0;nn?n:4,e(!0);var r=Lr.transition;Lr.transition={};try{e(!1),t()}finally{It=n,Lr.transition=r}}function go(){return Vr().memoizedState}function mo(e,t,n){var r=Ia(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bo(e))wo(t,n);else if(null!==(n=Wn(e,t,n,r))){Ra(n,e,r,Ta()),ko(n,t,r)}}function yo(e,t,n){var r=Ia(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bo(e))wo(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,qt(s,a)){var l=t.interleaved;return null===l?(o.next=o,Vn(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(hpe){}null!==(n=Wn(e,t,o,r))&&(Ra(n,e,r,o=Ta()),ko(n,t,r))}}function bo(e){var t=e.alternate;return e===Ar||null!==t&&t===Ar}function wo(e,t){Rr=Ir=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ko(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Tt(e,n)}}var xo={readContext:Fn,useCallback:zr,useContext:zr,useEffect:zr,useImperativeHandle:zr,useInsertionEffect:zr,useLayoutEffect:zr,useMemo:zr,useReducer:zr,useRef:zr,useState:zr,useDebugValue:zr,useDeferredValue:zr,useTransition:zr,useMutableSource:zr,useSyncExternalStore:zr,useId:zr,unstable_isNewReconciler:!1},So={readContext:Fn,useCallback:function(e,t){return Hr().memoizedState=[e,void 0===t?null:t],e},useContext:Fn,useEffect:oo,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,no(4194308,4,lo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){return no(4,2,e,t)},useMemo:function(e,t){var n=Hr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Hr();return t=void 0!==n?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=mo.bind(null,Ar,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Hr().memoizedState=e},useState:Jr,useDebugValue:co,useDeferredValue:function(e){return Hr().memoizedState=e},useTransition:function(){var e=Jr(!1),t=e[0];return e=vo.bind(null,e[1]),Hr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ar,o=Hr();if(pn){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===ia)throw Error(i(349));0!=(30&Or)||Zr(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,oo($r.bind(null,r,a,e),[e]),r.flags|=2048,eo(9,Xr.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Hr(),t=ia.identifierPrefix;if(pn){var n=sn;t=":"+t+"R"+(n=(an&~(1<<32-wt(an)-1)).toString(32)+n),0<(n=Nr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Dr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Co={readContext:Fn,useCallback:fo,useContext:Fn,useEffect:io,useImperativeHandle:uo,useInsertionEffect:ao,useLayoutEffect:so,useMemo:ho,useReducer:Ur,useRef:to,useState:function(){return Ur(Wr)},useDebugValue:co,useDeferredValue:function(e){return po(Vr(),Mr.memoizedState,e)},useTransition:function(){return[Ur(Wr)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:go,unstable_isNewReconciler:!1},_o={readContext:Fn,useCallback:fo,useContext:Fn,useEffect:io,useImperativeHandle:uo,useInsertionEffect:ao,useLayoutEffect:so,useMemo:ho,useReducer:Gr,useRef:to,useState:function(){return Gr(Wr)},useDebugValue:co,useDeferredValue:function(e){var t=Vr();return null===Mr?t.memoizedState=e:po(t,Mr.memoizedState,e)},useTransition:function(){return[Gr(Wr)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:go,unstable_isNewReconciler:!1};function Eo(e,t){try{var n="",r=t;do{n+=On(r),r=r.return}while(r);var o=n}catch(Xke){o="\nError generating stack: "+Xke.message+"\n"+Xke.stack}return{value:e,source:t,stack:o,digest:null}}function Po(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Lo(e,t){try{console.error(t.value)}catch(qke){setTimeout((function(){throw qke}))}}var Oo="function"==typeof WeakMap?WeakMap:Map;function Ao(e,t,n){(n=Zn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xa||(xa=!0,Sa=r),Lo(0,t)},n}function Mo(e,t,n){(n=Zn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Lo(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){Lo(0,t),"function"!=typeof r&&(null===Ca?Ca=new Set([this]):Ca.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function To(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Oo;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=ns.bind(null,e,t,n),t.then(e,e))}function Io(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function Ro(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Zn(-1,1)).tag=2,Xn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var No=a.ReactCurrentOwner,Do=!1;function zo(e,t,n,r){t.child=null===e?hr(t,null,n,r):fr(t,e.child,n,r)}function jo(e,t,n,r,o){n=n.render;var i=t.ref;return Bn(t,o),r=Br(e,t,n,r,i,o),n=Fr(),null===e||Do?(pn&&n&&cn(t),t.flags|=1,zo(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,si(e,t,o))}function Bo(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||us(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=ds(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Fo(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:Ln)(a,r)&&e.ref===t.ref)return si(e,t,o)}return t.flags|=1,(e=cs(i,r)).ref=t.ref,e.return=t,t.child=e}function Fo(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(Ln(i,r)&&e.ref===t.ref){if(Do=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,si(e,t,o);0!=(131072&e.flags)&&(Do=!0)}}return Wo(e,t,n,r,o)}function Ho(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},lt(ua,la),la|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,lt(ua,la),la|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,lt(ua,la),la|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,lt(ua,la),la|=r;return zo(e,t,o,n),t.child}function Vo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Wo(e,t,n,r,o){var i=pt(n)?ft:ct.current;return i=ht(t,i),Bn(t,o),n=Br(e,t,n,r,i,o),r=Fr(),null===e||Do?(pn&&r&&cn(t),t.flags|=1,zo(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,si(e,t,o))}function Uo(e,t,n,r,o){if(pt(n)){var i=!0;yt(t)}else i=!1;if(Bn(t,o),null===t.stateNode)ai(e,t),or(t,n,r),ar(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"===kn(u)&&null!==u?u=Fn(u):u=ht(t,u=pt(n)?ft:ct.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&ir(t,a,r,u),Gn=!1;var f=t.memoizedState;a.state=f,Qn(t,r,a,o),l=t.memoizedState,s!==r||f!==l||dt.current||Gn?("function"==typeof c&&(tr(t,n,c,r),l=t.memoizedState),(s=Gn||rr(t,n,s,r,f,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Yn(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:An(t.type,s),a.props=u,d=t.pendingProps,f=a.context,"object"===kn(l=n.contextType)&&null!==l?l=Fn(l):l=ht(t,l=pt(n)?ft:ct.current);var h=n.getDerivedStateFromProps;(c="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&ir(t,a,r,l),Gn=!1,f=t.memoizedState,a.state=f,Qn(t,r,a,o);var p=t.memoizedState;s!==d||f!==p||dt.current||Gn?("function"==typeof h&&(tr(t,n,h,r),p=t.memoizedState),(u=Gn||rr(t,n,u,r,f,p,l)||!1)?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Go(e,t,n,r,i,o)}function Go(e,t,n,r,o,i){Vo(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&bt(t,n,!1),si(e,t,i);r=t.stateNode,No.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=fr(t,e.child,null,i),t.child=fr(t,null,s,i)):zo(e,t,s,i),t.memoizedState=r.state,o&&bt(t,n,!0),t.child}function qo(e){var t=e.stateNode;t.pendingContext?gt(0,t.pendingContext,t.pendingContext!==t.context):t.context&>(0,t.context,!1),br(e,t.containerInfo)}function Yo(e,t,n,r,o){return _n(),En(o),t.flags|=256,zo(e,t,n,r),t.child}var Zo,Xo,$o,Ko,Qo={dehydrated:null,treeContext:null,retryLane:0};function Jo(e){return{baseLanes:e,cachePool:null,transitions:null}}function ei(e,t,n){var r,o=t.pendingProps,a=Sr.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),lt(Sr,1&a),null===e)return wn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:De(e)?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0==(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=hs(l,o,0,null),e=fs(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Jo(n),t.memoizedState=Qo,e):ti(t,l));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,s){if(n)return 256&t.flags?(t.flags&=-257,ni(e,t,s,r=Po(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=hs({mode:"visible",children:r.children},o,0,null),(a=fs(a,o,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!=(1&t.mode)&&fr(t,e.child,null,s),t.child.memoizedState=Jo(s),t.memoizedState=Qo,a);if(0==(1&t.mode))return ni(e,t,s,null);if(De(o))return r=ze(o).digest,a=Error(i(419)),r=Po(a,r,void 0),ni(e,t,s,r);if(n=0!=(s&e.childLanes),Do||n){if(null!==(r=ia)){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}0!==(o=0!=(o&(r.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Un(e,o),Ra(r,e,o,-1))}return qa(),ni(e,t,s,r=Po(Error(i(421))))}return Ne(o)?(t.flags|=128,t.child=e.child,t=os.bind(null,e),je(o,t),null):(e=a.treeContext,X&&(hn=Ve(o),fn=t,pn=!0,gn=null,vn=!1,null!==e&&(nn[rn++]=an,nn[rn++]=sn,nn[rn++]=on,an=e.id,sn=e.overflow,on=t)),t=ti(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,a,n);if(s){s=o.fallback,l=t.mode,r=(a=e.child).sibling;var u={mode:"hidden",children:o.children};return 0==(1&l)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=u,t.deletions=null):(o=cs(a,u)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=cs(r,s):(s=fs(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?Jo(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Qo,o}return e=(s=e.child).sibling,o=cs(s,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function ti(e,t){return(t=hs({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ni(e,t,n,r){return null!==r&&En(r),fr(t,e.child,null,n),(e=ti(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function ri(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),jn(e.return,t,n)}function oi(e,t,n,r,o){var i=e.memoizedState;null===i?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 ii(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(zo(e,t,r.children,n),0!=(2&(r=Sr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ri(e,n,t);else if(19===e.tag)ri(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(lt(Sr,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Cr(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),oi(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Cr(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}oi(t,!0,n,null,i);break;case"together":oi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ai(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function si(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),fa|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=cs(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=cs(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function li(e){e.flags|=4}function ui(e,t){if(null!==e&&e.child===t.child)return!0;if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Y)Zo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)j(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xo=function(){},$o=function(e,t,n,r,o){if((e=e.memoizedProps)!==r){var i=t.stateNode,a=yr(vr.current);n=F(i,n,e,r,o,a),(t.updateQueue=n)&&li(t)}},Ko=function(e,t,n,r){n!==r&&li(t)};else if(Z){Zo=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),j(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Me(i,o.memoizedProps,o)),j(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),Zo(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};var ci=function e(t,n,r,o){for(var i=n.child;null!==i;){if(5===i.tag){var a=i.stateNode;r&&o&&(a=Ae(a,i.type,i.memoizedProps,i)),Pe(t,a)}else if(6===i.tag)a=i.stateNode,r&&o&&(a=Me(a,i.memoizedProps,i)),Pe(t,a);else if(4!==i.tag)if(22===i.tag&&null!==i.memoizedState)null!==(a=i.child)&&(a.return=i),e(t,i,!0,!0);else if(null!==i.child){i.child.return=i,i=i.child;continue}if(i===n)break;for(;null===i.sibling;){if(null===i.return||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};Xo=function(e,t){var n=t.stateNode;if(!ui(e,t)){e=n.containerInfo;var r=Ee(e);ci(r,t,!1,!1),n.pendingChildren=r,li(t),Le(e,r)}},$o=function(e,t,n,r,o){var i=e.stateNode,a=e.memoizedProps;if((e=ui(e,t))&&a===r)t.stateNode=i;else{var s=t.stateNode,l=yr(vr.current),u=null;a!==r&&(u=F(s,n,a,r,o,l)),e&&null===u?t.stateNode=i:(i=_e(i,u,n,a,r,t,e,s),B(i,n,r,o,l)&&li(t),t.stateNode=i,e?li(t):Zo(i,t,!1,!1))}},Ko=function(e,t,n,r){n!==r?(e=yr(mr.current),n=yr(vr.current),t.stateNode=V(r,e,n,t),li(t)):t.stateNode=e.stateNode}}else Xo=function(){},$o=function(){},Ko=function(){};function di(e,t){if(!pn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fi(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)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 hi(e,t,n){var r=t.pendingProps;switch(dn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fi(t),null;case 1:case 17:return pt(t.type)&&vt(),fi(t),null;case 3:return n=t.stateNode,wr(),st(dt),st(ct),Er(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(Sn(t)?li(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==gn&&(ja(gn),gn=null))),Xo(e,t),fi(t),null;case 5:xr(t),n=yr(mr.current);var o=t.type;if(null!==e&&null!=t.stateNode)$o(e,t,o,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return fi(t),null}if(e=yr(vr.current),Sn(t)){if(!X)throw Error(i(175));e=We(t.stateNode,t.type,t.memoizedProps,n,e,t,!vn),t.updateQueue=e,null!==e&&li(t)}else{var a=z(o,r,n,e,t);Zo(a,t,!1,!1),t.stateNode=a,B(a,o,r,n,e)&&li(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return fi(t),null;case 6:if(e&&null!=t.stateNode)Ko(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=yr(mr.current),n=yr(vr.current),Sn(t)){if(!X)throw Error(i(176));if(e=t.stateNode,n=t.memoizedProps,(r=Ue(e,n,t,!vn))&&null!==(o=fn))switch(o.tag){case 3:Qe(o.stateNode.containerInfo,e,n,0!=(1&o.mode));break;case 5:Je(o.type,o.memoizedProps,o.stateNode,e,n,0!=(1&o.mode))}r&&li(t)}else t.stateNode=V(r,e,n,t)}return fi(t),null;case 13:if(st(Sr),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(pn&&null!==hn&&0!=(1&t.mode)&&0==(128&t.flags))Cn(),_n(),t.flags|=98560,o=!1;else if(o=Sn(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(i(318));if(!X)throw Error(i(344));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(i(317));Ge(o,t)}else _n(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;fi(t),o=!1}else null!==gn&&(ja(gn),gn=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((n=null!==r)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&Sr.current)?0===ca&&(ca=3):qa())),null!==t.updateQueue&&(t.flags|=4),fi(t),null);case 4:return wr(),Xo(e,t),null===e&&K(t.stateNode.containerInfo),fi(t),null;case 10:return zn(t.type._context),fi(t),null;case 19:if(st(Sr),null===(o=t.memoizedState))return fi(t),null;if(r=0!=(128&t.flags),null===(a=o.rendering))if(r)di(o,!1);else{if(0!==ca||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=Cr(e))){for(t.flags|=128,di(o,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;null!==n;)o=e,(r=n).flags&=14680066,null===(a=r.alternate)?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,o=a.dependencies,r.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),n=n.sibling;return lt(Sr,1&Sr.current|2),t.child}e=e.sibling}null!==o.tail&&Bt()>ya&&(t.flags|=128,r=!0,di(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=Cr(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),di(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!pn)return fi(t),null}else 2*Bt()-o.renderingStartTime>ya&&1073741824!==n&&(t.flags|=128,r=!0,di(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=o.last)?e.sibling=a:t.child=a,o.last=a)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Bt(),t.sibling=null,e=Sr.current,lt(Sr,r?1&e|2:1&e),t):(fi(t),null);case 22:case 23:return Va(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&la)&&(fi(t),Y&&6&t.subtreeFlags&&(t.flags|=8192)):fi(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function pi(e,t){switch(dn(t),t.tag){case 1:return pt(t.type)&&vt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return wr(),st(dt),st(ct),Er(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return xr(t),null;case 13:if(st(Sr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));_n()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return st(Sr),null;case 4:return wr(),null;case 10:return zn(t.type._context),null;case 22:case 23:return Va(),null;default:return null}}var vi=!1,gi=!1,mi="function"==typeof WeakSet?WeakSet:Set,yi=null;function bi(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(Kke){ts(e,t,Kke)}else n.current=null}function wi(e,t,n){try{n()}catch(Kke){ts(e,t,Kke)}}var ki=!1;function xi(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&wi(t,n,i)}o=o.next}while(o!==r)}}function Si(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect: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 Ci(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=T(n);else e=n;"function"==typeof t?t(e):t.current=e}}function _i(e){var t=e.alternate;null!==t&&(e.alternate=null,_i(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&J(t)),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 Ei(e){return 5===e.tag||3===e.tag||4===e.tag}function Pi(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Ei(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Li(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ge(n,e,t):de(n,e);else if(4!==r&&null!==(e=e.child))for(Li(e,t,n),e=e.sibling;null!==e;)Li(e,t,n),e=e.sibling}function Oi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):ce(n,e);else if(4!==r&&null!==(e=e.child))for(Oi(e,t,n),e=e.sibling;null!==e;)Oi(e,t,n),e=e.sibling}var Ai=null,Mi=!1;function Ti(e,t,n){for(n=n.child;null!==n;)Ii(e,t,n),n=n.sibling}function Ii(e,t,n){if(Gt&&"function"==typeof Gt.onCommitFiberUnmount)try{Gt.onCommitFiberUnmount(Ut,n)}catch(Qke){}switch(n.tag){case 5:gi||bi(n,t);case 6:if(Y){var r=Ai,o=Mi;Ai=null,Ti(e,t,n),Mi=o,null!==(Ai=r)&&(Mi?ye(Ai,n.stateNode):me(Ai,n.stateNode))}else Ti(e,t,n);break;case 18:Y&&null!==Ai&&(Mi?$e(Ai,n.stateNode):Xe(Ai,n.stateNode));break;case 4:Y?(r=Ai,o=Mi,Ai=n.stateNode.containerInfo,Mi=!0,Ti(e,t,n),Ai=r,Mi=o):(Z&&(r=n.stateNode.containerInfo,o=Ee(r),Oe(r,o)),Ti(e,t,n));break;case 0:case 11:case 14:case 15:if(!gi&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&wi(n,t,a),o=o.next}while(o!==r)}Ti(e,t,n);break;case 1:if(!gi&&(bi(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(Qke){ts(n,t,Qke)}Ti(e,t,n);break;case 21:Ti(e,t,n);break;case 22:1&n.mode?(gi=(r=gi)||null!==n.memoizedState,Ti(e,t,n),gi=r):Ti(e,t,n);break;default:Ti(e,t,n)}}function Ri(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new mi),t.forEach((function(t){var r=is.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Ni(e,t){var n=t.deletions;if(null!==n)for(var r=0;r";case Ui:return":has("+(Ki(e)||"")+")";case Gi:return'[role="'+e.value+'"]';case Yi:return'"'+e.value+'"';case qi:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function Qi(e,t){var n=[];e=[e,0];for(var r=0;ro&&(o=s),r&=~a}if(r=o,10<(r=(120>(r=Bt()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ea(r/1960))-r)){e.timeoutHandle=W(Qa.bind(null,e,ga,ba),r);break}Qa(e,ga,ba);break;default:throw Error(i(329))}}}return Na(e,Bt()),e.callbackNode===n?Da.bind(null,e):null}function za(e,t){var n=va;return e.current.memoizedState.isDehydrated&&(Wa(e,t).flags|=256),2!==(e=Ya(e,t))&&(t=ga,ga=n,null!==t&&ja(t)),e}function ja(e){null===ga?ga=e:ga.push.apply(ga,e)}function Ba(e,t){for(t&=~pa,t&=~ha,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===Ea)var r=!1;else{if(e=Ea,Ea=null,Pa=0,0!=(6&oa))throw Error(i(331));var o=oa;for(oa|=4,yi=e.current;null!==yi;){var a=yi,s=a.child;if(0!=(16&yi.flags)){var l=a.deletions;if(null!==l){for(var u=0;uBt()-ma?Wa(e,0):pa|=n),Na(e,t)}function rs(e,t){0===t&&(0==(1&e.mode)?t=1:(t=Ct,0==(130023424&(Ct<<=1))&&(Ct=4194304)));var n=Ta();null!==(e=Un(e,t))&&(Mt(e,t,n),Na(e,n))}function os(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),rs(e,n)}function is(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),rs(e,n)}function as(e,t){return Nt(e,t)}function ss(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 ls(e,t,n,r){return new ss(e,t,n,r)}function us(e){return!(!(e=e.prototype)||!e.isReactComponent)}function cs(e,t){var n=e.alternate;return null===n?((n=ls(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ds(e,t,n,r,o,a){var s=2;if(r=e,"function"==typeof e)us(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case u:return fs(n.children,o,a,t);case c:s=8,o|=8;break;case d:return(e=ls(12,n,t,2|o)).elementType=d,e.lanes=a,e;case v:return(e=ls(13,n,t,o)).elementType=v,e.lanes=a,e;case g:return(e=ls(19,n,t,o)).elementType=g,e.lanes=a,e;case b:return hs(n,o,a,t);default:if("object"===kn(e)&&null!==e)switch(e.$$typeof){case f:s=10;break e;case h:s=9;break e;case p:s=11;break e;case m:s=14;break e;case y:s=16,r=null;break e}throw Error(i(130,null==e?e:kn(e),""))}return(t=ls(s,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function fs(e,t,n,r){return(e=ls(7,e,r,t)).lanes=n,e}function hs(e,t,n,r){return(e=ls(22,e,r,t)).elementType=b,e.lanes=n,e.stateNode={isHidden:!1},e}function ps(e,t,n){return(e=ls(6,e,null,t)).lanes=n,e}function vs(e,t,n){return(t=ls(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function gs(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=G,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=At(0),this.expirationTimes=At(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.identifierPrefix=r,this.onRecoverableError=o,X&&(this.mutableSourceEagerHydrationData=null)}function ms(e,t,n,r,o,i,a,s,l){return e=new gs(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=ls(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qn(i),e}function ys(e){if(!e)return ut;e:{if(C(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(pt(n))return mt(e,n,t)}return t}function bs(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return null===(e=P(t))?null:e.stateNode}function ws(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=c&&a>=f&&o<=d&&s<=h){e.splice(t,1);break}if(!(r!==c||n.width!==u.width||hs)){f>a&&(u.height+=f-a,u.y=a),ho)){c>r&&(u.width+=c-r,u.x=r),dn&&(n=s)),s ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?T(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:xs,findFiberByHostInstance:e.findFiberByHostInstance||Ss,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Ut=t.inject(e),Gt=t}catch(qke){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!ne)throw Error(i(363));e=Ji(e,t);var o=ue(e,n,r).disconnect;return{disconnect:function(){o()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=It;try{return It=e,t()}finally{It=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var o=t.current,i=Ta(),a=Ia(o);return n=ys(n),null===t.context?t.context=n:t.pendingContext=n,(t=Zn(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Xn(o,t,a))&&(Ra(e,o,a,i),$n(e,o,a)),a},t};!function(e){e.exports=sbe}(abe);var lbe=ar(ibe),ube={},cbe={get exports(){return ube},set exports(e){ube=e}},dbe={ /** * @license React * react-reconciler-constants.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ ConcurrentRoot:1,ContinuousEventPriority:4,DefaultEventPriority:16,DiscreteEventPriority:1,IdleEventPriority:536870912,LegacyRoot:0};!function(e){e.exports=dbe}(cbe);var fbe={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0},hbe=!1,pbe=!1,vbe=".react-konva-event",gbe="ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n",mbe='ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n',ybe={};function bbe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ybe;if(!hbe&&"zIndex"in t&&(console.warn(mbe),hbe=!0),!pbe&&t.draggable){var r=void 0!==t.x||void 0!==t.y,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(gbe),pbe=!0)}for(var i in n)if(!fbe[i]){var a="on"===i.slice(0,2),s=n[i]!==t[i];if(a&&s)"content"===(p=i.substr(2).toLowerCase()).substr(0,7)&&(p="content"+p.substr(7,1).toUpperCase()+p.substr(8)),e.off(p,n[i]);var l=!t.hasOwnProperty(i);l&&e.setAttr(i,void 0)}var u=t._useStrictMode,c={},d=!1,f={};for(var i in t)if(!fbe[i]){a="on"===i.slice(0,2);var h=n[i]!==t[i];if(a&&h)"content"===(p=i.substr(2).toLowerCase()).substr(0,7)&&(p="content"+p.substr(7,1).toUpperCase()+p.substr(8)),t[i]&&(f[p]=t[i]);!a&&(t[i]!==n[i]||u&&t[i]!==e.getAttr(i))&&(d=!0,c[i]=t[i])}for(var p in d&&(e.setAttrs(c),wbe(e)),f)e.on(p+vbe,f[p])}function wbe(e){if(!Ste.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var kbe={},xbe={};kre.Node.prototype._applyProps=bbe;var Sbe=setTimeout,Cbe=clearTimeout;function _be(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),wbe(e)}var Ebe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:function(e,t){t.parent===e?t.moveToTop():e.add(t),wbe(e)},appendChildToContainer:function(e,t){t.parent===e?t.moveToTop():e.add(t),wbe(e)},appendInitialChild:function(e,t){"string"!=typeof t?(e.add(t),wbe(e)):console.error("Do not use plain text as child of Konva.Node. You are using text: ".concat(t))},cancelTimeout:Cbe,clearContainer:function(e){},commitMount:function(e,t,n){},commitTextUpdate:function(e,t,n){console.error('Text components are not yet supported in ReactKonva. You text is: "'.concat(n,'"'))},commitUpdate:function(e,t,n,r,o){bbe(e,o,r)},createInstance:function(e,t,n){var r=kre[e];r||(console.error("Konva has no node with the type ".concat(e,'. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/').concat(e,'" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html')),r=kre.Group);var o={},i={};for(var a in t){"on"===a.slice(0,2)?i[a]=t[a]:o[a]=t[a]}var s=new r(o);return bbe(s,i),s},createTextInstance:function(e,t,n){console.error('Text components are not supported for now in ReactKonva. Your text is: "'.concat(e,'"'))},detachDeletedInstance:function(){},finalizeInitialChildren:function(e,t,n){return!1},getChildHostContext:function(){return kbe},getCurrentEventPriority:function(){return ube.DefaultEventPriority},getPublicInstance:function(e){return e},getRootHostContext:function(){return kbe},hideInstance:function(e){e.hide(),wbe(e)},hideTextInstance:function(e){},idlePriority:tA.unstable_IdlePriority,insertBefore:_be,insertInContainerBefore:function(e,t,n){_be(e,t,n)},isPrimaryRenderer:!1,noTimeout:-1,now:tA.unstable_now,prepareForCommit:function(){return null},preparePortalMount:function(){return null},prepareUpdate:function(e,t,n,r){return xbe},removeChild:function(e,t){t.destroy(),t.off(vbe),wbe(e)},removeChildFromContainer:function(e,t){t.destroy(),t.off(vbe),wbe(e)},resetAfterCommit:function(){},resetTextContent:function(e){},run:tA.unstable_runWithPriority,scheduleTimeout:Sbe,shouldDeprioritizeSubtree:function(e,t){return!1},shouldSetTextContent:function(e,t){return!1},supportsMutation:!0,unhideInstance:function(e,t){(null==t.visible||t.visible)&&e.show()},unhideTextInstance:function(e,t){},warnsIfNotActing:!0},Symbol.toStringTag,{value:"Module"})),Pbe=Object.defineProperty,Lbe=Object.defineProperties,Obe=Object.getOwnPropertyDescriptors,Abe=Object.getOwnPropertySymbols,Mbe=Object.prototype.hasOwnProperty,Tbe=Object.prototype.propertyIsEnumerable,Ibe=function(e,t,n){return t in e?Pbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Rbe=function(e,t){for(var n in t||(t={}))Mbe.call(t,n)&&Ibe(e,n,t[n]);if(Abe){var r,o=xn(Abe(t));try{for(o.s();!(r=o.n()).done;){n=r.value;Tbe.call(t,n)&&Ibe(e,n,t[n])}}catch(COe){o.e(COe)}finally{o.f()}}return e};function Nbe(e,t,n){if(e){if(!0===n(e))return e;for(var r=t?e.return:e.child;r;){var o=Nbe(r,t,n);if(o)return o;r=t?null:r.sibling}}}function Dbe(e){try{return Object.defineProperties(e,{_currentRenderer:{get:function(){return null},set:function(){}},_currentRenderer2:{get:function(){return null},set:function(){}}})}catch(bce){return e}}var zbe=Dbe(cr.createContext(null)),jbe=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"render",value:function(){return cr.createElement(zbe.Provider,{value:this._reactInternals},this.props.children)}}]),n}(cr.Component),Bbe=cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fbe=Bbe.ReactCurrentOwner,Hbe=Bbe.ReactCurrentDispatcher;var Vbe=[],Wbe=new WeakMap;function Ube(){var e,t=function(){var e=cr.useContext(zbe);if(!e)throw new Error("its-fine: useFiber must be called within a !");var t=cr.useId(),n=cr.useMemo((function(){var n;return null!=(n=Fbe.current)?n:Nbe(e,!1,(function(e){for(var n=e.memoizedState;n;){if(n.memoizedState===t)return!0;n=n.next}}))}),[e,t]);return n}();Vbe.splice(0,Vbe.length),Nbe(t,!0,(function(e){var t,n=null==(t=e.type)?void 0:t._context;n&&n!==zbe&&Vbe.push(Dbe(n))}));for(var n=0,r=Vbe;n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'.replaceAll("black",e)},jwe=function(e){var t=Object.assign({},(Kt(e),e)),n=kie(Dwe),r=n.maskColorString,o=n.stageCoordinates,i=n.stageDimensions,a=n.stageScale,s=yn(cr.useState(null),2),l=s[0],u=s[1],c=yn(cr.useState(0),2),d=c[0],f=c[1],h=cr.useRef(null),p=cr.useCallback((function(){f(d+1),setTimeout(p,500)}),[d]);return cr.useEffect((function(){if(!l){var e=new Image;e.onload=function(){u(e)},e.src=zwe(r)}}),[l,r]),cr.useEffect((function(){l&&(l.src=zwe(r))}),[l,r]),cr.useEffect((function(){var e=setInterval((function(){return f((function(e){return(e+1)%5}))}),50);return function(){return clearInterval(e)}}),[]),l&&Nwe(o.x)&&Nwe(o.y)&&Nwe(a)&&Nwe(i.width)&&Nwe(i.height)?no(Zbe,un({ref:h,offsetX:o.x/a,offsetY:o.y/a,height:i.height/a,width:i.width/a,fillPatternImage:l,fillPatternOffsetY:Nwe(d)?d:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/a,y:1/a},listening:!0,globalCompositeOperation:"source-in"},t)):null},Bwe=QX([Lde],(function(e){return{objects:e.layerState.objects}}),{memoizeOptions:{resultEqualityCheck:dae}}),Fwe=function(e){var t=Object.assign({},(Kt(e),e)),n=kie(Bwe).objects;return no(Ybe,un(un({listening:!1},t),{},{children:n.filter(j5).map((function(e,t){return no($be,{points:e.points,stroke:"rgb(0,0,0)",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"},t)}))}))},Hwe=cr,Vwe=function(e){var t=e.url,n=e.x,r=e.y,o=function(e,t,n){var r=Hwe.useRef("loading"),o=Hwe.useRef(),i=yn(Hwe.useState(0),2),a=(i[0],i[1]),s=Hwe.useRef(),l=Hwe.useRef(),u=Hwe.useRef();return s.current===e&&l.current===t&&u.current===n||(r.current="loading",o.current=void 0,s.current=e,l.current=t,u.current=n),Hwe.useLayoutEffect((function(){if(e){var i=document.createElement("img");return i.addEventListener("load",s),i.addEventListener("error",l),t&&(i.crossOrigin=t),n&&(i.referrerpolicy=n),i.src=e,function(){i.removeEventListener("load",s),i.removeEventListener("error",l)}}function s(){r.current="loaded",o.current=i,a(Math.random())}function l(){r.current="failed",o.current=void 0,a(Math.random())}}),[e,t,n]),[o.current,r.current]}(t),i=yn(o,1)[0];return no(Kbe,{x:n,y:r,image:i,listening:!1})},Wwe=QX([Lde],(function(e){return{objects:e.layerState.objects}}),{memoizeOptions:{resultEqualityCheck:dae}}),Uwe=function(){var e=kie(Wwe).objects;return e?no(Ybe,{name:"outpainting-objects",listening:!1,children:e.map((function(e,t){if(B5(e))return no(Vwe,{x:e.x,y:e.y,url:e.image.url},t);if(function(e){return"line"===e.kind&&"base"===e.layer}(e)){var n=no($be,{points:e.points,stroke:e.color?Twe(e.color):"rgb(0,0,0)",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"},t);return e.clip?no(Ybe,{clipX:e.clip.x,clipY:e.clip.y,clipWidth:e.clip.width,clipHeight:e.clip.height,children:n},t):n}return function(e){return"fillRect"===e.kind&&"base"===e.layer}(e)?no(Zbe,{x:e.x,y:e.y,width:e.width,height:e.height,fill:Twe(e.color)},t):function(e){return"eraseRect"===e.kind&&"base"===e.layer}(e)?no(Zbe,{x:e.x,y:e.y,width:e.width,height:e.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},t):void 0}))}):null},Gwe=QX([Lde],(function(e){var t=e.layerState.stagingArea,n=t.images,r=t.selectedImageIndex,o=e.shouldShowStagingImage,i=e.shouldShowStagingOutline,a=e.boundingBoxCoordinates,s=a.x,l=a.y,u=e.boundingBoxDimensions,c=u.width,d=u.height;return{currentStagingAreaImage:n.length>0?n[r]:void 0,isOnFirstImage:0===r,isOnLastImage:r===n.length-1,shouldShowStagingImage:o,shouldShowStagingOutline:i,x:s,y:l,width:c,height:d}}),{memoizeOptions:{resultEqualityCheck:dae}}),qwe=function(e){var t=Object.assign({},(Kt(e),e)),n=kie(Gwe),r=n.currentStagingAreaImage,o=n.shouldShowStagingImage,i=n.shouldShowStagingOutline,a=n.x,s=n.y,l=n.width,u=n.height;return ro(Ybe,un(un({},t),{},{children:[o&&r&&no(Vwe,{url:r.image.url,x:a,y:s}),i&&ro(Ybe,{children:[no(Zbe,{x:a,y:s,width:l,height:u,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),no(Zbe,{x:a,y:s,width:l,height:u,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]}))},Ywe=QX([Lde],(function(e){var t=e.layerState.stagingArea,n=t.images,r=t.selectedImageIndex,o=e.shouldShowStagingOutline,i=e.shouldShowStagingImage;return{currentStagingAreaImage:n.length>0?n[r]:void 0,isOnFirstImage:0===r,isOnLastImage:r===n.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:o}}),{memoizeOptions:{resultEqualityCheck:dae}}),Zwe=function(){var e=wie(),t=kie(Ywe),n=t.isOnFirstImage,r=t.isOnLastImage,o=t.currentStagingAreaImage,i=t.shouldShowStagingImage,a=o8().t,s=cr.useCallback((function(){e(z3(!0))}),[e]),l=cr.useCallback((function(){e(z3(!1))}),[e]);_ce(["left"],(function(){u()}),{enabled:function(){return!0},preventDefault:!0}),_ce(["right"],(function(){c()}),{enabled:function(){return!0},preventDefault:!0}),_ce(["enter"],(function(){d()}),{enabled:function(){return!0},preventDefault:!0});var u=function(){return e(n3())},c=function(){return e(t3())},d=function(){return e(Q5())};return o?no(yP,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:s,onMouseOut:l,children:ro(k_,{isAttached:!0,children:[no(_ae,{tooltip:"".concat(a("unifiedcanvas:previous")," (Left)"),"aria-label":"".concat(a("unifiedcanvas:previous")," (Left)"),icon:no(Bce,{}),onClick:u,"data-selected":!0,isDisabled:n}),no(_ae,{tooltip:"".concat(a("unifiedcanvas:next")," (Right)"),"aria-label":"".concat(a("unifiedcanvas:next")," (Right)"),icon:no(Fce,{}),onClick:c,"data-selected":!0,isDisabled:r}),no(_ae,{tooltip:"".concat(a("unifiedcanvas:accept")," (Enter)"),"aria-label":"".concat(a("unifiedcanvas:accept")," (Enter)"),icon:no(Uce,{}),onClick:d,"data-selected":!0}),no(_ae,{tooltip:a("unifiedcanvas:showHide"),"aria-label":a("unifiedcanvas:showHide"),"data-alert":!i,icon:no(i?tde:ede,{}),onClick:function(){return e(D3(!i))},"data-selected":!0}),no(_ae,{tooltip:a("unifiedcanvas:saveToGallery"),"aria-label":a("unifiedcanvas:saveToGallery"),icon:no(mde,{}),onClick:function(){return e(uie(o.image.url))},"data-selected":!0}),no(_ae,{tooltip:a("unifiedcanvas:discardAll"),"aria-label":a("unifiedcanvas:discardAll"),icon:no(hde,{style:{transform:"rotate(45deg)"}}),onClick:function(){return e(J5())},"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},Xwe=function(e){return Math.round(100*e)/100},$we=QX([Lde],(function(e){var t=e.cursorPosition,n=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1},r=n.cursorY;return{cursorCoordinatesString:"(".concat(Xwe(n.cursorX),", ").concat(Xwe(r),")")}}),{memoizeOptions:{resultEqualityCheck:dae}});function Kwe(){var e=kie($we).cursorCoordinatesString,t=o8().t;return no("div",{children:"".concat(t("unifiedcanvas:cursorPosition"),": ").concat(e)})}var Qwe=QX([Lde],(function(e){var t=e.stageDimensions,n=t.width,r=t.height,o=e.stageCoordinates,i=o.x,a=o.y,s=e.boundingBoxDimensions,l=s.width,u=s.height,c=e.scaledBoundingBoxDimensions,d=c.width,f=c.height,h=e.boundingBoxCoordinates,p=h.x,v=h.y,g=e.stageScale,m=e.shouldShowCanvasDebugInfo,y=e.layer,b=e.boundingBoxScaleMethod,w="inherit";return("none"===b&&(l<512||u<512)||"manual"===b&&d*f<262144)&&(w="var(--status-working-color)"),{activeLayerColor:"mask"===y?"var(--status-working-color)":"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:"(".concat(Xwe(p),", ").concat(Xwe(v),")"),boundingBoxDimensionsString:"".concat(l,"×").concat(u),scaledBoundingBoxDimensionsString:"".concat(d,"×").concat(f),canvasCoordinatesString:"".concat(Xwe(i),"×").concat(Xwe(a)),canvasDimensionsString:"".concat(n,"×").concat(r),canvasScaleString:Math.round(100*g),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:"auto"!==b,shouldShowScaledBoundingBox:"none"!==b}}),{memoizeOptions:{resultEqualityCheck:dae}}),Jwe=function(){var e=kie(Qwe),t=e.activeLayerColor,n=e.activeLayerString,r=e.boundingBoxColor,o=e.boundingBoxCoordinatesString,i=e.boundingBoxDimensionsString,a=e.scaledBoundingBoxDimensionsString,s=e.shouldShowScaledBoundingBox,l=e.canvasCoordinatesString,u=e.canvasDimensionsString,c=e.canvasScaleString,d=e.shouldShowCanvasDebugInfo,f=e.shouldShowBoundingBox,h=o8().t;return ro("div",{className:"canvas-status-text",children:[no("div",{style:{color:t},children:"".concat(h("unifiedcanvas:activeLayer"),": ").concat(n)}),no("div",{children:"".concat(h("unifiedcanvas:canvasScale"),": ").concat(c,"%")}),f&&no("div",{style:{color:r},children:"".concat(h("unifiedcanvas:boundingBox"),": ").concat(i)}),s&&no("div",{style:{color:r},children:"".concat(h("unifiedcanvas:scaledBoundingBox"),": ").concat(a)}),d&&ro(to,{children:[no("div",{children:"".concat(h("unifiedcanvas:boundingBoxPosition"),": ").concat(o)}),no("div",{children:"".concat(h("unifiedcanvas:canvasDimensions"),": ").concat(u)}),no("div",{children:"".concat(h("unifiedcanvas:canvasPosition"),": ").concat(l)}),no(Kwe,{})]})]})},eke=QX(Lde,(function(e){var t=e.boundingBoxCoordinates,n=e.boundingBoxDimensions,r=e.stageScale,o=e.isDrawing,i=e.isTransformingBoundingBox,a=e.isMovingBoundingBox,s=e.tool;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:i,stageScale:r,shouldSnapToGrid:e.shouldSnapToGrid,tool:s,hitStrokeWidth:20/r}}),{memoizeOptions:{resultEqualityCheck:dae}}),tke=function(e){var t=Object.assign({},(Kt(e),e)),n=wie(),r=kie(eke),o=r.boundingBoxCoordinates,i=r.boundingBoxDimensions,a=r.isDrawing,s=r.isMovingBoundingBox,l=r.isTransformingBoundingBox,u=r.stageScale,c=r.shouldSnapToGrid,d=r.tool,f=r.hitStrokeWidth,h=cr.useRef(null),p=cr.useRef(null),v=yn(cr.useState(!1),2),g=v[0],m=v[1];cr.useEffect((function(){var e;h.current&&p.current&&(h.current.nodes([p.current]),null===(e=h.current.getLayer())||void 0===e||e.batchDraw())}),[]);var y=64*u,b=cr.useCallback((function(e){if(c){var t=e.target.x(),r=e.target.y(),o=pK(t,64),i=pK(r,64);e.target.x(o),e.target.y(i),n(u3({x:o,y:i}))}else n(u3({x:Math.floor(e.target.x()),y:Math.floor(e.target.y())}))}),[n,c]),w=cr.useCallback((function(){if(p.current){var e=p.current,t=e.scaleX(),r=e.scaleY(),o=Math.round(e.width()*t),i=Math.round(e.height()*r),a=Math.round(e.x()),s=Math.round(e.y());n(c3({width:o,height:i})),n(u3({x:c?hK(a,64):a,y:c?hK(s,64):s})),e.scaleX(1),e.scaleY(1)}}),[n,c]),k=cr.useCallback((function(e,t,n){var r=e.x%y,o=e.y%y;return{x:hK(t.x,y)+r,y:hK(t.y,y)+o}}),[y]),x=function(){n(C3(!1)),n(x3(!1)),n(k3(!1)),m(!1)},S=function(){n(x3(!0))},C=function(){n(C3(!1)),n(x3(!1)),n(k3(!1)),m(!1)},_=function(){m(!0)},E=function(){n(k3(!0))},P=function(){n(k3(!1))};return ro(Ybe,un(un({},t),{},{children:[no(Zbe,{height:i.height,width:i.width,x:o.x,y:o.y,onMouseEnter:E,onMouseOver:E,onMouseLeave:P,onMouseOut:P}),no(Zbe,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:f,listening:!a&&"move"===d,onDragStart:S,onDragEnd:C,onDragMove:b,onMouseDown:S,onMouseOut:function(){!l&&!s&&m(!1)},onMouseOver:_,onMouseEnter:_,onMouseUp:C,onTransform:w,onTransformEnd:x,ref:p,stroke:g?"rgba(255,255,255,0.7)":"white",strokeWidth:(g?8:1)/u,width:i.width,x:o.x,y:o.y}),no("Transformer",{anchorCornerRadius:3,anchorDragBoundFunc:k,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:"move"===d?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!a&&"move"===d,onDragStart:S,onDragEnd:C,onMouseDown:function(){n(C3(!0))},onMouseUp:x,onTransformEnd:x,ref:h,rotateEnabled:!1})]}))},nke=QX(Lde,(function(e){var t=e.cursorPosition,n=e.brushSize,r=e.colorPickerColor,o=e.maskColor,i=e.brushColor,a=e.tool,s=e.layer,l=e.shouldShowBrush,u=e.isMovingBoundingBox,c=e.isTransformingBoundingBox,d=e.stageScale,f=e.stageDimensions,h=e.boundingBoxCoordinates,p=e.boundingBoxDimensions,v=e.shouldRestrictStrokesToBox?{clipX:h.x,clipY:h.y,clipWidth:p.width,clipHeight:p.height}:{};return{cursorPosition:t,brushX:t?t.x:f.width/2,brushY:t?t.y:f.height/2,radius:n/2,colorPickerOuterRadius:30/d,colorPickerInnerRadius:21/d,maskColorString:Twe(un(un({},o),{},{a:.5})),brushColorString:Twe(i),colorPickerColorString:Twe(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||c||!t)&&l,strokeWidth:1.5/d,dotRadius:1.5/d,clip:v}}),{memoizeOptions:{resultEqualityCheck:dae}}),rke=function(e){var t=Object.assign({},(Kt(e),e)),n=kie(nke),r=n.brushX,o=n.brushY,i=n.radius,a=n.maskColorString,s=n.tool,l=n.layer,u=n.shouldDrawBrushPreview,c=n.dotRadius,d=n.strokeWidth,f=n.brushColorString,h=n.colorPickerColorString,p=n.colorPickerInnerRadius,v=n.colorPickerOuterRadius,g=n.clip;return u?ro(Ybe,un(un(un({listening:!1},g),t),{},{children:[ro(to,"colorPicker"===s?{children:[no(Xbe,{x:r,y:o,radius:v,stroke:f,strokeWidth:10,strokeScaleEnabled:!1}),no(Xbe,{x:r,y:o,radius:p,stroke:h,strokeWidth:10,strokeScaleEnabled:!1})]}:{children:[no(Xbe,{x:r,y:o,radius:i,fill:"mask"===l?a:f,globalCompositeOperation:"eraser"===s?"destination-out":"source-out"}),no(Xbe,{x:r,y:o,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:2*d,strokeEnabled:!0,listening:!1}),no(Xbe,{x:r,y:o,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),no(Xbe,{x:r,y:o,radius:2*c,fill:"rgba(255,255,255,0.4)",listening:!1}),no(Xbe,{x:r,y:o,radius:c,fill:"rgba(0,0,0,1)",listening:!1})]})):null},oke=QX([Lde,Ode],(function(e,t){var n=e.isMaskEnabled,r=e.stageScale,o=e.shouldShowBoundingBox,i=e.isTransformingBoundingBox,a=e.isMouseOverBoundingBox,s=e.isMovingBoundingBox,l=e.stageDimensions,u=e.stageCoordinates,c=e.tool,d=e.isMovingStage,f=e.shouldShowIntermediates,h=e.shouldShowGrid,p=e.shouldRestrictStrokesToBox,v="none";return"move"===c||t?v=d?"grabbing":"grab":i?v=void 0:p&&!a&&(v="default"),{isMaskEnabled:n,isModifyingBoundingBox:i||s,shouldShowBoundingBox:o,shouldShowGrid:h,stageCoordinates:u,stageCursor:v,stageDimensions:l,stageScale:r,tool:c,isStaging:t,shouldShowIntermediates:f}}),{memoizeOptions:{resultEqualityCheck:dae}}),ike=function(){var e=kie(oke),t=e.isMaskEnabled,n=e.isModifyingBoundingBox,r=e.shouldShowBoundingBox,o=e.shouldShowGrid,i=e.stageCoordinates,a=e.stageCursor,s=e.stageDimensions,l=e.stageScale,u=e.tool,c=e.isStaging,d=e.shouldShowIntermediates;nwe();var f,h=cr.useRef(null),p=cr.useRef(null),v=cr.useCallback((function(e){Poe=e,h.current=e}),[]),g=cr.useCallback((function(e){Eoe=e,p.current=e}),[]),m=cr.useRef({x:0,y:0}),y=cr.useRef(!1),b=function(e){var t=wie(),n=kie(lwe),r=n.isMoveStageKeyHeld,o=n.stageScale;return cr.useCallback((function(n){if(e.current&&!r){n.evt.preventDefault();var i=e.current.getPointerPosition();if(i){var a=(i.x-e.current.x())/o,s=(i.y-e.current.y())/o,l=n.evt.deltaY;n.evt.ctrlKey&&(l=-l);var u=JK(o*Math.pow(.999,l),.1,20),c={x:i.x-a*u,y:i.y-s*u};t(F3(u)),t(B3(c))}}}),[e,r,o,t])}(h),w=function(e){var t=wie(),n=kie(iwe),r=n.tool,o=n.isStaging,i=owe().commitColorUnderCursor;return cr.useCallback((function(n){if(e.current)if(e.current.container().focus(),"move"===r||o)t(S3(!0));else if("colorPicker"!==r){var a=rwe(e.current);a&&(n.evt.preventDefault(),t(b3(!0)),t(Y5([a.x,a.y])))}else i()}),[e,r,o,t,i])}(h),k=function(e,t){var n=wie(),r=kie(swe),o=r.tool,i=r.isDrawing,a=r.isStaging;return cr.useCallback((function(){if("move"===o||a)n(S3(!1));else{if(!t.current&&i&&e.current){var r=rwe(e.current);if(!r)return;n(Z5([r.x,r.y]))}else t.current=!1;n(b3(!1))}}),[t,n,i,a,e,o])}(h,y),x=function(e,t,n){var r=wie(),o=kie(awe),i=o.isDrawing,a=o.tool,s=o.isStaging,l=owe().updateColorUnderCursor;return cr.useCallback((function(){if(e.current){var o=rwe(e.current);o&&(r(g3(o)),n.current=o,"colorPicker"!==a?i&&"move"!==a&&!s&&(t.current=!0,r(Z5([o.x,o.y]))):l())}}),[t,r,i,s,n,e,a,l])}(h,y,m),S=(f=wie(),cr.useCallback((function(){f(e3())}),[f])),C=function(){var e=wie(),t=kie(ewe),n=t.tool,r=t.isStaging,o=t.isMovingBoundingBox;return{handleDragStart:cr.useCallback((function(){"move"!==n&&!r||o||e(S3(!0))}),[e,o,r,n]),handleDragMove:cr.useCallback((function(t){if(("move"===n||r)&&!o){var i={x:t.target.x(),y:t.target.y()};e(B3(i))}}),[e,o,r,n]),handleDragEnd:cr.useCallback((function(){"move"!==n&&!r||o||e(S3(!1))}),[e,o,r,n])}}(),_=C.handleDragStart,E=C.handleDragMove,P=C.handleDragEnd;return no("div",{className:"inpainting-canvas-container",children:ro("div",{className:"inpainting-canvas-wrapper",children:[ro(Jbe,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:un({},a?{cursor:a}:{}),x:i.x,y:i.y,width:s.width,height:s.height,scale:{x:l,y:l},onTouchStart:w,onTouchMove:x,onTouchEnd:k,onMouseDown:w,onMouseLeave:S,onMouseMove:x,onMouseUp:k,onDragStart:_,onDragMove:E,onDragEnd:P,onContextMenu:function(e){return e.evt.preventDefault()},onWheel:b,draggable:("move"===u||c)&&!n,children:[no(qbe,{id:"grid",visible:o,children:no(Owe,{})}),no(qbe,{id:"base",ref:g,listening:!1,imageSmoothingEnabled:!1,children:no(Uwe,{})}),ro(qbe,{id:"mask",visible:t,listening:!1,children:[no(Fwe,{visible:!0,listening:!1}),no(jwe,{listening:!1})]}),no(qbe,{children:no(cwe,{})}),ro(qbe,{id:"preview",imageSmoothingEnabled:!1,children:[!c&&no(rke,{visible:"move"!==u,listening:!1}),no(qwe,{visible:c}),d&&no(Mwe,{}),no(tke,{visible:r&&!c})]})]}),no(Jwe,{}),no(Zwe,{})]})})},ake=QX(Lde,Ade,fae,(function(e,t,n){return{doesCanvasNeedScaling:e.doesCanvasNeedScaling,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:e.isCanvasInitialized}})),ske=function(){var e=wie(),t=kie(ake),n=t.doesCanvasNeedScaling,r=t.activeTabName,o=t.initialCanvasImage,i=t.isCanvasInitialized,a=cr.useRef(null);return cr.useLayoutEffect((function(){window.setTimeout((function(){if(a.current){var t=a.current,n=t.clientWidth,r=t.clientHeight;e(p3({width:n,height:r})),e(i?l3():s3()),e(m3(!1))}}),0)}),[e,o,n,r,i]),no("div",{ref:a,className:"inpainting-canvas-area",children:no(XC,{thickness:"2px",speed:"1s",size:"xl"})})},lke=_K,uke=kK,cke=function(){return lke.Date.now()},dke=$K,fke=Math.max,hke=Math.min;var pke=function(e,t,n){var r,o,i,a,s,l,u=0,c=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,i=o;return r=o=void 0,u=t,a=e.apply(i,n)}function p(e){return u=e,s=setTimeout(g,t),c?h(e):a}function v(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=i}function g(){var e=cke();if(v(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?hke(n,i-(e-u)):n}(e))}function m(e){return s=void 0,f&&r?h(e):(r=o=void 0,a)}function y(){var e=cke(),n=v(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return p(l);if(d)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=dke(t)||0,uke(n)&&(c=!!n.leading,i=(d="maxWait"in n)?fke(dke(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=o=s=void 0},y.flush=function(){return void 0===s?a:m(cke())},y},vke=QX([Lde,fae,wle],(function(e,t,n){return{canRedo:e.futureLayerStates.length>0&&!n.isProcessing,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:dae}});function gke(){var e=wie(),t=kie(vke),n=t.canRedo,r=t.activeTabName,o=o8().t,i=function(){e(r3())};return _ce(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],(function(){i()}),{enabled:function(){return n},preventDefault:!0},[r,n]),no(_ae,{"aria-label":"".concat(o("unifiedcanvas:redo")," (Ctrl+Shift+Z)"),tooltip:"".concat(o("unifiedcanvas:redo")," (Ctrl+Shift+Z)"),icon:no(gde,{}),onClick:i,isDisabled:!n})}var mke=QX([Lde,fae,wle],(function(e,t,n){return{canUndo:e.pastLayerStates.length>0&&!n.isProcessing,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:dae}});function yke(){var e=wie(),t=o8().t,n=kie(mke),r=n.canUndo,o=n.activeTabName,i=function(){e(V3())};return _ce(["meta+z","ctrl+z"],(function(){i()}),{enabled:function(){return r},preventDefault:!0},[o,r]),no(_ae,{"aria-label":"".concat(t("unifiedcanvas:undo")," (Ctrl+Z)"),tooltip:"".concat(t("unifiedcanvas:undo")," (Ctrl+Z)"),icon:no(Cde,{}),onClick:i,isDisabled:!r})}var bke=function(e,t,n){var r=document.createElement("img");r.addEventListener("load",(function(){var e=document.createElement("canvas");e.width=t,e.height=n;var o=e.getContext("2d");o&&(o.drawImage(r,0,0),e.toBlob((function(e){e&&navigator.clipboard.write([new ClipboardItem(gn({},e.type,e))])})),e.remove(),r.remove())})),r.src=e},wke=function(e){var t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},kke=function(e,t,n,r){var o=e.scale(),i=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});var a=e.getClientRect(),s=a.x,l=a.y,u=a.width,c=a.height,d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:s,y:l,width:u,height:c},f=e.toDataURL(d);return e.scale(o),{dataURL:f,boundingBox:{x:i.x,y:i.y,width:u,height:c}}},xke={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Ske=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xke;return function(){var t=qt(Ut().mark((function t(n,r){var o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S,C,_,E;return Ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.cropVisible,i=e.cropToBoundingBox,a=e.shouldSaveToGallery,s=e.shouldDownload,l=e.shouldCopy,u=e.shouldSetAsInitialImage,n(O8("Exporting Image")),n(x8(!1)),c=r(),d=c.canvas,f=d.stageScale,h=d.boundingBoxCoordinates,p=d.boundingBoxDimensions,v=d.stageCoordinates,g=Loe()){t.next=10;break}return n(l8(!1)),n(x8(!0)),t.abrupt("return");case 10:if(m=kke(g,f,v,i?un(un({},h),p):void 0),y=m.dataURL,b=m.boundingBox,y){t.next=15;break}return n(l8(!1)),n(x8(!0)),t.abrupt("return");case 15:return(w=new FormData).append("data",JSON.stringify({dataURL:y,filename:"merged_canvas.png",kind:a?"result":"temp",cropVisible:o})),t.next=19,fetch("".concat(window.location.origin,"/upload"),{method:"POST",body:w});case 19:return k=t.sent,t.next=22,k.json();case 22:x=t.sent,S=x.url,C=x.width,_=x.height,E=un({uuid:Xoe(),category:a?"result":"user"},x),s&&(wke(S),n(P8({title:A7.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),l&&(bke(S,C,_),n(P8({title:A7.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),a&&(n(Z3({image:E,category:"result"})),n(P8({title:A7.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),u&&(n(P3(un(un({kind:"image",layer:"base"},b),{},{image:E}))),n(P8({title:A7.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),n(l8(!1)),n(v8(A7.t("common:statusConnected"))),n(x8(!0));case 32:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()};function Cke(){var e=kie(Ode),t=Loe(),n=kie((function(e){return e.system.isProcessing})),r=kie((function(e){return e.canvas.shouldCropToBoundingBoxOnSave})),o=wie(),i=o8().t;_ce(["meta+c","ctrl+c"],(function(){a()}),{enabled:function(){return!e},preventDefault:!0},[t,n]);var a=function(){o(Ske({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return no(_ae,{"aria-label":"".concat(i("unifiedcanvas:copyToClipboard")," (Cmd/Ctrl+C)"),tooltip:"".concat(i("unifiedcanvas:copyToClipboard")," (Cmd/Ctrl+C)"),icon:no(qce,{}),onClick:a,isDisabled:e})}function _ke(){var e=wie(),t=o8().t,n=Loe(),r=kie(Ode),o=kie((function(e){return e.system.isProcessing})),i=kie((function(e){return e.canvas.shouldCropToBoundingBoxOnSave}));_ce(["shift+d"],(function(){a()}),{enabled:function(){return!r},preventDefault:!0},[n,o]);var a=function(){e(Ske({cropVisible:!i,cropToBoundingBox:i,shouldDownload:!0}))};return no(_ae,{"aria-label":"".concat(t("unifiedcanvas:downloadAsImage")," (Shift+D)"),tooltip:"".concat(t("unifiedcanvas:downloadAsImage")," (Shift+D)"),icon:no(Xce,{}),onClick:a,isDisabled:r})}function Eke(){var e=kie(Ode),t=xie().openUploader,n=o8().t;return no(_ae,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:no(_de,{}),onClick:t,isDisabled:e})}var Pke=QX([Lde,Ode],(function(e,t){return{layer:e.layer,isMaskEnabled:e.isMaskEnabled,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:dae}});function Lke(){var e=wie(),t=o8().t,n=kie(Pke),r=n.layer,o=n.isMaskEnabled,i=n.isStaging;_ce(["q"],(function(){e(_3("mask"===r?"base":"mask"))}),{enabled:function(){return!i},preventDefault:!0},[r]);return no(Mae,{tooltip:"".concat(t("unifiedcanvas:layer")," (Q)"),tooltipProps:{hasArrow:!0,placement:"top"},value:r,validValues:D5,onChange:function(t){var n=t.target.value;e(_3(n)),"mask"!==n||o||e(w3(!0))},isDisabled:i})}function Oke(){var e=wie(),t=o8().t,n=Loe(),r=kie(Ode),o=kie((function(e){return e.system.isProcessing}));_ce(["shift+m"],(function(){i()}),{enabled:function(){return!r},preventDefault:!0},[n,o]);var i=function(){e(Ske({cropVisible:!1,shouldSetAsInitialImage:!0}))};return no(_ae,{"aria-label":"".concat(t("unifiedcanvas:mergeVisible")," (Shift+M)"),tooltip:"".concat(t("unifiedcanvas:mergeVisible")," (Shift+M)"),icon:no(sde,{}),onClick:i,isDisabled:r})}function Ake(){var e=kie((function(e){return e.canvas.tool})),t=kie(Ode),n=wie(),r=o8().t;_ce(["v"],(function(){o()}),{enabled:function(){return!t},preventDefault:!0},[]);var o=function(){return n(H3("move"))};return no(_ae,{"aria-label":"".concat(r("unifiedcanvas:move")," (V)"),tooltip:"".concat(r("unifiedcanvas:move")," (V)"),icon:no(Hce,{}),"data-selected":"move"===e||t,onClick:o})}function Mke(){var e=kie((function(e){return e.ui.shouldPinParametersPanel})),t=wie(),n=o8().t;return ro(yP,{flexDirection:"column",gap:"0.5rem",children:[no(_ae,{tooltip:"".concat(n("parameters:showOptionsPanel")," (O)"),tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:function(){t(V8(!0)),e&&setTimeout((function(){return t(m3(!0))}),400)},children:no(kde,{})}),no(yP,{children:no(Fye,{iconButton:!0})}),no(yP,{children:no(zye,{width:"100%",height:"40px"})})]})}function Tke(){var e=wie(),t=o8().t,n=kie(Ode);return no(_ae,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:no(Sde,{}),onClick:function(){e(o3()),e(s3())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function Ike(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,r=cr.useState(0),o=yn(r,2),i=o[0],a=o[1];return cr.useEffect((function(){var r=setTimeout((function(){1===i&&e(),a(0)}),n);return 2===i&&t(),function(){return clearTimeout(r)}}),[i,e,t,n]),function(){return a((function(e){return e+1}))}}function Rke(){var e=Loe(),t=wie(),n=o8().t;_ce(["r"],(function(){o()}),{enabled:function(){return!0},preventDefault:!0},[e]);var r=Ike((function(){return o(!1)}),(function(){return o(!0)})),o=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Loe();if(n){var r=n.getClientRect({skipTransform:!0});t(a3({contentRect:r,shouldScaleTo1:e}))}};return no(_ae,{"aria-label":"".concat(n("unifiedcanvas:resetView")," (R)"),tooltip:"".concat(n("unifiedcanvas:resetView")," (R)"),icon:no(Yce,{}),onClick:r})}function Nke(){var e=kie(Ode),t=Loe(),n=kie((function(e){return e.system.isProcessing})),r=kie((function(e){return e.canvas.shouldCropToBoundingBoxOnSave})),o=wie(),i=o8().t;_ce(["shift+s"],(function(){a()}),{enabled:function(){return!e},preventDefault:!0},[t,n]);var a=function(){o(Ske({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return no(_ae,{"aria-label":"".concat(i("unifiedcanvas:saveToGallery")," (Shift+S)"),tooltip:"".concat(i("unifiedcanvas:saveToGallery")," (Shift+S)"),icon:no(mde,{}),onClick:a,isDisabled:e})}var Dke=QX([Lde,Ode,wle],(function(e,t,n){var r=n.isProcessing;return{tool:e.tool,isStaging:t,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:dae}}),zke=function(){var e=wie(),t=o8().t,n=kie(Dke),r=n.tool,o=n.isStaging;_ce(["b"],(function(){i()}),{enabled:function(){return!o},preventDefault:!0},[]),_ce(["e"],(function(){a()}),{enabled:function(){return!o},preventDefault:!0},[r]),_ce(["c"],(function(){s()}),{enabled:function(){return!o},preventDefault:!0},[r]),_ce(["shift+f"],(function(){l()}),{enabled:function(){return!o},preventDefault:!0}),_ce(["delete","backspace"],(function(){u()}),{enabled:function(){return!o},preventDefault:!0});var i=function(){return e(H3("brush"))},a=function(){return e(H3("eraser"))},s=function(){return e(H3("colorPicker"))},l=function(){return e(G5())},u=function(){return e(U5())};return ro(yP,{flexDirection:"column",gap:"0.5rem",children:[ro(k_,{children:[no(_ae,{"aria-label":"".concat(t("unifiedcanvas:brush")," (B)"),tooltip:"".concat(t("unifiedcanvas:brush")," (B)"),icon:no(cde,{}),"data-selected":"brush"===r&&!o,onClick:i,isDisabled:o}),no(_ae,{"aria-label":"".concat(t("unifiedcanvas:eraser")," (E)"),tooltip:"".concat(t("unifiedcanvas:eraser")," (B)"),icon:no($ce,{}),"data-selected":"eraser"===r&&!o,isDisabled:o,onClick:a})]}),ro(k_,{children:[no(_ae,{"aria-label":"".concat(t("unifiedcanvas:fillBoundingBox")," (Shift+F)"),tooltip:"".concat(t("unifiedcanvas:fillBoundingBox")," (Shift+F)"),icon:no(nde,{}),isDisabled:o,onClick:l}),no(_ae,{"aria-label":"".concat(t("unifiedcanvas:eraseBoundingBox")," (Del/Backspace)"),tooltip:"".concat(t("unifiedcanvas:eraseBoundingBox")," (Del/Backspace)"),icon:no(hde,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:u})]}),no(_ae,{"aria-label":"".concat(t("unifiedcanvas:colorPicker")," (C)"),tooltip:"".concat(t("unifiedcanvas:colorPicker")," (C)"),icon:no(Jce,{}),"data-selected":"colorPicker"===r&&!o,isDisabled:o,onClick:s,width:"max-content"})]})},jke=Cv((function(e,t){var n=e.acceptButtonText,r=void 0===n?"Accept":n,o=e.acceptCallback,i=e.cancelButtonText,a=void 0===i?"Cancel":i,s=e.cancelCallback,l=e.children,u=e.title,c=e.triggerComponent,d=GE(),f=d.isOpen,h=d.onOpen,p=d.onClose,v=cr.useRef(null);return ro(to,{children:[cr.cloneElement(c,{onClick:h,ref:t}),no(oU,{isOpen:f,leastDestructiveRef:v,onClose:p,children:no(rU,{children:ro(iU,{className:"modal",children:[no(tU,{fontSize:"lg",fontWeight:"bold",children:u}),no(YW,{children:l}),ro(eU,{children:[no(b_,{ref:v,onClick:function(){s&&s(),p()},className:"modal-close-btn",children:a}),no(b_,{colorScheme:"red",onClick:function(){o(),p()},ml:3,children:r})]})]})})})]})})),Bke=function(){var e=kie(Ode),t=wie(),n=o8().t;return ro(jke,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:function(){t(cie()),t(o3()),t(X5())},acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:no(Eae,{leftIcon:no(Sde,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[no("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),no("br",{}),no("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},Fke=function(){var e=kie(Ode),t=wie(),n=o8().t;return ro(jke,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:function(){return t(X5())},acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:no(Eae,{size:"sm",leftIcon:no(Sde,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[no("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),no("br",{}),no("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},Hke=QX([Lde],(function(e){return{shouldAutoSave:e.shouldAutoSave,shouldCropToBoundingBoxOnSave:e.shouldCropToBoundingBoxOnSave,shouldShowCanvasDebugInfo:e.shouldShowCanvasDebugInfo,shouldShowIntermediates:e.shouldShowIntermediates}}),{memoizeOptions:{resultEqualityCheck:dae}}),Vke=function(){var e=wie(),t=o8().t,n=kie(Hke),r=n.shouldAutoSave,o=n.shouldCropToBoundingBoxOnSave,i=n.shouldShowCanvasDebugInfo,a=n.shouldShowIntermediates;return no(Pae,{trigger:"hover",triggerComponent:no(_ae,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:no(Pde,{})}),children:ro(yP,{direction:"column",gap:"0.5rem",children:[no(pfe,{label:t("unifiedcanvas:showIntermediates"),isChecked:a,onChange:function(t){return e(N3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:r,onChange:function(t){return e(L3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:o,onChange:function(t){return e(O3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:function(t){return e(I3(t.target.checked))}}),no(Fke,{}),no(Bke,{})]})})},Wke=function(){var e=kie((function(e){return e.ui.shouldShowParametersPanel}));return ro(yP,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[no(Lke,{}),no(zke,{}),ro(yP,{gap:"0.5rem",children:[no(Ake,{}),no(Rke,{})]}),ro(yP,{columnGap:"0.5rem",children:[no(Oke,{}),no(Nke,{})]}),ro(yP,{columnGap:"0.5rem",children:[no(Cke,{}),no(_ke,{})]}),ro(yP,{gap:"0.5rem",children:[no(yke,{}),no(gke,{})]}),ro(yP,{gap:"0.5rem",children:[no(Eke,{}),no(Tke,{})]}),no(Vke,{}),!e&&no(Mke,{})]})};function Uke(){var e=wie(),t=kie((function(e){return e.canvas.brushSize})),n=o8().t,r=kie(Ode);return _ce(["BracketLeft"],(function(){e(h3(Math.max(t-5,5)))}),{enabled:function(){return!r},preventDefault:!0},[t]),_ce(["BracketRight"],(function(){e(h3(Math.min(t+5,500)))}),{enabled:function(){return!r},preventDefault:!0},[t]),no(xfe,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:function(t){return e(h3(t))},sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function Gke(){return(Gke=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function Yke(e){var t=cr.useRef(e),n=cr.useRef((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var Zke=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(Kke(o.current,e,s.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=$ke(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(Qke(t),!function(e,t){return t&&!Xke(e)}(t,l.current)&&r)){if(Xke(t)){l.current=!0;var a=t.changedTouches||[];a.length&&(s.current=a[0].identifier)}r.focus(),i(Kke(r,t,s.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),a({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[a,i]),c=u[0],d=u[1],f=u[2];return cr.useEffect((function(){return f}),[f]),qr.createElement("div",Gke({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),exe=function(e){return e.filter(Boolean).join(" ")},txe=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=exe(["react-colorful__pointer",e.className]);return qr.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},qr.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},nxe=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},rxe=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:nxe(e.h),s:nxe(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:nxe(o/2),a:nxe(r,2)}},oxe=function(e){var t=rxe(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},ixe=function(e){var t=rxe(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},axe=qr.memo((function(e){var t=e.hue,n=e.onChange,r=exe(["react-colorful__hue",e.className]);return qr.createElement("div",{className:r},qr.createElement(Jke,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Zke(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":nxe(t),"aria-valuemax":"360","aria-valuemin":"0"},qr.createElement(txe,{className:"react-colorful__hue-pointer",left:t/360,color:oxe({h:t,s:100,v:100,a:1})})))})),sxe=qr.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:oxe({h:t.h,s:100,v:100,a:1})};return qr.createElement("div",{className:"react-colorful__saturation",style:r},qr.createElement(Jke,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Zke(t.s+100*e.left,0,100),v:Zke(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+nxe(t.s)+"%, Brightness "+nxe(t.v)+"%"},qr.createElement(txe,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:oxe(t)})))})),lxe=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function uxe(e,t,n){var r=Yke(n),o=cr.useState((function(){return e.toHsva(t)})),i=o[0],a=o[1],s=cr.useRef({color:t,hsva:i});cr.useEffect((function(){if(!e.equal(t,s.current.color)){var n=e.toHsva(t);s.current={hsva:n,color:t},a(n)}}),[t,e]),cr.useEffect((function(){var t;lxe(i,s.current.hsva)||e.equal(t=e.fromHsva(i),s.current.color)||(s.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=cr.useCallback((function(e){a((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var cxe="undefined"!=typeof window?cr.useLayoutEffect:cr.useEffect,dxe=new Map,fxe=function(e){cxe((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!dxe.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',dxe.set(t,n);var r="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0;r&&n.setAttribute("nonce",r),t.head.appendChild(n)}}),[])},hxe=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+ixe(Object.assign({},n,{a:0}))+", "+ixe(Object.assign({},n,{a:1}))+")"},i=exe(["react-colorful__alpha",t]),a=nxe(100*n.a);return qr.createElement("div",{className:i},qr.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),qr.createElement(Jke,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:Zke(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},qr.createElement(txe,{className:"react-colorful__alpha-pointer",left:n.a,color:ixe(n)})))},pxe=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=qke(e,["className","colorModel","color","onChange"]),s=cr.useRef(null);fxe(s);var l=uxe(n,o,i),u=l[0],c=l[1],d=exe(["react-colorful",t]);return qr.createElement("div",Gke({},a,{ref:s,className:d}),qr.createElement(sxe,{hsva:u,onChange:c}),qr.createElement(axe,{hue:u.h,onChange:c}),qr.createElement(hxe,{hsva:u,onChange:c,className:"react-colorful__last-control"}))},vxe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:nxe(60*(s<0?s+6:s)),s:nxe(i?a/i*100:0),v:nxe(i/255*100),a:o}},fromHsva:function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),u=i%6;return{r:nxe(255*[r,s,a,a,l,r][u]),g:nxe(255*[l,r,r,s,a,a][u]),b:nxe(255*[a,a,l,r,r,s][u]),a:nxe(o,2)}},equal:lxe},gxe=function(e){return qr.createElement(pxe,Gke({},e,{colorModel:vxe}))},mxe=function(e){var t=e.styleClass,n=sn(e,Wt);return no(gxe,un({className:"invokeai__color-picker ".concat(t)},n))},yxe=QX([Lde,Ode],(function(e,t){return{brushColor:e.brushColor,maskColor:e.maskColor,layer:e.layer,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:dae}});function bxe(){var e=wie(),t=kie(yxe),n=t.brushColor,r=t.maskColor,o=t.layer,i=t.isStaging;return _ce(["shift+BracketLeft"],(function(){e(f3(un(un({},n),{},{a:JK(n.a-.05,.05,1)})))}),{enabled:function(){return!i},preventDefault:!0},[n]),_ce(["shift+BracketRight"],(function(){e(f3(un(un({},n),{},{a:JK(n.a+.05,.05,1)})))}),{enabled:function(){return!i},preventDefault:!0},[n]),no(Pae,{trigger:"hover",triggerComponent:no(cP,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:"base"===o?"rgba(".concat(n.r,",").concat(n.g,",").concat(n.b,",").concat(n.a,")"):"mask"===o?"rgba(".concat(r.r,",").concat(r.g,",").concat(r.b,",").concat(r.a,")"):void 0,cursor:"pointer"}}),children:ro(yP,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:["base"===o&&no(mxe,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:function(t){return e(f3(t))}}),"mask"===o&&no(mxe,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:function(t){return e(E3(t))}})]})})}function wxe(){return ro(yP,{columnGap:"1rem",alignItems:"center",children:[no(Uke,{}),no(bxe,{})]})}function kxe(){var e=wie(),t=kie((function(e){return e.canvas.shouldRestrictStrokesToBox})),n=o8().t;return no(pfe,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:function(t){return e(U3(t.target.checked))}})}function xxe(){return ro(yP,{gap:"1rem",alignItems:"center",children:[no(wxe,{}),no(kxe,{})]})}function Sxe(){var e=wie(),t=o8().t;return no(Eae,{size:"sm",leftIcon:no(Sde,{}),onClick:function(){return e($5())},tooltip:"".concat(t("unifiedcanvas:clearMask")," (Shift+C)"),children:t("unifiedcanvas:betaClear")})}function Cxe(){var e=kie((function(e){return e.canvas.isMaskEnabled})),t=wie(),n=o8().t;return no(pfe,{label:"".concat(n("unifiedcanvas:enableMask")," (H)"),isChecked:e,onChange:function(){return t(w3(!e))}})}function _xe(){var e=wie(),t=o8().t,n=kie((function(e){return e.canvas.shouldPreserveMaskedArea}));return no(pfe,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:function(t){return e(M3(t.target.checked))}})}function Exe(){return ro(yP,{gap:"1rem",alignItems:"center",children:[no(wxe,{}),no(Cxe,{}),no(_xe,{}),no(Sxe,{})]})}function Pxe(){var e=kie((function(e){return e.canvas.shouldDarkenOutsideBoundingBox})),t=wie(),n=o8().t;return no(pfe,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:function(e){return t(A3(e.target.checked))}})}function Lxe(){var e=kie((function(e){return e.canvas.shouldShowGrid})),t=wie(),n=o8().t;return no(pfe,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:function(e){return t(R3(e.target.checked))}})}function Oxe(){var e=kie((function(e){return e.canvas.shouldSnapToGrid})),t=wie(),n=o8().t;return no(pfe,{label:"".concat(n("unifiedcanvas:snapToGrid")," (N)"),isChecked:e,onChange:function(e){return t(j3(e.target.checked))}})}function Axe(){return ro(yP,{alignItems:"center",gap:"1rem",children:[no(Lxe,{}),no(Oxe,{}),no(Pxe,{})]})}var Mxe=QX([Lde],(function(e){return{tool:e.tool,layer:e.layer}}),{memoizeOptions:{resultEqualityCheck:dae}});function Txe(){var e=kie(Mxe),t=e.tool,n=e.layer;return ro(yP,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:["base"==n&&["brush","eraser","colorPicker"].includes(t)&&no(xxe,{}),"mask"==n&&["brush","eraser","colorPicker"].includes(t)&&no(Exe,{}),"move"==t&&no(Axe,{})]})}var Ixe=QX([Lde],(function(e){return{doesCanvasNeedScaling:e.doesCanvasNeedScaling}}),{memoizeOptions:{resultEqualityCheck:dae}}),Rxe=function(){var e=wie(),t=kie(Ixe).doesCanvasNeedScaling;return cr.useLayoutEffect((function(){e(m3(!0));var t=pke((function(){e(m3(!0))}),250);return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}}),[e]),no("div",{className:"workarea-single-view",children:ro(yP,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[no(Wke,{}),ro(yP,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[no(Txe,{}),no(t?ske:ike,{})]})]})})},Nxe=QX([Lde,Ode],(function(e,t){var n=e.maskColor,r=e.layer,o=e.isMaskEnabled,i=e.shouldPreserveMaskedArea;return{layer:r,maskColor:n,maskColorString:Twe(n),isMaskEnabled:o,shouldPreserveMaskedArea:i,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:dae}}),Dxe=function(){var e=wie(),t=o8().t,n=kie(Nxe),r=n.layer,o=n.maskColor,i=n.isMaskEnabled,a=n.shouldPreserveMaskedArea,s=n.isStaging;_ce(["q"],(function(){l()}),{enabled:function(){return!s},preventDefault:!0},[r]),_ce(["shift+c"],(function(){u()}),{enabled:function(){return!s},preventDefault:!0},[]),_ce(["h"],(function(){c()}),{enabled:function(){return!s},preventDefault:!0},[i]);var l=function(){e(_3("mask"===r?"base":"mask"))},u=function(){return e($5())},c=function(){return e(w3(!i))};return no(Pae,{trigger:"hover",triggerComponent:no(k_,{children:no(_ae,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:no(lde,{}),style:"mask"===r?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:s})}),children:ro(yP,{direction:"column",gap:"0.5rem",children:[no(pfe,{label:"".concat(t("unifiedcanvas:enableMask")," (H)"),isChecked:i,onChange:c}),no(pfe,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:a,onChange:function(t){return e(M3(t.target.checked))}}),no(mxe,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:o,onChange:function(t){return e(E3(t))}}),ro(Eae,{size:"sm",leftIcon:no(Sde,{}),onClick:u,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},zxe=QX([Lde],(function(e){return{shouldAutoSave:e.shouldAutoSave,shouldCropToBoundingBoxOnSave:e.shouldCropToBoundingBoxOnSave,shouldDarkenOutsideBoundingBox:e.shouldDarkenOutsideBoundingBox,shouldShowCanvasDebugInfo:e.shouldShowCanvasDebugInfo,shouldShowGrid:e.shouldShowGrid,shouldShowIntermediates:e.shouldShowIntermediates,shouldSnapToGrid:e.shouldSnapToGrid,shouldRestrictStrokesToBox:e.shouldRestrictStrokesToBox}}),{memoizeOptions:{resultEqualityCheck:dae}}),jxe=function(){var e=wie(),t=o8().t,n=kie(zxe),r=n.shouldAutoSave,o=n.shouldCropToBoundingBoxOnSave,i=n.shouldDarkenOutsideBoundingBox,a=n.shouldShowCanvasDebugInfo,s=n.shouldShowGrid,l=n.shouldShowIntermediates,u=n.shouldSnapToGrid,c=n.shouldRestrictStrokesToBox;_ce(["n"],(function(){e(j3(!u))}),{enabled:!0,preventDefault:!0},[u]);return no(Pae,{trigger:"hover",triggerComponent:no(_ae,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:no(Pde,{})}),children:ro(yP,{direction:"column",gap:"0.5rem",children:[no(pfe,{label:t("unifiedcanvas:showIntermediates"),isChecked:l,onChange:function(t){return e(N3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:showGrid"),isChecked:s,onChange:function(t){return e(R3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:snapToGrid"),isChecked:u,onChange:function(t){return e(j3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:function(t){return e(A3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:r,onChange:function(t){return e(L3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:o,onChange:function(t){return e(O3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:c,onChange:function(t){return e(U3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:a,onChange:function(t){return e(I3(t.target.checked))}}),no(Fke,{}),no(Bke,{})]})})},Bxe=QX([Lde,Ode,wle],(function(e,t,n){var r=n.isProcessing;return{tool:e.tool,isStaging:t,isProcessing:r,brushColor:e.brushColor,brushSize:e.brushSize}}),{memoizeOptions:{resultEqualityCheck:dae}}),Fxe=function(){var e=wie(),t=kie(Bxe),n=t.tool,r=t.brushColor,o=t.brushSize,i=t.isStaging,a=o8().t;_ce(["b"],(function(){s()}),{enabled:function(){return!i},preventDefault:!0},[]),_ce(["e"],(function(){l()}),{enabled:function(){return!i},preventDefault:!0},[n]),_ce(["c"],(function(){u()}),{enabled:function(){return!i},preventDefault:!0},[n]),_ce(["shift+f"],(function(){c()}),{enabled:function(){return!i},preventDefault:!0}),_ce(["delete","backspace"],(function(){d()}),{enabled:function(){return!i},preventDefault:!0}),_ce(["BracketLeft"],(function(){e(h3(Math.max(o-5,5)))}),{enabled:function(){return!i},preventDefault:!0},[o]),_ce(["BracketRight"],(function(){e(h3(Math.min(o+5,500)))}),{enabled:function(){return!i},preventDefault:!0},[o]),_ce(["shift+BracketLeft"],(function(){e(f3(un(un({},r),{},{a:JK(r.a-.05,.05,1)})))}),{enabled:function(){return!i},preventDefault:!0},[r]),_ce(["shift+BracketRight"],(function(){e(f3(un(un({},r),{},{a:JK(r.a+.05,.05,1)})))}),{enabled:function(){return!i},preventDefault:!0},[r]);var s=function(){return e(H3("brush"))},l=function(){return e(H3("eraser"))},u=function(){return e(H3("colorPicker"))},c=function(){return e(G5())},d=function(){return e(U5())};return ro(k_,{isAttached:!0,children:[no(_ae,{"aria-label":"".concat(a("unifiedcanvas:brush")," (B)"),tooltip:"".concat(a("unifiedcanvas:brush")," (B)"),icon:no(cde,{}),"data-selected":"brush"===n&&!i,onClick:s,isDisabled:i}),no(_ae,{"aria-label":"".concat(a("unifiedcanvas:eraser")," (E)"),tooltip:"".concat(a("unifiedcanvas:eraser")," (E)"),icon:no($ce,{}),"data-selected":"eraser"===n&&!i,isDisabled:i,onClick:l}),no(_ae,{"aria-label":"".concat(a("unifiedcanvas:fillBoundingBox")," (Shift+F)"),tooltip:"".concat(a("unifiedcanvas:fillBoundingBox")," (Shift+F)"),icon:no(nde,{}),isDisabled:i,onClick:c}),no(_ae,{"aria-label":"".concat(a("unifiedcanvas:eraseBoundingBox")," (Del/Backspace)"),tooltip:"".concat(a("unifiedcanvas:eraseBoundingBox")," (Del/Backspace)"),icon:no(hde,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),no(_ae,{"aria-label":"".concat(a("unifiedcanvas:colorPicker")," (C)"),tooltip:"".concat(a("unifiedcanvas:colorPicker")," (C)"),icon:no(Jce,{}),"data-selected":"colorPicker"===n&&!i,isDisabled:i,onClick:u}),no(Pae,{trigger:"hover",triggerComponent:no(_ae,{"aria-label":a("unifiedcanvas:brushOptions"),tooltip:a("unifiedcanvas:brushOptions"),icon:no(kde,{})}),children:ro(yP,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[no(yP,{gap:"1rem",justifyContent:"space-between",children:no(xfe,{label:a("unifiedcanvas:brushSize"),value:o,withInput:!0,onChange:function(t){return e(h3(t))},sliderNumberInputProps:{max:500},inputReadOnly:!1})}),no(mxe,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:function(t){return e(f3(t))}})]})})]})},Hxe=QX([wle,Lde,Ode],(function(e,t,n){var r=e.isProcessing,o=t.tool,i=t.shouldCropToBoundingBoxOnSave,a=t.layer;return{isProcessing:r,isStaging:n,isMaskEnabled:t.isMaskEnabled,tool:o,layer:a,shouldCropToBoundingBoxOnSave:i}}),{memoizeOptions:{resultEqualityCheck:dae}}),Vxe=function(){var e=wie(),t=kie(Hxe),n=t.isProcessing,r=t.isStaging,o=t.isMaskEnabled,i=t.layer,a=t.tool,s=t.shouldCropToBoundingBoxOnSave,l=Loe(),u=o8().t,c=xie().openUploader;_ce(["v"],(function(){d()}),{enabled:function(){return!r},preventDefault:!0},[]),_ce(["r"],(function(){h()}),{enabled:function(){return!0},preventDefault:!0},[l]),_ce(["shift+m"],(function(){p()}),{enabled:function(){return!r},preventDefault:!0},[l,n]),_ce(["shift+s"],(function(){v()}),{enabled:function(){return!r},preventDefault:!0},[l,n]),_ce(["meta+c","ctrl+c"],(function(){g()}),{enabled:function(){return!r},preventDefault:!0},[l,n]),_ce(["shift+d"],(function(){m()}),{enabled:function(){return!r},preventDefault:!0},[l,n]);var d=function(){return e(H3("move"))},f=Ike((function(){return h(!1)}),(function(){return h(!0)})),h=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Loe();if(n){var r=n.getClientRect({skipTransform:!0});e(a3({contentRect:r,shouldScaleTo1:t}))}},p=function(){e(Ske({cropVisible:!1,shouldSetAsInitialImage:!0}))},v=function(){e(Ske({cropVisible:!s,cropToBoundingBox:s,shouldSaveToGallery:!0}))},g=function(){e(Ske({cropVisible:!s,cropToBoundingBox:s,shouldCopy:!0}))},m=function(){e(Ske({cropVisible:!s,cropToBoundingBox:s,shouldDownload:!0}))};return ro("div",{className:"inpainting-settings",children:[no(Mae,{tooltip:"".concat(u("unifiedcanvas:layer")," (Q)"),tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:D5,onChange:function(t){var n=t.target.value;e(_3(n)),"mask"!==n||o||e(w3(!0))},isDisabled:r}),no(Dxe,{}),no(Fxe,{}),ro(k_,{isAttached:!0,children:[no(_ae,{"aria-label":"".concat(u("unifiedcanvas:move")," (V)"),tooltip:"".concat(u("unifiedcanvas:move")," (V)"),icon:no(Hce,{}),"data-selected":"move"===a||r,onClick:d}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:resetView")," (R)"),tooltip:"".concat(u("unifiedcanvas:resetView")," (R)"),icon:no(Yce,{}),onClick:f})]}),ro(k_,{isAttached:!0,children:[no(_ae,{"aria-label":"".concat(u("unifiedcanvas:mergeVisible")," (Shift+M)"),tooltip:"".concat(u("unifiedcanvas:mergeVisible")," (Shift+M)"),icon:no(sde,{}),onClick:p,isDisabled:r}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:saveToGallery")," (Shift+S)"),tooltip:"".concat(u("unifiedcanvas:saveToGallery")," (Shift+S)"),icon:no(mde,{}),onClick:v,isDisabled:r}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:copyToClipboard")," (Cmd/Ctrl+C)"),tooltip:"".concat(u("unifiedcanvas:copyToClipboard")," (Cmd/Ctrl+C)"),icon:no(qce,{}),onClick:g,isDisabled:r}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:downloadAsImage")," (Shift+D)"),tooltip:"".concat(u("unifiedcanvas:downloadAsImage")," (Shift+D)"),icon:no(Xce,{}),onClick:m,isDisabled:r})]}),ro(k_,{isAttached:!0,children:[no(yke,{}),no(gke,{})]}),ro(k_,{isAttached:!0,children:[no(_ae,{"aria-label":"".concat(u("common:upload")),tooltip:"".concat(u("common:upload")),icon:no(_de,{}),onClick:c,isDisabled:r}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:clearCanvas")),tooltip:"".concat(u("unifiedcanvas:clearCanvas")),icon:no(Sde,{}),onClick:function(){e(o3()),e(s3())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:r})]}),no(k_,{isAttached:!0,children:no(jxe,{})})]})},Wxe=QX([Lde],(function(e){return{doesCanvasNeedScaling:e.doesCanvasNeedScaling}}),{memoizeOptions:{resultEqualityCheck:dae}}),Uxe=function(){var e=wie(),t=kie(Wxe).doesCanvasNeedScaling;return cr.useLayoutEffect((function(){e(m3(!0));var t=pke((function(){e(m3(!0))}),250);return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}}),[e]),no("div",{className:"workarea-single-view",children:no("div",{className:"workarea-split-view-left",children:ro("div",{className:"inpainting-main-area",children:[no(Vxe,{}),no("div",{className:"inpainting-canvas-area",children:no(t?ske:ike,{})})]})})})},Gxe=QX(Lde,(function(e){return{boundingBoxDimensions:e.boundingBoxDimensions,boundingBoxScale:e.boundingBoxScaleMethod}}),{memoizeOptions:{resultEqualityCheck:dae}}),qxe=function(){var e=wie(),t=kie(Gxe).boundingBoxDimensions,n=o8().t;return ro(yP,{direction:"column",gap:"1rem",children:[no(xfe,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:function(n){e(c3(un(un({},t),{},{width:Math.floor(n)})))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:function(){e(c3(un(un({},t),{},{width:Math.floor(512)})))}}),no(xfe,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:function(n){e(c3(un(un({},t),{},{height:Math.floor(n)})))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:function(){e(c3(un(un({},t),{},{height:Math.floor(512)})))}})]})},Yxe=QX([jye,wle,Lde],(function(e,t,n){var r=e.tileSize,o=e.infillMethod,i=t.infill_methods,a=n.boundingBoxScaleMethod;return{boundingBoxScale:a,scaledBoundingBoxDimensions:n.scaledBoundingBoxDimensions,tileSize:r,infillMethod:o,availableInfillMethods:i,isManual:"manual"===a}}),{memoizeOptions:{resultEqualityCheck:dae}}),Zxe=function(){var e=wie(),t=kie(Yxe),n=t.tileSize,r=t.infillMethod,o=t.availableInfillMethods,i=t.boundingBoxScale,a=t.isManual,s=t.scaledBoundingBoxDimensions,l=o8().t;return ro(yP,{direction:"column",gap:"1rem",children:[no(Mae,{label:l("parameters:scaleBeforeProcessing"),validValues:z5,value:i,onChange:function(t){e(d3(t.target.value))}}),no(xfe,{isInputDisabled:!a,isResetDisabled:!a,isSliderDisabled:!a,label:l("parameters:scaledWidth"),min:64,max:1024,step:64,value:s.width,onChange:function(t){e(W3(un(un({},s),{},{width:Math.floor(t)})))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:function(){e(W3(un(un({},s),{},{width:Math.floor(512)})))}}),no(xfe,{isInputDisabled:!a,isResetDisabled:!a,isSliderDisabled:!a,label:l("parameters:scaledHeight"),min:64,max:1024,step:64,value:s.height,onChange:function(t){e(W3(un(un({},s),{},{height:Math.floor(t)})))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:function(){e(W3(un(un({},s),{},{height:Math.floor(512)})))}}),no(Mae,{label:l("parameters:infillMethod"),value:r,validValues:o,onChange:function(t){return e(A4(t.target.value))}}),no(xfe,{isInputDisabled:"tile"!==r,isResetDisabled:"tile"!==r,isSliderDisabled:"tile"!==r,sliderMarkRightOffset:-4,label:l("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:n,onChange:function(t){e($4(t))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){e($4(32))}})]})};function Xxe(){var e=wie(),t=kie((function(e){return e.generation.seamBlur})),n=o8().t;return no(xfe,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:function(t){e(j4(t))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){e(j4(16))}})}function $xe(){var e=wie(),t=o8().t,n=kie((function(e){return e.generation.seamSize}));return no(xfe,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:function(t){e(F4(t))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){return e(F4(96))}})}function Kxe(){var e=o8().t,t=kie((function(e){return e.generation.seamSteps})),n=wie();return no(xfe,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:function(e){n(H4(e))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){n(H4(30))}})}function Qxe(){var e=wie(),t=o8().t,n=kie((function(e){return e.generation.seamStrength}));return no(xfe,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:function(t){e(V4(t))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){e(V4(.7))}})}var Jxe=function(){return ro(yP,{direction:"column",gap:"1rem",children:[no($xe,{}),no(Xxe,{}),no(Qxe,{}),no(Kxe,{})]})};function eSe(){var e=o8().t,t={boundingBox:{header:"".concat(e("parameters:boundingBoxHeader")),feature:rye.BOUNDING_BOX,content:no(qxe,{})},seamCorrection:{header:"".concat(e("parameters:seamCorrectionHeader")),feature:rye.SEAM_CORRECTION,content:no(Jxe,{})},infillAndScaling:{header:"".concat(e("parameters:infillScalingHeader")),feature:rye.INFILL_AND_SCALING,content:no(Zxe,{})},seed:{header:"".concat(e("parameters:seed")),feature:rye.SEED,content:no(gye,{})},variations:{header:"".concat(e("parameters:variations")),feature:rye.VARIATIONS,content:no(xye,{}),additionalHeaderComponents:no(yye,{})}};return ro(Xye,{children:[ro(yP,{flexDir:"column",rowGap:"0.5rem",children:[no(qye,{}),no(Uye,{})]}),no(Wye,{}),no(Aye,{}),no(lye,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),no(Nye,{accordionInfo:t})]})}function tSe(){var e=kie((function(e){return e.ui.shouldUseCanvasBetaLayout}));return no($me,{optionsPanel:no(eSe,{}),styleClass:"inpainting-workarea-overrides",children:no(e?Rxe:Uxe,{})})}var nSe={txt2img:{title:no(xae,{fill:"black",boxSize:"2.5rem"}),workarea:no(obe,{}),tooltip:"Text To Image"},img2img:{title:no(bae,{fill:"black",boxSize:"2.5rem"}),workarea:no(Kye,{}),tooltip:"Image To Image"},unifiedCanvas:{title:no(Cae,{fill:"black",boxSize:"2.5rem"}),workarea:no(tSe,{}),tooltip:"Unified Canvas"},nodes:{title:no(wae,{fill:"black",boxSize:"2.5rem"}),workarea:no(gae,{}),tooltip:"Nodes"},postprocess:{title:no(kae,{fill:"black",boxSize:"2.5rem"}),workarea:no(mae,{}),tooltip:"Post Processing"},training:{title:no(Sae,{fill:"black",boxSize:"2.5rem"}),workarea:no(yae,{}),tooltip:"Training"}};function rSe(){nSe.txt2img.tooltip=A7.t("common:text2img"),nSe.img2img.tooltip=A7.t("common:img2img"),nSe.unifiedCanvas.tooltip=A7.t("common:unifiedCanvas"),nSe.nodes.tooltip=A7.t("common:nodes"),nSe.postprocess.tooltip=A7.t("common:postProcessing"),nSe.training.tooltip=A7.t("common:training")}function oSe(){var e=kie(hae),t=kie((function(e){return e.lightbox.isLightboxOpen}));!function(e){var t=o8().i18n,n=localStorage.getItem("i18nextLng");qr.useEffect((function(){e()}),[e]),qr.useEffect((function(){t.on("languageChanged",(function(){e()}))}),[e,t,n])}(rSe);var n=wie();_ce("1",(function(){n(z8(0))})),_ce("2",(function(){n(z8(1))})),_ce("3",(function(){n(z8(2))})),_ce("4",(function(){n(z8(3))})),_ce("5",(function(){n(z8(4))})),_ce("6",(function(){n(z8(5))})),_ce("z",(function(){n(p4(!t))}),[t]);var r,o;return ro(Uq,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:function(e){n(z8(e))},children:[no("div",{className:"app-tabs-list",children:(o=[],Object.keys(nSe).forEach((function(e){o.push(no(kY,{hasArrow:!0,label:nSe[e].tooltip,placement:"right",children:no(Xq,{children:nSe[e].title})},e))})),o)}),no(Zq,{className:"app-tabs-panels",children:t?no(qme,{}):(r=[],Object.keys(nSe).forEach((function(e){r.push(no(Yq,{className:"app-tabs-panel",children:nSe[e].workarea},e))})),r)})]})}var iSe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function aSe(e,t){var n=function(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=iSe.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!=typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"==typeof t?t:"string"==typeof r&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var sSe=[".DS_Store","Thumbs.db"];function lSe(e){return"object"===kn(e)&&null!==e}function uSe(e){return hSe(e.target.files).map((function(e){return aSe(e)}))}function cSe(e){return XS(this,void 0,void 0,(function(){return $S(this,(function(t){switch(t.label){case 0:return[4,Promise.all(e.map((function(e){return e.getFile()})))];case 1:return[2,t.sent().map((function(e){return aSe(e)}))]}}))}))}function dSe(e,t){return XS(this,void 0,void 0,(function(){var n;return $S(this,(function(r){switch(r.label){case 0:return e.items?(n=hSe(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(pSe))]):[3,2];case 1:return[2,fSe(vSe(r.sent()))];case 2:return[2,fSe(hSe(e.files).map((function(e){return aSe(e)})))]}}))}))}function fSe(e){return e.filter((function(e){return-1===sSe.indexOf(e.name)}))}function hSe(e){if(null===e)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,LSe(n)];if(e.sizen)return[!1,LSe(n)]}return[!0,null]}function ISe(e){return null!=e}function RSe(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,s=e.validator;return!(!i&&t.length>1||i&&a>=1&&t.length>a)&&t.every((function(e){var t=CSe(MSe(e,n),1)[0],i=CSe(TSe(e,r,o),1)[0],a=s?s(e):null;return t&&i&&!a}))}function NSe(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function DSe(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,(function(e){return"Files"===e||"application/x-moz-file"===e})):!!e.target&&!!e.target.files}function zSe(e){e.preventDefault()}function jSe(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function BSe(e){return-1!==e.indexOf("Edge/")}function FSe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return jSe(e)||BSe(e)}function HSe(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var sCe=cr.forwardRef((function(e,t){var n=e.children,r=cCe(aCe(e,XSe)),o=r.open,i=aCe(r,$Se);return cr.useImperativeHandle(t,(function(){return{open:o}}),[o]),qr.createElement(cr.Fragment,null,n(oCe(oCe({},i),{},{open:o})))}));sCe.displayName="Dropzone";var lCe={disabled:!1,getFilesFromEvent:function(e){return XS(this,void 0,void 0,(function(){return $S(this,(function(t){return lSe(e)&&function(e){return lSe(e)}(e.dataTransfer)?[2,dSe(e.dataTransfer,e.type)]:function(e){return lSe(e)&&lSe(e.target)}(e)?[2,uSe(e)]:Array.isArray(e)&&e.every((function(e){return"getFile"in e&&"function"==typeof e.getFile}))?[2,cSe(e)]:[2,[]]}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};sCe.defaultProps=lCe,sCe.propTypes={children:_H.func,accept:_H.objectOf(_H.arrayOf(_H.string)),multiple:_H.bool,preventDropOnDocument:_H.bool,noClick:_H.bool,noKeyboard:_H.bool,noDrag:_H.bool,noDragEventsBubbling:_H.bool,minSize:_H.number,maxSize:_H.number,maxFiles:_H.number,disabled:_H.bool,getFilesFromEvent:_H.func,onFileDialogCancel:_H.func,onFileDialogOpen:_H.func,useFsAccessApi:_H.bool,autoFocus:_H.bool,onDragEnter:_H.func,onDragLeave:_H.func,onDragOver:_H.func,onDrop:_H.func,onDropAccepted:_H.func,onDropRejected:_H.func,onError:_H.func,validator:_H.func};var uCe={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function cCe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oCe(oCe({},lCe),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,c=t.onDragLeave,d=t.onDragOver,f=t.onDrop,h=t.onDropAccepted,p=t.onDropRejected,v=t.onFileDialogCancel,g=t.onFileDialogOpen,m=t.useFsAccessApi,y=t.autoFocus,b=t.preventDropOnDocument,w=t.noClick,k=t.noKeyboard,x=t.noDrag,S=t.noDragEventsBubbling,C=t.onError,_=t.validator,E=cr.useMemo((function(){return USe(n)}),[n]),P=cr.useMemo((function(){return WSe(n)}),[n]),L=cr.useMemo((function(){return"function"==typeof g?g:fCe}),[g]),O=cr.useMemo((function(){return"function"==typeof v?v:fCe}),[v]),A=cr.useRef(null),M=cr.useRef(null),T=cr.useReducer(dCe,uCe),I=eCe(T,2),R=I[0],N=I[1],D=R.isFocused,z=R.isFileDialogActive,j=cr.useRef("undefined"!=typeof window&&window.isSecureContext&&m&&VSe()),B=function(){!j.current&&z&&setTimeout((function(){M.current&&(M.current.files.length||(N({type:"closeDialog"}),O()))}),300)};cr.useEffect((function(){return window.addEventListener("focus",B,!1),function(){window.removeEventListener("focus",B,!1)}}),[M,z,O,j]);var F=cr.useRef([]),H=function(e){A.current&&A.current.contains(e.target)||(e.preventDefault(),F.current=[])};cr.useEffect((function(){return b&&(document.addEventListener("dragover",zSe,!1),document.addEventListener("drop",H,!1)),function(){b&&(document.removeEventListener("dragover",zSe),document.removeEventListener("drop",H))}}),[A,b]),cr.useEffect((function(){return!r&&y&&A.current&&A.current.focus(),function(){}}),[A,y,r]);var V=cr.useCallback((function(e){C?C(e):console.error(e)}),[C]),W=cr.useCallback((function(e){e.preventDefault(),e.persist(),ne(e),F.current=[].concat(JSe(F.current),[e.target]),DSe(e)&&Promise.resolve(o(e)).then((function(t){if(!NSe(e)||S){var n=t.length,r=n>0&&RSe({files:t,accept:E,minSize:a,maxSize:i,multiple:s,maxFiles:l,validator:_});N({isDragAccept:r,isDragReject:n>0&&!r,isDragActive:!0,type:"setDraggedFiles"}),u&&u(e)}})).catch((function(e){return V(e)}))}),[o,u,V,S,E,a,i,s,l,_]),U=cr.useCallback((function(e){e.preventDefault(),e.persist(),ne(e);var t=DSe(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(n){}return t&&d&&d(e),!1}),[d,S]),G=cr.useCallback((function(e){e.preventDefault(),e.persist(),ne(e);var t=F.current.filter((function(e){return A.current&&A.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),F.current=t,t.length>0||(N({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),DSe(e)&&c&&c(e))}),[A,c,S]),q=cr.useCallback((function(e,t){var n=[],r=[];e.forEach((function(e){var t=eCe(MSe(e,E),2),o=t[0],s=t[1],l=eCe(TSe(e,a,i),2),u=l[0],c=l[1],d=_?_(e):null;if(o&&u&&!d)n.push(e);else{var f=[s,c];d&&(f=f.concat(d)),r.push({file:e,errors:f.filter((function(e){return e}))})}})),(!s&&n.length>1||s&&l>=1&&n.length>l)&&(n.forEach((function(e){r.push({file:e,errors:[ASe]})})),n.splice(0)),N({acceptedFiles:n,fileRejections:r,type:"setFiles"}),f&&f(n,r,t),r.length>0&&p&&p(r,t),n.length>0&&h&&h(n,t)}),[N,s,E,a,i,l,f,h,p,_]),Y=cr.useCallback((function(e){e.preventDefault(),e.persist(),ne(e),F.current=[],DSe(e)&&Promise.resolve(o(e)).then((function(t){NSe(e)&&!S||q(t,e)})).catch((function(e){return V(e)})),N({type:"reset"})}),[o,q,V,S]),Z=cr.useCallback((function(){if(j.current){N({type:"openDialog"}),L();var e={multiple:s,types:P};window.showOpenFilePicker(e).then((function(e){return o(e)})).then((function(e){q(e,null),N({type:"closeDialog"})})).catch((function(e){GSe(e)?(O(e),N({type:"closeDialog"})):qSe(e)?(j.current=!1,M.current?(M.current.value=null,M.current.click()):V(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):V(e)}))}else M.current&&(N({type:"openDialog"}),L(),M.current.value=null,M.current.click())}),[N,L,O,m,q,V,P,s]),X=cr.useCallback((function(e){A.current&&A.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),Z()))}),[A,Z]),$=cr.useCallback((function(){N({type:"focus"})}),[]),K=cr.useCallback((function(){N({type:"blur"})}),[]),Q=cr.useCallback((function(){w||(FSe()?setTimeout(Z,0):Z())}),[w,Z]),J=function(e){return r?null:e},ee=function(e){return k?null:J(e)},te=function(e){return x?null:J(e)},ne=function(e){S&&e.stopPropagation()},re=cr.useMemo((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,o=e.role,i=e.onKeyDown,a=e.onFocus,s=e.onBlur,l=e.onClick,u=e.onDragEnter,c=e.onDragOver,d=e.onDragLeave,f=e.onDrop,h=aCe(e,KSe);return oCe(oCe(iCe({onKeyDown:ee(HSe(i,X)),onFocus:ee(HSe(a,$)),onBlur:ee(HSe(s,K)),onClick:J(HSe(l,Q)),onDragEnter:te(HSe(u,W)),onDragOver:te(HSe(c,U)),onDragLeave:te(HSe(d,G)),onDrop:te(HSe(f,Y)),role:"string"==typeof o&&""!==o?o:"presentation"},n,A),r||k?{}:{tabIndex:0}),h)}}),[A,X,$,K,Q,W,U,G,Y,k,x,r]),oe=cr.useCallback((function(e){e.stopPropagation()}),[]),ie=cr.useMemo((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.onChange,o=e.onClick,i=aCe(e,QSe),a=iCe({accept:E,multiple:s,type:"file",style:{display:"none"},onChange:J(HSe(r,Y)),onClick:J(HSe(o,oe)),tabIndex:-1},n,M);return oCe(oCe({},a),i)}}),[M,n,s,Y,r]);return oCe(oCe({},R),{},{isFocused:D&&!r,getRootProps:re,getInputProps:ie,rootRef:A,inputRef:M,open:J(Z)})}function dCe(e,t){switch(t.type){case"focus":return oCe(oCe({},e),{},{isFocused:!0});case"blur":return oCe(oCe({},e),{},{isFocused:!1});case"openDialog":return oCe(oCe({},uCe),{},{isFileDialogActive:!0});case"closeDialog":return oCe(oCe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return oCe(oCe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return oCe(oCe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return oCe({},uCe);default:return e}}function fCe(){}var hCe=function(e){var t=e.isDragAccept,n=e.isDragReject,r=e.overlaySecondaryText,o=e.setIsHandlingUpload;return _ce("esc",(function(){o(!1)})),ro("div",{className:"dropzone-container",children:[t&&no("div",{className:"dropzone-overlay is-drag-accept",children:ro(xP,{size:"lg",children:["Upload Image",r]})}),n&&ro("div",{className:"dropzone-overlay is-drag-reject",children:[no(xP,{size:"lg",children:"Invalid Upload"}),no(xP,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},pCe=function(e){var t=e.children,n=wie(),r=kie(fae),o=cY({}),i=o8().t,a=yn(cr.useState(!1),2),s=a[0],l=a[1],u=xie().setOpenUploader,c=cr.useCallback((function(e){l(!0);var t=e.errors.reduce((function(e,t){return"".concat(e,"\n").concat(t.message)}),"");o({title:i("toast:uploadFailed"),description:t,status:"error",isClosable:!0})}),[i,o]),d=cr.useCallback(function(){var e=qt(Ut().mark((function e(t){return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n(vae({imageFile:t}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[n]),f=cCe({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:cr.useCallback((function(e,t){t.forEach((function(e){c(e)})),e.forEach((function(e){d(e)}))}),[d,c]),onDragOver:function(){return l(!0)},maxFiles:1}),h=f.getRootProps,p=f.getInputProps,v=f.isDragAccept,g=f.isDragReject,m=f.isDragActive,y=f.open;u(y),cr.useEffect((function(){var e=function(e){var t,r=null===(t=e.clipboardData)||void 0===t?void 0:t.items;if(r){var a,s=[],l=xn(r);try{for(l.s();!(a=l.n()).done;){var u=a.value;"file"===u.kind&&["image/png","image/jpg"].includes(u.type)&&s.push(u)}}catch(COe){l.e(COe)}finally{l.f()}if(s.length)if(e.stopImmediatePropagation(),s.length>1)o({description:i("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});else{var c=s[0].getAsFile();c?n(vae({imageFile:c})):o({description:i("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0})}}};return document.addEventListener("paste",e),function(){document.removeEventListener("paste",e)}}),[i,n,o,r]);var b=["img2img","unifiedCanvas"].includes(r)?" to ".concat(nSe[r].tooltip):"";return no(bie.Provider,{value:y,children:ro("div",un(un({},h({style:{}})),{},{onKeyDown:function(e){e.key},children:[no("input",un({},p())),t,m&&s&&no(hCe,{isDragAccept:v,isDragReject:g,overlaySecondaryText:b,setIsHandlingUpload:l})]}))})},vCe=QX(wle,(function(e){return e.log}),{memoizeOptions:{resultEqualityCheck:function(e,t){return e.length===t.length}}}),gCe=QX(wle,(function(e){return{shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}}),{memoizeOptions:{resultEqualityCheck:dae}}),mCe=function(){var e=wie(),t=kie(vCe),n=kie(gCe),r=n.shouldShowLogViewer,o=n.hasError,i=n.wasErrorSeen,a=yn(cr.useState(!0),2),s=a[0],l=a[1],u=cr.useRef(null);cr.useLayoutEffect((function(){null!==u.current&&s&&(u.current.scrollTop=u.current.scrollHeight)}),[s,t,r]);_ce("`",(function(){e(c8(!r))}),[r]),_ce("esc",(function(){e(c8(!1))}));return ro(to,{children:[r&&no(hfe,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:no("div",{className:"console",ref:u,onScroll:function(){u.current&&s&&u.current.scrollTop-1},r_e.prototype.set=function(e,t){var n=this.__data__,r=t_e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function i_e(e){if(!o_e(e))return!1;var t=UCe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var a_e=DCe["__core-js_shared__"],s_e=function(){var e=/[^.]+$/.exec(a_e&&a_e.keys&&a_e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var l_e=Function.prototype.toString;function u_e(e){if(null!=e){try{return l_e.call(e)}catch(Dhe){}try{return e+""}catch(Dhe){}}return""}var c_e=/^\[object .+?Constructor\]$/,d_e=Function.prototype,f_e=Object.prototype,h_e=d_e.toString,p_e=f_e.hasOwnProperty,v_e=RegExp("^"+h_e.call(p_e).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g_e(e){return!(!o_e(e)||(t=e,s_e&&s_e in t))&&(i_e(e)?v_e:c_e).test(u_e(e));var t}function m_e(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return g_e(n)?n:void 0}var y_e=m_e(DCe,"Map"),b_e=m_e(Object,"create");var w_e=Object.prototype.hasOwnProperty;var k_e=Object.prototype.hasOwnProperty;function x_e(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}var G_e={};function q_e(e){return function(t){return e(t)}}G_e["[object Float32Array]"]=G_e["[object Float64Array]"]=G_e["[object Int8Array]"]=G_e["[object Int16Array]"]=G_e["[object Int32Array]"]=G_e["[object Uint8Array]"]=G_e["[object Uint8ClampedArray]"]=G_e["[object Uint16Array]"]=G_e["[object Uint32Array]"]=!0,G_e["[object Arguments]"]=G_e["[object Array]"]=G_e["[object ArrayBuffer]"]=G_e["[object Boolean]"]=G_e["[object DataView]"]=G_e["[object Date]"]=G_e["[object Error]"]=G_e["[object Function]"]=G_e["[object Map]"]=G_e["[object Number]"]=G_e["[object Object]"]=G_e["[object RegExp]"]=G_e["[object Set]"]=G_e["[object String]"]=G_e["[object WeakMap]"]=!1;var Y_e="object"==kn(Gt)&&Gt&&!Gt.nodeType&&Gt,Z_e=Y_e&&"object"==kn(Zt)&&Zt&&!Zt.nodeType&&Zt,X_e=Z_e&&Z_e.exports===Y_e&&RCe.process,$_e=function(){try{var e=Z_e&&Z_e.require&&Z_e.require("util").types;return e||X_e&&X_e.binding&&X_e.binding("util")}catch(Dhe){}}(),K_e=$_e,Q_e=K_e&&K_e.isTypedArray,J_e=Q_e?q_e(Q_e):function(e){return YCe(e)&&U_e(e.length)&&!!G_e[UCe(e)]},eEe=J_e,tEe=Object.prototype.hasOwnProperty;function nEe(e,t){var n=z_e(e),r=!n&&D_e(e),o=!n&&!r&&H_e(e),i=!n&&!r&&!o&&eEe(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n=0||(o[n]=e[n]);return o}function _Pe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var EPe=function(e){return Array.isArray(e)&&0===e.length},PPe=function(e){return"function"==typeof e},LPe=function(e){return null!==e&&"object"===kn(e)},OPe=function(e){return String(Math.floor(Number(e)))===e},APe=function(e){return"[object String]"===Object.prototype.toString.call(e)},MPe=function(e){return 0===cr.Children.count(e)},TPe=function(e){return LPe(e)&&PPe(e.then)};function IPe(e,t,n,r){void 0===r&&(r=0);for(var o=kPe(t);e&&r=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function NPe(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i;IPe(t,a.path)||(t=RPe(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[f.validationSchema]),C=cr.useCallback((function(e,t){return new Promise((function(n){return n(y.current[e].validate(t))}))}),[]),_=cr.useCallback((function(e){var t=Object.keys(y.current).filter((function(e){return PPe(y.current[e].validate)})),n=t.length>0?t.map((function(t){return C(t,IPe(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=RPe(e,t[r],n)),e}),{})}))}),[C]),E=cr.useCallback((function(e){return Promise.all([_(e),f.validationSchema?S(e):{},f.validate?x(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return ICe.all([t,n,r],{arrayMerge:GPe})}))}),[f.validate,f.validationSchema,_,x,S]),P=YPe((function(e){return void 0===e&&(e=w.values),k({type:"SET_ISVALIDATING",payload:!0}),E(e).then((function(e){return m.current&&(k({type:"SET_ISVALIDATING",payload:!1}),k({type:"SET_ERRORS",payload:e})),e}))}));cr.useEffect((function(){a&&!0===m.current&&PCe(h.current,f.initialValues)&&P(h.current)}),[a,P]);var L=cr.useCallback((function(e){var t=e&&e.values?e.values:h.current,n=e&&e.errors?e.errors:p.current?p.current:f.initialErrors||{},r=e&&e.touched?e.touched:v.current?v.current:f.initialTouched||{},o=e&&e.status?e.status:g.current?g.current:f.initialStatus;h.current=t,p.current=n,v.current=r,g.current=o;var i=function(){k({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(f.onReset){var a=f.onReset(w.values,Y);TPe(a)?a.then(i):i()}else i()}),[f.initialErrors,f.initialStatus,f.initialTouched]);cr.useEffect((function(){!0!==m.current||PCe(h.current,f.initialValues)||(u&&(h.current=f.initialValues,L()),a&&P(h.current))}),[u,f.initialValues,L,a,P]),cr.useEffect((function(){u&&!0===m.current&&!PCe(p.current,f.initialErrors)&&(p.current=f.initialErrors||FPe,k({type:"SET_ERRORS",payload:f.initialErrors||FPe}))}),[u,f.initialErrors]),cr.useEffect((function(){u&&!0===m.current&&!PCe(v.current,f.initialTouched)&&(v.current=f.initialTouched||HPe,k({type:"SET_TOUCHED",payload:f.initialTouched||HPe}))}),[u,f.initialTouched]),cr.useEffect((function(){u&&!0===m.current&&!PCe(g.current,f.initialStatus)&&(g.current=f.initialStatus,k({type:"SET_STATUS",payload:f.initialStatus}))}),[u,f.initialStatus,f.initialTouched]);var O=YPe((function(e){if(y.current[e]&&PPe(y.current[e].validate)){var t=IPe(w.values,e),n=y.current[e].validate(t);return TPe(n)?(k({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),k({type:"SET_ISVALIDATING",payload:!1})}))):(k({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return f.validationSchema?(k({type:"SET_ISVALIDATING",payload:!0}),S(w.values,e).then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),k({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),A=cr.useCallback((function(e,t){var n=t.validate;y.current[e]={validate:n}}),[]),M=cr.useCallback((function(e){delete y.current[e]}),[]),T=YPe((function(e,t){return k({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?P(w.values):Promise.resolve()})),I=cr.useCallback((function(e){k({type:"SET_ERRORS",payload:e})}),[]),R=YPe((function(e,t){var r=PPe(e)?e(w.values):e;return k({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?P(r):Promise.resolve()})),N=cr.useCallback((function(e,t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),D=YPe((function(e,t,r){return k({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?P(RPe(w.values,e,t)):Promise.resolve()})),z=cr.useCallback((function(e,t){var n,r=t,o=e;if(!APe(e)){e.persist&&e.persist();var i=e.target?e.target:e.currentTarget,a=i.type,s=i.name,l=i.id,u=i.value,c=i.checked,d=(i.outerHTML,i.options),f=i.multiple;r=t||(s||l),o=/number|range/.test(a)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],o=!1,i=-1;if(Array.isArray(e))r=e,o=(i=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);if(t&&n&&!o)return r.concat(n);if(!o)return r;return r.slice(0,i).concat(r.slice(i+1))}(IPe(w.values,r),c,u):d&&f?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(d):u}r&&D(r,o)}),[D,w.values]),j=YPe((function(e){if(APe(e))return function(t){return z(t,e)};z(e)})),B=YPe((function(e,t,n){return void 0===t&&(t=!0),k({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?o:n)?P(w.values):Promise.resolve()})),F=cr.useCallback((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,o=n.id,i=(n.outerHTML,t||(r||o));B(i,!0)}),[B]),H=YPe((function(e){if(APe(e))return function(t){return F(t,e)};F(e)})),V=cr.useCallback((function(e){PPe(e)?k({type:"SET_FORMIK_STATE",payload:e}):k({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),W=cr.useCallback((function(e){k({type:"SET_STATUS",payload:e})}),[]),U=cr.useCallback((function(e){k({type:"SET_ISSUBMITTING",payload:e})}),[]),G=YPe((function(){return k({type:"SUBMIT_ATTEMPT"}),P().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var n;try{if(void 0===(n=Z()))return}catch(r){throw r}return Promise.resolve(n).then((function(e){return m.current&&k({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(m.current)throw k({type:"SUBMIT_FAILURE"}),e}))}if(m.current&&(k({type:"SUBMIT_FAILURE"}),t))throw e}))})),q=YPe((function(e){e&&e.preventDefault&&PPe(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&PPe(e.stopPropagation)&&e.stopPropagation(),G().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Y={resetForm:L,validateForm:P,validateField:O,setErrors:I,setFieldError:N,setFieldTouched:B,setFieldValue:D,setStatus:W,setSubmitting:U,setTouched:T,setValues:R,setFormikState:V,submitForm:G},Z=YPe((function(){return c(w.values,Y)})),X=YPe((function(e){e&&e.preventDefault&&PPe(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&PPe(e.stopPropagation)&&e.stopPropagation(),L()})),$=cr.useCallback((function(e){return{value:IPe(w.values,e),error:IPe(w.errors,e),touched:!!IPe(w.touched,e),initialValue:IPe(h.current,e),initialTouched:!!IPe(v.current,e),initialError:IPe(p.current,e)}}),[w.errors,w.touched,w.values]),K=cr.useCallback((function(e){return{setValue:function(t,n){return D(e,t,n)},setTouched:function(t,n){return B(e,t,n)},setError:function(t){return N(e,t)}}}),[D,B,N]),Q=cr.useCallback((function(e){var t=LPe(e),n=t?e.name:e,r=IPe(w.values,n),o={name:n,value:r,onChange:j,onBlur:H};if(t){var i=e.type,a=e.value,s=e.as,l=e.multiple;"checkbox"===i?void 0===a?o.checked=!!r:(o.checked=!(!Array.isArray(r)||!~r.indexOf(a)),o.value=a):"radio"===i?(o.checked=r===a,o.value=a):"select"===s&&l&&(o.value=o.value||[],o.multiple=!0)}return o}),[H,j,w.values]),J=cr.useMemo((function(){return!PCe(h.current,w.values)}),[h.current,w.values]),ee=cr.useMemo((function(){return void 0!==s?J?w.errors&&0===Object.keys(w.errors).length:!1!==s&&PPe(s)?s(f):s:w.errors&&0===Object.keys(w.errors).length}),[s,J,w.errors,f]);return SPe({},w,{initialValues:h.current,initialErrors:p.current,initialTouched:v.current,initialStatus:g.current,handleBlur:H,handleChange:j,handleReset:X,handleSubmit:q,resetForm:L,setErrors:I,setFormikState:V,setFieldTouched:B,setFieldValue:D,setFieldError:N,setStatus:W,setSubmitting:U,setTouched:T,setValues:R,submitForm:G,validateForm:P,validateField:O,isValid:ee,dirty:J,unregisterField:M,registerField:A,getFieldProps:Q,getFieldMeta:$,getFieldHelpers:K,validateOnBlur:o,validateOnChange:n,validateOnMount:a})}function WPe(e){var t=VPe(e),n=e.component,r=e.children,o=e.render,i=e.innerRef;return cr.useImperativeHandle(i,(function(){return t})),cr.createElement(zPe,{value:t},n?cr.createElement(n,t):o?o(t):r?PPe(r)?r(t):MPe(r)?null:cr.Children.only(r):null)}function UPe(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map((function(e){return!0===Array.isArray(e)||JCe(e)?UPe(e):""!==e?e:void 0})):JCe(e[r])?t[r]=UPe(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function GPe(e,t,n){var r=e.slice();return t.forEach((function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?ICe(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=ICe(e[o],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var qPe="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?cr.useLayoutEffect:cr.useEffect;function YPe(e){var t=cr.useRef(e);return qPe((function(){t.current=e})),cr.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;re?t:e}),0);return Array.from(SPe({},e,{length:t+1}))}return[]},KPe=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var o=n.props,i=o.name;(0,o.formik.setFormikState)((function(n){var o="function"==typeof r?r:e,a="function"==typeof t?t:e,s=RPe(n.values,i,e(IPe(n.values,i))),l=r?o(IPe(n.errors,i)):void 0,u=t?a(IPe(n.touched,i)):void 0;return EPe(l)&&(l=void 0),EPe(u)&&(u=void 0),SPe({},n,{values:s,errors:r?RPe(n.errors,i,l):n.errors,touched:t?RPe(n.touched,i,u):n.touched})}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat($Pe(t),[xPe(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=$Pe(e),o=r[t];return r[t]=r[n],r[n]=o,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=$Pe(e),o=r[t];return r.splice(t,1),r.splice(n,0,o),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return XPe(n,e,t)}),(function(t){return XPe(t,e,null)}),(function(t){return XPe(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=$Pe(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(_Pe(n)),n.pop=n.pop.bind(_Pe(n)),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!PCe(IPe(e.formik.values,e.name),IPe(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},o.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?$Pe(n):[];return t||(t=r[e]),PPe(r.splice)&&r.splice(e,1),r}),!0,!0),t},o.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},o.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,o=t.children,i=t.name,a=SPe({},e,{form:CPe(t.formik,["validate","validationSchema"]),name:i});return n?cr.createElement(n,a):r?r(a):o?"function"==typeof o?o(a):MPe(o)?null:cr.Children.only(o):null},r}(cr.Component);KPe.defaultProps={validateOnChange:!0};var QPe=e0,JPe=_se,eLe=w0,tLe=kK,nLe=Pse;var rLe=function(e,t,n,r){if(!tLe(e))return e;for(var o=-1,i=(t=JPe(t,e)).length,a=i-1,s=e;null!=s&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r0?"var(--accent-color) !important":"",children:r("modelmanager:addSelected")})]}),ro(yP,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[i.length>0?0===c.length&&no(jP,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:r("modelmanager:selectAndAdd")}):no(jP,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:r("modelmanager:noModelsFound")}),(e=[],t=[],i&&i.forEach((function(n,r){a.includes(n.location)?t.push(no(WLe,{model:n,modelsToAdd:c,setModelsToAdd:d},r)):e.push(no(WLe,{model:n,modelsToAdd:c,setModelsToAdd:d},r))})),ro(to,{children:[e,s&&t]}))]})]})]})}function GLe(){var e=wie(),t=o8().t,n=kie((function(e){return e.system.isProcessing}));function r(e){var n;return function(e){return/\s/.test(e)}(e)&&(n=t("modelmanager:cannotUseSpaces")),n}var o=yn(qr.useState(!1),2),i=o[0],a=o[1];return ro(to,{children:[no(_ae,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:function(){return e(Y8(null))},width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:no(vfe,{})}),no(ULe,{}),no(pfe,{label:t("modelmanager:addManually"),isChecked:i,onChange:function(){return a(!i)}}),i&&no(WPe,{initialValues:{name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},onSubmit:function(t){e(aie(t)),e(Y8(null))},children:function(e){var o=e.handleSubmit,i=e.errors,a=e.touched;return no("form",{onSubmit:o,children:ro(zP,{rowGap:"0.5rem",children:[no(jP,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),ro(I_,{isInvalid:!!i.name&&a.name,isRequired:!0,children:[no(V_,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"name",name:"name",type:"text",validate:r,width:"2xl"}),i.name&&a.name?no(F_,{children:i.name}):no(R_,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.description&&a.description,isRequired:!0,children:[no(V_,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"description",name:"description",type:"text",width:"2xl"}),i.description&&a.description?no(F_,{children:i.description}):no(R_,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.config&&a.config,isRequired:!0,children:[no(V_,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"config",name:"config",type:"text",width:"2xl"}),i.config&&a.config?no(F_,{children:i.config}):no(R_,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.weights&&a.weights,isRequired:!0,children:[no(V_,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"weights",name:"weights",type:"text",width:"2xl"}),i.weights&&a.weights?no(F_,{children:i.weights}):no(R_,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.vae&&a.vae,children:[no(V_,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"vae",name:"vae",type:"text",width:"2xl"}),i.vae&&a.vae?no(F_,{children:i.vae}):no(R_,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),ro(DP,{width:"100%",children:[ro(I_,{isInvalid:!!i.width&&a.width,children:[no(V_,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),ro(zP,{alignItems:"start",children:[no(ZPe,{id:"width",name:"width",children:function(e){var t=e.field,n=e.form;return no(Aae,{id:"width",name:"width",min:64,max:2048,step:64,width:"90%",value:n.values.width,onChange:function(e){return n.setFieldValue(t.name,Number(e))}})}}),i.width&&a.width?no(F_,{children:i.width}):no(R_,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.height&&a.height,children:[no(V_,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),ro(zP,{alignItems:"start",children:[no(ZPe,{id:"height",name:"height",children:function(e){var t=e.field,n=e.form;return no(Aae,{id:"height",name:"height",min:64,max:2048,width:"90%",step:64,value:n.values.height,onChange:function(e){return n.setFieldValue(t.name,Number(e))}})}}),i.height&&a.height?no(F_,{children:i.height}):no(R_,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),no(Eae,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function qLe(e){var t=e.children;return no(yP,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:t})}function YLe(){var e=wie(),t=o8().t,n=kie((function(e){return e.system.isProcessing}));function r(e){var n;return function(e){return/\s/.test(e)}(e)&&(n=t("modelmanager:cannotUseSpaces")),n}return ro(yP,{children:[no(_ae,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:function(){return e(Y8(null))},width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:no(vfe,{})}),no(WPe,{initialValues:{name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},onSubmit:function(t){var n=t;""===t.path&&delete n.path,""===t.repo_id&&delete n.repo_id,""===t.vae.path&&delete n.vae.path,""===t.vae.repo_id&&delete n.vae.repo_id,e(aie(n)),e(Y8(null))},children:function(e){var o,i,a,s,l,u,c,d,f,h,p=e.handleSubmit,v=e.errors,g=e.touched;return no("form",{onSubmit:p,children:ro(zP,{rowGap:"0.5rem",children:[no(qLe,{children:ro(I_,{isInvalid:!!v.name&&g.name,isRequired:!0,children:[no(V_,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"name",name:"name",type:"text",validate:r,width:"2xl",isRequired:!0}),v.name&&g.name?no(F_,{children:v.name}):no(R_,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),no(qLe,{children:ro(I_,{isInvalid:!!v.description&&g.description,isRequired:!0,children:[no(V_,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),v.description&&g.description?no(F_,{children:v.description}):no(R_,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),ro(qLe,{children:[no(jP,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),no(jP,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),ro(I_,{isInvalid:!!v.path&&g.path,children:[no(V_,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"path",name:"path",type:"text",width:"2xl"}),v.path&&g.path?no(F_,{children:v.path}):no(R_,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),ro(I_,{isInvalid:!!v.repo_id&&g.repo_id,children:[no(V_,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),v.repo_id&&g.repo_id?no(F_,{children:v.repo_id}):no(R_,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),ro(qLe,{children:[no(jP,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),no(jP,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),ro(I_,{isInvalid:!(null===(o=v.vae)||void 0===o||!o.path)&&(null===(i=g.vae)||void 0===i?void 0:i.path),children:[no(V_,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),null!==(a=v.vae)&&void 0!==a&&a.path&&null!==(s=g.vae)&&void 0!==s&&s.path?no(F_,{children:null===(l=v.vae)||void 0===l?void 0:l.path}):no(R_,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),ro(I_,{isInvalid:!(null===(u=v.vae)||void 0===u||!u.repo_id)&&(null===(c=g.vae)||void 0===c?void 0:c.repo_id),children:[no(V_,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),null!==(d=v.vae)&&void 0!==d&&d.repo_id&&null!==(f=g.vae)&&void 0!==f&&f.repo_id?no(F_,{children:null===(h=v.vae)||void 0===h?void 0:h.repo_id}):no(R_,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),no(Eae,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function ZLe(e){var t=e.text,n=e.onClick;return no(yP,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:n,children:no(jP,{fontWeight:"bold",children:t})})}function XLe(){var e=GE(),t=e.isOpen,n=e.onOpen,r=e.onClose,o=kie((function(e){return e.ui.addNewModelUIOption})),i=wie(),a=o8().t;return ro(to,{children:[no(Eae,{"aria-label":a("modelmanager:addNewModel"),tooltip:a("modelmanager:addNewModel"),onClick:n,className:"modal-close-btn",size:"sm",children:ro(yP,{columnGap:"0.5rem",alignItems:"center",children:[no(hde,{}),a("modelmanager:addNew")]})}),ro(qW,{isOpen:t,onClose:function(){r(),i(Y8(null))},size:"3xl",closeOnOverlayClick:!1,children:[no(rU,{}),ro(JW,{className:"modal add-model-modal",fontFamily:"Inter",children:[no(tU,{children:a("modelmanager:addNewModel")}),no(ZW,{marginTop:"0.3rem"}),ro(YW,{className:"add-model-modal-body",children:[null==o&&ro(yP,{columnGap:"1rem",children:[no(ZLe,{text:a("modelmanager:addCheckpointModel"),onClick:function(){return i(Y8("ckpt"))}}),no(ZLe,{text:a("modelmanager:addDiffuserModel"),onClick:function(){return i(Y8("diffusers"))}})]}),"ckpt"==o&&no(GLe,{}),"diffusers"==o&&no(YLe,{})]})]})]})]})}function $Le(e){var t=kie((function(e){return e.system})),n=t.isProcessing,r=t.isConnected,o=kie((function(e){return e.system.openModel})),i=o8().t,a=wie(),s=e.name,l=e.status,u=e.description,c=function(){a(T8(s))};return ro(yP,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:s===o?"var(--accent-color)":"",_hover:{backgroundColor:s===o?"var(--accent-color)":"var(--background-color)"},children:[no(cP,{onClick:c,cursor:"pointer",children:no(kY,{label:u,hasArrow:!0,placement:"bottom",children:no(jP,{fontWeight:"bold",children:s})})}),no(TP,{onClick:c,cursor:"pointer"}),ro(yP,{gap:2,alignItems:"center",children:[no(jP,{color:function(){switch(l){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}}(),children:l}),no(b_,{size:"sm",onClick:function(){a(lie(s))},isDisabled:"active"===l||n||!r,className:"modal-close-btn",children:i("modelmanager:load")}),no(_ae,{icon:no(Bde,{}),size:"sm",onClick:c,"aria-label":"Modify Config",isDisabled:"active"===l||n||!r,className:" modal-close-btn"}),no(jke,{title:i("modelmanager:deleteModel"),acceptCallback:function(){a(sie(s)),a(T8(null))},acceptButtonText:i("modelmanager:delete"),triggerComponent:no(_ae,{icon:no(jde,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:"active"===l||n||!r,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:ro(yP,{rowGap:"1rem",flexDirection:"column",children:[no("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),no("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}var KLe=Bae,QLe=Q0;var JLe=function(e,t){var n=-1,r=QLe(e)?Array(e.length):[];return KLe(e,(function(e,o,i){r[++n]=t(e,o,i)})),r},eOe=fse,tOe=fle,nOe=JLe,rOe=v0;var oOe=function(e,t){return(rOe(e)?eOe:nOe)(e,tOe(t))},iOe=QX(wle,(function(e){var t=oOe(e.model_list,(function(e,t){return un({name:t},e)}));return t}),{memoizeOptions:{resultEqualityCheck:dae}});function aOe(e){var t=e.label,n=e.isActive,r=e.onClick;return no(Eae,{onClick:r,isActive:n,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:t})}var sOe=function(){var e=kie(iOe),t=yn(cr.useState(""),2),n=t[0],r=t[1],o=yn(cr.useState("all"),2),i=o[0],a=o[1],s=yn(cr.useTransition(),2),l=(s[0],s[1]),u=o8().t,c=cr.useMemo((function(){var t=[],r=[],o=[],a=[];return e.forEach((function(e,s){e.name.toLowerCase().includes(n.toLowerCase())&&(o.push(no($Le,{name:e.name,status:e.status,description:e.description},s)),e.format===i&&a.push(no($Le,{name:e.name,status:e.status,description:e.description},s))),"diffusers"!==e.format?t.push(no($Le,{name:e.name,status:e.status,description:e.description},s)):r.push(no($Le,{name:e.name,status:e.status,description:e.description},s))})),""!==n?no(cP,"all"===i?{marginTop:"1rem",children:o}:{marginTop:"1rem",children:a}):ro(yP,{flexDirection:"column",rowGap:"1.5rem",children:["all"===i&&ro(to,{children:[ro(cP,{children:[no(jP,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:u("modelmanager:checkpointModels")}),t]}),ro(cP,{children:[no(jP,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:u("modelmanager:diffusersModels")}),r]})]}),"ckpt"===i&&no(yP,{flexDirection:"column",marginTop:"1rem",children:t}),"diffusers"===i&&no(yP,{flexDirection:"column",marginTop:"1rem",children:r})]})}),[e,n,u,i]);return ro(yP,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[ro(yP,{justifyContent:"space-between",children:[no(jP,{fontSize:"1.4rem",fontWeight:"bold",children:u("modelmanager:availableModels")}),no(XLe,{})]}),no(bye,{onChange:function(e){l((function(){r(e.target.value)}))},label:u("modelmanager:search")}),ro(yP,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[ro(yP,{columnGap:"0.5rem",children:[no(aOe,{label:u("modelmanager:allModels"),onClick:function(){return a("all")},isActive:"all"===i}),no(aOe,{label:u("modelmanager:checkpointModels"),onClick:function(){return a("ckpt")},isActive:"ckpt"===i}),no(aOe,{label:u("modelmanager:diffusersModels"),onClick:function(){return a("diffusers")},isActive:"diffusers"===i})]}),c]})]})};function lOe(e){var t=e.children,n=GE(),r=n.isOpen,o=n.onOpen,i=n.onClose,a=kie((function(e){return e.system.model_list})),s=kie((function(e){return e.system.openModel})),l=o8().t;return ro(to,{children:[cr.cloneElement(t,{onClick:o}),ro(qW,{isOpen:r,onClose:i,size:"6xl",children:[no(rU,{}),ro(JW,{className:"modal",fontFamily:"Inter",children:[no(ZW,{className:"modal-close-btn"}),no(tU,{fontWeight:"bold",children:l("modelmanager:modelManager")}),ro(yP,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[no(sOe,{}),s&&"diffusers"===a[s].format?no(gLe,{}):no(pLe,{})]})]})]})]})}var uOe=QX([wle],(function(e){var t=e.isProcessing,n=e.model_list,r=oOe(n,(function(e,t){return t}));return{models:r,isProcessing:t}}),{memoizeOptions:{resultEqualityCheck:dae}}),cOe=function(){var e=wie(),t=kie(uOe),n=t.models,r=t.isProcessing,o=kie(xle);return no(yP,{style:{paddingLeft:"0.3rem"},children:no(Mae,{style:{fontSize:"0.8rem"},tooltip:o.description,isDisabled:r,value:o.name,validValues:n,onChange:function(t){e(lie(t.target.value))}})})},dOe=QX([wle,pae],(function(e,t){var n=e.shouldDisplayInProgressType,r=e.shouldConfirmOnDelete,o=e.shouldDisplayGuides,i=e.model_list,a=e.saveIntermediatesInterval,s=e.enableImageDebugging,l=t.shouldUseCanvasBetaLayout;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:oOe(i,(function(e,t){return t})),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}}),{memoizeOptions:{resultEqualityCheck:dae}}),fOe=function(e){var t=e.children,n=wie(),r=o8().t,o=kie((function(e){return e.generation.steps})),i=GE(),a=i.isOpen,s=i.onOpen,l=i.onClose,u=GE(),c=u.isOpen,d=u.onOpen,f=u.onClose,h=kie(dOe),p=h.shouldDisplayInProgressType,v=h.shouldConfirmOnDelete,g=h.shouldDisplayGuides,m=h.saveIntermediatesInterval,y=h.enableImageDebugging,b=h.shouldUseCanvasBetaLayout;return ro(to,{children:[cr.cloneElement(t,{onClick:s}),ro(qW,{isOpen:a,onClose:l,size:"lg",children:[no(rU,{}),ro(JW,{className:"modal settings-modal",children:[no(tU,{className:"settings-modal-header",children:r("common:settingsLabel")}),no(ZW,{className:"modal-close-btn"}),ro(YW,{className:"settings-modal-content",children:[ro("div",{className:"settings-modal-items",children:[ro("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[no(Mae,{label:r("settings:displayInProgress"),validValues:wte,value:p,onChange:function(e){return n(s8(e.target.value))}}),"full-res"===p&&no(Aae,{label:r("settings:saveSteps"),min:1,max:o,step:1,onChange:function(e){e>o&&(e=o),e<1&&(e=1),n(C8(e))},value:m,width:"auto",textAlign:"center"})]}),no(iye,{styleClass:"settings-modal-item",label:r("settings:confirmOnDelete"),isChecked:v,onChange:function(e){return n(f8(e.target.checked))}}),no(iye,{styleClass:"settings-modal-item",label:r("settings:displayHelpIcons"),isChecked:g,onChange:function(e){return n(m8(e.target.checked))}}),no(iye,{styleClass:"settings-modal-item",label:r("settings:useCanvasBeta"),isChecked:b,onChange:function(e){return n(G8(e.target.checked))}})]}),ro("div",{className:"settings-modal-items",children:[no("h2",{style:{fontWeight:"bold"},children:"Developer"}),no(iye,{styleClass:"settings-modal-item",label:r("settings:enableImageDebugging"),isChecked:y,onChange:function(e){return n(_8(e.target.checked))}})]}),ro("div",{className:"settings-modal-reset",children:[no(xP,{size:"md",children:r("settings:resetWebUI")}),no(b_,{colorScheme:"red",onClick:function(){yie.purge().then((function(){l(),d()}))},children:r("settings:resetWebUI")}),no(jP,{children:r("settings:resetWebUIDesc1")}),no(jP,{children:r("settings:resetWebUIDesc2")})]})]}),no(eU,{children:no(b_,{onClick:l,className:"modal-close-btn",children:r("common:close")})})]})]}),ro(qW,{closeOnOverlayClick:!1,isOpen:c,onClose:f,isCentered:!0,children:[no(rU,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),no(JW,{children:no(YW,{pb:6,pt:6,children:no(yP,{justifyContent:"center",children:no(jP,{fontSize:"lg",children:no(jP,{children:r("settings:resetComplete")})})})})})]})]})},hOe=QX(wle,(function(e){return{isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}}),{memoizeOptions:{resultEqualityCheck:dae}}),pOe=function(){var e,t=kie(hOe),n=t.isConnected,r=t.isProcessing,o=t.currentIteration,i=t.totalIterations,a=t.currentStatus,s=t.hasError,l=t.wasErrorSeen,u=wie(),c=o8().t;e=n&&!s?"status-good":"status-bad";var d=a;[c("common:statusGenerating"),c("common:statusPreparing"),c("common:statusSavingImage"),c("common:statusRestoringFaces"),c("common:statusUpscaling")].includes(d)&&(e="status-working"),d&&r&&i>1&&(d="".concat(c(d)," (").concat(o,"/").concat(i,")"));return no(kY,{label:s&&!l?"Click to clear, check logs for details":void 0,children:no(jP,{cursor:s&&!l?"pointer":"initial",onClick:function(){!s&&l||u(w8())},className:"status ".concat(e),children:c(d)})})};function vOe(){var e=o8().t,t=ao(),n=t.setColorMode,r=t.colorMode,o=wie(),i=kie((function(e){return e.ui.currentTheme})),a={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};cr.useEffect((function(){r!==i&&n(i)}),[n,r,i]);var s;return no(Pae,{trigger:"hover",triggerComponent:no(_ae,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:no(dde,{})}),children:no(zP,{align:"stretch",children:(s=[],Object.keys(a).forEach((function(e){s.push(no(Eae,{style:{width:"6rem"},leftIcon:i===e?no(Uce,{}):void 0,size:"sm",onClick:function(){return function(e){o(j8(e))}(e)},children:a[e]},e))})),s)})})}function gOe(){var e,t=o8(),n=t.t,r=t.i18n,o={en:n("common:langEnglish"),nl:n("common:langDutch"),fr:n("common:langFrench"),de:n("common:langGerman"),it:n("common:langItalian"),ja:n("common:langJapanese"),pl:n("common:langPolish"),pt_br:n("common:langBrPortuguese"),ru:n("common:langRussian"),zh_cn:n("common:langSimplifiedChinese"),es:n("common:langSpanish"),ua:n("common:langUkranian")};return no(Pae,{trigger:"hover",triggerComponent:no(_ae,{"aria-label":n("common:languagePickerLabel"),tooltip:n("common:languagePickerLabel"),icon:no(ade,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:no(zP,{children:(e=[],Object.keys(o).forEach((function(t){e.push(no(Eae,{"data-selected":localStorage.getItem("i18nextLng")===t,onClick:function(){return r.changeLanguage(t)},className:"modal-close-btn lang-select-btn","aria-label":o[t],tooltip:o[t],size:"sm",minWidth:"200px",children:o[t]},t))})),e)})})}var mOe=function(){var e=o8().t,t=kie((function(e){return e.system.app_version}));return ro("div",{className:"site-header",children:[ro("div",{className:"site-header-left-side",children:[no("img",{src:Yye,alt:"invoke-ai-logo"}),ro(yP,{alignItems:"center",columnGap:"0.6rem",children:[ro(jP,{fontSize:"1.4rem",children:["invoke ",no("strong",{children:"ai"})]}),no(jP,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),ro("div",{className:"site-header-right-side",children:[no(pOe,{}),no(cOe,{}),no(lOe,{children:no(_ae,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:no(Zce,{})})}),no(kCe,{children:no(_ae,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:no(ide,{})})}),no(vOe,{}),no(gOe,{}),no(_ae,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:no(CP,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:no(Wce,{})})}),no(_ae,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:no(CP,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:no(Nce,{})})}),no(_ae,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:no(CP,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:no(Rce,{})})}),no(fOe,{children:no(_ae,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:no(Pfe,{})})})]})]})};var yOe=QX([Mde,pae,fae],(function(e,t,n){var r=t.shouldPinParametersPanel,o=t.shouldShowParametersPanel,i=t.shouldHoldParametersPanelOpen,a=t.shouldUseCanvasBetaLayout,s=e.shouldShowGallery,l=e.shouldPinGallery,u=e.shouldHoldGalleryOpen,c=a&&"unifiedCanvas"===n;return{shouldPinParametersPanel:r,shouldShowProcessButtons:!(c||r&&o),shouldShowParametersPanelButton:!c&&!(o||i&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),shouldShowParametersPanel:o,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n)}}),{memoizeOptions:{resultEqualityCheck:dae}}),bOe=function(){var e=wie(),t=kie(yOe),n=t.shouldShowParametersPanel,r=t.shouldShowParametersPanelButton,o=t.shouldShowProcessButtons,i=t.shouldPinParametersPanel,a=t.shouldShowGallery,s=t.shouldPinGallery;return _ce("f",(function(){a||n?(e(V8(!1)),e(r4(!1))):(e(V8(!0)),e(r4(!0))),(s||i)&&setTimeout((function(){return e(m3(!0))}),400)}),[a,n]),r?ro("div",{className:"show-hide-button-options",children:[no(_ae,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:function(){e(V8(!0)),i&&setTimeout((function(){return e(m3(!0))}),400)},children:no(kde,{})}),o&&ro(to,{children:[no(Fye,{iconButton:!0}),no(zye,{})]})]}):null},wOe=function(){var e=wie(),t=kie(yOe),n=t.shouldShowGallery,r=t.shouldShowGalleryButton,o=t.shouldPinGallery,i=t.shouldShowParametersPanel,a=t.shouldPinParametersPanel;return _ce("f",(function(){n||i?(e(V8(!1)),e(r4(!1))):(e(V8(!0)),e(r4(!0))),(o||a)&&setTimeout((function(){return e(m3(!0))}),400)}),[n,i]),r?no(_ae,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:function(){e(r4(!0)),o&&e(m3(!0))},children:no(Ofe,{})}):null};!function(){function e(){return e=qt(Ut().mark((function e(){var t,n,r=arguments;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"",e.next=3,fetch(t,{method:"GET",cache:"no-cache"});case 3:return n=e.sent,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)}))),e.apply(this,arguments)}var t=function(){(function(){return e.apply(this,arguments)})(document.location+"/flaskwebgui-keep-server-alive").then((function(e){return e}))};({}).NODE_ENV&&"production"!=={}.NODE_ENV||document.addEventListener("DOMContentLoaded",(function(){t(),setInterval(t,3e3)}))}();var kOe=function(){var e,t,n;return e=wie(),t=kie(kle),n=cY(),cr.useEffect((function(){t.forEach((function(e){n(e)})),t.length>0&&e(L8())}),[e,n,t]),ro("div",{className:"App",children:[ro(pCe,{children:[no(bCe,{}),ro("div",{className:"app-content",children:[no(mOe,{}),no(oSe,{})]}),no("div",{className:"app-console",children:no(mCe,{})})]}),no(bOe,{}),no(wOe,{})]})},xOe=function(){return no(yP,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:no(XC,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})})},SOe=hs({key:"invokeai-style-cache",prepend:!0});CY.createRoot(document.getElementById("root")).render(no(qr.StrictMode,{children:no(CZ,{store:mie,children:no(jZ,{loading:no(xOe,{}),persistor:yie,children:no(il,{value:SOe,children:no(SY,{children:no(qr.Suspense,{fallback:no(xOe,{}),children:no(kOe,{})})})})})})}))}}}))}();