( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/tmpr/../tmpr/..//tmpr/../tmpr/..//tmpr/../tmpr/..//dist/pixie.umd.js
var yq=Object.defineProperty,bq=Object.defineProperties;var xq=Object.getOwnPropertyDescriptors;var Qd=Object.getOwnPropertySymbols;var Ak=Object.prototype.hasOwnProperty,Ik=Object.prototype.propertyIsEnumerable;var vb=(Ke,We,vt)=>We in Ke?yq(Ke,We,{enumerable:!0,configurable:!0,writable:!0,value:vt}):Ke[We]=vt,$=(Ke,We)=>{for(var vt in We||(We={}))Ak.call(We,vt)&&vb(Ke,vt,We[vt]);if(Qd)for(var vt of Qd(We))Ik.call(We,vt)&&vb(Ke,vt,We[vt]);return Ke},Y=(Ke,We)=>bq(Ke,xq(We));var ze=(Ke,We)=>{var vt={};for(var C in Ke)Ak.call(Ke,C)&&We.indexOf(C)<0&&(vt[C]=Ke[C]);if(Ke!=null&&Qd)for(var C of Qd(Ke))We.indexOf(C)<0&&Ik.call(Ke,C)&&(vt[C]=Ke[C]);return vt};var Te=(Ke,We,vt)=>(vb(Ke,typeof We!="symbol"?We+"":We,vt),vt);(function(Ke,We){typeof exports=="object"&&typeof module!="undefined"?module.exports=We():typeof define=="function"&&define.amd?define(We):(Ke=typeof globalThis!="undefined"?globalThis:Ke||self,Ke.Pixie=We())})(this,function(){var $k,Dk;"use strict";var Ke=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function We(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vt(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach(function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}),t}var C={exports:{}},je={};/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var yb=Object.getOwnPropertySymbols,Rk=Object.prototype.hasOwnProperty,Fk=Object.prototype.propertyIsEnumerable;function Lk(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Nk(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var bb=Nk()?Object.assign:function(e,t){for(var r,n=Lk(e),i,s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var u in r)Rk.call(r,u)&&(n[u]=r[u]);if(yb){i=yb(r);for(var o=0;o<i.length;o++)Fk.call(r,i[o])&&(n[i[o]]=r[i[o]])}}return n};/** @license React v17.0.2
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var eh=bb,Po=60103,xb=60106;je.Fragment=60107,je.StrictMode=60108,je.Profiler=60114;var wb=60109,Sb=60110,_b=60112;je.Suspense=60113;var Tb=60115,Cb=60116;if(typeof Symbol=="function"&&Symbol.for){var Nr=Symbol.for;Po=Nr("react.element"),xb=Nr("react.portal"),je.Fragment=Nr("react.fragment"),je.StrictMode=Nr("react.strict_mode"),je.Profiler=Nr("react.profiler"),wb=Nr("react.provider"),Sb=Nr("react.context"),_b=Nr("react.forward_ref"),je.Suspense=Nr("react.suspense"),Tb=Nr("react.memo"),Cb=Nr("react.lazy")}var Eb=typeof Symbol=="function"&&Symbol.iterator;function zk(e){return e===null||typeof e!="object"?null:(e=Eb&&e[Eb]||e["@@iterator"],typeof e=="function"?e:null)}function qa(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Pb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ob={};function Oo(e,t,r){this.props=e,this.context=t,this.refs=Ob,this.updater=r||Pb}Oo.prototype.isReactComponent={},Oo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(qa(85));this.updater.enqueueSetState(this,e,t,"setState")},Oo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Mb(){}Mb.prototype=Oo.prototype;function th(e,t,r){this.props=e,this.context=t,this.refs=Ob,this.updater=r||Pb}var rh=th.prototype=new Mb;rh.constructor=th,eh(rh,Oo.prototype),rh.isPureReactComponent=!0;var nh={current:null},kb=Object.prototype.hasOwnProperty,$b={key:!0,ref:!0,__self:!0,__source:!0};function Db(e,t,r){var n,i={},s=null,u=null;if(t!=null)for(n in t.ref!==void 0&&(u=t.ref),t.key!==void 0&&(s=""+t.key),t)kb.call(t,n)&&!$b.hasOwnProperty(n)&&(i[n]=t[n]);var o=arguments.length-2;if(o===1)i.children=r;else if(1<o){for(var a=Array(o),l=0;l<o;l++)a[l]=arguments[l+2];i.children=a}if(e&&e.defaultProps)for(n in o=e.defaultProps,o)i[n]===void 0&&(i[n]=o[n]);return{$$typeof:Po,type:e,key:s,ref:u,props:i,_owner:nh.current}}function jk(e,t){return{$$typeof:Po,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ih(e){return typeof e=="object"&&e!==null&&e.$$typeof===Po}function Bk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ab=/\/+/g;function oh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Bk(""+e.key):t.toString(36)}function ou(e,t,r,n,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var u=!1;if(e===null)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case Po:case xb:u=!0}}if(u)return u=e,i=i(u),e=n===""?"."+oh(u,0):n,Array.isArray(i)?(r="",e!=null&&(r=e.replace(Ab,"$&/")+"/"),ou(i,t,r,"",function(l){return l})):i!=null&&(ih(i)&&(i=jk(i,r+(!i.key||u&&u.key===i.key?"":(""+i.key).replace(Ab,"$&/")+"/")+e)),t.push(i)),1;if(u=0,n=n===""?".":n+":",Array.isArray(e))for(var o=0;o<e.length;o++){s=e[o];var a=n+oh(s,o);u+=ou(s,t,r,a,i)}else if(a=zk(e),typeof a=="function")for(e=a.call(e),o=0;!(s=e.next()).done;)s=s.value,a=n+oh(s,o++),u+=ou(s,t,r,a,i);else if(s==="object")throw t=""+e,Error(qa(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t));return u}function au(e,t,r){if(e==null)return e;var n=[],i=0;return ou(e,n,"","",function(s){return t.call(r,s,i++)}),n}function Vk(e){if(e._status===-1){var t=e._result;t=t(),e._status=0,e._result=t,t.then(function(r){e._status===0&&(r=r.default,e._status=1,e._result=r)},function(r){e._status===0&&(e._status=2,e._result=r)})}if(e._status===1)return e._result;throw e._result}var Ib={current:null};function xn(){var e=Ib.current;if(e===null)throw Error(qa(321));return e}var Uk={ReactCurrentDispatcher:Ib,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:nh,IsSomeRendererActing:{current:!1},assign:eh};je.Children={map:au,forEach:function(e,t,r){au(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return au(e,function(){t++}),t},toArray:function(e){return au(e,function(t){return t})||[]},only:function(e){if(!ih(e))throw Error(qa(143));return e}},je.Component=Oo,je.PureComponent=th,je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Uk,je.cloneElement=function(e,t,r){if(e==null)throw Error(qa(267,e));var n=eh({},e.props),i=e.key,s=e.ref,u=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,u=nh.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(a in t)kb.call(t,a)&&!$b.hasOwnProperty(a)&&(n[a]=t[a]===void 0&&o!==void 0?o[a]:t[a])}var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){o=Array(a);for(var l=0;l<a;l++)o[l]=arguments[l+2];n.children=o}return{$$typeof:Po,type:e.type,key:i,ref:s,props:n,_owner:u}},je.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Sb,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:wb,_context:e},e.Consumer=e},je.createElement=Db,je.createFactory=function(e){var t=Db.bind(null,e);return t.type=e,t},je.createRef=function(){return{current:null}},je.forwardRef=function(e){return{$$typeof:_b,render:e}},je.isValidElement=ih,je.lazy=function(e){return{$$typeof:Cb,_payload:{_status:-1,_result:e},_init:Vk}},je.memo=function(e,t){return{$$typeof:Tb,type:e,compare:t===void 0?null:t}},je.useCallback=function(e,t){return xn().useCallback(e,t)},je.useContext=function(e,t){return xn().useContext(e,t)},je.useDebugValue=function(){},je.useEffect=function(e,t){return xn().useEffect(e,t)},je.useImperativeHandle=function(e,t,r){return xn().useImperativeHandle(e,t,r)},je.useLayoutEffect=function(e,t){return xn().useLayoutEffect(e,t)},je.useMemo=function(e,t){return xn().useMemo(e,t)},je.useReducer=function(e,t,r){return xn().useReducer(e,t,r)},je.useRef=function(e){return xn().useRef(e)},je.useState=function(e){return xn().useState(e)},je.version="17.0.2",C.exports=je;var ee=C.exports,Rb={exports:{}},Pr={},Fb={exports:{}},Lb={};/** @license React v0.20.2
 * 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){var t,r,n,i;if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}if(typeof window=="undefined"||typeof MessageChannel!="function"){var a=null,l=null,h=function(){if(a!==null)try{var M=e.unstable_now();a(!0,M),a=null}catch(D){throw setTimeout(h,0),D}};t=function(M){a!==null?setTimeout(t,0,M):(a=M,setTimeout(h,0))},r=function(M,D){l=setTimeout(M,D)},n=function(){clearTimeout(l)},e.unstable_shouldYield=function(){return!1},i=e.unstable_forceFrameRate=function(){}}else{var c=window.setTimeout,f=window.clearTimeout;if(typeof console!="undefined"){var d=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof d!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var g=!1,m=null,p=-1,v=5,y=0;e.unstable_shouldYield=function(){return e.unstable_now()>=y},i=function(){},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=0<M?Math.floor(1e3/M):5};var b=new MessageChannel,x=b.port2;b.port1.onmessage=function(){if(m!==null){var M=e.unstable_now();y=M+v;try{m(!0,M)?x.postMessage(null):(g=!1,m=null)}catch(D){throw x.postMessage(null),D}}else g=!1},t=function(M){m=M,g||(g=!0,x.postMessage(null))},r=function(M,D){p=c(function(){M(e.unstable_now())},D)},n=function(){f(p),p=-1}}function w(M,D){var R=M.length;M.push(D);e:for(;;){var P=R-1>>>1,O=M[P];if(O!==void 0&&0<E(O,D))M[P]=D,M[R]=O,R=P;else break e}}function T(M){return M=M[0],M===void 0?null:M}function _(M){var D=M[0];if(D!==void 0){var R=M.pop();if(R!==D){M[0]=R;e:for(var P=0,O=M.length;P<O;){var N=2*(P+1)-1,I=M[N],q=N+1,X=M[q];if(I!==void 0&&0>E(I,R))X!==void 0&&0>E(X,I)?(M[P]=X,M[q]=R,P=q):(M[P]=I,M[N]=R,P=N);else if(X!==void 0&&0>E(X,R))M[P]=X,M[q]=R,P=q;else break e}}return D}return null}function E(M,D){var R=M.sortIndex-D.sortIndex;return R!==0?R:M.id-D.id}var k=[],z=[],F=1,j=null,K=3,B=!1,H=!1,ue=!1;function ge(M){for(var D=T(z);D!==null;){if(D.callback===null)_(z);else if(D.startTime<=M)_(z),D.sortIndex=D.expirationTime,w(k,D);else break;D=T(z)}}function fe(M){if(ue=!1,ge(M),!H)if(T(k)!==null)H=!0,t(L);else{var D=T(z);D!==null&&r(fe,D.startTime-M)}}function L(M,D){H=!1,ue&&(ue=!1,n()),B=!0;var R=K;try{for(ge(D),j=T(k);j!==null&&(!(j.expirationTime>D)||M&&!e.unstable_shouldYield());){var P=j.callback;if(typeof P=="function"){j.callback=null,K=j.priorityLevel;var O=P(j.expirationTime<=D);D=e.unstable_now(),typeof O=="function"?j.callback=O:j===T(k)&&_(k),ge(D)}else _(k);j=T(k)}if(j!==null)var N=!0;else{var I=T(z);I!==null&&r(fe,I.startTime-D),N=!1}return N}finally{j=null,K=R,B=!1}}var Z=i;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){H||B||(H=!0,t(L))},e.unstable_getCurrentPriorityLevel=function(){return K},e.unstable_getFirstCallbackNode=function(){return T(k)},e.unstable_next=function(M){switch(K){case 1:case 2:case 3:var D=3;break;default:D=K}var R=K;K=D;try{return M()}finally{K=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=Z,e.unstable_runWithPriority=function(M,D){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var R=K;K=M;try{return D()}finally{K=R}},e.unstable_scheduleCallback=function(M,D,R){var P=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?P+R:P):R=P,M){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=R+O,M={id:F++,callback:D,priorityLevel:M,startTime:R,expirationTime:O,sortIndex:-1},R>P?(M.sortIndex=R,w(z,M),T(k)===null&&M===T(z)&&(ue?n():ue=!0,r(fe,R-P))):(M.sortIndex=O,w(k,M),H||B||(H=!0,t(L))),M},e.unstable_wrapCallback=function(M){var D=K;return function(){var R=K;K=D;try{return M.apply(this,arguments)}finally{K=R}}}})(Lb),Fb.exports=Lb;/** @license React v17.0.2
 * 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 su=C.exports,nt=bb,Ct=Fb.exports;function de(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!su)throw Error(de(227));var Nb=new Set,Ja={};function Pi(e,t){Mo(e,t),Mo(e+"Capture",t)}function Mo(e,t){for(Ja[e]=t,e=0;e<t.length;e++)Nb.add(t[e])}var wn=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),Hk=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,zb=Object.prototype.hasOwnProperty,jb={},Bb={};function Wk(e){return zb.call(Bb,e)?!0:zb.call(jb,e)?!1:Hk.test(e)?Bb[e]=!0:(jb[e]=!0,!1)}function Yk(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Kk(e,t,r,n){if(t===null||typeof t=="undefined"||Yk(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function qt(e,t,r,n,i,s,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=u}var It={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){It[e]=new qt(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];It[t]=new qt(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){It[e]=new qt(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){It[e]=new qt(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){It[e]=new qt(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){It[e]=new qt(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){It[e]=new qt(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){It[e]=new qt(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){It[e]=new qt(e,5,!1,e.toLowerCase(),null,!1,!1)});var ah=/[\-:]([a-z])/g;function sh(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ah,sh);It[t]=new qt(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ah,sh);It[t]=new qt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ah,sh);It[t]=new qt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){It[e]=new qt(e,1,!1,e.toLowerCase(),null,!1,!1)}),It.xlinkHref=new qt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){It[e]=new qt(e,1,!1,e.toLowerCase(),null,!0,!0)});function lh(e,t,r,n){var i=It.hasOwnProperty(t)?It[t]:null,s=i!==null?i.type===0:n?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");s||(Kk(t,r,i,n)&&(r=null),n||i===null?Wk(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Oi=su.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Za=60103,Mi=60106,jn=60107,uh=60108,Qa=60114,ch=60109,fh=60110,lu=60112,es=60113,uu=60120,cu=60115,dh=60116,hh=60121,ph=60128,Vb=60129,gh=60130,mh=60131;if(typeof Symbol=="function"&&Symbol.for){var Et=Symbol.for;Za=Et("react.element"),Mi=Et("react.portal"),jn=Et("react.fragment"),uh=Et("react.strict_mode"),Qa=Et("react.profiler"),ch=Et("react.provider"),fh=Et("react.context"),lu=Et("react.forward_ref"),es=Et("react.suspense"),uu=Et("react.suspense_list"),cu=Et("react.memo"),dh=Et("react.lazy"),hh=Et("react.block"),Et("react.scope"),ph=Et("react.opaque.id"),Vb=Et("react.debug_trace_mode"),gh=Et("react.offscreen"),mh=Et("react.legacy_hidden")}var Ub=typeof Symbol=="function"&&Symbol.iterator;function ts(e){return e===null||typeof e!="object"?null:(e=Ub&&e[Ub]||e["@@iterator"],typeof e=="function"?e:null)}var vh;function rs(e){if(vh===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);vh=t&&t[1]||""}return`
`+vh+e}var yh=!1;function fu(e,t){if(!e||yh)return"";yh=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(a){var n=a}Reflect.construct(e,[],t)}else{try{t.call()}catch(a){n=a}e.call(t.prototype)}else{try{throw Error()}catch(a){n=a}e()}}catch(a){if(a&&n&&typeof a.stack=="string"){for(var i=a.stack.split(`
`),s=n.stack.split(`
`),u=i.length-1,o=s.length-1;1<=u&&0<=o&&i[u]!==s[o];)o--;for(;1<=u&&0<=o;u--,o--)if(i[u]!==s[o]){if(u!==1||o!==1)do if(u--,o--,0>o||i[u]!==s[o])return`
`+i[u].replace(" at new "," at ");while(1<=u&&0<=o);break}}}finally{yh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?rs(e):""}function Xk(e){switch(e.tag){case 5:return rs(e.type);case 16:return rs("Lazy");case 13:return rs("Suspense");case 19:return rs("SuspenseList");case 0:case 2:case 15:return e=fu(e.type,!1),e;case 11:return e=fu(e.type.render,!1),e;case 22:return e=fu(e.type._render,!1),e;case 1:return e=fu(e.type,!0),e;default:return""}}function ko(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case jn:return"Fragment";case Mi:return"Portal";case Qa:return"Profiler";case uh:return"StrictMode";case es:return"Suspense";case uu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fh:return(e.displayName||"Context")+".Consumer";case ch:return(e._context.displayName||"Context")+".Provider";case lu:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case cu:return ko(e.type);case hh:return ko(e._render);case dh:t=e._payload,e=e._init;try{return ko(e(t))}catch{}}return null}function Bn(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Hb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gk(e){var t=Hb(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r!="undefined"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(u){n=""+u,s.call(this,u)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(u){n=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function du(e){e._valueTracker||(e._valueTracker=Gk(e))}function Wb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Hb(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function hu(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch{return e.body}}function bh(e,t){var r=t.checked;return nt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r!=null?r:e._wrapperState.initialChecked})}function Yb(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Bn(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Kb(e,t){t=t.checked,t!=null&&lh(e,"checked",t,!1)}function xh(e,t){Kb(e,t);var r=Bn(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?wh(e,t.type,r):t.hasOwnProperty("defaultValue")&&wh(e,t.type,Bn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xb(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function wh(e,t,r){(t!=="number"||hu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}function qk(e){var t="";return su.Children.forEach(e,function(r){r!=null&&(t+=r)}),t}function Sh(e,t){return e=nt({children:void 0},t),(t=qk(t.children))&&(e.children=t),e}function $o(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Bn(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function _h(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(de(91));return nt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Gb(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(de(92));if(Array.isArray(r)){if(!(1>=r.length))throw Error(de(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Bn(r)}}function qb(e,t){var r=Bn(t.value),n=Bn(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Jb(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}var Th={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Zb(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ch(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Zb(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var pu,Qb=function(e){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!==Th.svg||"innerHTML"in e)e.innerHTML=t;else{for(pu=pu||document.createElement("div"),pu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=pu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ns(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var is={animationIterationCount:!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},Jk=["Webkit","ms","Moz","O"];Object.keys(is).forEach(function(e){Jk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),is[t]=is[e]})});function e1(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||is.hasOwnProperty(e)&&is[e]?(""+t).trim():t+"px"}function t1(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=e1(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var Zk=nt({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 Eh(e,t){if(t){if(Zk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(de(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(de(60));if(!(typeof t.dangerouslySetInnerHTML=="object"&&"__html"in t.dangerouslySetInnerHTML))throw Error(de(61))}if(t.style!=null&&typeof t.style!="object")throw Error(de(62))}}function Ph(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Oh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mh=null,Do=null,Ao=null;function r1(e){if(e=_s(e)){if(typeof Mh!="function")throw Error(de(280));var t=e.stateNode;t&&(t=Du(t),Mh(e.stateNode,e.type,t))}}function n1(e){Do?Ao?Ao.push(e):Ao=[e]:Do=e}function i1(){if(Do){var e=Do,t=Ao;if(Ao=Do=null,r1(e),t)for(e=0;e<t.length;e++)r1(t[e])}}function kh(e,t){return e(t)}function o1(e,t,r,n,i){return e(t,r,n,i)}function $h(){}var a1=kh,ki=!1,Dh=!1;function Ah(){(Do!==null||Ao!==null)&&($h(),i1())}function Qk(e,t,r){if(Dh)return e(t,r);Dh=!0;try{return a1(e,t,r)}finally{Dh=!1,Ah()}}function os(e,t){var r=e.stateNode;if(r===null)return null;var n=Du(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(de(231,t,typeof r));return r}var Ih=!1;if(wn)try{var as={};Object.defineProperty(as,"passive",{get:function(){Ih=!0}}),window.addEventListener("test",as,as),window.removeEventListener("test",as,as)}catch{Ih=!1}function e$(e,t,r,n,i,s,u,o,a){var l=Array.prototype.slice.call(arguments,3);try{t.apply(r,l)}catch(h){this.onError(h)}}var ss=!1,gu=null,mu=!1,Rh=null,t$={onError:function(e){ss=!0,gu=e}};function r$(e,t,r,n,i,s,u,o,a){ss=!1,gu=null,e$.apply(t$,arguments)}function n$(e,t,r,n,i,s,u,o,a){if(r$.apply(this,arguments),ss){if(ss){var l=gu;ss=!1,gu=null}else throw Error(de(198));mu||(mu=!0,Rh=l)}}function $i(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&1026)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function s1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l1(e){if($i(e)!==e)throw Error(de(188))}function i$(e){var t=e.alternate;if(!t){if(t=$i(e),t===null)throw Error(de(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return l1(i),e;if(s===n)return l1(i),t;s=s.sibling}throw Error(de(188))}if(r.return!==n.return)r=i,n=s;else{for(var u=!1,o=i.child;o;){if(o===r){u=!0,r=i,n=s;break}if(o===n){u=!0,n=i,r=s;break}o=o.sibling}if(!u){for(o=s.child;o;){if(o===r){u=!0,r=s,n=i;break}if(o===n){u=!0,n=s,r=i;break}o=o.sibling}if(!u)throw Error(de(189))}}if(r.alternate!==n)throw Error(de(190))}if(r.tag!==3)throw Error(de(188));return r.stateNode.current===r?e:t}function u1(e){if(e=i$(e),!e)return null;for(var t=e;;){if(t.tag===5||t.tag===6)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function c1(e,t){for(var r=e.alternate;t!==null;){if(t===e||t===r)return!0;t=t.return}return!1}var f1,Fh,d1,h1,Lh=!1,qr=[],Vn=null,Un=null,Hn=null,ls=new Map,us=new Map,cs=[],p1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Nh(e,t,r,n,i){return{blockedOn:e,domEventName:t,eventSystemFlags:r|16,nativeEvent:i,targetContainers:[n]}}function g1(e,t){switch(e){case"focusin":case"focusout":Vn=null;break;case"dragenter":case"dragleave":Un=null;break;case"mouseover":case"mouseout":Hn=null;break;case"pointerover":case"pointerout":ls.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":us.delete(t.pointerId)}}function fs(e,t,r,n,i,s){return e===null||e.nativeEvent!==s?(e=Nh(t,r,n,i,s),t!==null&&(t=_s(t),t!==null&&Fh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function o$(e,t,r,n,i){switch(t){case"focusin":return Vn=fs(Vn,e,t,r,n,i),!0;case"dragenter":return Un=fs(Un,e,t,r,n,i),!0;case"mouseover":return Hn=fs(Hn,e,t,r,n,i),!0;case"pointerover":var s=i.pointerId;return ls.set(s,fs(ls.get(s)||null,e,t,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,us.set(s,fs(us.get(s)||null,e,t,r,n,i)),!0}return!1}function a$(e){var t=Di(e.target);if(t!==null){var r=$i(t);if(r!==null){if(t=r.tag,t===13){if(t=s1(r),t!==null){e.blockedOn=t,h1(e.lanePriority,function(){Ct.unstable_runWithPriority(e.priority,function(){d1(r)})});return}}else if(t===3&&r.stateNode.hydrate){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function vu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Hh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r!==null)return t=_s(r),t!==null&&Fh(t),e.blockedOn=r,!1;t.shift()}return!0}function m1(e,t,r){vu(e)&&r.delete(t)}function s$(){for(Lh=!1;0<qr.length;){var e=qr[0];if(e.blockedOn!==null){e=_s(e.blockedOn),e!==null&&f1(e);break}for(var t=e.targetContainers;0<t.length;){var r=Hh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r!==null){e.blockedOn=r;break}t.shift()}e.blockedOn===null&&qr.shift()}Vn!==null&&vu(Vn)&&(Vn=null),Un!==null&&vu(Un)&&(Un=null),Hn!==null&&vu(Hn)&&(Hn=null),ls.forEach(m1),us.forEach(m1)}function ds(e,t){e.blockedOn===t&&(e.blockedOn=null,Lh||(Lh=!0,Ct.unstable_scheduleCallback(Ct.unstable_NormalPriority,s$)))}function v1(e){function t(i){return ds(i,e)}if(0<qr.length){ds(qr[0],e);for(var r=1;r<qr.length;r++){var n=qr[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Vn!==null&&ds(Vn,e),Un!==null&&ds(Un,e),Hn!==null&&ds(Hn,e),ls.forEach(t),us.forEach(t),r=0;r<cs.length;r++)n=cs[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<cs.length&&(r=cs[0],r.blockedOn===null);)a$(r),r.blockedOn===null&&cs.shift()}function yu(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Io={animationend:yu("Animation","AnimationEnd"),animationiteration:yu("Animation","AnimationIteration"),animationstart:yu("Animation","AnimationStart"),transitionend:yu("Transition","TransitionEnd")},zh={},y1={};wn&&(y1=document.createElement("div").style,"AnimationEvent"in window||(delete Io.animationend.animation,delete Io.animationiteration.animation,delete Io.animationstart.animation),"TransitionEvent"in window||delete Io.transitionend.transition);function bu(e){if(zh[e])return zh[e];if(!Io[e])return e;var t=Io[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in y1)return zh[e]=t[r];return e}var b1=bu("animationend"),x1=bu("animationiteration"),w1=bu("animationstart"),S1=bu("transitionend"),_1=new Map,jh=new Map,l$=["abort","abort",b1,"animationEnd",x1,"animationIteration",w1,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",S1,"transitionEnd","waiting","waiting"];function Bh(e,t){for(var r=0;r<e.length;r+=2){var n=e[r],i=e[r+1];i="on"+(i[0].toUpperCase()+i.slice(1)),jh.set(n,t),_1.set(n,i),Pi(i,[n])}}var u$=Ct.unstable_now;u$();var Ze=8;function Ro(e){if((1&e)!==0)return Ze=15,1;if((2&e)!==0)return Ze=14,2;if((4&e)!==0)return Ze=13,4;var t=24&e;return t!==0?(Ze=12,t):(e&32)!==0?(Ze=11,32):(t=192&e,t!==0?(Ze=10,t):(e&256)!==0?(Ze=9,256):(t=3584&e,t!==0?(Ze=8,t):(e&4096)!==0?(Ze=7,4096):(t=4186112&e,t!==0?(Ze=6,t):(t=62914560&e,t!==0?(Ze=5,t):e&67108864?(Ze=4,67108864):(e&134217728)!==0?(Ze=3,134217728):(t=805306368&e,t!==0?(Ze=2,t):(1073741824&e)!==0?(Ze=1,1073741824):(Ze=8,e))))))}function c$(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function f$(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(de(358,e))}}function hs(e,t){var r=e.pendingLanes;if(r===0)return Ze=0;var n=0,i=0,s=e.expiredLanes,u=e.suspendedLanes,o=e.pingedLanes;if(s!==0)n=s,i=Ze=15;else if(s=r&134217727,s!==0){var a=s&~u;a!==0?(n=Ro(a),i=Ze):(o&=s,o!==0&&(n=Ro(o),i=Ze))}else s=r&~u,s!==0?(n=Ro(s),i=Ze):o!==0&&(n=Ro(o),i=Ze);if(n===0)return 0;if(n=31-Wn(n),n=r&((0>n?0:1<<n)<<1)-1,t!==0&&t!==n&&(t&u)===0){if(Ro(t),i<=Ze)return t;Ze=i}if(t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Wn(t),i=1<<r,n|=e[r],t&=~i;return n}function T1(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xu(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return e=Fo(24&~t),e===0?xu(10,t):e;case 10:return e=Fo(192&~t),e===0?xu(8,t):e;case 8:return e=Fo(3584&~t),e===0&&(e=Fo(4186112&~t),e===0&&(e=512)),e;case 2:return t=Fo(805306368&~t),t===0&&(t=268435456),t}throw Error(de(358,e))}function Fo(e){return e&-e}function Vh(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function wu(e,t,r){e.pendingLanes|=t;var n=t-1;e.suspendedLanes&=n,e.pingedLanes&=n,e=e.eventTimes,t=31-Wn(t),e[t]=r}var Wn=Math.clz32?Math.clz32:p$,d$=Math.log,h$=Math.LN2;function p$(e){return e===0?32:31-(d$(e)/h$|0)|0}var g$=Ct.unstable_UserBlockingPriority,m$=Ct.unstable_runWithPriority,Su=!0;function v$(e,t,r,n){ki||$h();var i=Uh,s=ki;ki=!0;try{o1(i,e,t,r,n)}finally{(ki=s)||Ah()}}function y$(e,t,r,n){m$(g$,Uh.bind(null,e,t,r,n))}function Uh(e,t,r,n){if(Su){var i;if((i=(t&4)===0)&&0<qr.length&&-1<p1.indexOf(e))e=Nh(null,e,t,r,n),qr.push(e);else{var s=Hh(e,t,r,n);if(s===null)i&&g1(e,n);else{if(i){if(-1<p1.indexOf(e)){e=Nh(s,e,t,r,n),qr.push(e);return}if(o$(s,e,t,r,n))return;g1(e,n)}ex(e,t,n,null,r)}}}}function Hh(e,t,r,n){var i=Oh(n);if(i=Di(i),i!==null){var s=$i(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=s1(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.hydrate)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return ex(e,t,n,i,r),null}var Yn=null,Wh=null,_u=null;function C1(){if(_u)return _u;var e,t=Wh,r=t.length,n,i="value"in Yn?Yn.value:Yn.textContent,s=i.length;for(e=0;e<r&&t[e]===i[e];e++);var u=r-e;for(n=1;n<=u&&t[r-n]===i[s-n];n++);return _u=i.slice(e,1<n?1-n:void 0)}function Tu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Cu(){return!0}function E1(){return!1}function gr(e){function t(r,n,i,s,u){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=u,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Cu:E1,this.isPropagationStopped=E1,this}return nt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Cu)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Cu)},persist:function(){},isPersistent:Cu}),t}var Lo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yh=gr(Lo),ps=nt({},Lo,{view:0,detail:0}),b$=gr(ps),Kh,Xh,gs,Eu=nt({},ps,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==gs&&(gs&&e.type==="mousemove"?(Kh=e.screenX-gs.screenX,Xh=e.screenY-gs.screenY):Xh=Kh=0,gs=e),Kh)},movementY:function(e){return"movementY"in e?e.movementY:Xh}}),P1=gr(Eu),x$=nt({},Eu,{dataTransfer:0}),w$=gr(x$),S$=nt({},ps,{relatedTarget:0}),Gh=gr(S$),_$=nt({},Lo,{animationName:0,elapsedTime:0,pseudoElement:0}),T$=gr(_$),C$=nt({},Lo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),E$=gr(C$),P$=nt({},Lo,{data:0}),O1=gr(P$),O$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M$={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},k$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $$(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=k$[e])?!!t[e]:!1}function qh(){return $$}var D$=nt({},ps,{key:function(e){if(e.key){var t=O$[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Tu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?M$[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qh,charCode:function(e){return e.type==="keypress"?Tu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Tu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),A$=gr(D$),I$=nt({},Eu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),M1=gr(I$),R$=nt({},ps,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qh}),F$=gr(R$),L$=nt({},Lo,{propertyName:0,elapsedTime:0,pseudoElement:0}),N$=gr(L$),z$=nt({},Eu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),j$=gr(z$),B$=[9,13,27,32],Jh=wn&&"CompositionEvent"in window,ms=null;wn&&"documentMode"in document&&(ms=document.documentMode);var V$=wn&&"TextEvent"in window&&!ms,k1=wn&&(!Jh||ms&&8<ms&&11>=ms),$1=String.fromCharCode(32),D1=!1;function A1(e,t){switch(e){case"keyup":return B$.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function I1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var No=!1;function U$(e,t){switch(e){case"compositionend":return I1(t);case"keypress":return t.which!==32?null:(D1=!0,$1);case"textInput":return e=t.data,e===$1&&D1?null:e;default:return null}}function H$(e,t){if(No)return e==="compositionend"||!Jh&&A1(e,t)?(e=C1(),_u=Wh=Yn=null,No=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return k1&&t.locale!=="ko"?null:t.data;default:return null}}var W$={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 R1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!W$[e.type]:t==="textarea"}function F1(e,t,r,n){n1(n),t=Ou(t,"onChange"),0<t.length&&(r=new Yh("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var vs=null,ys=null;function Y$(e){G1(e,0)}function Pu(e){var t=Uo(e);if(Wb(t))return e}function K$(e,t){if(e==="change")return t}var L1=!1;if(wn){var Zh;if(wn){var Qh="oninput"in document;if(!Qh){var N1=document.createElement("div");N1.setAttribute("oninput","return;"),Qh=typeof N1.oninput=="function"}Zh=Qh}else Zh=!1;L1=Zh&&(!document.documentMode||9<document.documentMode)}function z1(){vs&&(vs.detachEvent("onpropertychange",j1),ys=vs=null)}function j1(e){if(e.propertyName==="value"&&Pu(ys)){var t=[];if(F1(t,ys,e,Oh(e)),e=Y$,ki)e(t);else{ki=!0;try{kh(e,t)}finally{ki=!1,Ah()}}}}function X$(e,t,r){e==="focusin"?(z1(),vs=t,ys=r,vs.attachEvent("onpropertychange",j1)):e==="focusout"&&z1()}function G$(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pu(ys)}function q$(e,t){if(e==="click")return Pu(t)}function J$(e,t){if(e==="input"||e==="change")return Pu(t)}function Z$(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Or=typeof Object.is=="function"?Object.is:Z$,Q$=Object.prototype.hasOwnProperty;function bs(e,t){if(Or(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++)if(!Q$.call(t,r[n])||!Or(e[r[n]],t[r[n]]))return!1;return!0}function B1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function V1(e,t){var r=B1(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=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=B1(r)}}function U1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?U1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function H1(){for(var e=window,t=hu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=hu(e.document)}return t}function ep(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var e4=wn&&"documentMode"in document&&11>=document.documentMode,zo=null,tp=null,xs=null,rp=!1;function W1(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;rp||zo==null||zo!==hu(n)||(n=zo,"selectionStart"in n&&ep(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),xs&&bs(xs,n)||(xs=n,n=Ou(tp,"onSelect"),0<n.length&&(t=new Yh("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=zo)))}Bh("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Bh("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Bh(l$,2);for(var Y1="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),np=0;np<Y1.length;np++)jh.set(Y1[np],0);Mo("onMouseEnter",["mouseout","mouseover"]),Mo("onMouseLeave",["mouseout","mouseover"]),Mo("onPointerEnter",["pointerout","pointerover"]),Mo("onPointerLeave",["pointerout","pointerover"]),Pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ws="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),K1=new Set("cancel close invalid load scroll toggle".split(" ").concat(ws));function X1(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,n$(n,t,void 0,e),e.currentTarget=null}function G1(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var u=n.length-1;0<=u;u--){var o=n[u],a=o.instance,l=o.currentTarget;if(o=o.listener,a!==s&&i.isPropagationStopped())break e;X1(i,o,l),s=a}else for(u=0;u<n.length;u++){if(o=n[u],a=o.instance,l=o.currentTarget,o=o.listener,a!==s&&i.isPropagationStopped())break e;X1(i,o,l),s=a}}}if(mu)throw e=Rh,mu=!1,Rh=null,e}function et(e,t){var r=ax(t),n=e+"__bubble";r.has(n)||(Q1(t,e,2,!1),r.add(n))}var q1="_reactListening"+Math.random().toString(36).slice(2);function J1(e){e[q1]||(e[q1]=!0,Nb.forEach(function(t){K1.has(t)||Z1(t,!1,e,null),Z1(t,!0,e,null)}))}function Z1(e,t,r,n){var i=4<arguments.length&&arguments[4]!==void 0?arguments[4]:0,s=r;if(e==="selectionchange"&&r.nodeType!==9&&(s=r.ownerDocument),n!==null&&!t&&K1.has(e)){if(e!=="scroll")return;i|=2,s=n}var u=ax(s),o=e+"__"+(t?"capture":"bubble");u.has(o)||(t&&(i|=4),Q1(s,e,i,t),u.add(o))}function Q1(e,t,r,n){var i=jh.get(t);switch(i===void 0?2:i){case 0:i=v$;break;case 1:i=y$;break;default:i=Uh}r=i.bind(null,t,r,e),i=void 0,!Ih||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function ex(e,t,r,n,i){var s=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var u=n.tag;if(u===3||u===4){var o=n.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(u===4)for(u=n.return;u!==null;){var a=u.tag;if((a===3||a===4)&&(a=u.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;u=u.return}for(;o!==null;){if(u=Di(o),u===null)return;if(a=u.tag,a===5||a===6){n=s=u;continue e}o=o.parentNode}}n=n.return}Qk(function(){var l=s,h=Oh(r),c=[];e:{var f=_1.get(e);if(f!==void 0){var d=Yh,g=e;switch(e){case"keypress":if(Tu(r)===0)break e;case"keydown":case"keyup":d=A$;break;case"focusin":g="focus",d=Gh;break;case"focusout":g="blur",d=Gh;break;case"beforeblur":case"afterblur":d=Gh;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=P1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=w$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=F$;break;case b1:case x1:case w1:d=T$;break;case S1:d=N$;break;case"scroll":d=b$;break;case"wheel":d=j$;break;case"copy":case"cut":case"paste":d=E$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=M1}var m=(t&4)!==0,p=!m&&e==="scroll",v=m?f!==null?f+"Capture":null:f;m=[];for(var y=l,b;y!==null;){b=y;var x=b.stateNode;if(b.tag===5&&x!==null&&(b=x,v!==null&&(x=os(y,v),x!=null&&m.push(Ss(y,x,b)))),p)break;y=y.return}0<m.length&&(f=new d(f,g,null,r,h),c.push({event:f,listeners:m}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",f&&(t&16)===0&&(g=r.relatedTarget||r.fromElement)&&(Di(g)||g[Vo]))break e;if((d||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,d?(g=r.relatedTarget||r.toElement,d=l,g=g?Di(g):null,g!==null&&(p=$i(g),g!==p||g.tag!==5&&g.tag!==6)&&(g=null)):(d=null,g=l),d!==g)){if(m=P1,x="onMouseLeave",v="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=M1,x="onPointerLeave",v="onPointerEnter",y="pointer"),p=d==null?f:Uo(d),b=g==null?f:Uo(g),f=new m(x,y+"leave",d,r,h),f.target=p,f.relatedTarget=b,x=null,Di(h)===l&&(m=new m(v,y+"enter",g,r,h),m.target=b,m.relatedTarget=p,x=m),p=x,d&&g)t:{for(m=d,v=g,y=0,b=m;b;b=jo(b))y++;for(b=0,x=v;x;x=jo(x))b++;for(;0<y-b;)m=jo(m),y--;for(;0<b-y;)v=jo(v),b--;for(;y--;){if(m===v||v!==null&&m===v.alternate)break t;m=jo(m),v=jo(v)}m=null}else m=null;d!==null&&tx(c,f,d,m,!1),g!==null&&p!==null&&tx(c,p,g,m,!0)}}e:{if(f=l?Uo(l):window,d=f.nodeName&&f.nodeName.toLowerCase(),d==="select"||d==="input"&&f.type==="file")var w=K$;else if(R1(f))if(L1)w=J$;else{w=G$;var T=X$}else(d=f.nodeName)&&d.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(w=q$);if(w&&(w=w(e,l))){F1(c,w,r,h);break e}T&&T(e,f,l),e==="focusout"&&(T=f._wrapperState)&&T.controlled&&f.type==="number"&&wh(f,"number",f.value)}switch(T=l?Uo(l):window,e){case"focusin":(R1(T)||T.contentEditable==="true")&&(zo=T,tp=l,xs=null);break;case"focusout":xs=tp=zo=null;break;case"mousedown":rp=!0;break;case"contextmenu":case"mouseup":case"dragend":rp=!1,W1(c,r,h);break;case"selectionchange":if(e4)break;case"keydown":case"keyup":W1(c,r,h)}var _;if(Jh)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else No?A1(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(k1&&r.locale!=="ko"&&(No||E!=="onCompositionStart"?E==="onCompositionEnd"&&No&&(_=C1()):(Yn=h,Wh="value"in Yn?Yn.value:Yn.textContent,No=!0)),T=Ou(l,E),0<T.length&&(E=new O1(E,e,null,r,h),c.push({event:E,listeners:T}),_?E.data=_:(_=I1(r),_!==null&&(E.data=_)))),(_=V$?U$(e,r):H$(e,r))&&(l=Ou(l,"onBeforeInput"),0<l.length&&(h=new O1("onBeforeInput","beforeinput",null,r,h),c.push({event:h,listeners:l}),h.data=_))}G1(c,t)})}function Ss(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Ou(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=os(e,r),s!=null&&n.unshift(Ss(e,s,i)),s=os(e,t),s!=null&&n.push(Ss(e,s,i))),e=e.return}return n}function jo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function tx(e,t,r,n,i){for(var s=t._reactName,u=[];r!==null&&r!==n;){var o=r,a=o.alternate,l=o.stateNode;if(a!==null&&a===n)break;o.tag===5&&l!==null&&(o=l,i?(a=os(r,s),a!=null&&u.unshift(Ss(r,a,o))):i||(a=os(r,s),a!=null&&u.push(Ss(r,a,o)))),r=r.return}u.length!==0&&e.push({event:t,listeners:u})}function Mu(){}var ip=null,op=null;function rx(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function ap(e,t){return e==="textarea"||e==="option"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nx=typeof setTimeout=="function"?setTimeout:void 0,t4=typeof clearTimeout=="function"?clearTimeout:void 0;function sp(e){e.nodeType===1?e.textContent="":e.nodeType===9&&(e=e.body,e!=null&&(e.textContent=""))}function Bo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break}return e}function ix(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var lp=0;function r4(e){return{$$typeof:ph,toString:e,valueOf:e}}var ku=Math.random().toString(36).slice(2),Kn="__reactFiber$"+ku,$u="__reactProps$"+ku,Vo="__reactContainer$"+ku,ox="__reactEvents$"+ku;function Di(e){var t=e[Kn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Vo]||r[Kn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=ix(e);e!==null;){if(r=e[Kn])return r;e=ix(e)}return t}e=r,r=e.parentNode}return null}function _s(e){return e=e[Kn]||e[Vo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Uo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(de(33))}function Du(e){return e[$u]||null}function ax(e){var t=e[ox];return t===void 0&&(t=e[ox]=new Set),t}var up=[],Ho=-1;function Xn(e){return{current:e}}function tt(e){0>Ho||(e.current=up[Ho],up[Ho]=null,Ho--)}function lt(e,t){Ho++,up[Ho]=e.current,e.current=t}var Gn={},jt=Xn(Gn),or=Xn(!1),Ai=Gn;function Wo(e,t){var r=e.type.contextTypes;if(!r)return Gn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ar(e){return e=e.childContextTypes,e!=null}function Au(){tt(or),tt(jt)}function sx(e,t,r){if(jt.current!==Gn)throw Error(de(168));lt(jt,t),lt(or,r)}function lx(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(de(108,ko(t)||"Unknown",i));return nt({},r,n)}function Iu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gn,Ai=jt.current,lt(jt,e),lt(or,or.current),!0}function ux(e,t,r){var n=e.stateNode;if(!n)throw Error(de(169));r?(e=lx(e,t,Ai),n.__reactInternalMemoizedMergedChildContext=e,tt(or),tt(jt),lt(jt,e)):tt(or),lt(or,r)}var cp=null,Ii=null,n4=Ct.unstable_runWithPriority,fp=Ct.unstable_scheduleCallback,dp=Ct.unstable_cancelCallback,i4=Ct.unstable_shouldYield,cx=Ct.unstable_requestPaint,hp=Ct.unstable_now,o4=Ct.unstable_getCurrentPriorityLevel,Ru=Ct.unstable_ImmediatePriority,fx=Ct.unstable_UserBlockingPriority,dx=Ct.unstable_NormalPriority,hx=Ct.unstable_LowPriority,px=Ct.unstable_IdlePriority,pp={},a4=cx!==void 0?cx:function(){},Sn=null,Fu=null,gp=!1,gx=hp(),Bt=1e4>gx?hp:function(){return hp()-gx};function Yo(){switch(o4()){case Ru:return 99;case fx:return 98;case dx:return 97;case hx:return 96;case px:return 95;default:throw Error(de(332))}}function mx(e){switch(e){case 99:return Ru;case 98:return fx;case 97:return dx;case 96:return hx;case 95:return px;default:throw Error(de(332))}}function Ri(e,t){return e=mx(e),n4(e,t)}function Ts(e,t,r){return e=mx(e),fp(e,t,r)}function Jr(){if(Fu!==null){var e=Fu;Fu=null,dp(e)}vx()}function vx(){if(!gp&&Sn!==null){gp=!0;var e=0;try{var t=Sn;Ri(99,function(){for(;e<t.length;e++){var r=t[e];do r=r(!0);while(r!==null)}}),Sn=null}catch(r){throw Sn!==null&&(Sn=Sn.slice(e+1)),fp(Ru,Jr),r}finally{gp=!1}}}var s4=Oi.ReactCurrentBatchConfig;function zr(e,t){if(e&&e.defaultProps){t=nt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var Lu=Xn(null),Nu=null,Ko=null,zu=null;function mp(){zu=Ko=Nu=null}function vp(e){var t=Lu.current;tt(Lu),e.type._context._currentValue=t}function yx(e,t){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t){if(r===null||(r.childLanes&t)===t)break;r.childLanes|=t}else e.childLanes|=t,r!==null&&(r.childLanes|=t);e=e.return}}function Xo(e,t){Nu=e,zu=Ko=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(jr=!0),e.firstContext=null)}function Mr(e,t){if(zu!==e&&t!==!1&&t!==0)if((typeof t!="number"||t===1073741823)&&(zu=e,t=1073741823),t={context:e,observedBits:t,next:null},Ko===null){if(Nu===null)throw Error(de(308));Ko=t,Nu.dependencies={lanes:0,firstContext:t,responders:null}}else Ko=Ko.next=t;return e._currentValue}var qn=!1;function yp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function bx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Zn(e,t){if(e=e.updateQueue,e!==null){e=e.shared;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}}function xx(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var u={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=u:s=s.next=u,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Cs(e,t,r,n){var i=e.updateQueue;qn=!1;var s=i.firstBaseUpdate,u=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var a=o,l=a.next;a.next=null,u===null?s=l:u.next=l,u=a;var h=e.alternate;if(h!==null){h=h.updateQueue;var c=h.lastBaseUpdate;c!==u&&(c===null?h.firstBaseUpdate=l:c.next=l,h.lastBaseUpdate=a)}}if(s!==null){c=i.baseState,u=0,h=l=a=null;do{o=s.lane;var f=s.eventTime;if((n&o)===o){h!==null&&(h=h.next={eventTime:f,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var d=e,g=s;switch(o=t,f=r,g.tag){case 1:if(d=g.payload,typeof d=="function"){c=d.call(f,c,o);break e}c=d;break e;case 3:d.flags=d.flags&-4097|64;case 0:if(d=g.payload,o=typeof d=="function"?d.call(f,c,o):d,o==null)break e;c=nt({},c,o);break e;case 2:qn=!0}}s.callback!==null&&(e.flags|=32,o=i.effects,o===null?i.effects=[s]:o.push(s))}else f={eventTime:f,lane:o,tag:s.tag,payload:s.payload,callback:s.callback,next:null},h===null?(l=h=f,a=c):h=h.next=f,u|=o;if(s=s.next,s===null){if(o=i.shared.pending,o===null)break;s=o.next,o.next=null,i.lastBaseUpdate=o,i.shared.pending=null}}while(1);h===null&&(a=c),i.baseState=a,i.firstBaseUpdate=l,i.lastBaseUpdate=h,Ls|=u,e.lanes=u,e.memoizedState=c}}function wx(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(de(191,i));i.call(n)}}}var Sx=new su.Component().refs;function ju(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:nt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Bu={isMounted:function(e){return(e=e._reactInternals)?$i(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=mr(),i=ti(e),s=Jn(n,i);s.payload=t,r!=null&&(s.callback=r),Zn(e,s),ri(e,i,n)},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=mr(),i=ti(e),s=Jn(n,i);s.tag=1,s.payload=t,r!=null&&(s.callback=r),Zn(e,s),ri(e,i,n)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=mr(),n=ti(e),i=Jn(r,n);i.tag=2,t!=null&&(i.callback=t),Zn(e,i),ri(e,n,r)}};function _x(e,t,r,n,i,s,u){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,u):t.prototype&&t.prototype.isPureReactComponent?!bs(r,n)||!bs(i,s):!0}function Tx(e,t,r){var n=!1,i=Gn,s=t.contextType;return typeof s=="object"&&s!==null?s=Mr(s):(i=ar(t)?Ai:jt.current,n=t.contextTypes,s=(n=n!=null)?Wo(e,i):Gn),t=new t(r,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Bu,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Cx(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Bu.enqueueReplaceState(t,t.state,null)}function bp(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=Sx,yp(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Mr(s):(s=ar(t)?Ai:jt.current,i.context=Wo(e,s)),Cs(e,r,i,n),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(ju(e,t,s,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Bu.enqueueReplaceState(i,i.state,null),Cs(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4)}var Vu=Array.isArray;function Es(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(de(309));var n=r.stateNode}if(!n)throw Error(de(147,e));var i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var u=n.refs;u===Sx&&(u=n.refs={}),s===null?delete u[i]:u[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(de(284));if(!r._owner)throw Error(de(290,e))}return e}function Uu(e,t){if(e.type!=="textarea")throw Error(de(31,Object.prototype.toString.call(t)==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Ex(e){function t(p,v){if(e){var y=p.lastEffect;y!==null?(y.nextEffect=v,p.lastEffect=v):p.firstEffect=p.lastEffect=v,v.nextEffect=null,v.flags=8}}function r(p,v){if(!e)return null;for(;v!==null;)t(p,v),v=v.sibling;return null}function n(p,v){for(p=new Map;v!==null;)v.key!==null?p.set(v.key,v):p.set(v.index,v),v=v.sibling;return p}function i(p,v){return p=oi(p,v),p.index=0,p.sibling=null,p}function s(p,v,y){return p.index=y,e?(y=p.alternate,y!==null?(y=y.index,y<v?(p.flags=2,v):y):(p.flags=2,v)):v}function u(p){return e&&p.alternate===null&&(p.flags=2),p}function o(p,v,y,b){return v===null||v.tag!==6?(v=tg(y,p.mode,b),v.return=p,v):(v=i(v,y),v.return=p,v)}function a(p,v,y,b){return v!==null&&v.elementType===y.type?(b=i(v,y.props),b.ref=Es(p,v,y),b.return=p,b):(b=sc(y.type,y.key,y.props,null,p.mode,b),b.ref=Es(p,v,y),b.return=p,b)}function l(p,v,y,b){return v===null||v.tag!==4||v.stateNode.containerInfo!==y.containerInfo||v.stateNode.implementation!==y.implementation?(v=rg(y,p.mode,b),v.return=p,v):(v=i(v,y.children||[]),v.return=p,v)}function h(p,v,y,b,x){return v===null||v.tag!==7?(v=ra(y,p.mode,b,x),v.return=p,v):(v=i(v,y),v.return=p,v)}function c(p,v,y){if(typeof v=="string"||typeof v=="number")return v=tg(""+v,p.mode,y),v.return=p,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Za:return y=sc(v.type,v.key,v.props,null,p.mode,y),y.ref=Es(p,null,v),y.return=p,y;case Mi:return v=rg(v,p.mode,y),v.return=p,v}if(Vu(v)||ts(v))return v=ra(v,p.mode,y,null),v.return=p,v;Uu(p,v)}return null}function f(p,v,y,b){var x=v!==null?v.key:null;if(typeof y=="string"||typeof y=="number")return x!==null?null:o(p,v,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Za:return y.key===x?y.type===jn?h(p,v,y.props.children,b,x):a(p,v,y,b):null;case Mi:return y.key===x?l(p,v,y,b):null}if(Vu(y)||ts(y))return x!==null?null:h(p,v,y,b,null);Uu(p,y)}return null}function d(p,v,y,b,x){if(typeof b=="string"||typeof b=="number")return p=p.get(y)||null,o(v,p,""+b,x);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Za:return p=p.get(b.key===null?y:b.key)||null,b.type===jn?h(v,p,b.props.children,x,b.key):a(v,p,b,x);case Mi:return p=p.get(b.key===null?y:b.key)||null,l(v,p,b,x)}if(Vu(b)||ts(b))return p=p.get(y)||null,h(v,p,b,x,null);Uu(v,b)}return null}function g(p,v,y,b){for(var x=null,w=null,T=v,_=v=0,E=null;T!==null&&_<y.length;_++){T.index>_?(E=T,T=null):E=T.sibling;var k=f(p,T,y[_],b);if(k===null){T===null&&(T=E);break}e&&T&&k.alternate===null&&t(p,T),v=s(k,v,_),w===null?x=k:w.sibling=k,w=k,T=E}if(_===y.length)return r(p,T),x;if(T===null){for(;_<y.length;_++)T=c(p,y[_],b),T!==null&&(v=s(T,v,_),w===null?x=T:w.sibling=T,w=T);return x}for(T=n(p,T);_<y.length;_++)E=d(T,p,_,y[_],b),E!==null&&(e&&E.alternate!==null&&T.delete(E.key===null?_:E.key),v=s(E,v,_),w===null?x=E:w.sibling=E,w=E);return e&&T.forEach(function(z){return t(p,z)}),x}function m(p,v,y,b){var x=ts(y);if(typeof x!="function")throw Error(de(150));if(y=x.call(y),y==null)throw Error(de(151));for(var w=x=null,T=v,_=v=0,E=null,k=y.next();T!==null&&!k.done;_++,k=y.next()){T.index>_?(E=T,T=null):E=T.sibling;var z=f(p,T,k.value,b);if(z===null){T===null&&(T=E);break}e&&T&&z.alternate===null&&t(p,T),v=s(z,v,_),w===null?x=z:w.sibling=z,w=z,T=E}if(k.done)return r(p,T),x;if(T===null){for(;!k.done;_++,k=y.next())k=c(p,k.value,b),k!==null&&(v=s(k,v,_),w===null?x=k:w.sibling=k,w=k);return x}for(T=n(p,T);!k.done;_++,k=y.next())k=d(T,p,_,k.value,b),k!==null&&(e&&k.alternate!==null&&T.delete(k.key===null?_:k.key),v=s(k,v,_),w===null?x=k:w.sibling=k,w=k);return e&&T.forEach(function(F){return t(p,F)}),x}return function(p,v,y,b){var x=typeof y=="object"&&y!==null&&y.type===jn&&y.key===null;x&&(y=y.props.children);var w=typeof y=="object"&&y!==null;if(w)switch(y.$$typeof){case Za:e:{for(w=y.key,x=v;x!==null;){if(x.key===w){switch(x.tag){case 7:if(y.type===jn){r(p,x.sibling),v=i(x,y.props.children),v.return=p,p=v;break e}break;default:if(x.elementType===y.type){r(p,x.sibling),v=i(x,y.props),v.ref=Es(p,x,y),v.return=p,p=v;break e}}r(p,x);break}else t(p,x);x=x.sibling}y.type===jn?(v=ra(y.props.children,p.mode,b,y.key),v.return=p,p=v):(b=sc(y.type,y.key,y.props,null,p.mode,b),b.ref=Es(p,v,y),b.return=p,p=b)}return u(p);case Mi:e:{for(x=y.key;v!==null;){if(v.key===x)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){r(p,v.sibling),v=i(v,y.children||[]),v.return=p,p=v;break e}else{r(p,v);break}else t(p,v);v=v.sibling}v=rg(y,p.mode,b),v.return=p,p=v}return u(p)}if(typeof y=="string"||typeof y=="number")return y=""+y,v!==null&&v.tag===6?(r(p,v.sibling),v=i(v,y),v.return=p,p=v):(r(p,v),v=tg(y,p.mode,b),v.return=p,p=v),u(p);if(Vu(y))return g(p,v,y,b);if(ts(y))return m(p,v,y,b);if(w&&Uu(p,y),typeof y=="undefined"&&!x)switch(p.tag){case 1:case 22:case 0:case 11:case 15:throw Error(de(152,ko(p.type)||"Component"))}return r(p,v)}}var Hu=Ex(!0),Px=Ex(!1),Ps={},Zr=Xn(Ps),Os=Xn(Ps),Ms=Xn(Ps);function Fi(e){if(e===Ps)throw Error(de(174));return e}function xp(e,t){switch(lt(Ms,t),lt(Os,e),lt(Zr,Ps),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ch(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ch(t,e)}tt(Zr),lt(Zr,t)}function Go(){tt(Zr),tt(Os),tt(Ms)}function Ox(e){Fi(Ms.current);var t=Fi(Zr.current),r=Ch(t,e.type);t!==r&&(lt(Os,e),lt(Zr,r))}function wp(e){Os.current===e&&(tt(Zr),tt(Os))}var ut=Xn(0);function Wu(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&64)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _n=null,Qn=null,Qr=!1;function Mx(e,t){var r=Dr(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=t,r.return=e,r.flags=8,e.lastEffect!==null?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function kx(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,!0):!1;case 13:return!1;default:return!1}}function Sp(e){if(Qr){var t=Qn;if(t){var r=t;if(!kx(e,t)){if(t=Bo(r.nextSibling),!t||!kx(e,t)){e.flags=e.flags&-1025|2,Qr=!1,_n=e;return}Mx(_n,r)}_n=e,Qn=Bo(t.firstChild)}else e.flags=e.flags&-1025|2,Qr=!1,_n=e}}function $x(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_n=e}function Yu(e){if(e!==_n)return!1;if(!Qr)return $x(e),Qr=!0,!1;var t=e.type;if(e.tag!==5||t!=="head"&&t!=="body"&&!ap(t,e.memoizedProps))for(t=Qn;t;)Mx(e,t),t=Bo(t.nextSibling);if($x(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(de(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Qn=Bo(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Qn=null}}else Qn=_n?Bo(e.stateNode.nextSibling):null;return!0}function _p(){Qn=_n=null,Qr=!1}var qo=[];function Tp(){for(var e=0;e<qo.length;e++)qo[e]._workInProgressVersionPrimary=null;qo.length=0}var ks=Oi.ReactCurrentDispatcher,kr=Oi.ReactCurrentBatchConfig,$s=0,dt=null,Vt=null,Rt=null,Ku=!1,Ds=!1;function sr(){throw Error(de(321))}function Cp(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Or(e[r],t[r]))return!1;return!0}function Ep(e,t,r,n,i,s){if($s=s,dt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ks.current=e===null||e.memoizedState===null?u4:c4,e=r(n,i),Ds){s=0;do{if(Ds=!1,!(25>s))throw Error(de(301));s+=1,Rt=Vt=null,t.updateQueue=null,ks.current=f4,e=r(n,i)}while(Ds)}if(ks.current=Ju,t=Vt!==null&&Vt.next!==null,$s=0,Rt=Vt=dt=null,Ku=!1,t)throw Error(de(300));return e}function Li(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?dt.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function Ni(){if(Vt===null){var e=dt.alternate;e=e!==null?e.memoizedState:null}else e=Vt.next;var t=Rt===null?dt.memoizedState:Rt.next;if(t!==null)Rt=t,Vt=e;else{if(e===null)throw Error(de(310));Vt=e,e={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Rt===null?dt.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function en(e,t){return typeof t=="function"?t(e):t}function As(e){var t=Ni(),r=t.queue;if(r===null)throw Error(de(311));r.lastRenderedReducer=e;var n=Vt,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var u=i.next;i.next=s.next,s.next=u}n.baseQueue=i=s,r.pending=null}if(i!==null){i=i.next,n=n.baseState;var o=u=s=null,a=i;do{var l=a.lane;if(($s&l)===l)o!==null&&(o=o.next={lane:0,action:a.action,eagerReducer:a.eagerReducer,eagerState:a.eagerState,next:null}),n=a.eagerReducer===e?a.eagerState:e(n,a.action);else{var h={lane:l,action:a.action,eagerReducer:a.eagerReducer,eagerState:a.eagerState,next:null};o===null?(u=o=h,s=n):o=o.next=h,dt.lanes|=l,Ls|=l}a=a.next}while(a!==null&&a!==i);o===null?s=n:o.next=u,Or(n,t.memoizedState)||(jr=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=o,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function Is(e){var t=Ni(),r=t.queue;if(r===null)throw Error(de(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,s=t.memoizedState;if(i!==null){r.pending=null;var u=i=i.next;do s=e(s,u.action),u=u.next;while(u!==i);Or(s,t.memoizedState)||(jr=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),r.lastRenderedState=s}return[s,n]}function Dx(e,t,r){var n=t._getVersion;n=n(t._source);var i=t._workInProgressVersionPrimary;if(i!==null?e=i===n:(e=e.mutableReadLanes,(e=($s&e)===e)&&(t._workInProgressVersionPrimary=n,qo.push(t))),e)return r(t._source);throw qo.push(t),Error(de(350))}function Ax(e,t,r,n){var i=Jt;if(i===null)throw Error(de(349));var s=t._getVersion,u=s(t._source),o=ks.current,a=o.useState(function(){return Dx(i,t,r)}),l=a[1],h=a[0];a=Rt;var c=e.memoizedState,f=c.refs,d=f.getSnapshot,g=c.source;c=c.subscribe;var m=dt;return e.memoizedState={refs:f,source:t,subscribe:n},o.useEffect(function(){f.getSnapshot=r,f.setSnapshot=l;var p=s(t._source);if(!Or(u,p)){p=r(t._source),Or(h,p)||(l(p),p=ti(m),i.mutableReadLanes|=p&i.pendingLanes),p=i.mutableReadLanes,i.entangledLanes|=p;for(var v=i.entanglements,y=p;0<y;){var b=31-Wn(y),x=1<<b;v[b]|=p,y&=~x}}},[r,t,n]),o.useEffect(function(){return n(t._source,function(){var p=f.getSnapshot,v=f.setSnapshot;try{v(p(t._source));var y=ti(m);i.mutableReadLanes|=y&i.pendingLanes}catch(b){v(function(){throw b})}})},[t,n]),Or(d,r)&&Or(g,t)&&Or(c,n)||(e={pending:null,dispatch:null,lastRenderedReducer:en,lastRenderedState:h},e.dispatch=l=kp.bind(null,dt,e),a.queue=e,a.baseQueue=null,h=Dx(i,t,r),a.memoizedState=a.baseState=h),h}function Ix(e,t,r){var n=Ni();return Ax(n,e,t,r)}function Rs(e){var t=Li();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e=t.queue={pending:null,dispatch:null,lastRenderedReducer:en,lastRenderedState:e},e=e.dispatch=kp.bind(null,dt,e),[t.memoizedState,e]}function Xu(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=dt.updateQueue,t===null?(t={lastEffect:null},dt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Rx(e){var t=Li();return e={current:e},t.memoizedState=e}function Gu(){return Ni().memoizedState}function Pp(e,t,r,n){var i=Li();dt.flags|=e,i.memoizedState=Xu(1|t,r,void 0,n===void 0?null:n)}function Op(e,t,r,n){var i=Ni();n=n===void 0?null:n;var s=void 0;if(Vt!==null){var u=Vt.memoizedState;if(s=u.destroy,n!==null&&Cp(n,u.deps)){Xu(t,r,s,n);return}}dt.flags|=e,i.memoizedState=Xu(1|t,r,s,n)}function Fx(e,t){return Pp(516,4,e,t)}function qu(e,t){return Op(516,4,e,t)}function Lx(e,t){return Op(4,2,e,t)}function Nx(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zx(e,t,r){return r=r!=null?r.concat([e]):null,Op(4,2,Nx.bind(null,t,e),r)}function Mp(){}function jx(e,t){var r=Ni();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Cp(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Bx(e,t){var r=Ni();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Cp(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function l4(e,t){var r=Yo();Ri(98>r?98:r,function(){e(!0)}),Ri(97<r?97:r,function(){var n=kr.transition;kr.transition=1;try{e(!1),t()}finally{kr.transition=n}})}function kp(e,t,r){var n=mr(),i=ti(e),s={lane:i,action:r,eagerReducer:null,eagerState:null,next:null},u=t.pending;if(u===null?s.next=s:(s.next=u.next,u.next=s),t.pending=s,u=e.alternate,e===dt||u!==null&&u===dt)Ds=Ku=!0;else{if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var o=t.lastRenderedState,a=u(o,r);if(s.eagerReducer=u,s.eagerState=a,Or(a,o))return}catch{}finally{}ri(e,i,n)}}var Ju={readContext:Mr,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useOpaqueIdentifier:sr,unstable_isNewReconciler:!1},u4={readContext:Mr,useCallback:function(e,t){return Li().memoizedState=[e,t===void 0?null:t],e},useContext:Mr,useEffect:Fx,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Pp(4,2,Nx.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Pp(4,2,e,t)},useMemo:function(e,t){var r=Li();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Li();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},e=e.dispatch=kp.bind(null,dt,e),[n.memoizedState,e]},useRef:Rx,useState:Rs,useDebugValue:Mp,useDeferredValue:function(e){var t=Rs(e),r=t[0],n=t[1];return Fx(function(){var i=kr.transition;kr.transition=1;try{n(e)}finally{kr.transition=i}},[e]),r},useTransition:function(){var e=Rs(!1),t=e[0];return e=l4.bind(null,e[1]),Rx(e),[e,t]},useMutableSource:function(e,t,r){var n=Li();return n.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:r},Ax(n,e,t,r)},useOpaqueIdentifier:function(){if(Qr){var e=!1,t=r4(function(){throw e||(e=!0,r("r:"+(lp++).toString(36))),Error(de(355))}),r=Rs(t)[1];return(dt.mode&2)===0&&(dt.flags|=516,Xu(5,function(){r("r:"+(lp++).toString(36))},void 0,null)),t}return t="r:"+(lp++).toString(36),Rs(t),t},unstable_isNewReconciler:!1},c4={readContext:Mr,useCallback:jx,useContext:Mr,useEffect:qu,useImperativeHandle:zx,useLayoutEffect:Lx,useMemo:Bx,useReducer:As,useRef:Gu,useState:function(){return As(en)},useDebugValue:Mp,useDeferredValue:function(e){var t=As(en),r=t[0],n=t[1];return qu(function(){var i=kr.transition;kr.transition=1;try{n(e)}finally{kr.transition=i}},[e]),r},useTransition:function(){var e=As(en)[0];return[Gu().current,e]},useMutableSource:Ix,useOpaqueIdentifier:function(){return As(en)[0]},unstable_isNewReconciler:!1},f4={readContext:Mr,useCallback:jx,useContext:Mr,useEffect:qu,useImperativeHandle:zx,useLayoutEffect:Lx,useMemo:Bx,useReducer:Is,useRef:Gu,useState:function(){return Is(en)},useDebugValue:Mp,useDeferredValue:function(e){var t=Is(en),r=t[0],n=t[1];return qu(function(){var i=kr.transition;kr.transition=1;try{n(e)}finally{kr.transition=i}},[e]),r},useTransition:function(){var e=Is(en)[0];return[Gu().current,e]},useMutableSource:Ix,useOpaqueIdentifier:function(){return Is(en)[0]},unstable_isNewReconciler:!1},d4=Oi.ReactCurrentOwner,jr=!1;function lr(e,t,r,n){t.child=e===null?Px(t,null,r,n):Hu(t,e.child,r,n)}function Vx(e,t,r,n,i){r=r.render;var s=t.ref;return Xo(t,i),n=Ep(e,t,r,n,s,i),e!==null&&!jr?(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,Tn(e,t,i)):(t.flags|=1,lr(e,t,n,i),t.child)}function Ux(e,t,r,n,i,s){if(e===null){var u=r.type;return typeof u=="function"&&!Qp(u)&&u.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=u,Hx(e,t,u,n,i,s)):(e=sc(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}return u=e.child,(i&s)===0&&(i=u.memoizedProps,r=r.compare,r=r!==null?r:bs,r(i,n)&&e.ref===t.ref)?Tn(e,t,s):(t.flags|=1,e=oi(u,n),e.ref=t.ref,e.return=t,t.child=e)}function Hx(e,t,r,n,i,s){if(e!==null&&bs(e.memoizedProps,n)&&e.ref===t.ref)if(jr=!1,(s&i)!==0)(e.flags&16384)!==0&&(jr=!0);else return t.lanes=e.lanes,Tn(e,t,s);return Dp(e,t,r,n,s)}function $p(e,t,r){var n=t.pendingProps,i=n.children,s=e!==null?e.memoizedState:null;if(n.mode==="hidden"||n.mode==="unstable-defer-without-hiding")if((t.mode&4)===0)t.memoizedState={baseLanes:0},ac(t,r);else if((r&1073741824)!==0)t.memoizedState={baseLanes:0},ac(t,s!==null?s.baseLanes:r);else return e=s!==null?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},ac(t,e),null;else s!==null?(n=s.baseLanes|r,t.memoizedState=null):n=r,ac(t,n);return lr(e,t,i,r),t.child}function Wx(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=128)}function Dp(e,t,r,n,i){var s=ar(r)?Ai:jt.current;return s=Wo(t,s),Xo(t,i),r=Ep(e,t,r,n,s,i),e!==null&&!jr?(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,Tn(e,t,i)):(t.flags|=1,lr(e,t,r,i),t.child)}function Yx(e,t,r,n,i){if(ar(r)){var s=!0;Iu(t)}else s=!1;if(Xo(t,i),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),Tx(t,r,n),bp(t,r,n,i),n=!0;else if(e===null){var u=t.stateNode,o=t.memoizedProps;u.props=o;var a=u.context,l=r.contextType;typeof l=="object"&&l!==null?l=Mr(l):(l=ar(r)?Ai:jt.current,l=Wo(t,l));var h=r.getDerivedStateFromProps,c=typeof h=="function"||typeof u.getSnapshotBeforeUpdate=="function";c||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(o!==n||a!==l)&&Cx(t,u,n,l),qn=!1;var f=t.memoizedState;u.state=f,Cs(t,n,u,i),a=t.memoizedState,o!==n||f!==a||or.current||qn?(typeof h=="function"&&(ju(t,r,h,n),a=t.memoizedState),(o=qn||_x(t,r,o,n,f,a,l))?(c||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4)):(typeof u.componentDidMount=="function"&&(t.flags|=4),t.memoizedProps=n,t.memoizedState=a),u.props=n,u.state=a,u.context=l,n=o):(typeof u.componentDidMount=="function"&&(t.flags|=4),n=!1)}else{u=t.stateNode,bx(e,t),o=t.memoizedProps,l=t.type===t.elementType?o:zr(t.type,o),u.props=l,c=t.pendingProps,f=u.context,a=r.contextType,typeof a=="object"&&a!==null?a=Mr(a):(a=ar(r)?Ai:jt.current,a=Wo(t,a));var d=r.getDerivedStateFromProps;(h=typeof d=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(o!==c||f!==a)&&Cx(t,u,n,a),qn=!1,f=t.memoizedState,u.state=f,Cs(t,n,u,i);var g=t.memoizedState;o!==c||f!==g||or.current||qn?(typeof d=="function"&&(ju(t,r,d,n),g=t.memoizedState),(l=qn||_x(t,r,l,n,f,g,a))?(h||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(n,g,a),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(n,g,a)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=256)):(typeof u.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),t.memoizedProps=n,t.memoizedState=g),u.props=n,u.state=g,u.context=a,n=l):(typeof u.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),n=!1)}return Ap(e,t,r,n,s,i)}function Ap(e,t,r,n,i,s){Wx(e,t);var u=(t.flags&64)!==0;if(!n&&!u)return i&&ux(t,r,!1),Tn(e,t,s);n=t.stateNode,d4.current=t;var o=u&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&u?(t.child=Hu(t,e.child,null,s),t.child=Hu(t,null,o,s)):lr(e,t,o,s),t.memoizedState=n.state,i&&ux(t,r,!0),t.child}function Kx(e){var t=e.stateNode;t.pendingContext?sx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sx(e,t.context,!1),xp(e,t.containerInfo)}var Zu={dehydrated:null,retryLane:0};function Xx(e,t,r){var n=t.pendingProps,i=ut.current,s=!1,u;return(u=(t.flags&64)!==0)||(u=e!==null&&e.memoizedState===null?!1:(i&2)!==0),u?(s=!0,t.flags&=-65):e!==null&&e.memoizedState===null||n.fallback===void 0||n.unstable_avoidThisFallback===!0||(i|=1),lt(ut,i&1),e===null?(n.fallback!==void 0&&Sp(t),e=n.children,i=n.fallback,s?(e=Gx(t,e,i,r),t.child.memoizedState={baseLanes:r},t.memoizedState=Zu,e):typeof n.unstable_expectedLoadTime=="number"?(e=Gx(t,e,i,r),t.child.memoizedState={baseLanes:r},t.memoizedState=Zu,t.lanes=33554432,e):(r=eg({mode:"visible",children:e},t.mode,r,null),r.return=t,t.child=r)):e.memoizedState!==null?s?(n=Jx(e,t,n.children,n.fallback,r),s=t.child,i=e.child.memoizedState,s.memoizedState=i===null?{baseLanes:r}:{baseLanes:i.baseLanes|r},s.childLanes=e.childLanes&~r,t.memoizedState=Zu,n):(r=qx(e,t,n.children,r),t.memoizedState=null,r):s?(n=Jx(e,t,n.children,n.fallback,r),s=t.child,i=e.child.memoizedState,s.memoizedState=i===null?{baseLanes:r}:{baseLanes:i.baseLanes|r},s.childLanes=e.childLanes&~r,t.memoizedState=Zu,n):(r=qx(e,t,n.children,r),t.memoizedState=null,r)}function Gx(e,t,r,n){var i=e.mode,s=e.child;return t={mode:"hidden",children:t},(i&2)===0&&s!==null?(s.childLanes=0,s.pendingProps=t):s=eg(t,i,0,null),r=ra(r,i,n,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r}function qx(e,t,r,n){var i=e.child;return e=i.sibling,r=oi(i,{mode:"visible",children:r}),(t.mode&2)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=r}function Jx(e,t,r,n,i){var s=t.mode,u=e.child;e=u.sibling;var o={mode:"hidden",children:r};return(s&2)===0&&t.child!==u?(r=t.child,r.childLanes=0,r.pendingProps=o,u=r.lastEffect,u!==null?(t.firstEffect=r.firstEffect,t.lastEffect=u,u.nextEffect=null):t.firstEffect=t.lastEffect=null):r=oi(u,o),e!==null?n=oi(e,n):(n=ra(n,s,i,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,n}function Zx(e,t){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),yx(e.return,t)}function Ip(e,t,r,n,i,s){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i,lastEffect:s}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=n,u.tail=r,u.tailMode=i,u.lastEffect=s)}function Qx(e,t,r){var n=t.pendingProps,i=n.revealOrder,s=n.tail;if(lr(e,t,n.children,r),n=ut.current,(n&2)!==0)n=n&1|2,t.flags|=64;else{if(e!==null&&(e.flags&64)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zx(e,r);else if(e.tag===19)Zx(e,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(lt(ut,n),(t.mode&2)===0)t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Wu(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Ip(t,!1,i,r,s,t.lastEffect);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Wu(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Ip(t,!0,r,null,s,t.lastEffect);break;case"together":Ip(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Tn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ls|=t.lanes,(r&t.childLanes)!==0){if(e!==null&&t.child!==e.child)throw Error(de(153));if(t.child!==null){for(e=t.child,r=oi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=oi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}return null}var ew,Rp,tw,rw;ew=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Rp=function(){},tw=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Fi(Zr.current);var s=null;switch(r){case"input":i=bh(e,i),n=bh(e,n),s=[];break;case"option":i=Sh(e,i),n=Sh(e,n),s=[];break;case"select":i=nt({},i,{value:void 0}),n=nt({},n,{value:void 0}),s=[];break;case"textarea":i=_h(e,i),n=_h(e,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Mu)}Eh(r,n);var u;r=null;for(l in i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var o=i[l];for(u in o)o.hasOwnProperty(u)&&(r||(r={}),r[u]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Ja.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in n){var a=n[l];if(o=i!=null?i[l]:void 0,n.hasOwnProperty(l)&&a!==o&&(a!=null||o!=null))if(l==="style")if(o){for(u in o)!o.hasOwnProperty(u)||a&&a.hasOwnProperty(u)||(r||(r={}),r[u]="");for(u in a)a.hasOwnProperty(u)&&o[u]!==a[u]&&(r||(r={}),r[u]=a[u])}else r||(s||(s=[]),s.push(l,r)),r=a;else l==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,o=o?o.__html:void 0,a!=null&&o!==a&&(s=s||[]).push(l,a)):l==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(l,""+a):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(Ja.hasOwnProperty(l)?(a!=null&&l==="onScroll"&&et("scroll",e),s||o===a||(s=[])):typeof a=="object"&&a!==null&&a.$$typeof===ph?a.toString():(s=s||[]).push(l,a))}r&&(s=s||[]).push("style",r);var l=s;(t.updateQueue=l)&&(t.flags|=4)}},rw=function(e,t,r,n){r!==n&&(t.flags|=4)};function Fs(e,t){if(!Qr)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function h4(e,t,r){var n=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return ar(t.type)&&Au(),null;case 3:return Go(),tt(or),tt(jt),Tp(),n=t.stateNode,n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Yu(t)?t.flags|=4:n.hydrate||(t.flags|=256)),Rp(t),null;case 5:wp(t);var i=Fi(Ms.current);if(r=t.type,e!==null&&t.stateNode!=null)tw(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=128);else{if(!n){if(t.stateNode===null)throw Error(de(166));return null}if(e=Fi(Zr.current),Yu(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[Kn]=t,n[$u]=s,r){case"dialog":et("cancel",n),et("close",n);break;case"iframe":case"object":case"embed":et("load",n);break;case"video":case"audio":for(e=0;e<ws.length;e++)et(ws[e],n);break;case"source":et("error",n);break;case"img":case"image":case"link":et("error",n),et("load",n);break;case"details":et("toggle",n);break;case"input":Yb(n,s),et("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},et("invalid",n);break;case"textarea":Gb(n,s),et("invalid",n)}Eh(r,s),e=null;for(var u in s)s.hasOwnProperty(u)&&(i=s[u],u==="children"?typeof i=="string"?n.textContent!==i&&(e=["children",i]):typeof i=="number"&&n.textContent!==""+i&&(e=["children",""+i]):Ja.hasOwnProperty(u)&&i!=null&&u==="onScroll"&&et("scroll",n));switch(r){case"input":du(n),Xb(n,s,!0);break;case"textarea":du(n),Jb(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=Mu)}n=e,t.updateQueue=n,n!==null&&(t.flags|=4)}else{switch(u=i.nodeType===9?i:i.ownerDocument,e===Th.html&&(e=Zb(r)),e===Th.html?r==="script"?(e=u.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=u.createElement(r,{is:n.is}):(e=u.createElement(r),r==="select"&&(u=e,n.multiple?u.multiple=!0:n.size&&(u.size=n.size))):e=u.createElementNS(e,r),e[Kn]=t,e[$u]=n,ew(e,t,!1,!1),t.stateNode=e,u=Ph(r,n),r){case"dialog":et("cancel",e),et("close",e),i=n;break;case"iframe":case"object":case"embed":et("load",e),i=n;break;case"video":case"audio":for(i=0;i<ws.length;i++)et(ws[i],e);i=n;break;case"source":et("error",e),i=n;break;case"img":case"image":case"link":et("error",e),et("load",e),i=n;break;case"details":et("toggle",e),i=n;break;case"input":Yb(e,n),i=bh(e,n),et("invalid",e);break;case"option":i=Sh(e,n);break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=nt({},n,{value:void 0}),et("invalid",e);break;case"textarea":Gb(e,n),i=_h(e,n),et("invalid",e);break;default:i=n}Eh(r,i);var o=i;for(s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="style"?t1(e,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Qb(e,a)):s==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&ns(e,a):typeof a=="number"&&ns(e,""+a):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ja.hasOwnProperty(s)?a!=null&&s==="onScroll"&&et("scroll",e):a!=null&&lh(e,s,a,u))}switch(r){case"input":du(e),Xb(e,n,!1);break;case"textarea":du(e),Jb(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Bn(n.value));break;case"select":e.multiple=!!n.multiple,s=n.value,s!=null?$o(e,!!n.multiple,s,!1):n.defaultValue!=null&&$o(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Mu)}rx(r,n)&&(t.flags|=4)}t.ref!==null&&(t.flags|=128)}return null;case 6:if(e&&t.stateNode!=null)rw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(de(166));r=Fi(Ms.current),Fi(Zr.current),Yu(t)?(n=t.stateNode,r=t.memoizedProps,n[Kn]=t,n.nodeValue!==r&&(t.flags|=4)):(n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Kn]=t,t.stateNode=n)}return null;case 13:return tt(ut),n=t.memoizedState,(t.flags&64)!==0?(t.lanes=r,t):(n=n!==null,r=!1,e===null?t.memoizedProps.fallback!==void 0&&Yu(t):r=e.memoizedState!==null,n&&!r&&(t.mode&2)!==0&&(e===null&&t.memoizedProps.unstable_avoidThisFallback!==!0||(ut.current&1)!==0?Ft===0&&(Ft=3):((Ft===0||Ft===3)&&(Ft=4),Jt===null||(Ls&134217727)===0&&(Zo&134217727)===0||ea(Jt,Ut))),(n||r)&&(t.flags|=4),null);case 4:return Go(),Rp(t),e===null&&J1(t.stateNode.containerInfo),null;case 10:return vp(t),null;case 17:return ar(t.type)&&Au(),null;case 19:if(tt(ut),n=t.memoizedState,n===null)return null;if(s=(t.flags&64)!==0,u=n.rendering,u===null)if(s)Fs(n,!1);else{if(Ft!==0||e!==null&&(e.flags&64)!==0)for(e=t.child;e!==null;){if(u=Wu(e),u!==null){for(t.flags|=64,Fs(n,!1),s=u.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),n.lastEffect===null&&(t.firstEffect=null),t.lastEffect=n.lastEffect,n=r,r=t.child;r!==null;)s=r,e=n,s.flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,u=s.alternate,u===null?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,e=u.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return lt(ut,ut.current&1|2),t.child}e=e.sibling}n.tail!==null&&Bt()>Yp&&(t.flags|=64,s=!0,Fs(n,!1),t.lanes=33554432)}else{if(!s)if(e=Wu(u),e!==null){if(t.flags|=64,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Fs(n,!0),n.tail===null&&n.tailMode==="hidden"&&!u.alternate&&!Qr)return t=t.lastEffect=n.lastEffect,t!==null&&(t.nextEffect=null),null}else 2*Bt()-n.renderingStartTime>Yp&&r!==1073741824&&(t.flags|=64,s=!0,Fs(n,!1),t.lanes=33554432);n.isBackwards?(u.sibling=t.child,t.child=u):(r=n.last,r!==null?r.sibling=u:t.child=u,n.last=u)}return n.tail!==null?(r=n.tail,n.rendering=r,n.tail=r.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=Bt(),r.sibling=null,t=ut.current,lt(ut,s?t&1|2:t&1),r):null;case 23:case 24:return Zp(),e!==null&&e.memoizedState!==null!=(t.memoizedState!==null)&&n.mode!=="unstable-defer-without-hiding"&&(t.flags|=4),null}throw Error(de(156,t.tag))}function p4(e){switch(e.tag){case 1:ar(e.type)&&Au();var t=e.flags;return t&4096?(e.flags=t&-4097|64,e):null;case 3:if(Go(),tt(or),tt(jt),Tp(),t=e.flags,(t&64)!==0)throw Error(de(285));return e.flags=t&-4097|64,e;case 5:return wp(e),null;case 13:return tt(ut),t=e.flags,t&4096?(e.flags=t&-4097|64,e):null;case 19:return tt(ut),null;case 4:return Go(),null;case 10:return vp(e),null;case 23:case 24:return Zp(),null;default:return null}}function Fp(e,t){try{var r="",n=t;do r+=Xk(n),n=n.return;while(n);var i=r}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:i}}function Lp(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var g4=typeof WeakMap=="function"?WeakMap:Map;function nw(e,t,r){r=Jn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){tc||(tc=!0,Kp=n),Lp(e,t)},r}function iw(e,t,r){r=Jn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return Lp(e,t),n(i)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){typeof n!="function"&&(tn===null?tn=new Set([this]):tn.add(this),Lp(e,t));var u=t.stack;this.componentDidCatch(t.value,{componentStack:u!==null?u:""})}),r}var m4=typeof WeakSet=="function"?WeakSet:Set;function ow(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){ii(e,r)}else t.current=null}function v4(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.flags&256&&e!==null){var r=e.memoizedProps,n=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?r:zr(t.type,r),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:t.flags&256&&sp(t.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(de(163))}function y4(e,t,r){switch(r.tag){case 0:case 11:case 15:case 22:if(t=r.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{if((e.tag&3)===3){var n=e.create;e.destroy=n()}e=e.next}while(e!==t)}if(t=r.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{var i=e;n=i.next,i=i.tag,(i&4)!==0&&(i&1)!==0&&(xw(r,e),E4(r,e)),e=n}while(e!==t)}return;case 1:e=r.stateNode,r.flags&4&&(t===null?e.componentDidMount():(n=r.elementType===r.type?t.memoizedProps:zr(r.type,t.memoizedProps),e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),t=r.updateQueue,t!==null&&wx(r,t,e);return;case 3:if(t=r.updateQueue,t!==null){if(e=null,r.child!==null)switch(r.child.tag){case 5:e=r.child.stateNode;break;case 1:e=r.child.stateNode}wx(r,t,e)}return;case 5:e=r.stateNode,t===null&&r.flags&4&&rx(r.type,r.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:r.memoizedState===null&&(r=r.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&v1(r))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(de(163))}function aw(e,t){for(var r=e;;){if(r.tag===5){var n=r.stateNode;if(t)n=n.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none";else{n=r.stateNode;var i=r.memoizedProps.style;i=i!=null&&i.hasOwnProperty("display")?i.display:null,n.style.display=e1("display",i)}}else if(r.tag===6)r.stateNode.nodeValue=t?"":r.memoizedProps;else if((r.tag!==23&&r.tag!==24||r.memoizedState===null||r===e)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function sw(e,t){if(Ii&&typeof Ii.onCommitFiberUnmount=="function")try{Ii.onCommitFiberUnmount(cp,t)}catch{}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var r=e=e.next;do{var n=r,i=n.destroy;if(n=n.tag,i!==void 0)if((n&4)!==0)xw(t,r);else{n=t;try{i()}catch(s){ii(n,s)}}r=r.next}while(r!==e)}break;case 1:if(ow(t),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(s){ii(t,s)}break;case 5:ow(t);break;case 4:fw(e,t)}}function lw(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function uw(e){return e.tag===5||e.tag===3||e.tag===4}function cw(e){e:{for(var t=e.return;t!==null;){if(uw(t))break e;t=t.return}throw Error(de(160))}var r=t;switch(t=r.stateNode,r.tag){case 5:var n=!1;break;case 3:t=t.containerInfo,n=!0;break;case 4:t=t.containerInfo,n=!0;break;default:throw Error(de(161))}r.flags&16&&(ns(t,""),r.flags&=-17);e:t:for(r=e;;){for(;r.sibling===null;){if(r.return===null||uw(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue t;r.child.return=r,r=r.child}if(!(r.flags&2)){r=r.stateNode;break e}}n?Np(e,r,t):zp(e,r,t)}function Np(e,t,r){var n=e.tag,i=n===5||n===6;if(i)e=i?e.stateNode:e.stateNode.instance,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Mu));else if(n!==4&&(e=e.child,e!==null))for(Np(e,t,r),e=e.sibling;e!==null;)Np(e,t,r),e=e.sibling}function zp(e,t,r){var n=e.tag,i=n===5||n===6;if(i)e=i?e.stateNode:e.stateNode.instance,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(zp(e,t,r),e=e.sibling;e!==null;)zp(e,t,r),e=e.sibling}function fw(e,t){for(var r=t,n=!1,i,s;;){if(!n){n=r.return;e:for(;;){if(n===null)throw Error(de(160));switch(i=n.stateNode,n.tag){case 5:s=!1;break e;case 3:i=i.containerInfo,s=!0;break e;case 4:i=i.containerInfo,s=!0;break e}n=n.return}n=!0}if(r.tag===5||r.tag===6){e:for(var u=e,o=r,a=o;;)if(sw(u,a),a.child!==null&&a.tag!==4)a.child.return=a,a=a.child;else{if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}s?(u=i,o=r.stateNode,u.nodeType===8?u.parentNode.removeChild(o):u.removeChild(o)):i.removeChild(r.stateNode)}else if(r.tag===4){if(r.child!==null){i=r.stateNode.containerInfo,s=!0,r.child.return=r,r=r.child;continue}}else if(sw(e,r),r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return,r.tag===4&&(n=!1)}r.sibling.return=r.return,r=r.sibling}}function jp(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var n=r=r.next;do(n.tag&3)===3&&(e=n.destroy,n.destroy=void 0,e!==void 0&&e()),n=n.next;while(n!==r)}return;case 1:return;case 5:if(r=t.stateNode,r!=null){n=t.memoizedProps;var i=e!==null?e.memoizedProps:n;e=t.type;var s=t.updateQueue;if(t.updateQueue=null,s!==null){for(r[$u]=n,e==="input"&&n.type==="radio"&&n.name!=null&&Kb(r,n),Ph(e,i),t=Ph(e,n),i=0;i<s.length;i+=2){var u=s[i],o=s[i+1];u==="style"?t1(r,o):u==="dangerouslySetInnerHTML"?Qb(r,o):u==="children"?ns(r,o):lh(r,u,o,t)}switch(e){case"input":xh(r,n);break;case"textarea":qb(r,n);break;case"select":e=r._wrapperState.wasMultiple,r._wrapperState.wasMultiple=!!n.multiple,s=n.value,s!=null?$o(r,!!n.multiple,s,!1):e!==!!n.multiple&&(n.defaultValue!=null?$o(r,!!n.multiple,n.defaultValue,!0):$o(r,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(t.stateNode===null)throw Error(de(162));t.stateNode.nodeValue=t.memoizedProps;return;case 3:r=t.stateNode,r.hydrate&&(r.hydrate=!1,v1(r.containerInfo));return;case 12:return;case 13:t.memoizedState!==null&&(Wp=Bt(),aw(t.child,!0)),dw(t);return;case 19:dw(t);return;case 17:return;case 23:case 24:aw(t,t.memoizedState!==null);return}throw Error(de(163))}function dw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new m4),t.forEach(function(n){var i=M4.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function b4(e,t){return e!==null&&(e=e.memoizedState,e===null||e.dehydrated!==null)?(t=t.memoizedState,t!==null&&t.dehydrated===null):!1}var x4=Math.ceil,Qu=Oi.ReactCurrentDispatcher,Bp=Oi.ReactCurrentOwner,$e=0,Jt=null,yt=null,Ut=0,zi=0,Vp=Xn(0),Ft=0,ec=null,Jo=0,Ls=0,Zo=0,Up=0,Hp=null,Wp=0,Yp=1/0;function Qo(){Yp=Bt()+500}var xe=null,tc=!1,Kp=null,tn=null,ei=!1,Ns=null,zs=90,Xp=[],Gp=[],Cn=null,js=0,qp=null,rc=-1,En=0,nc=0,Bs=null,ic=!1;function mr(){return($e&48)!==0?Bt():rc!==-1?rc:rc=Bt()}function ti(e){if(e=e.mode,(e&2)===0)return 1;if((e&4)===0)return Yo()===99?1:2;if(En===0&&(En=Jo),s4.transition!==0){nc!==0&&(nc=Hp!==null?Hp.pendingLanes:0),e=En;var t=4186112&~nc;return t&=-t,t===0&&(e=4186112&~e,t=e&-e,t===0&&(t=8192)),t}return e=Yo(),($e&4)!==0&&e===98?e=xu(12,En):(e=c$(e),e=xu(e,En)),e}function ri(e,t,r){if(50<js)throw js=0,qp=null,Error(de(185));if(e=oc(e,t),e===null)return null;wu(e,t,r),e===Jt&&(Zo|=t,Ft===4&&ea(e,Ut));var n=Yo();t===1?($e&8)!==0&&($e&48)===0?Jp(e):($r(e,r),$e===0&&(Qo(),Jr())):(($e&4)===0||n!==98&&n!==99||(Cn===null?Cn=new Set([e]):Cn.add(e)),$r(e,r)),Hp=e}function oc(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}function $r(e,t){for(var r=e.callbackNode,n=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,u=e.pendingLanes;0<u;){var o=31-Wn(u),a=1<<o,l=s[o];if(l===-1){if((a&n)===0||(a&i)!==0){l=t,Ro(a);var h=Ze;s[o]=10<=h?l+250:6<=h?l+5e3:-1}}else l<=t&&(e.expiredLanes|=a);u&=~a}if(n=hs(e,e===Jt?Ut:0),t=Ze,n===0)r!==null&&(r!==pp&&dp(r),e.callbackNode=null,e.callbackPriority=0);else{if(r!==null){if(e.callbackPriority===t)return;r!==pp&&dp(r)}t===15?(r=Jp.bind(null,e),Sn===null?(Sn=[r],Fu=fp(Ru,vx)):Sn.push(r),r=pp):t===14?r=Ts(99,Jp.bind(null,e)):(r=f$(t),r=Ts(r,hw.bind(null,e))),e.callbackPriority=t,e.callbackNode=r}}function hw(e){if(rc=-1,nc=En=0,($e&48)!==0)throw Error(de(327));var t=e.callbackNode;if(ni()&&e.callbackNode!==t)return null;var r=hs(e,e===Jt?Ut:0);if(r===0)return null;var n=r,i=$e;$e|=16;var s=vw();(Jt!==e||Ut!==n)&&(Qo(),ta(e,n));do try{_4();break}catch(o){mw(e,o)}while(1);if(mp(),Qu.current=s,$e=i,yt!==null?n=0:(Jt=null,Ut=0,n=Ft),(Jo&Zo)!==0)ta(e,0);else if(n!==0){if(n===2&&($e|=64,e.hydrate&&(e.hydrate=!1,sp(e.containerInfo)),r=T1(e),r!==0&&(n=Vs(e,r))),n===1)throw t=ec,ta(e,0),ea(e,r),$r(e,Bt()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=r,n){case 0:case 1:throw Error(de(345));case 2:ji(e);break;case 3:if(ea(e,r),(r&62914560)===r&&(n=Wp+500-Bt(),10<n)){if(hs(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){mr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=nx(ji.bind(null,e),n);break}ji(e);break;case 4:if(ea(e,r),(r&4186112)===r)break;for(n=e.eventTimes,i=-1;0<r;){var u=31-Wn(r);s=1<<u,u=n[u],u>i&&(i=u),r&=~s}if(r=i,r=Bt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*x4(r/1960))-r,10<r){e.timeoutHandle=nx(ji.bind(null,e),r);break}ji(e);break;case 5:ji(e);break;default:throw Error(de(329))}}return $r(e,Bt()),e.callbackNode===t?hw.bind(null,e):null}function ea(e,t){for(t&=~Up,t&=~Zo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Wn(t),n=1<<r;e[r]=-1,t&=~n}}function Jp(e){if(($e&48)!==0)throw Error(de(327));if(ni(),e===Jt&&(e.expiredLanes&Ut)!==0){var t=Ut,r=Vs(e,t);(Jo&Zo)!==0&&(t=hs(e,t),r=Vs(e,t))}else t=hs(e,0),r=Vs(e,t);if(e.tag!==0&&r===2&&($e|=64,e.hydrate&&(e.hydrate=!1,sp(e.containerInfo)),t=T1(e),t!==0&&(r=Vs(e,t))),r===1)throw r=ec,ta(e,0),ea(e,t),$r(e,Bt()),r;return e.finishedWork=e.current.alternate,e.finishedLanes=t,ji(e),$r(e,Bt()),null}function w4(){if(Cn!==null){var e=Cn;Cn=null,e.forEach(function(t){t.expiredLanes|=24&t.pendingLanes,$r(t,Bt())})}Jr()}function pw(e,t){var r=$e;$e|=1;try{return e(t)}finally{$e=r,$e===0&&(Qo(),Jr())}}function gw(e,t){var r=$e;$e&=-2,$e|=8;try{return e(t)}finally{$e=r,$e===0&&(Qo(),Jr())}}function ac(e,t){lt(Vp,zi),zi|=t,Jo|=t}function Zp(){zi=Vp.current,tt(Vp)}function ta(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,t4(r)),yt!==null)for(r=yt.return;r!==null;){var n=r;switch(n.tag){case 1:n=n.type.childContextTypes,n!=null&&Au();break;case 3:Go(),tt(or),tt(jt),Tp();break;case 5:wp(n);break;case 4:Go();break;case 13:tt(ut);break;case 19:tt(ut);break;case 10:vp(n);break;case 23:case 24:Zp()}r=r.return}Jt=e,yt=oi(e.current,null),Ut=zi=Jo=t,Ft=0,ec=null,Up=Zo=Ls=0}function mw(e,t){do{var r=yt;try{if(mp(),ks.current=Ju,Ku){for(var n=dt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Ku=!1}if($s=0,Rt=Vt=dt=null,Ds=!1,Bp.current=null,r===null||r.return===null){Ft=1,ec=t,yt=null;break}e:{var s=e,u=r.return,o=r,a=t;if(t=Ut,o.flags|=2048,o.firstEffect=o.lastEffect=null,a!==null&&typeof a=="object"&&typeof a.then=="function"){var l=a;if((o.mode&2)===0){var h=o.alternate;h?(o.updateQueue=h.updateQueue,o.memoizedState=h.memoizedState,o.lanes=h.lanes):(o.updateQueue=null,o.memoizedState=null)}var c=(ut.current&1)!==0,f=u;do{var d;if(d=f.tag===13){var g=f.memoizedState;if(g!==null)d=g.dehydrated!==null;else{var m=f.memoizedProps;d=m.fallback===void 0?!1:m.unstable_avoidThisFallback!==!0?!0:!c}}if(d){var p=f.updateQueue;if(p===null){var v=new Set;v.add(l),f.updateQueue=v}else p.add(l);if((f.mode&2)===0){if(f.flags|=64,o.flags|=16384,o.flags&=-2981,o.tag===1)if(o.alternate===null)o.tag=17;else{var y=Jn(-1,1);y.tag=2,Zn(o,y)}o.lanes|=1;break e}a=void 0,o=t;var b=s.pingCache;if(b===null?(b=s.pingCache=new g4,a=new Set,b.set(l,a)):(a=b.get(l),a===void 0&&(a=new Set,b.set(l,a))),!a.has(o)){a.add(o);var x=O4.bind(null,s,l,o);l.then(x,x)}f.flags|=4096,f.lanes=t;break e}f=f.return}while(f!==null);a=Error((ko(o.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.

Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Ft!==5&&(Ft=2),a=Fp(a,o),f=u;do{switch(f.tag){case 3:s=a,f.flags|=4096,t&=-t,f.lanes|=t;var w=nw(f,s,t);xx(f,w);break e;case 1:s=a;var T=f.type,_=f.stateNode;if((f.flags&64)===0&&(typeof T.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(tn===null||!tn.has(_)))){f.flags|=4096,t&=-t,f.lanes|=t;var E=iw(f,s,t);xx(f,E);break e}}f=f.return}while(f!==null)}bw(r)}catch(k){t=k,yt===r&&r!==null&&(yt=r=r.return);continue}break}while(1)}function vw(){var e=Qu.current;return Qu.current=Ju,e===null?Ju:e}function Vs(e,t){var r=$e;$e|=16;var n=vw();Jt===e&&Ut===t||ta(e,t);do try{S4();break}catch(i){mw(e,i)}while(1);if(mp(),$e=r,Qu.current=n,yt!==null)throw Error(de(261));return Jt=null,Ut=0,Ft}function S4(){for(;yt!==null;)yw(yt)}function _4(){for(;yt!==null&&!i4();)yw(yt)}function yw(e){var t=Sw(e.alternate,e,zi);e.memoizedProps=e.pendingProps,t===null?bw(e):yt=t,Bp.current=null}function bw(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&2048)===0){if(r=h4(r,t,zi),r!==null){yt=r;return}if(r=t,r.tag!==24&&r.tag!==23||r.memoizedState===null||(zi&1073741824)!==0||(r.mode&4)===0){for(var n=0,i=r.child;i!==null;)n|=i.lanes|i.childLanes,i=i.sibling;r.childLanes=n}e!==null&&(e.flags&2048)===0&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(e.lastEffect!==null?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(r=p4(t),r!==null){r.flags&=2047,yt=r;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);Ft===0&&(Ft=5)}function ji(e){var t=Yo();return Ri(99,T4.bind(null,e,t)),null}function T4(e,t){do ni();while(Ns!==null);if(($e&48)!==0)throw Error(de(327));var r=e.finishedWork;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(de(177));e.callbackNode=null;var n=r.lanes|r.childLanes,i=n,s=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var u=e.eventTimes,o=e.expirationTimes;0<s;){var a=31-Wn(s),l=1<<a;i[a]=0,u[a]=-1,o[a]=-1,s&=~l}if(Cn!==null&&(n&24)===0&&Cn.has(e)&&Cn.delete(e),e===Jt&&(yt=Jt=null,Ut=0),1<r.flags?r.lastEffect!==null?(r.lastEffect.nextEffect=r,n=r.firstEffect):n=r:n=r.firstEffect,n!==null){if(i=$e,$e|=32,Bp.current=null,ip=Su,u=H1(),ep(u)){if("selectionStart"in u)o={start:u.selectionStart,end:u.selectionEnd};else e:if(o=(o=u.ownerDocument)&&o.defaultView||window,(l=o.getSelection&&o.getSelection())&&l.rangeCount!==0){o=l.anchorNode,s=l.anchorOffset,a=l.focusNode,l=l.focusOffset;try{o.nodeType,a.nodeType}catch{o=null;break e}var h=0,c=-1,f=-1,d=0,g=0,m=u,p=null;t:for(;;){for(var v;m!==o||s!==0&&m.nodeType!==3||(c=h+s),m!==a||l!==0&&m.nodeType!==3||(f=h+l),m.nodeType===3&&(h+=m.nodeValue.length),(v=m.firstChild)!==null;)p=m,m=v;for(;;){if(m===u)break t;if(p===o&&++d===s&&(c=h),p===a&&++g===l&&(f=h),(v=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=v}o=c===-1||f===-1?null:{start:c,end:f}}else o=null;o=o||{start:0,end:0}}else o=null;op={focusedElem:u,selectionRange:o},Su=!1,Bs=null,ic=!1,xe=n;do try{C4()}catch(k){if(xe===null)throw Error(de(330));ii(xe,k),xe=xe.nextEffect}while(xe!==null);Bs=null,xe=n;do try{for(u=e;xe!==null;){var y=xe.flags;if(y&16&&ns(xe.stateNode,""),y&128){var b=xe.alternate;if(b!==null){var x=b.ref;x!==null&&(typeof x=="function"?x(null):x.current=null)}}switch(y&1038){case 2:cw(xe),xe.flags&=-3;break;case 6:cw(xe),xe.flags&=-3,jp(xe.alternate,xe);break;case 1024:xe.flags&=-1025;break;case 1028:xe.flags&=-1025,jp(xe.alternate,xe);break;case 4:jp(xe.alternate,xe);break;case 8:o=xe,fw(u,o);var w=o.alternate;lw(o),w!==null&&lw(w)}xe=xe.nextEffect}}catch(k){if(xe===null)throw Error(de(330));ii(xe,k),xe=xe.nextEffect}while(xe!==null);if(x=op,b=H1(),y=x.focusedElem,u=x.selectionRange,b!==y&&y&&y.ownerDocument&&U1(y.ownerDocument.documentElement,y)){for(u!==null&&ep(y)&&(b=u.start,x=u.end,x===void 0&&(x=b),"selectionStart"in y?(y.selectionStart=b,y.selectionEnd=Math.min(x,y.value.length)):(x=(b=y.ownerDocument||document)&&b.defaultView||window,x.getSelection&&(x=x.getSelection(),o=y.textContent.length,w=Math.min(u.start,o),u=u.end===void 0?w:Math.min(u.end,o),!x.extend&&w>u&&(o=u,u=w,w=o),o=V1(y,w),s=V1(y,u),o&&s&&(x.rangeCount!==1||x.anchorNode!==o.node||x.anchorOffset!==o.offset||x.focusNode!==s.node||x.focusOffset!==s.offset)&&(b=b.createRange(),b.setStart(o.node,o.offset),x.removeAllRanges(),w>u?(x.addRange(b),x.extend(s.node,s.offset)):(b.setEnd(s.node,s.offset),x.addRange(b)))))),b=[],x=y;x=x.parentNode;)x.nodeType===1&&b.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<b.length;y++)x=b[y],x.element.scrollLeft=x.left,x.element.scrollTop=x.top}Su=!!ip,op=ip=null,e.current=r,xe=n;do try{for(y=e;xe!==null;){var T=xe.flags;if(T&36&&y4(y,xe.alternate,xe),T&128){b=void 0;var _=xe.ref;if(_!==null){var E=xe.stateNode;switch(xe.tag){case 5:b=E;break;default:b=E}typeof _=="function"?_(b):_.current=b}}xe=xe.nextEffect}}catch(k){if(xe===null)throw Error(de(330));ii(xe,k),xe=xe.nextEffect}while(xe!==null);xe=null,a4(),$e=i}else e.current=r;if(ei)ei=!1,Ns=e,zs=t;else for(xe=n;xe!==null;)t=xe.nextEffect,xe.nextEffect=null,xe.flags&8&&(T=xe,T.sibling=null,T.stateNode=null),xe=t;if(n=e.pendingLanes,n===0&&(tn=null),n===1?e===qp?js++:(js=0,qp=e):js=0,r=r.stateNode,Ii&&typeof Ii.onCommitFiberRoot=="function")try{Ii.onCommitFiberRoot(cp,r,void 0,(r.current.flags&64)===64)}catch{}if($r(e,Bt()),tc)throw tc=!1,e=Kp,Kp=null,e;return($e&8)!==0||Jr(),null}function C4(){for(;xe!==null;){var e=xe.alternate;ic||Bs===null||((xe.flags&8)!==0?c1(xe,Bs)&&(ic=!0):xe.tag===13&&b4(e,xe)&&c1(xe,Bs)&&(ic=!0));var t=xe.flags;(t&256)!==0&&v4(e,xe),(t&512)===0||ei||(ei=!0,Ts(97,function(){return ni(),null})),xe=xe.nextEffect}}function ni(){if(zs!==90){var e=97<zs?97:zs;return zs=90,Ri(e,P4)}return!1}function E4(e,t){Xp.push(t,e),ei||(ei=!0,Ts(97,function(){return ni(),null}))}function xw(e,t){Gp.push(t,e),ei||(ei=!0,Ts(97,function(){return ni(),null}))}function P4(){if(Ns===null)return!1;var e=Ns;if(Ns=null,($e&48)!==0)throw Error(de(331));var t=$e;$e|=32;var r=Gp;Gp=[];for(var n=0;n<r.length;n+=2){var i=r[n],s=r[n+1],u=i.destroy;if(i.destroy=void 0,typeof u=="function")try{u()}catch(a){if(s===null)throw Error(de(330));ii(s,a)}}for(r=Xp,Xp=[],n=0;n<r.length;n+=2){i=r[n],s=r[n+1];try{var o=i.create;i.destroy=o()}catch(a){if(s===null)throw Error(de(330));ii(s,a)}}for(o=e.current.firstEffect;o!==null;)e=o.nextEffect,o.nextEffect=null,o.flags&8&&(o.sibling=null,o.stateNode=null),o=e;return $e=t,Jr(),!0}function ww(e,t,r){t=Fp(r,t),t=nw(e,t,1),Zn(e,t),t=mr(),e=oc(e,1),e!==null&&(wu(e,1,t),$r(e,t))}function ii(e,t){if(e.tag===3)ww(e,e,t);else for(var r=e.return;r!==null;){if(r.tag===3){ww(r,e,t);break}else if(r.tag===1){var n=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(tn===null||!tn.has(n))){e=Fp(t,e);var i=iw(r,e,1);if(Zn(r,i),i=mr(),r=oc(r,1),r!==null)wu(r,1,i),$r(r,i);else if(typeof n.componentDidCatch=="function"&&(tn===null||!tn.has(n)))try{n.componentDidCatch(t,e)}catch{}break}}r=r.return}}function O4(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=mr(),e.pingedLanes|=e.suspendedLanes&r,Jt===e&&(Ut&r)===r&&(Ft===4||Ft===3&&(Ut&62914560)===Ut&&500>Bt()-Wp?ta(e,0):Up|=r),$r(e,t)}function M4(e,t){var r=e.stateNode;r!==null&&r.delete(t),t=0,t===0&&(t=e.mode,(t&2)===0?t=1:(t&4)===0?t=Yo()===99?1:2:(En===0&&(En=Jo),t=Fo(62914560&~En),t===0&&(t=4194304))),r=mr(),e=oc(e,t),e!==null&&(wu(e,t,r),$r(e,r))}var Sw;Sw=function(e,t,r){var n=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||or.current)jr=!0;else if((r&n)!==0)jr=(e.flags&16384)!==0;else{switch(jr=!1,t.tag){case 3:Kx(t),_p();break;case 5:Ox(t);break;case 1:ar(t.type)&&Iu(t);break;case 4:xp(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value;var i=t.type._context;lt(Lu,i._currentValue),i._currentValue=n;break;case 13:if(t.memoizedState!==null)return(r&t.child.childLanes)!==0?Xx(e,t,r):(lt(ut,ut.current&1),t=Tn(e,t,r),t!==null?t.sibling:null);lt(ut,ut.current&1);break;case 19:if(n=(r&t.childLanes)!==0,(e.flags&64)!==0){if(n)return Qx(e,t,r);t.flags|=64}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),lt(ut,ut.current),n)break;return null;case 23:case 24:return t.lanes=0,$p(e,t,r)}return Tn(e,t,r)}else jr=!1;switch(t.lanes=0,t.tag){case 2:if(n=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=Wo(t,jt.current),Xo(t,r),i=Ep(null,t,n,e,i,r),t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ar(n)){var s=!0;Iu(t)}else s=!1;t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,yp(t);var u=n.getDerivedStateFromProps;typeof u=="function"&&ju(t,n,u,e),i.updater=Bu,t.stateNode=i,i._reactInternals=t,bp(t,n,e,r),t=Ap(null,t,n,!0,s,r)}else t.tag=0,lr(null,t,i,r),t=t.child;return t;case 16:i=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=$4(i),e=zr(i,e),s){case 0:t=Dp(null,t,i,e,r);break e;case 1:t=Yx(null,t,i,e,r);break e;case 11:t=Vx(null,t,i,e,r);break e;case 14:t=Ux(null,t,i,zr(i.type,e),n,r);break e}throw Error(de(306,i,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:zr(n,i),Dp(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:zr(n,i),Yx(e,t,n,i,r);case 3:if(Kx(t),n=t.updateQueue,e===null||n===null)throw Error(de(282));if(n=t.pendingProps,i=t.memoizedState,i=i!==null?i.element:null,bx(e,t),Cs(t,n,null,r),n=t.memoizedState.element,n===i)_p(),t=Tn(e,t,r);else{if(i=t.stateNode,(s=i.hydrate)&&(Qn=Bo(t.stateNode.containerInfo.firstChild),_n=t,s=Qr=!0),s){if(e=i.mutableSourceEagerHydrationData,e!=null)for(i=0;i<e.length;i+=2)s=e[i],s._workInProgressVersionPrimary=e[i+1],qo.push(s);for(r=Px(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|1024,r=r.sibling}else lr(e,t,n,r),_p();t=t.child}return t;case 5:return Ox(t),e===null&&Sp(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,u=i.children,ap(n,i)?u=null:s!==null&&ap(n,s)&&(t.flags|=16),Wx(e,t),lr(e,t,u,r),t.child;case 6:return e===null&&Sp(t),null;case 13:return Xx(e,t,r);case 4:return xp(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hu(t,null,n,r):lr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:zr(n,i),Vx(e,t,n,i,r);case 7:return lr(e,t,t.pendingProps,r),t.child;case 8:return lr(e,t,t.pendingProps.children,r),t.child;case 12:return lr(e,t,t.pendingProps.children,r),t.child;case 10:e:{n=t.type._context,i=t.pendingProps,u=t.memoizedProps,s=i.value;var o=t.type._context;if(lt(Lu,o._currentValue),o._currentValue=s,u!==null)if(o=u.value,s=Or(o,s)?0:(typeof n._calculateChangedBits=="function"?n._calculateChangedBits(o,s):1073741823)|0,s===0){if(u.children===i.children&&!or.current){t=Tn(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){u=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n&&(l.observedBits&s)!==0){o.tag===1&&(l=Jn(-1,r&-r),l.tag=2,Zn(o,l)),o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),yx(o.return,r),a.lanes|=r;break}l=l.next}}else u=o.tag===10&&o.type===t.type?null:o.child;if(u!==null)u.return=o;else for(u=o;u!==null;){if(u===t){u=null;break}if(o=u.sibling,o!==null){o.return=u.return,u=o;break}u=u.return}o=u}lr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,s=t.pendingProps,n=s.children,Xo(t,r),i=Mr(i,s.unstable_observedBits),n=n(i),t.flags|=1,lr(e,t,n,r),t.child;case 14:return i=t.type,s=zr(i,t.pendingProps),s=zr(i.type,s),Ux(e,t,i,s,n,r);case 15:return Hx(e,t,t.type,t.pendingProps,n,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:zr(n,i),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,ar(n)?(e=!0,Iu(t)):e=!1,Xo(t,r),Tx(t,n,i),bp(t,n,i,r),Ap(null,t,n,!0,e,r);case 19:return Qx(e,t,r);case 23:return $p(e,t,r);case 24:return $p(e,t,r)}throw Error(de(156,t.tag))};function k4(e,t,r,n){this.tag=e,this.key=r,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=n,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Dr(e,t,r,n){return new k4(e,t,r,n)}function Qp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $4(e){if(typeof e=="function")return Qp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lu)return 11;if(e===cu)return 14}return 2}function oi(e,t){var r=e.alternate;return r===null?(r=Dr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function sc(e,t,r,n,i,s){var u=2;if(n=e,typeof e=="function")Qp(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case jn:return ra(r.children,i,s,t);case Vb:u=8,i|=16;break;case uh:u=8,i|=1;break;case Qa:return e=Dr(12,r,t,i|8),e.elementType=Qa,e.type=Qa,e.lanes=s,e;case es:return e=Dr(13,r,t,i),e.type=es,e.elementType=es,e.lanes=s,e;case uu:return e=Dr(19,r,t,i),e.elementType=uu,e.lanes=s,e;case gh:return eg(r,i,s,t);case mh:return e=Dr(24,r,t,i),e.elementType=mh,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ch:u=10;break e;case fh:u=9;break e;case lu:u=11;break e;case cu:u=14;break e;case dh:u=16,n=null;break e;case hh:u=22;break e}throw Error(de(130,e==null?e:typeof e,""))}return t=Dr(u,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function ra(e,t,r,n){return e=Dr(7,e,n,t),e.lanes=r,e}function eg(e,t,r,n){return e=Dr(23,e,n,t),e.elementType=gh,e.lanes=r,e}function tg(e,t,r){return e=Dr(6,e,null,t),e.lanes=r,e}function rg(e,t,r){return t=Dr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function D4(e,t,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=r,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Vh(0),this.expirationTimes=Vh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vh(0),this.mutableSourceEagerHydrationData=null}function A4(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Mi,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function lc(e,t,r,n){var i=t.current,s=mr(),u=ti(i);e:if(r){r=r._reactInternals;t:{if($i(r)!==r||r.tag!==1)throw Error(de(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break t;case 1:if(ar(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break t}}o=o.return}while(o!==null);throw Error(de(171))}if(r.tag===1){var a=r.type;if(ar(a)){r=lx(r,a,o);break e}}r=o}else r=Gn;return t.context===null?t.context=r:t.pendingContext=r,t=Jn(s,u),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),Zn(i,t),ri(i,u,s),u}function ng(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function _w(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ig(e,t){_w(e,t),(e=e.alternate)&&_w(e,t)}function I4(){return null}function og(e,t,r){var n=r!=null&&r.hydrationOptions!=null&&r.hydrationOptions.mutableSources||null;if(r=new D4(e,t,r!=null&&r.hydrate===!0),t=Dr(3,null,null,t===2?7:t===1?3:0),r.current=t,t.stateNode=r,yp(t),e[Vo]=r.current,J1(e.nodeType===8?e.parentNode:e),n)for(e=0;e<n.length;e++){t=n[e];var i=t._getVersion;i=i(t._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[t,i]:r.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=r}og.prototype.render=function(e){lc(e,this._internalRoot,null,null)},og.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;lc(null,e,null,function(){t[Vo]=null})};function Us(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function R4(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var r;r=e.lastChild;)e.removeChild(r);return new og(e,0,t?{hydrate:!0}:void 0)}function uc(e,t,r,n,i){var s=r._reactRootContainer;if(s){var u=s._internalRoot;if(typeof i=="function"){var o=i;i=function(){var l=ng(u);o.call(l)}}lc(t,u,e,i)}else{if(s=r._reactRootContainer=R4(r,n),u=s._internalRoot,typeof i=="function"){var a=i;i=function(){var l=ng(u);a.call(l)}}gw(function(){lc(t,u,e,i)})}return ng(u)}f1=function(e){if(e.tag===13){var t=mr();ri(e,4,t),ig(e,4)}},Fh=function(e){if(e.tag===13){var t=mr();ri(e,67108864,t),ig(e,67108864)}},d1=function(e){if(e.tag===13){var t=mr(),r=ti(e);ri(e,r,t),ig(e,r)}},h1=function(e,t){return t()},Mh=function(e,t,r){switch(t){case"input":if(xh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=Du(n);if(!i)throw Error(de(90));Wb(n),xh(n,i)}}}break;case"textarea":qb(e,r);break;case"select":t=r.value,t!=null&&$o(e,!!r.multiple,t,!1)}},kh=pw,o1=function(e,t,r,n,i){var s=$e;$e|=4;try{return Ri(98,e.bind(null,t,r,n,i))}finally{$e=s,$e===0&&(Qo(),Jr())}},$h=function(){($e&49)===0&&(w4(),ni())},a1=function(e,t){var r=$e;$e|=2;try{return e(t)}finally{$e=r,$e===0&&(Qo(),Jr())}};function Tw(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Us(t))throw Error(de(200));return A4(e,t,null,r)}var F4={Events:[_s,Uo,Du,n1,i1,ni,{current:!1}]},Hs={findFiberByHostInstance:Di,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},L4={bundleType:Hs.bundleType,version:Hs.version,rendererPackageName:Hs.rendererPackageName,rendererConfig:Hs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Oi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=u1(e),e===null?null:e.stateNode},findFiberByHostInstance:Hs.findFiberByHostInstance||I4,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var cc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cc.isDisabled&&cc.supportsFiber)try{cp=cc.inject(L4),Ii=cc}catch{}}Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F4,Pr.createPortal=Tw,Pr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(de(188)):Error(de(268,Object.keys(e)));return e=u1(t),e=e===null?null:e.stateNode,e},Pr.flushSync=function(e,t){var r=$e;if((r&48)!==0)return e(t);$e|=1;try{if(e)return Ri(99,e.bind(null,t))}finally{$e=r,Jr()}},Pr.hydrate=function(e,t,r){if(!Us(t))throw Error(de(200));return uc(null,e,t,!0,r)},Pr.render=function(e,t,r){if(!Us(t))throw Error(de(200));return uc(null,e,t,!1,r)},Pr.unmountComponentAtNode=function(e){if(!Us(e))throw Error(de(40));return e._reactRootContainer?(gw(function(){uc(null,null,e,!1,function(){e._reactRootContainer=null,e[Vo]=null})}),!0):!1},Pr.unstable_batchedUpdates=pw,Pr.unstable_createPortal=function(e,t){return Tw(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)},Pr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Us(r))throw Error(de(200));if(e==null||e._reactInternals===void 0)throw Error(de(38));return uc(e,t,r,!1,n)},Pr.version="17.0.2";function Cw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Cw)}catch(e){console.error(e)}}Cw(),Rb.exports=Pr;var fc=Rb.exports,N4=function(t){return z4(t)&&!j4(t)};function z4(e){return!!e&&typeof e=="object"}function j4(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||U4(e)}var B4=typeof Symbol=="function"&&Symbol.for,V4=B4?Symbol.for("react.element"):60103;function U4(e){return e.$$typeof===V4}function H4(e){return Array.isArray(e)?[]:{}}function Ws(e,t){return t.clone!==!1&&t.isMergeableObject(e)?na(H4(e),e,t):e}function W4(e,t,r){return e.concat(t).map(function(n){return Ws(n,r)})}function Y4(e,t){if(!t.customMerge)return na;var r=t.customMerge(e);return typeof r=="function"?r:na}function K4(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}function Ew(e){return Object.keys(e).concat(K4(e))}function Pw(e,t){try{return t in e}catch{return!1}}function X4(e,t){return Pw(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function G4(e,t,r){var n={};return r.isMergeableObject(e)&&Ew(e).forEach(function(i){n[i]=Ws(e[i],r)}),Ew(t).forEach(function(i){X4(e,i)||(Pw(e,i)&&r.isMergeableObject(t[i])?n[i]=Y4(i,r)(e[i],t[i],r):n[i]=Ws(t[i],r))}),n}function na(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||W4,r.isMergeableObject=r.isMergeableObject||N4,r.cloneUnlessOtherwiseSpecified=Ws;var n=Array.isArray(t),i=Array.isArray(e),s=n===i;return s?n?r.arrayMerge(e,t,r):G4(e,t,r):Ws(t,r)}na.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return na(n,i,r)},{})};var q4=na,Ow=q4;function J4(e,t){t===void 0&&(t={});var r=t.insertAt;if(!(!e||typeof document=="undefined")){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",r==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}function ag(e,t){return t===void 0&&(t=15),+parseFloat(Number(e).toPrecision(t))}function rn(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function Ys(e){if(e.toString().indexOf("e")===-1)return Number(e.toString().replace(".",""));var t=rn(e);return t>0?ag(Number(e)*Math.pow(10,t)):Number(e)}function sg(e){$w&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&console.warn(e+" is beyond boundary when transfer to integer, the results may not be accurate")}function dc(e,t){var r=e[0],n=e[1],i=e.slice(2),s=t(r,n);return i.forEach(function(u){s=t(s,u)}),s}function Pn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length>2)return dc(e,Pn);var r=e[0],n=e[1],i=Ys(r),s=Ys(n),u=rn(r)+rn(n),o=i*s;return sg(o),o/Math.pow(10,u)}function Mw(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length>2)return dc(e,Mw);var r=e[0],n=e[1],i=Math.pow(10,Math.max(rn(r),rn(n)));return(Pn(r,i)+Pn(n,i))/i}function kw(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length>2)return dc(e,kw);var r=e[0],n=e[1],i=Math.pow(10,Math.max(rn(r),rn(n)));return(Pn(r,i)-Pn(n,i))/i}function lg(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length>2)return dc(e,lg);var r=e[0],n=e[1],i=Ys(r),s=Ys(n);return sg(i),sg(s),Pn(i/s,ag(Math.pow(10,rn(n)-rn(r))))}function Z4(e,t){var r=Math.pow(10,t),n=lg(Math.round(Math.abs(Pn(e,r))),r);return e<0&&n!==0&&(n=Pn(n,-1)),n}var $w=!0;function Q4(e){e===void 0&&(e=!0),$w=e}var ug={strip:ag,plus:Mw,minus:kw,times:Pn,divide:lg,round:Z4,digitLength:rn,float2Fixed:Ys,enableBoundaryChecking:Q4};/*! *****************************************************************************
	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 cg=function(e,t){return cg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},cg(e,t)};function hc(e,t){cg(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var at=function(){return at=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},at.apply(this,arguments)};function Dw(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ia(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){u={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return s}function Aw(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ia(arguments[t]));return e}var nn;(function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"})(nn||(nn={}));/*! *****************************************************************************
	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.
	***************************************************************************** */function eD(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){u={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return s}function tD(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(eD(arguments[t]));return e}/*! *****************************************************************************
	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 Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Oe.apply(this,arguments)};function rD(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){u={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return s}function oa(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(rD(arguments[t]));return e}function nD(e){e.then(null,function(t){console.error(t)})}function gt(){return typeof __SENTRY_NO_DEBUG__!="undefined"&&!__SENTRY_BROWSER_BUNDLE__}function iD(){return typeof __SENTRY_BROWSER_BUNDLE__!="undefined"&&!!__SENTRY_BROWSER_BUNDLE__}function Ks(){return!iD()&&Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]"}function ai(e,t){return e.require(t)}function oD(e){var t;try{t=ai(module,e)}catch{}try{var r=ai(module,"process").cwd;t=ai(module,r()+"/node_modules/"+e)}catch{}return t}var aD={};function Ye(){return Ks()?global:typeof window!="undefined"?window:typeof self!="undefined"?self:aD}var Iw=Object.prototype.toString;function Rw(e){switch(Iw.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return on(e,Error)}}function aa(e,t){return Iw.call(e)==="[object "+t+"]"}function Fw(e){return aa(e,"ErrorEvent")}function Lw(e){return aa(e,"DOMError")}function sD(e){return aa(e,"DOMException")}function sa(e){return aa(e,"String")}function pc(e){return e===null||typeof e!="object"&&typeof e!="function"}function la(e){return aa(e,"Object")}function fg(e){return typeof Event!="undefined"&&on(e,Event)}function Nw(e){return typeof Element!="undefined"&&on(e,Element)}function lD(e){return aa(e,"RegExp")}function dg(e){return Boolean(e&&e.then&&typeof e.then=="function")}function uD(e){return la(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function on(e,t){try{return e instanceof t}catch{return!1}}function ua(e,t){try{for(var r=e,n=5,i=80,s=[],u=0,o=0,a=" > ",l=a.length,h=void 0;r&&u++<n&&(h=cD(r,t),!(h==="html"||u>1&&o+s.length*l+h.length>=i));)s.push(h),o+=h.length,r=r.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function cD(e,t){var r=e,n=[],i,s,u,o,a;if(!r||!r.tagName)return"";n.push(r.tagName.toLowerCase());var l=t&&t.length?t.filter(function(c){return r.getAttribute(c)}).map(function(c){return[c,r.getAttribute(c)]}):null;if(l&&l.length)l.forEach(function(c){n.push("["+c[0]+'="'+c[1]+'"]')});else if(r.id&&n.push("#"+r.id),i=r.className,i&&sa(i))for(s=i.split(/\s+/),a=0;a<s.length;a++)n.push("."+s[a]);var h=["type","name","title","alt"];for(a=0;a<h.length;a++)u=h[a],o=r.getAttribute(u),o&&n.push("["+u+'="'+o+'"]');return n.join("")}function fD(){var e=Ye();try{return e.document.location.href}catch{return""}}/*! *****************************************************************************
	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 hg=function(e,t){return hg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},hg(e,t)};function dD(e,t){hg(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ur=function(){return ur=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},ur.apply(this,arguments)};function gc(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hD(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){u={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return s}var pD=Object.setPrototypeOf||({__proto__:[]}instanceof Array?gD:mD);function gD(e,t){return e.__proto__=t,e}function mD(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=t[r]);return e}var bt=function(e){dD(t,e);function t(r){var n=this.constructor,i=e.call(this,r)||this;return i.message=r,i.name=n.prototype.constructor.name,pD(i,n.prototype),i}return t}(Error),vD=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function yD(e){return e==="http"||e==="https"}function mc(e,t){t===void 0&&(t=!1);var r=e.host,n=e.path,i=e.pass,s=e.port,u=e.projectId,o=e.protocol,a=e.publicKey;return o+"://"+a+(t&&i?":"+i:"")+("@"+r+(s?":"+s:"")+"/"+(n&&n+"/")+u)}function bD(e){var t=vD.exec(e);if(!t)throw new bt("Invalid Sentry Dsn: "+e);var r=hD(t.slice(1),6),n=r[0],i=r[1],s=r[2],u=s===void 0?"":s,o=r[3],a=r[4],l=a===void 0?"":a,h=r[5],c="",f=h,d=f.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),f=d.pop()),f){var g=f.match(/^\d+/);g&&(f=g[0])}return zw({host:o,pass:u,path:c,projectId:f,port:l,protocol:n,publicKey:i})}function zw(e){return"user"in e&&!("publicKey"in e)&&(e.publicKey=e.user),{user:e.publicKey||"",protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function xD(e){if(!!gt()){var t=e.port,r=e.projectId,n=e.protocol,i=["protocol","publicKey","host","projectId"];if(i.forEach(function(s){if(!e[s])throw new bt("Invalid Sentry Dsn: "+s+" missing")}),!r.match(/^\d+$/))throw new bt("Invalid Sentry Dsn: Invalid projectId "+r);if(!yD(n))throw new bt("Invalid Sentry Dsn: Invalid protocol "+n);if(t&&isNaN(parseInt(t,10)))throw new bt("Invalid Sentry Dsn: Invalid port "+t);return!0}}function pg(e){var t=typeof e=="string"?bD(e):zw(e);return xD(t),t}var wD=["fatal","error","warning","log","info","debug","critical"],Bi=Ye(),gg="Sentry Logger ";function vc(e){var t=Ye(),r=["debug","info","warn","error","log","assert"];if(!("console"in t))return e();var n=t.console,i={};r.forEach(function(u){u in t.console&&n[u].__sentry_original__&&(i[u]=n[u],n[u]=n[u].__sentry_original__)});var s=e();return Object.keys(i).forEach(function(u){n[u]=i[u]}),s}var SD=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];!this._enabled||vc(function(){Bi.console.log(gg+"[Log]: "+t.join(" "))})},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];!this._enabled||vc(function(){Bi.console.warn(gg+"[Warn]: "+t.join(" "))})},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];!this._enabled||vc(function(){Bi.console.error(gg+"[Error]: "+t.join(" "))})},e}();Bi.__SENTRY__=Bi.__SENTRY__||{};var ve=Bi.__SENTRY__.logger||(Bi.__SENTRY__.logger=new SD);function _D(){var e=typeof WeakSet=="function",t=e?new WeakSet:[];function r(i){if(e)return t.has(i)?!0:(t.add(i),!1);for(var s=0;s<t.length;s++){var u=t[s];if(u===i)return!0}return t.push(i),!1}function n(i){if(e)t.delete(i);else for(var s=0;s<t.length;s++)if(t[s]===i){t.splice(s,1);break}}return[r,n]}var TD=50;function CD(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r,n){var i,s,u,o;n===void 0&&(n=0);var a=[];try{for(var l=gc(r.split(`
`).slice(n)),h=l.next();!h.done;h=l.next()){var c=h.value;try{for(var f=(u=void 0,gc(e)),d=f.next();!d.done;d=f.next()){var g=d.value,m=g(c);if(m){a.push(m);break}}}catch(p){u={error:p}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(u)throw u.error}}}}catch(p){i={error:p}}finally{try{h&&!h.done&&(s=l.return)&&s.call(l)}finally{if(i)throw i.error}}return ED(a)}}function ED(e){if(!e.length)return[];var t=e,r=t[0].function||"",n=t[t.length-1].function||"";return(r.indexOf("captureMessage")!==-1||r.indexOf("captureException")!==-1)&&(t=t.slice(1)),n.indexOf("sentryWrapped")!==-1&&(t=t.slice(0,-1)),t.slice(0,TD).map(function(i){return ur(ur({},i),{filename:i.filename||t[0].filename,function:i.function||"?"})}).reverse()}var mg="<anonymous>";function si(e){try{return!e||typeof e!="function"?mg:e.name||mg}catch{return mg}}function Xs(e,t){return t===void 0&&(t=0),typeof e!="string"||t===0||e.length<=t?e:e.substr(0,t)+"..."}function jw(e,t){if(!Array.isArray(e))return"";for(var r=[],n=0;n<e.length;n++){var i=e[n];try{r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function Gs(e,t){return sa(e)?lD(t)?t.test(e):typeof t=="string"?e.indexOf(t)!==-1:!1:!1}function Ht(e,t,r){if(t in e){var n=e[t],i=r(n);if(typeof i=="function")try{Bw(i,n)}catch{}e[t]=i}}function yc(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}function Bw(e,t){var r=t.prototype||{};e.prototype=t.prototype=r,yc(e,"__sentry_original__",t)}function vg(e){return e.__sentry_original__}function PD(e){return Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")}function Vw(e){if(Rw(e)){var t=e,r={message:t.message,name:t.name,stack:t.stack};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}if(fg(e)){var i=e,s={};s.type=i.type;try{s.target=Nw(i.target)?ua(i.target):Object.prototype.toString.call(i.target)}catch{s.target="<unknown>"}try{s.currentTarget=Nw(i.currentTarget)?ua(i.currentTarget):Object.prototype.toString.call(i.currentTarget)}catch{s.currentTarget="<unknown>"}typeof CustomEvent!="undefined"&&on(e,CustomEvent)&&(s.detail=i.detail);for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(s[u]=i[u]);return s}return e}function OD(e){return~-encodeURI(e).split(/%..|./).length}function MD(e){return OD(JSON.stringify(e))}function Uw(e,t,r){t===void 0&&(t=3),r===void 0&&(r=100*1024);var n=Vi(e,t);return MD(n)>r?Uw(e,t-1,r):n}function kD(e){if(typeof e=="string")return e;var t=Object.prototype.toString.call(e);if(t==="[object Object]")return"[Object]";if(t==="[object Array]")return"[Array]";var r=Hw(e);return pc(r)?r:t}function Hw(e,t){return t==="domain"&&e&&typeof e=="object"&&e._events?"[Domain]":t==="domainEmitter"?"[DomainEmitter]":typeof global!="undefined"&&e===global?"[Global]":typeof window!="undefined"&&e===window?"[Window]":typeof document!="undefined"&&e===document?"[Document]":uD(e)?"[SyntheticEvent]":typeof e=="number"&&e!==e?"[NaN]":e===void 0?"[undefined]":typeof e=="function"?"[Function: "+si(e)+"]":typeof e=="symbol"?"["+String(e)+"]":typeof e=="bigint"?"[BigInt: "+String(e)+"]":e}function Ww(e,t,r,n){if(r===void 0&&(r=1/0),n===void 0&&(n=_D()),r===0)return kD(t);if(t!=null&&typeof t.toJSON=="function")return t.toJSON();var i=Hw(t,e);if(pc(i))return i;var s=Vw(t),u=Array.isArray(t)?[]:{};if(n[0](t))return"[Circular ~]";for(var o in s)!Object.prototype.hasOwnProperty.call(s,o)||(u[o]=Ww(o,s[o],r-1,n));return n[1](t),u}function Vi(e,t){try{return JSON.parse(JSON.stringify(e,function(r,n){return Ww(r,n,t)}))}catch{return"**non-serializable**"}}function $D(e,t){t===void 0&&(t=40);var r=Object.keys(Vw(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Xs(r[0],t);for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length?i:Xs(i,t)}return""}function Ui(e){var t,r;if(la(e)){var n=e,i={};try{for(var s=gc(Object.keys(n)),u=s.next();!u.done;u=s.next()){var o=u.value;typeof n[o]!="undefined"&&(i[o]=Ui(n[o]))}}catch(a){t={error:a}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return i}return Array.isArray(e)?e.map(Ui):e}function bc(){if(!("fetch"in Ye()))return!1;try{return new Headers,new Request(""),new Response,!0}catch{return!1}}function yg(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function DD(){if(!bc())return!1;var e=Ye();if(yg(e.fetch))return!0;var t=!1,r=e.document;if(r&&typeof r.createElement=="function")try{var n=r.createElement("iframe");n.hidden=!0,r.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=yg(n.contentWindow.fetch)),r.head.removeChild(n)}catch(i){gt()&&ve.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return t}function AD(){if(!bc())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch{return!1}}function ID(){var e=Ye(),t=e.chrome,r=t&&t.app&&t.app.runtime,n="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!r&&n}var it=Ye(),qs={},Yw={};function RD(e){if(!Yw[e])switch(Yw[e]=!0,e){case"console":FD();break;case"dom":WD();break;case"xhr":jD();break;case"fetch":LD();break;case"history":BD();break;case"error":YD();break;case"unhandledrejection":KD();break;default:ve.warn("unknown instrumentation type:",e)}}function vr(e,t){qs[e]=qs[e]||[],qs[e].push(t),RD(e)}function Br(e,t){var r,n;if(!(!e||!qs[e]))try{for(var i=gc(qs[e]||[]),s=i.next();!s.done;s=i.next()){var u=s.value;try{u(t)}catch(o){gt()&&ve.error(`Error while triggering instrumentation handler.
Type: `+e+`
Name: `+si(u)+`
Error: `+o)}}}catch(o){r={error:o}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}function FD(){"console"in it&&["debug","info","warn","error","log","assert"].forEach(function(e){e in it.console&&Ht(it.console,e,function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];Br("console",{args:r,level:e}),t&&t.apply(it.console,r)}})})}function LD(){!DD()||Ht(it,"fetch",function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n={args:t,fetchData:{method:ND(t),url:zD(t)},startTimestamp:Date.now()};return Br("fetch",ur({},n)),e.apply(it,t).then(function(i){return Br("fetch",ur(ur({},n),{endTimestamp:Date.now(),response:i})),i},function(i){throw Br("fetch",ur(ur({},n),{endTimestamp:Date.now(),error:i})),i})}})}function ND(e){return e===void 0&&(e=[]),"Request"in it&&on(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function zD(e){return e===void 0&&(e=[]),typeof e[0]=="string"?e[0]:"Request"in it&&on(e[0],Request)?e[0].url:String(e[0])}function jD(){if("XMLHttpRequest"in it){var e=XMLHttpRequest.prototype;Ht(e,"open",function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this,s=r[1],u=i.__sentry_xhr__={method:sa(r[0])?r[0].toUpperCase():r[0],url:r[1]};sa(s)&&u.method==="POST"&&s.match(/sentry_key/)&&(i.__sentry_own_request__=!0);var o=function(){if(i.readyState===4){try{u.status_code=i.status}catch{}Br("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:i})}};return"onreadystatechange"in i&&typeof i.onreadystatechange=="function"?Ht(i,"onreadystatechange",function(a){return function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];return o(),a.apply(i,l)}}):i.addEventListener("readystatechange",o),t.apply(i,r)}}),Ht(e,"send",function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return this.__sentry_xhr__&&r[0]!==void 0&&(this.__sentry_xhr__.body=r[0]),Br("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),t.apply(this,r)}})}}var xc;function BD(){if(!ID())return;var e=it.onpopstate;it.onpopstate=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=it.location.href,s=xc;if(xc=i,Br("history",{from:s,to:i}),e)try{return e.apply(this,r)}catch{}};function t(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s=n.length>2?n[2]:void 0;if(s){var u=xc,o=String(s);xc=o,Br("history",{from:u,to:o})}return r.apply(this,n)}}Ht(it.history,"pushState",t),Ht(it.history,"replaceState",t)}var VD=1e3,wc,Sc;function UD(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch{}return!1}function HD(e){if(e.type!=="keypress")return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)return!1}catch{}return!0}function Kw(e,t){return t===void 0&&(t=!1),function(r){if(!(!r||Sc===r)&&!HD(r)){var n=r.type==="keypress"?"input":r.type;wc===void 0?(e({event:r,name:n,global:t}),Sc=r):UD(Sc,r)&&(e({event:r,name:n,global:t}),Sc=r),clearTimeout(wc),wc=it.setTimeout(function(){wc=void 0},VD)}}}function WD(){if("document"in it){var e=Br.bind(null,"dom"),t=Kw(e,!0);it.document.addEventListener("click",t,!1),it.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(function(r){var n=it[r]&&it[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Ht(n,"addEventListener",function(i){return function(s,u,o){if(s==="click"||s=="keypress")try{var a=this,l=a.__sentry_instrumentation_handlers__=a.__sentry_instrumentation_handlers__||{},h=l[s]=l[s]||{refCount:0};if(!h.handler){var c=Kw(e);h.handler=c,i.call(this,s,c,o)}h.refCount+=1}catch{}return i.call(this,s,u,o)}}),Ht(n,"removeEventListener",function(i){return function(s,u,o){if(s==="click"||s=="keypress")try{var a=this,l=a.__sentry_instrumentation_handlers__||{},h=l[s];h&&(h.refCount-=1,h.refCount<=0&&(i.call(this,s,h.handler,o),h.handler=void 0,delete l[s]),Object.keys(l).length===0&&delete a.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,u,o)}}))})}}var bg=null;function YD(){bg=it.onerror,it.onerror=function(e,t,r,n,i){return Br("error",{column:n,error:i,line:r,msg:e,url:t}),bg?bg.apply(this,arguments):!1}}var xg=null;function KD(){xg=it.onunhandledrejection,it.onunhandledrejection=function(e){return Br("unhandledrejection",e),xg?xg.apply(this,arguments):!0}}function li(){var e=Ye(),t=e.crypto||e.msCrypto;if(t!==void 0&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=r[3]&4095|16384,r[4]=r[4]&16383|32768;var n=function(i){for(var s=i.toString(16);s.length<4;)s="0"+s;return s};return n(r[0])+n(r[1])+n(r[2])+n(r[3])+n(r[4])+n(r[5])+n(r[6])+n(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(i){var s=Math.random()*16|0,u=i==="x"?s:s&3|8;return u.toString(16)})}function wg(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+r+n}}function Xw(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Hi(e){var t=e.message,r=e.event_id;if(t)return t;var n=Xw(e);return n?n.type&&n.value?n.type+": "+n.value:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Sg(e,t,r){var n=e.exception=e.exception||{},i=n.values=n.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type=r||"Error")}function Js(e,t){var r=Xw(e);if(!!r){var n={type:"generic",handled:!0},i=r.mechanism;if(r.mechanism=ur(ur(ur({},n),i),t),t&&"data"in t){var s=ur(ur({},i&&i.data),t.data);r.mechanism.data=s}}}var Gw=60*1e3;function XD(e,t){if(!t)return Gw;var r=parseInt(""+t,10);if(!isNaN(r))return r*1e3;var n=Date.parse(""+t);return isNaN(n)?Gw:n-e}function qw(e){if(e&&e.__sentry_captured__)return!0;try{yc(e,"__sentry_captured__",!0)}catch{}return!1}function ca(e){return new Wi(function(t){t(e)})}function _g(e){return new Wi(function(t,r){r(e)})}var Wi=function(){function e(t){var r=this;this._state=0,this._handlers=[],this._resolve=function(n){r._setResult(1,n)},this._reject=function(n){r._setResult(2,n)},this._setResult=function(n,i){if(r._state===0){if(dg(i)){i.then(r._resolve,r._reject);return}r._state=n,r._value=i,r._executeHandlers()}},this._executeHandlers=function(){if(r._state!==0){var n=r._handlers.slice();r._handlers=[],n.forEach(function(i){i[0]||(r._state===1&&i[1](r._value),r._state===2&&i[2](r._value),i[0]=!0)})}};try{t(this._resolve,this._reject)}catch(n){this._reject(n)}}return e.prototype.then=function(t,r){var n=this;return new e(function(i,s){n._handlers.push([!1,function(u){if(!t)i(u);else try{i(t(u))}catch(o){s(o)}},function(u){if(!r)s(u);else try{i(r(u))}catch(o){s(o)}}]),n._executeHandlers()})},e.prototype.catch=function(t){return this.then(function(r){return r},t)},e.prototype.finally=function(t){var r=this;return new e(function(n,i){var s,u;return r.then(function(o){u=!1,s=o,t&&t()},function(o){u=!0,s=o,t&&t()}).then(function(){if(u){i(s);return}n(s)})})},e}();function GD(e){var t=[];function r(){return e===void 0||t.length<e}function n(u){return t.splice(t.indexOf(u),1)[0]}function i(u){if(!r())return _g(new bt("Not adding Promise due to buffer limit reached."));var o=u();return t.indexOf(o)===-1&&t.push(o),o.then(function(){return n(o)}).then(null,function(){return n(o).then(null,function(){})}),o}function s(u){return new Wi(function(o,a){var l=t.length;if(!l)return o(!0);var h=setTimeout(function(){u&&u>0&&o(!1)},u);t.forEach(function(c){ca(c).then(function(){--l||(clearTimeout(h),o(!0))},a)})})}return{$:t,add:i,drain:s}}function qD(e){return wD.indexOf(e)!==-1}function JD(e){return e==="warn"?nn.Warning:qD(e)?e:nn.Log}function ZD(e){return e>=200&&e<300?"success":e===429?"rate_limit":e>=400&&e<500?"invalid":e>=500?"failed":"unknown"}var Tg={nowSeconds:function(){return Date.now()/1e3}};function QD(){var e=Ye().performance;if(!(!e||!e.now)){var t=Date.now()-e.now();return{now:function(){return e.now()},timeOrigin:t}}}function eA(){try{var e=ai(module,"perf_hooks");return e.performance}catch{return}}var Cg=Ks()?eA():QD(),Jw=Cg===void 0?Tg:{nowSeconds:function(){return(Cg.timeOrigin+Cg.now())/1e3}},_c=Tg.nowSeconds.bind(Tg),Eg=Jw.nowSeconds.bind(Jw),Zs=Eg,Qs=function(){var e=Ye().performance;if(!(!e||!e.now)){var t=3600*1e3,r=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+r-n):t,s=i<t,u=e.timing&&e.timing.navigationStart,o=typeof u=="number",a=o?Math.abs(u+r-n):t,l=a<t;return s||l?i<=a?e.timeOrigin:u:n}}(),Zw=100,Tc=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}return e.clone=function(t){var r=new e;return t&&(r._breadcrumbs=oa(t._breadcrumbs),r._tags=Oe({},t._tags),r._extra=Oe({},t._extra),r._contexts=Oe({},t._contexts),r._user=t._user,r._level=t._level,r._span=t._span,r._session=t._session,r._transactionName=t._transactionName,r._fingerprint=t._fingerprint,r._eventProcessors=oa(t._eventProcessors),r._requestSession=t._requestSession),r},e.prototype.addScopeListener=function(t){this._scopeListeners.push(t)},e.prototype.addEventProcessor=function(t){return this._eventProcessors.push(t),this},e.prototype.setUser=function(t){return this._user=t||{},this._session&&this._session.update({user:t}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(t){return this._requestSession=t,this},e.prototype.setTags=function(t){return this._tags=Oe(Oe({},this._tags),t),this._notifyScopeListeners(),this},e.prototype.setTag=function(t,r){var n;return this._tags=Oe(Oe({},this._tags),(n={},n[t]=r,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(t){return this._extra=Oe(Oe({},this._extra),t),this._notifyScopeListeners(),this},e.prototype.setExtra=function(t,r){var n;return this._extra=Oe(Oe({},this._extra),(n={},n[t]=r,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(t){return this._fingerprint=t,this._notifyScopeListeners(),this},e.prototype.setLevel=function(t){return this._level=t,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(t){return this._transactionName=t,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(t){return this.setTransactionName(t)},e.prototype.setContext=function(t,r){var n;return r===null?delete this._contexts[t]:this._contexts=Oe(Oe({},this._contexts),(n={},n[t]=r,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(t){return this._span=t,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var t=this.getSpan();return t&&t.transaction},e.prototype.setSession=function(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if(typeof t=="function"){var r=t(this);return r instanceof e?r:this}return t instanceof e?(this._tags=Oe(Oe({},this._tags),t._tags),this._extra=Oe(Oe({},this._extra),t._extra),this._contexts=Oe(Oe({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):la(t)&&(t=t,this._tags=Oe(Oe({},this._tags),t.tags),this._extra=Oe(Oe({},this._extra),t.extra),this._contexts=Oe(Oe({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(t,r){var n=typeof r=="number"?Math.min(r,Zw):Zw;if(n<=0)return this;var i=Oe({timestamp:_c()},t);return this._breadcrumbs=oa(this._breadcrumbs,[i]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(t,r){if(this._extra&&Object.keys(this._extra).length&&(t.extra=Oe(Oe({},this._extra),t.extra)),this._tags&&Object.keys(this._tags).length&&(t.tags=Oe(Oe({},this._tags),t.tags)),this._user&&Object.keys(this._user).length&&(t.user=Oe(Oe({},this._user),t.user)),this._contexts&&Object.keys(this._contexts).length&&(t.contexts=Oe(Oe({},this._contexts),t.contexts)),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts=Oe({trace:this._span.getTraceContext()},t.contexts);var n=this._span.transaction&&this._span.transaction.name;n&&(t.tags=Oe({transaction:n},t.tags))}return this._applyFingerprint(t),t.breadcrumbs=oa(t.breadcrumbs||[],this._breadcrumbs),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,t.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(oa(Qw(),this._eventProcessors),t,r)},e.prototype.setSDKProcessingMetadata=function(t){return this._sdkProcessingMetadata=Oe(Oe({},this._sdkProcessingMetadata),t),this},e.prototype._notifyEventProcessors=function(t,r,n,i){var s=this;return i===void 0&&(i=0),new Wi(function(u,o){var a=t[i];if(r===null||typeof a!="function")u(r);else{var l=a(Oe({},r),n);dg(l)?l.then(function(h){return s._notifyEventProcessors(t,h,n,i+1).then(u)}).then(null,o):s._notifyEventProcessors(t,l,n,i+1).then(u).then(null,o)}})},e.prototype._notifyScopeListeners=function(){var t=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(function(r){r(t)}),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},e}();function Qw(){var e=Ye();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function Cc(e){Qw().push(e)}var tA=function(){function e(t){this.errors=0,this.sid=li(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;var r=Eg();this.timestamp=r,this.started=r,t&&this.update(t)}return e.prototype.update=function(t){if(t===void 0&&(t={}),t.user&&(!this.ipAddress&&t.user.ip_address&&(this.ipAddress=t.user.ip_address),!this.did&&!t.did&&(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||Eg(),t.ignoreDuration&&(this.ignoreDuration=t.ignoreDuration),t.sid&&(this.sid=t.sid.length===32?t.sid:li()),t.init!==void 0&&(this.init=t.init),!this.did&&t.did&&(this.did=""+t.did),typeof t.started=="number"&&(this.started=t.started),this.ignoreDuration)this.duration=void 0;else if(typeof t.duration=="number")this.duration=t.duration;else{var r=this.timestamp-this.started;this.duration=r>=0?r:0}t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),!this.ipAddress&&t.ipAddress&&(this.ipAddress=t.ipAddress),!this.userAgent&&t.userAgent&&(this.userAgent=t.userAgent),typeof t.errors=="number"&&(this.errors=t.errors),t.status&&(this.status=t.status)},e.prototype.close=function(t){t?this.update({status:t}):this.status==="ok"?this.update({status:"exited"}):this.update()},e.prototype.toJSON=function(){return Ui({sid:""+this.sid,init:this.init,started:new Date(this.started*1e3).toISOString(),timestamp:new Date(this.timestamp*1e3).toISOString(),status:this.status,errors:this.errors,did:typeof this.did=="number"||typeof this.did=="string"?""+this.did:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},e}(),Pg=4,rA=100,Ec=function(){function e(t,r,n){r===void 0&&(r=new Tc),n===void 0&&(n=Pg),this._version=n,this._stack=[{}],this.getStackTop().scope=r,t&&this.bindClient(t)}return e.prototype.isOlderThan=function(t){return this._version<t},e.prototype.bindClient=function(t){var r=this.getStackTop();r.client=t,t&&t.setupIntegrations&&t.setupIntegrations()},e.prototype.pushScope=function(){var t=Tc.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t},e.prototype.popScope=function(){return this.getStack().length<=1?!1:!!this.getStack().pop()},e.prototype.withScope=function(t){var r=this.pushScope();try{t(r)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(t,r){var n=this._lastEventId=li(),i=r;if(!r){var s=void 0;try{throw new Error("Sentry syntheticException")}catch(u){s=u}i={originalException:t,syntheticException:s}}return this._invokeClient("captureException",t,Oe(Oe({},i),{event_id:n})),n},e.prototype.captureMessage=function(t,r,n){var i=this._lastEventId=li(),s=n;if(!n){var u=void 0;try{throw new Error(t)}catch(o){u=o}s={originalException:t,syntheticException:u}}return this._invokeClient("captureMessage",t,r,Oe(Oe({},s),{event_id:i})),i},e.prototype.captureEvent=function(t,r){var n=li();return t.type!=="transaction"&&(this._lastEventId=n),this._invokeClient("captureEvent",t,Oe(Oe({},r),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(t,r){var n=this.getStackTop(),i=n.scope,s=n.client;if(!(!i||!s)){var u=s.getOptions&&s.getOptions()||{},o=u.beforeBreadcrumb,a=o===void 0?null:o,l=u.maxBreadcrumbs,h=l===void 0?rA:l;if(!(h<=0)){var c=_c(),f=Oe({timestamp:c},t),d=a?vc(function(){return a(f,r)}):f;d!==null&&i.addBreadcrumb(d,h)}}},e.prototype.setUser=function(t){var r=this.getScope();r&&r.setUser(t)},e.prototype.setTags=function(t){var r=this.getScope();r&&r.setTags(t)},e.prototype.setExtras=function(t){var r=this.getScope();r&&r.setExtras(t)},e.prototype.setTag=function(t,r){var n=this.getScope();n&&n.setTag(t,r)},e.prototype.setExtra=function(t,r){var n=this.getScope();n&&n.setExtra(t,r)},e.prototype.setContext=function(t,r){var n=this.getScope();n&&n.setContext(t,r)},e.prototype.configureScope=function(t){var r=this.getStackTop(),n=r.scope,i=r.client;n&&i&&t(n)},e.prototype.run=function(t){var r=e2(this);try{t(this)}finally{e2(r)}},e.prototype.getIntegration=function(t){var r=this.getClient();if(!r)return null;try{return r.getIntegration(t)}catch{return ve.warn("Cannot retrieve integration "+t.id+" from the current Hub"),null}},e.prototype.startSpan=function(t){return this._callExtensionMethod("startSpan",t)},e.prototype.startTransaction=function(t,r){return this._callExtensionMethod("startTransaction",t,r)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(t){if(t===void 0&&(t=!1),t)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var t=this.getStackTop(),r=t&&t.scope,n=r&&r.getSession();n&&n.close(),this._sendSessionUpdate(),r&&r.setSession()},e.prototype.startSession=function(t){var r=this.getStackTop(),n=r.scope,i=r.client,s=i&&i.getOptions()||{},u=s.release,o=s.environment,a=Ye(),l=(a.navigator||{}).userAgent,h=new tA(Oe(Oe(Oe({release:u,environment:o},n&&{user:n.getUser()}),l&&{userAgent:l}),t));if(n){var c=n.getSession&&n.getSession();c&&c.status==="ok"&&c.update({status:"exited"}),this.endSession(),n.setSession(h)}return h},e.prototype._sendSessionUpdate=function(){var t=this.getStackTop(),r=t.scope,n=t.client;if(!!r){var i=r.getSession&&r.getSession();i&&n&&n.captureSession&&n.captureSession(i)}},e.prototype._invokeClient=function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var s=this.getStackTop(),u=s.scope,o=s.client;o&&o[t]&&(r=o)[t].apply(r,oa(n,[u]))},e.prototype._callExtensionMethod=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=fa(),s=i.__SENTRY__;if(s&&s.extensions&&typeof s.extensions[t]=="function")return s.extensions[t].apply(this,r);ve.warn("Extension method "+t+" couldn't be found, doing nothing.")},e}();function fa(){var e=Ye();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function e2(e){var t=fa(),r=ui(t);return Og(t,e),r}function xt(){var e=fa();return(!t2(e)||ui(e).isOlderThan(Pg))&&Og(e,new Ec),Ks()?nA(e):ui(e)}function nA(e){try{var t=fa().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return ui(e);if(!t2(r)||ui(r).isOlderThan(Pg)){var n=ui(e).getStackTop();Og(r,new Ec(n.client,Tc.clone(n.scope)))}return ui(r)}catch{return ui(e)}}function t2(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function ui(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new Ec),e.__SENTRY__.hub}function Og(e,t){return e?(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0):!1}function r2(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=xt();if(n&&n[e])return n[e].apply(n,tD(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function iA(e,t){var r;try{throw new Error("Sentry syntheticException")}catch(n){r=n}return r2("captureException",e,{captureContext:t,originalException:e,syntheticException:r})}function oA(e){r2("withScope",e)}var aA="7";function sA(e,t,r){return{initDsn:e,metadata:t||{},dsn:pg(e),tunnel:r}}function n2(e){var t=e.protocol?e.protocol+":":"",r=e.port?":"+e.port:"";return t+"//"+e.host+r+(e.path?"/"+e.path:"")+"/api/"}function i2(e,t){return""+n2(e)+e.projectId+"/"+t+"/"}function o2(e){return PD({sentry_key:e.publicKey,sentry_version:aA})}function lA(e){return i2(e,"store")}function a2(e){return lA(e)+"?"+o2(e)}function uA(e){return i2(e,"envelope")}function Mg(e,t){return t||uA(e)+"?"+o2(e)}function cA(e,t){var r=pg(e),n=n2(r)+"embed/error-page/",i="dsn="+mc(r);for(var s in t)if(s!=="dsn")if(s==="user"){if(!t.user)continue;t.user.name&&(i+="&name="+encodeURIComponent(t.user.name)),t.user.email&&(i+="&email="+encodeURIComponent(t.user.email))}else i+="&"+encodeURIComponent(s)+"="+encodeURIComponent(t[s]);return n+"?"+i}/*! *****************************************************************************
	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 ht=function(){return ht=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},ht.apply(this,arguments)};function fA(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function dA(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){u={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return s}function an(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(dA(arguments[t]));return e}var s2=[];function l2(e){return e.reduce(function(t,r){return t.every(function(n){return r.name!==n.name})&&t.push(r),t},[])}function hA(e){var t=e.defaultIntegrations&&an(e.defaultIntegrations)||[],r=e.integrations,n=an(l2(t));Array.isArray(r)?n=an(n.filter(function(u){return r.every(function(o){return o.name!==u.name})}),l2(r)):typeof r=="function"&&(n=r(n),n=Array.isArray(n)?n:[n]);var i=n.map(function(u){return u.name}),s="Debug";return i.indexOf(s)!==-1&&n.push.apply(n,an(n.splice(i.indexOf(s),1))),n}function pA(e){s2.indexOf(e.name)===-1&&(e.setupOnce(Cc,xt),s2.push(e.name),ve.log("Integration installed: "+e.name))}function gA(e){var t={};return hA(e).forEach(function(r){t[r.name]=r,pA(r)}),yc(t,"initialized",!0),t}var u2="Not capturing exception because it's already been captured.",mA=function(){function e(t,r){this._integrations={},this._numProcessing=0,this._backend=new t(r),this._options=r,r.dsn&&(this._dsn=pg(r.dsn))}return e.prototype.captureException=function(t,r,n){var i=this;if(qw(t)){ve.log(u2);return}var s=r&&r.event_id;return this._process(this._getBackend().eventFromException(t,r).then(function(u){return i._captureEvent(u,r,n)}).then(function(u){s=u})),s},e.prototype.captureMessage=function(t,r,n,i){var s=this,u=n&&n.event_id,o=pc(t)?this._getBackend().eventFromMessage(String(t),r,n):this._getBackend().eventFromException(t,n);return this._process(o.then(function(a){return s._captureEvent(a,n,i)}).then(function(a){u=a})),u},e.prototype.captureEvent=function(t,r,n){if(r&&r.originalException&&qw(r.originalException)){ve.log(u2);return}var i=r&&r.event_id;return this._process(this._captureEvent(t,r,n).then(function(s){i=s})),i},e.prototype.captureSession=function(t){if(!this._isEnabled()){gt()&&ve.warn("SDK not enabled, will not capture session.");return}typeof t.release!="string"?gt()&&ve.warn("Discarded session because of missing or non-string release"):(this._sendSession(t),t.update({init:!1}))},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.getTransport=function(){return this._getBackend().getTransport()},e.prototype.flush=function(t){var r=this;return this._isClientDoneProcessing(t).then(function(n){return r.getTransport().close(t).then(function(i){return n&&i})})},e.prototype.close=function(t){var r=this;return this.flush(t).then(function(n){return r.getOptions().enabled=!1,n})},e.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=gA(this._options))},e.prototype.getIntegration=function(t){try{return this._integrations[t.id]||null}catch{return ve.warn("Cannot retrieve integration "+t.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(t,r){var n,i,s=!1,u=!1,o=r.exception&&r.exception.values;if(o){u=!0;try{for(var a=fA(o),l=a.next();!l.done;l=a.next()){var h=l.value,c=h.mechanism;if(c&&c.handled===!1){s=!0;break}}}catch(g){n={error:g}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}var f=t.status==="ok",d=f&&t.errors===0||f&&s;d&&(t.update(ht(ht({},s&&{status:"crashed"}),{errors:t.errors||Number(u||s)})),this.captureSession(t))},e.prototype._sendSession=function(t){this._getBackend().sendSession(t)},e.prototype._isClientDoneProcessing=function(t){var r=this;return new Wi(function(n){var i=0,s=1,u=setInterval(function(){r._numProcessing==0?(clearInterval(u),n(!0)):(i+=s,t&&i>=t&&(clearInterval(u),n(!1)))},s)})},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return this.getOptions().enabled!==!1&&this._dsn!==void 0},e.prototype._prepareEvent=function(t,r,n){var i=this,s=this.getOptions().normalizeDepth,u=s===void 0?3:s,o=ht(ht({},t),{event_id:t.event_id||(n&&n.event_id?n.event_id:li()),timestamp:t.timestamp||_c()});this._applyClientOptions(o),this._applyIntegrationsMetadata(o);var a=r;n&&n.captureContext&&(a=Tc.clone(a).update(n.captureContext));var l=ca(o);return a&&(l=a.applyToEvent(o,n)),l.then(function(h){return h&&(h.sdkProcessingMetadata=ht(ht({},h.sdkProcessingMetadata),{normalizeDepth:Vi(u)})),typeof u=="number"&&u>0?i._normalizeEvent(h,u):h})},e.prototype._normalizeEvent=function(t,r){if(!t)return null;var n=ht(ht(ht(ht(ht({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(function(i){return ht(ht({},i),i.data&&{data:Vi(i.data,r)})})}),t.user&&{user:Vi(t.user,r)}),t.contexts&&{contexts:Vi(t.contexts,r)}),t.extra&&{extra:Vi(t.extra,r)});return t.contexts&&t.contexts.trace&&(n.contexts.trace=t.contexts.trace),t.sdkProcessingMetadata=ht(ht({},t.sdkProcessingMetadata),{baseClientNormalized:!0}),n},e.prototype._applyClientOptions=function(t){var r=this.getOptions(),n=r.environment,i=r.release,s=r.dist,u=r.maxValueLength,o=u===void 0?250:u;"environment"in t||(t.environment="environment"in r?n:"production"),t.release===void 0&&i!==void 0&&(t.release=i),t.dist===void 0&&s!==void 0&&(t.dist=s),t.message&&(t.message=Xs(t.message,o));var a=t.exception&&t.exception.values&&t.exception.values[0];a&&a.value&&(a.value=Xs(a.value,o));var l=t.request;l&&l.url&&(l.url=Xs(l.url,o))},e.prototype._applyIntegrationsMetadata=function(t){var r=Object.keys(this._integrations);r.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=an(t.sdk.integrations||[],r))},e.prototype._sendEvent=function(t){this._getBackend().sendEvent(t)},e.prototype._captureEvent=function(t,r,n){return this._processEvent(t,r,n).then(function(i){return i.event_id},function(i){ve.error(i)})},e.prototype._processEvent=function(t,r,n){var i=this,s=this.getOptions(),u=s.beforeSend,o=s.sampleRate,a=this.getTransport();function l(c,f){a.recordLostEvent&&a.recordLostEvent(c,f)}if(!this._isEnabled())return _g(new bt("SDK not enabled, will not capture event."));var h=t.type==="transaction";return!h&&typeof o=="number"&&Math.random()>o?(l("sample_rate","event"),_g(new bt("Discarding event because it's not included in the random sample (sampling rate = "+o+")"))):this._prepareEvent(t,n,r).then(function(c){if(c===null)throw l("event_processor",t.type||"event"),new bt("An event processor returned null, will not send event.");var f=r&&r.data&&r.data.__sentry__===!0;if(f||h||!u)return c;var d=u(c,r);return vA(d)}).then(function(c){if(c===null)throw l("before_send",t.type||"event"),new bt("`beforeSend` returned `null`, will not send event.");var f=n&&n.getSession&&n.getSession();return!h&&f&&i._updateSessionFromEvent(f,c),i._sendEvent(c),c}).then(null,function(c){throw c instanceof bt?c:(i.captureException(c,{data:{__sentry__:!0},originalException:c}),new bt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: `+c))})},e.prototype._process=function(t){var r=this;this._numProcessing+=1,t.then(function(n){return r._numProcessing-=1,n},function(n){return r._numProcessing-=1,n})},e}();function vA(e){var t="`beforeSend` method has to return `null` or a valid event.";if(dg(e))return e.then(function(r){if(!(la(r)||r===null))throw new bt(t);return r},function(r){throw new bt("beforeSend rejected with "+r)});if(!(la(e)||e===null))throw new bt(t);return e}var yA=function(){function e(){}return e.prototype.sendEvent=function(t){return ca({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})},e.prototype.close=function(t){return ca(!0)},e}(),bA=function(){function e(t){this._options=t,this._options.dsn||ve.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(t,r){throw new bt("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(t,r,n){throw new bt("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(t){this._transport.sendEvent(t).then(null,function(r){gt()&&ve.error("Error while sending event: "+r)})},e.prototype.sendSession=function(t){if(!this._transport.sendSession){gt()&&ve.warn("Dropping session because custom transport doesn't implement sendSession");return}this._transport.sendSession(t).then(null,function(r){gt()&&ve.error("Error while sending session: "+r)})},e.prototype.getTransport=function(){return this._transport},e.prototype._setupTransport=function(){return new yA},e}();function c2(e){if(!(!e.metadata||!e.metadata.sdk)){var t=e.metadata.sdk,r=t.name,n=t.version;return{name:r,version:n}}}function xA(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=an(e.sdk.integrations||[],t.integrations||[]),e.sdk.packages=an(e.sdk.packages||[],t.packages||[])),e}function wA(e,t){var r=c2(t),n=JSON.stringify(ht(ht({sent_at:new Date().toISOString()},r&&{sdk:r}),!!t.tunnel&&{dsn:mc(t.dsn)})),i="aggregates"in e?"sessions":"session",s=JSON.stringify({type:i});return{body:n+`
`+s+`
`+JSON.stringify(e),type:i,url:Mg(t.dsn,t.tunnel)}}function SA(e,t){var r=c2(t),n=e.type||"event",i=n==="transaction"||!!t.tunnel,s=(e.sdkProcessingMetadata||{}).transactionSampling,u=s||{},o=u.method,a=u.rate;xA(e,t.metadata.sdk),e.tags=e.tags||{},e.extra=e.extra||{},e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized||(e.tags.skippedNormalization=!0,e.extra.normalizeDepth=e.sdkProcessingMetadata?e.sdkProcessingMetadata.normalizeDepth:"unset"),delete e.sdkProcessingMetadata;var l;try{l=JSON.stringify(e)}catch(m){e.tags.JSONStringifyError=!0,e.extra.JSONStringifyError=m;try{l=JSON.stringify(Vi(e))}catch(p){var h=p;l=JSON.stringify({message:"JSON.stringify error after renormalization",extra:{message:h.message,stack:h.stack}})}}var c={body:l,type:n,url:i?Mg(t.dsn,t.tunnel):a2(t.dsn)};if(i){var f=JSON.stringify(ht(ht({event_id:e.event_id,sent_at:new Date().toISOString()},r&&{sdk:r}),!!t.tunnel&&{dsn:mc(t.dsn)})),d=JSON.stringify({type:n,sample_rates:[{id:o,rate:a}]}),g=f+`
`+d+`
`+c.body;c.body=g}return c}function _A(e,t){t.debug===!0&&ve.enable();var r=xt(),n=r.getScope();n&&n.update(t.initialScope);var i=new e(t);r.bindClient(i)}var Pc="6.17.9",f2,TA=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){f2=Function.prototype.toString,Function.prototype.toString=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=vg(this)||this;return f2.apply(n,t)}},e.id="FunctionToString",e}(),CA=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],EA=function(){function e(t){t===void 0&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(){Cc(function(t){var r=xt();if(!r)return t;var n=r.getIntegration(e);if(n){var i=r.getClient(),s=i?i.getOptions():{},u=typeof n._mergeOptions=="function"?n._mergeOptions(s):{};return typeof n._shouldDropEvent!="function"?t:n._shouldDropEvent(t,u)?null:t}return t})},e.prototype._shouldDropEvent=function(t,r){return this._isSentryError(t,r)?(gt()&&ve.warn(`Event dropped due to being internal Sentry Error.
Event: `+Hi(t)),!0):this._isIgnoredError(t,r)?(gt()&&ve.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+Hi(t)),!0):this._isDeniedUrl(t,r)?(gt()&&ve.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+Hi(t)+`.
Url: `+this._getEventFilterUrl(t)),!0):this._isAllowedUrl(t,r)?!1:(gt()&&ve.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+Hi(t)+`.
Url: `+this._getEventFilterUrl(t)),!0)},e.prototype._isSentryError=function(t,r){if(!r.ignoreInternal)return!1;try{return t.exception.values[0].type==="SentryError"}catch{}return!1},e.prototype._isIgnoredError=function(t,r){return!r.ignoreErrors||!r.ignoreErrors.length?!1:this._getPossibleEventMessages(t).some(function(n){return r.ignoreErrors.some(function(i){return Gs(n,i)})})},e.prototype._isDeniedUrl=function(t,r){if(!r.denyUrls||!r.denyUrls.length)return!1;var n=this._getEventFilterUrl(t);return n?r.denyUrls.some(function(i){return Gs(n,i)}):!1},e.prototype._isAllowedUrl=function(t,r){if(!r.allowUrls||!r.allowUrls.length)return!0;var n=this._getEventFilterUrl(t);return n?r.allowUrls.some(function(i){return Gs(n,i)}):!0},e.prototype._mergeOptions=function(t){return t===void 0&&(t={}),{allowUrls:an(this._options.whitelistUrls||[],this._options.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:an(this._options.blacklistUrls||[],this._options.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:an(this._options.ignoreErrors||[],t.ignoreErrors||[],CA),ignoreInternal:typeof this._options.ignoreInternal!="undefined"?this._options.ignoreInternal:!0}},e.prototype._getPossibleEventMessages=function(t){if(t.message)return[t.message];if(t.exception)try{var r=t.exception.values&&t.exception.values[0]||{},n=r.type,i=n===void 0?"":n,s=r.value,u=s===void 0?"":s;return[""+u,i+": "+u]}catch{return gt()&&ve.error("Cannot extract message for event "+Hi(t)),[]}return[]},e.prototype._getLastValidUrl=function(t){t===void 0&&(t=[]);for(var r=t.length-1;r>=0;r--){var n=t[r];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null},e.prototype._getEventFilterUrl=function(t){try{if(t.stacktrace)return this._getLastValidUrl(t.stacktrace.frames);var r;try{r=t.exception.values[0].stacktrace.frames}catch{}return r?this._getLastValidUrl(r):null}catch{return gt()&&ve.error("Cannot extract url for event "+Hi(t)),null}},e.id="InboundFilters",e}(),da="?";function el(e,t,r,n){var i={filename:e,function:t,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var PA=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,OA=/\((\S*)(?::(\d+))(?::(\d+))\)/,MA=function(e){var t=PA.exec(e);if(t){var r=t[2]&&t[2].indexOf("eval")===0;if(r){var n=OA.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var i=ia(d2(t[1]||da,t[2]),2),s=i[0],u=i[1];return el(u,s,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},kA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$A=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,DA=function(e){var t,r=kA.exec(e);if(r){var n=r[3]&&r[3].indexOf(" > eval")>-1;if(n){var i=$A.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var s=r[3],u=r[1]||da;return t=ia(d2(u,s),2),u=t[0],s=t[1],el(s,u,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},AA=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,IA=function(e){var t=AA.exec(e);return t?el(t[2],t[1]||da,+t[3],t[4]?+t[4]:void 0):void 0},RA=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,FA=function(e){var t=RA.exec(e);return t?el(t[2],t[3]||da,+t[1]):void 0},LA=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,NA=function(e){var t=LA.exec(e);return t?el(t[5],t[3]||t[4]||da,+t[1],+t[2]):void 0},d2=function(e,t){var r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:da,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};function h2(e){var t=$g(e),r={type:e&&e.name,value:VA(e)};return t&&t.length&&(r.stacktrace={frames:t}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function zA(e,t,r){var n={exception:{values:[{type:fg(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:"Non-Error "+(r?"promise rejection":"exception")+" captured with keys: "+$D(e)}]},extra:{__serialized__:Uw(e)}};return t&&(n.stacktrace={frames:$g(t)}),n}function kg(e){return{exception:{values:[h2(e)]}}}function $g(e){var t=e.stacktrace||e.stack||"",r=BA(e);try{return CD(FA,NA,MA,IA,DA)(t,r)}catch{}return[]}var jA=/Minified React error #\d+;/i;function BA(e){if(e){if(typeof e.framesToPop=="number")return e.framesToPop;if(jA.test(e.message))return 1}return 0}function VA(e){var t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function UA(e,t,r){var n=r&&r.syntheticException||void 0,i=Dg(t,n,{attachStacktrace:e.attachStacktrace});return Js(i),i.level=nn.Error,r&&r.event_id&&(i.event_id=r.event_id),ca(i)}function HA(e,t,r,n){r===void 0&&(r=nn.Info);var i=n&&n.syntheticException||void 0,s=Ag(t,i,{attachStacktrace:e.attachStacktrace});return s.level=r,n&&n.event_id&&(s.event_id=n.event_id),ca(s)}function Dg(e,t,r){r===void 0&&(r={});var n;if(Fw(e)&&e.error){var i=e;return kg(i.error)}if(Lw(e)||sD(e)){var s=e;if("stack"in e)n=kg(e);else{var u=s.name||(Lw(s)?"DOMError":"DOMException"),o=s.message?u+": "+s.message:u;n=Ag(o,t,r),Sg(n,o)}return"code"in s&&(n.tags=at(at({},n.tags),{"DOMException.code":""+s.code})),n}if(Rw(e))return kg(e);if(la(e)||fg(e)){var a=e;return n=zA(a,t,r.isRejection),Js(n,{synthetic:!0}),n}return n=Ag(e,t,r),Sg(n,""+e,void 0),Js(n,{synthetic:!0}),n}function Ag(e,t,r){r===void 0&&(r={});var n={message:e};return r.attachStacktrace&&t&&(n.stacktrace={frames:$g(t)}),n}var Vr=Ye(),Oc;function p2(){if(Oc)return Oc;if(yg(Vr.fetch))return Oc=Vr.fetch.bind(Vr);var e=Vr.document,t=Vr.fetch;if(e&&typeof e.createElement=="function")try{var r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r);var n=r.contentWindow;n&&n.fetch&&(t=n.fetch),e.head.removeChild(r)}catch(i){gt()&&ve.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return Oc=t.bind(Vr)}function WA(e,t){var r=Object.prototype.toString.call(Vr&&Vr.navigator)==="[object Navigator]",n=r&&typeof Vr.navigator.sendBeacon=="function";if(n){var i=Vr.navigator.sendBeacon.bind(Vr.navigator);return i(e,t)}if(bc()){var s=p2();return nD(s(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}))}}function g2(e){var t=e;return t==="event"?"error":t}var Ig=Ye(),m2=function(){function e(t){var r=this;this.options=t,this._buffer=GD(30),this._rateLimits={},this._outcomes={},this._api=sA(t.dsn,t._metadata,t.tunnel),this.url=a2(this._api.dsn),this.options.sendClientReports&&Ig.document&&Ig.document.addEventListener("visibilitychange",function(){Ig.document.visibilityState==="hidden"&&r._flushOutcomes()})}return e.prototype.sendEvent=function(t){return this._sendRequest(SA(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(wA(t,this._api),t)},e.prototype.close=function(t){return this._buffer.drain(t)},e.prototype.recordLostEvent=function(t,r){var n;if(!!this.options.sendClientReports){var i=g2(r)+":"+t;ve.log("Adding outcome: "+i),this._outcomes[i]=(n=this._outcomes[i],(n!=null?n:0)+1)}},e.prototype._flushOutcomes=function(){if(!!this.options.sendClientReports){var t=this._outcomes;if(this._outcomes={},!Object.keys(t).length){ve.log("No outcomes to flush");return}ve.log(`Flushing outcomes:
`+JSON.stringify(t,null,2));var r=Mg(this._api.dsn,this._api.tunnel),n=JSON.stringify(at({},this._api.tunnel&&{dsn:mc(this._api.dsn)})),i=JSON.stringify({type:"client_report"}),s=JSON.stringify({timestamp:_c(),discarded_events:Object.keys(t).map(function(o){var a=ia(o.split(":"),2),l=a[0],h=a[1];return{reason:h,category:l,quantity:t[o]}})}),u=n+`
`+i+`
`+s;try{WA(r,u)}catch(o){ve.error(o)}}},e.prototype._handleResponse=function(t){var r=t.requestType,n=t.response,i=t.headers,s=t.resolve,u=t.reject,o=ZD(n.status),a=this._handleRateLimit(i);if(a&&gt()&&ve.warn("Too many "+r+" requests, backing off until: "+this._disabledUntil(r)),o==="success"){s({status:o});return}u(n)},e.prototype._disabledUntil=function(t){var r=g2(t);return this._rateLimits[r]||this._rateLimits.all},e.prototype._isRateLimited=function(t){return this._disabledUntil(t)>new Date(Date.now())},e.prototype._handleRateLimit=function(t){var r,n,i,s,u=Date.now(),o=t["x-sentry-rate-limits"],a=t["retry-after"];if(o){try{for(var l=Dw(o.trim().split(",")),h=l.next();!h.done;h=l.next()){var c=h.value,f=c.split(":",2),d=parseInt(f[0],10),g=(isNaN(d)?60:d)*1e3;try{for(var m=(i=void 0,Dw(f[1].split(";"))),p=m.next();!p.done;p=m.next()){var v=p.value;this._rateLimits[v||"all"]=new Date(u+g)}}catch(y){i={error:y}}finally{try{p&&!p.done&&(s=m.return)&&s.call(m)}finally{if(i)throw i.error}}}}catch(y){r={error:y}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return!0}else if(a)return this._rateLimits.all=new Date(u+XD(u,a)),!0;return!1},e}(),YA=function(e){hc(t,e);function t(r,n){n===void 0&&(n=p2());var i=e.call(this,r)||this;return i._fetch=n,i}return t.prototype._sendRequest=function(r,n){var i=this;if(this._isRateLimited(r.type))return this.recordLostEvent("ratelimit_backoff",r.type),Promise.reject({event:n,type:r.type,reason:"Transport for "+r.type+" requests locked till "+this._disabledUntil(r.type)+" due to too many requests.",status:429});var s={body:r.body,method:"POST",referrerPolicy:AD()?"origin":""};return this.options.fetchParameters!==void 0&&Object.assign(s,this.options.fetchParameters),this.options.headers!==void 0&&(s.headers=this.options.headers),this._buffer.add(function(){return new Wi(function(u,o){i._fetch(r.url,s).then(function(a){var l={"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")};i._handleResponse({requestType:r.type,response:a,headers:l,resolve:u,reject:o})}).catch(o)})}).then(void 0,function(u){throw u instanceof bt?i.recordLostEvent("queue_overflow",r.type):i.recordLostEvent("network_error",r.type),u})},t}(m2),KA=function(e){hc(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._sendRequest=function(r,n){var i=this;return this._isRateLimited(r.type)?(this.recordLostEvent("ratelimit_backoff",r.type),Promise.reject({event:n,type:r.type,reason:"Transport for "+r.type+" requests locked till "+this._disabledUntil(r.type)+" due to too many requests.",status:429})):this._buffer.add(function(){return new Wi(function(s,u){var o=new XMLHttpRequest;o.onreadystatechange=function(){if(o.readyState===4){var l={"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")};i._handleResponse({requestType:r.type,response:o,headers:l,resolve:s,reject:u})}},o.open("POST",r.url);for(var a in i.options.headers)Object.prototype.hasOwnProperty.call(i.options.headers,a)&&o.setRequestHeader(a,i.options.headers[a]);o.send(r.body)})}).then(void 0,function(s){throw s instanceof bt?i.recordLostEvent("queue_overflow",r.type):i.recordLostEvent("network_error",r.type),s})},t}(m2),XA=function(e){hc(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.eventFromException=function(r,n){return UA(this._options,r,n)},t.prototype.eventFromMessage=function(r,n,i){return n===void 0&&(n=nn.Info),HA(this._options,r,n,i)},t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var r=at(at({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(r):bc()?new YA(r):new KA(r)},t}(bA),Mc=Ye(),Rg=0;function v2(){return Rg>0}function GA(){Rg+=1,setTimeout(function(){Rg-=1})}function ha(e,t,r){if(t===void 0&&(t={}),typeof e!="function")return e;try{var n=e.__sentry_wrapped__;if(n)return n;if(vg(e))return e}catch{return e}var i=function(){var o=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);var a=o.map(function(l){return ha(l,t)});return e.apply(this,a)}catch(l){throw GA(),oA(function(h){h.addEventProcessor(function(c){return t.mechanism&&(Sg(c,void 0,void 0),Js(c,t.mechanism)),c.extra=at(at({},c.extra),{arguments:o}),c}),iA(l)}),l}};try{for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}catch{}Bw(i,e),yc(e,"__sentry_wrapped__",i);try{var u=Object.getOwnPropertyDescriptor(i,"name");u.configurable&&Object.defineProperty(i,"name",{get:function(){return e.name}})}catch{}return i}function qA(e){if(e===void 0&&(e={}),!!Mc.document){if(!e.eventId){gt()&&ve.error("Missing eventId option in showReportDialog call");return}if(!e.dsn){gt()&&ve.error("Missing dsn option in showReportDialog call");return}var t=Mc.document.createElement("script");t.async=!0,t.src=cA(e.dsn,e),e.onLoad&&(t.onload=e.onLoad);var r=Mc.document.head||Mc.document.body;r&&r.appendChild(t)}}var Fg=function(){function e(t){this.name=e.id,this._installFunc={onerror:JA,onunhandledrejection:ZA},this._options=at({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50;var t=this._options;for(var r in t){var n=this._installFunc[r];n&&t[r]&&(tI(r),n(),this._installFunc[r]=void 0)}},e.id="GlobalHandlers",e}();function JA(){vr("error",function(e){var t=ia(x2(),2),r=t[0],n=t[1];if(!!r.getIntegration(Fg)){var i=e.msg,s=e.url,u=e.line,o=e.column,a=e.error;if(!(v2()||a&&a.__sentry_own_request__)){var l=a===void 0&&sa(i)?eI(i,s,u,o):y2(Dg(a||i,void 0,{attachStacktrace:n,isRejection:!1}),s,u,o);l.level=nn.Error,b2(r,a,l,"onerror")}}})}function ZA(){vr("unhandledrejection",function(e){var t=ia(x2(),2),r=t[0],n=t[1];if(!!r.getIntegration(Fg)){var i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch{}if(v2()||i&&i.__sentry_own_request__)return!0;var s=pc(i)?QA(i):Dg(i,void 0,{attachStacktrace:n,isRejection:!0});s.level=nn.Error,b2(r,i,s,"onunhandledrejection")}})}function QA(e){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(e)}]}}}function eI(e,t,r,n){var i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,s=Fw(e)?e.message:e,u="Error",o=s.match(i);o&&(u=o[1],s=o[2]);var a={exception:{values:[{type:u,value:s}]}};return y2(a,t,r,n)}function y2(e,t,r,n){var i=e.exception=e.exception||{},s=i.values=i.values||[],u=s[0]=s[0]||{},o=u.stacktrace=u.stacktrace||{},a=o.frames=o.frames||[],l=isNaN(parseInt(n,10))?void 0:n,h=isNaN(parseInt(r,10))?void 0:r,c=sa(t)&&t.length>0?t:fD();return a.length===0&&a.push({colno:l,filename:c,function:"?",in_app:!0,lineno:h}),e}function tI(e){gt()&&ve.log("Global Handler attached: "+e)}function b2(e,t,r,n){Js(r,{handled:!1,type:n}),e.captureEvent(r,{originalException:t})}function x2(){var e=xt(),t=e.getClient(),r=t&&t.getOptions().attachStacktrace;return[e,r]}var rI=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],nI=function(){function e(t){this.name=e.id,this._options=at({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var t=Ye();this._options.setTimeout&&Ht(t,"setTimeout",w2),this._options.setInterval&&Ht(t,"setInterval",w2),this._options.requestAnimationFrame&&Ht(t,"requestAnimationFrame",iI),this._options.XMLHttpRequest&&"XMLHttpRequest"in t&&Ht(XMLHttpRequest.prototype,"send",oI);var r=this._options.eventTarget;if(r){var n=Array.isArray(r)?r:rI;n.forEach(aI)}},e.id="TryCatch",e}();function w2(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0];return t[0]=ha(n,{mechanism:{data:{function:si(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function iI(e){return function(t){return e.call(this,ha(t,{mechanism:{data:{function:"requestAnimationFrame",handler:si(e)},handled:!0,type:"instrument"}}))}}function oI(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this,i=["onload","onerror","onprogress","onreadystatechange"];return i.forEach(function(s){s in n&&typeof n[s]=="function"&&Ht(n,s,function(u){var o={mechanism:{data:{function:s,handler:si(u)},handled:!0,type:"instrument"}},a=vg(u);return a&&(o.mechanism.data.handler=si(a)),ha(u,o)})}),e.apply(this,t)}}function aI(e){var t=Ye(),r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ht(r,"addEventListener",function(n){return function(i,s,u){try{typeof s.handleEvent=="function"&&(s.handleEvent=ha(s.handleEvent.bind(s),{mechanism:{data:{function:"handleEvent",handler:si(s),target:e},handled:!0,type:"instrument"}}))}catch{}return n.call(this,i,ha(s,{mechanism:{data:{function:"addEventListener",handler:si(s),target:e},handled:!0,type:"instrument"}}),u)}}),Ht(r,"removeEventListener",function(n){return function(i,s,u){var o=s;try{var a=o&&o.__sentry_wrapped__;a&&n.call(this,i,a,u)}catch{}return n.call(this,i,o,u)}}))}var S2=function(){function e(t){this.name=e.id,this._options=at({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(t){!this._options.sentry||xt().addBreadcrumb({category:"sentry."+(t.type==="transaction"?"transaction":"event"),event_id:t.event_id,level:t.level,message:Hi(t)},{event:t})},e.prototype.setupOnce=function(){this._options.console&&vr("console",lI),this._options.dom&&vr("dom",sI(this._options.dom)),this._options.xhr&&vr("xhr",uI),this._options.fetch&&vr("fetch",cI),this._options.history&&vr("history",fI)},e.id="Breadcrumbs",e}();function sI(e){function t(r){var n,i=typeof e=="object"?e.serializeAttribute:void 0;typeof i=="string"&&(i=[i]);try{n=r.event.target?ua(r.event.target,i):ua(r.event,i)}catch{n="<unknown>"}n.length!==0&&xt().addBreadcrumb({category:"ui."+r.name,message:n},{event:r.event,name:r.name,global:r.global})}return t}function lI(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:JD(e.level),message:jw(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)t.message="Assertion failed: "+(jw(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1);else return;xt().addBreadcrumb(t,{input:e.args,level:e.level})}function uI(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},r=t.method,n=t.url,i=t.status_code,s=t.body;xt().addBreadcrumb({category:"xhr",data:{method:r,url:n,status_code:i},type:"http"},{xhr:e.xhr,input:s});return}}function cI(e){!e.endTimestamp||e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"||(e.error?xt().addBreadcrumb({category:"fetch",data:e.fetchData,level:nn.Error,type:"http"},{data:e.error,input:e.args}):xt().addBreadcrumb({category:"fetch",data:at(at({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response}))}function fI(e){var t=Ye(),r=e.from,n=e.to,i=wg(t.location.href),s=wg(r),u=wg(n);s.path||(s=i),i.protocol===u.protocol&&i.host===u.host&&(n=u.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),xt().addBreadcrumb({category:"navigation",data:{from:r,to:n}})}var dI="cause",hI=5,pI=function(){function e(t){t===void 0&&(t={}),this.name=e.id,this._key=t.key||dI,this._limit=t.limit||hI}return e.prototype.setupOnce=function(){Cc(function(t,r){var n=xt().getIntegration(e);return n?gI(n._key,n._limit,t,r):t})},e.id="LinkedErrors",e}();function gI(e,t,r,n){if(!r.exception||!r.exception.values||!n||!on(n.originalException,Error))return r;var i=_2(t,n.originalException,e);return r.exception.values=Aw(i,r.exception.values),r}function _2(e,t,r,n){if(n===void 0&&(n=[]),!on(t[r],Error)||n.length+1>=e)return n;var i=h2(t[r]);return _2(e,t[r],r,Aw([i],n))}var Yi=Ye(),mI=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){Cc(function(t){if(xt().getIntegration(e)){if(!Yi.navigator&&!Yi.location&&!Yi.document)return t;var r=t.request&&t.request.url||Yi.location&&Yi.location.href,n=(Yi.document||{}).referrer,i=(Yi.navigator||{}).userAgent,s=at(at(at({},t.request&&t.request.headers),n&&{Referer:n}),i&&{"User-Agent":i}),u=at(at({},r&&{url:r}),{headers:s});return at(at({},t),{request:u})}return t})},e.id="UserAgent",e}(),vI=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(t,r){t(function(n){var i=r().getIntegration(e);if(i){try{if(yI(n,i._previousEvent))return ve.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return i._previousEvent=n}return i._previousEvent=n}return n})},e.id="Dedupe",e}();function yI(e,t){return t?!!(bI(e,t)||xI(e,t)):!1}function bI(e,t){var r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!C2(e,t)||!T2(e,t))}function xI(e,t){var r=E2(t),n=E2(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!C2(e,t)||!T2(e,t))}function T2(e,t){var r=P2(e),n=P2(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(var i=0;i<n.length;i++){var s=n[i],u=r[i];if(s.filename!==u.filename||s.lineno!==u.lineno||s.colno!==u.colno||s.function!==u.function)return!1}return!0}function C2(e,t){var r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function E2(e){return e.exception&&e.exception.values&&e.exception.values[0]}function P2(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}else if(e.stacktrace)return e.stacktrace.frames}var wI=function(e){hc(t,e);function t(r){r===void 0&&(r={});var n=this;return r._metadata=r._metadata||{},r._metadata.sdk=r._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:Pc}],version:Pc},n=e.call(this,XA,r)||this,n}return t.prototype.showReportDialog=function(r){r===void 0&&(r={});var n=Ye().document;if(!!n){if(!this._isEnabled()){ve.error("Trying to call showReportDialog with Sentry Client disabled");return}qA(at(at({},r),{dsn:r.dsn||this.getDsn()}))}},t.prototype._prepareEvent=function(r,n,i){return r.platform=r.platform||"javascript",e.prototype._prepareEvent.call(this,r,n,i)},t.prototype._sendEvent=function(r){var n=this.getIntegration(S2);n&&n.addSentryBreadcrumb(r),e.prototype._sendEvent.call(this,r)},t}(mA),SI=[new EA,new TA,new nI,new S2,new Fg,new pI,new vI,new mI];function _I(e){if(e===void 0&&(e={}),e.defaultIntegrations===void 0&&(e.defaultIntegrations=SI),e.release===void 0){var t=Ye();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}e.autoSessionTracking===void 0&&(e.autoSessionTracking=!0),e.sendClientReports===void 0&&(e.sendClientReports=!0),_A(wI,e),e.autoSessionTracking&&TI()}function O2(e){e.startSession({ignoreDuration:!0}),e.captureSession()}function TI(){var e=Ye(),t=e.document;if(typeof t=="undefined"){gt()&&ve.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}var r=xt();!r.captureSession||(O2(r),vr("history",function(n){var i=n.from,s=n.to;i===void 0||i===s||O2(xt())}))}function CI(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:Pc}],version:Pc},_I(e)}var M2={exports:{}},Xe={};/** @license React v16.13.1
 * react-is.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 Pt=typeof Symbol=="function"&&Symbol.for,Lg=Pt?Symbol.for("react.element"):60103,Ng=Pt?Symbol.for("react.portal"):60106,kc=Pt?Symbol.for("react.fragment"):60107,$c=Pt?Symbol.for("react.strict_mode"):60108,Dc=Pt?Symbol.for("react.profiler"):60114,Ac=Pt?Symbol.for("react.provider"):60109,Ic=Pt?Symbol.for("react.context"):60110,zg=Pt?Symbol.for("react.async_mode"):60111,Rc=Pt?Symbol.for("react.concurrent_mode"):60111,Fc=Pt?Symbol.for("react.forward_ref"):60112,Lc=Pt?Symbol.for("react.suspense"):60113,EI=Pt?Symbol.for("react.suspense_list"):60120,Nc=Pt?Symbol.for("react.memo"):60115,zc=Pt?Symbol.for("react.lazy"):60116,PI=Pt?Symbol.for("react.block"):60121,OI=Pt?Symbol.for("react.fundamental"):60117,MI=Pt?Symbol.for("react.responder"):60118,kI=Pt?Symbol.for("react.scope"):60119;function yr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Lg:switch(e=e.type,e){case zg:case Rc:case kc:case Dc:case $c:case Lc:return e;default:switch(e=e&&e.$$typeof,e){case Ic:case Fc:case zc:case Nc:case Ac:return e;default:return t}}case Ng:return t}}}function k2(e){return yr(e)===Rc}Xe.AsyncMode=zg,Xe.ConcurrentMode=Rc,Xe.ContextConsumer=Ic,Xe.ContextProvider=Ac,Xe.Element=Lg,Xe.ForwardRef=Fc,Xe.Fragment=kc,Xe.Lazy=zc,Xe.Memo=Nc,Xe.Portal=Ng,Xe.Profiler=Dc,Xe.StrictMode=$c,Xe.Suspense=Lc,Xe.isAsyncMode=function(e){return k2(e)||yr(e)===zg},Xe.isConcurrentMode=k2,Xe.isContextConsumer=function(e){return yr(e)===Ic},Xe.isContextProvider=function(e){return yr(e)===Ac},Xe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Lg},Xe.isForwardRef=function(e){return yr(e)===Fc},Xe.isFragment=function(e){return yr(e)===kc},Xe.isLazy=function(e){return yr(e)===zc},Xe.isMemo=function(e){return yr(e)===Nc},Xe.isPortal=function(e){return yr(e)===Ng},Xe.isProfiler=function(e){return yr(e)===Dc},Xe.isStrictMode=function(e){return yr(e)===$c},Xe.isSuspense=function(e){return yr(e)===Lc},Xe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kc||e===Rc||e===Dc||e===$c||e===Lc||e===EI||typeof e=="object"&&e!==null&&(e.$$typeof===zc||e.$$typeof===Nc||e.$$typeof===Ac||e.$$typeof===Ic||e.$$typeof===Fc||e.$$typeof===OI||e.$$typeof===MI||e.$$typeof===kI||e.$$typeof===PI)},Xe.typeOf=yr,M2.exports=Xe;var $2=M2.exports,$I={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},DI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},D2={};D2[$2.ForwardRef]=$I,D2[$2.Memo]=DI;/*! *****************************************************************************
	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 jg=function(e,t){return jg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},jg(e,t)};function Bg(e,t){jg(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Be=function(){return Be=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Be.apply(this,arguments)};function AI(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function II(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function RI(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){u={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return s}function A2(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(RI(arguments[t]));return e}var FI=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Vg(e){var t=xt().getClient(),r=e||t&&t.getOptions();return!!r&&("tracesSampleRate"in r||"tracesSampler"in r)}function LI(e){var t=e.match(FI);if(t){var r=void 0;return t[3]==="1"?r=!0:t[3]==="0"&&(r=!1),{traceId:t[1],parentSampled:r,parentSpanId:t[2]}}}function jc(e){var t=e||xt(),r=t.getScope();return r&&r.getTransaction()}function Ot(e){return e/1e3}function NI(e){return e*1e3}function zI(){vr("error",I2),vr("unhandledrejection",I2)}function I2(){var e=jc();if(e){var t="internal_error";ve.log("[Tracing] Transaction: "+t+" -> Global error occured"),e.setStatus(t)}}var Ug="finishReason",Hg=["heartbeatFailed","idleTimeout","documentHidden"],R2=function(){function e(t){t===void 0&&(t=1e3),this.spans=[],this._maxlen=t}return e.prototype.add=function(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)},e}(),jI=function(){function e(t){if(this.traceId=li(),this.spanId=li().substring(16),this.startTimestamp=Zs(),this.tags={},this.data={},!t)return this;t.traceId&&(this.traceId=t.traceId),t.spanId&&(this.spanId=t.spanId),t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.data&&(this.data=t.data),t.tags&&(this.tags=t.tags),t.status&&(this.status=t.status),t.startTimestamp&&(this.startTimestamp=t.startTimestamp),t.endTimestamp&&(this.endTimestamp=t.endTimestamp)}return e.prototype.child=function(t){return this.startChild(t)},e.prototype.startChild=function(t){var r=new e(Be(Be({},t),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}));return r.spanRecorder=this.spanRecorder,r.spanRecorder&&r.spanRecorder.add(r),r.transaction=this.transaction,r},e.prototype.setTag=function(t,r){var n;return this.tags=Be(Be({},this.tags),(n={},n[t]=r,n)),this},e.prototype.setData=function(t,r){var n;return this.data=Be(Be({},this.data),(n={},n[t]=r,n)),this},e.prototype.setStatus=function(t){return this.status=t,this},e.prototype.setHttpStatus=function(t){this.setTag("http.status_code",String(t));var r=BI(t);return r!=="unknown_error"&&this.setStatus(r),this},e.prototype.isSuccess=function(){return this.status==="ok"},e.prototype.finish=function(t){this.endTimestamp=typeof t=="number"?t:Zs()},e.prototype.toTraceparent=function(){var t="";return this.sampled!==void 0&&(t=this.sampled?"-1":"-0"),this.traceId+"-"+this.spanId+t},e.prototype.toContext=function(){return Ui({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})},e.prototype.updateWithContext=function(t){var r,n,i,s,u;return this.data=(r=t.data,r!=null?r:{}),this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=(n=t.spanId,n!=null?n:this.spanId),this.startTimestamp=(i=t.startTimestamp,i!=null?i:this.startTimestamp),this.status=t.status,this.tags=(s=t.tags,s!=null?s:{}),this.traceId=(u=t.traceId,u!=null?u:this.traceId),this},e.prototype.getTraceContext=function(){return Ui({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},e.prototype.toJSON=function(){return Ui({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},e}();function BI(e){if(e<400&&e>=100)return"ok";if(e>=400&&e<500)switch(e){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(e>=500&&e<600)switch(e){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}var F2=function(e){Bg(t,e);function t(r,n){var i=e.call(this,r)||this;return i._measurements={},i._hub=xt(),on(n,Ec)&&(i._hub=n),i.name=r.name||"",i.metadata=r.metadata||{},i._trimEnd=r.trimEnd,i.transaction=i,i}return t.prototype.setName=function(r){this.name=r},t.prototype.initSpanRecorder=function(r){r===void 0&&(r=1e3),this.spanRecorder||(this.spanRecorder=new R2(r)),this.spanRecorder.add(this)},t.prototype.setMeasurements=function(r){this._measurements=Be({},r)},t.prototype.setMetadata=function(r){this.metadata=Be(Be({},this.metadata),r)},t.prototype.finish=function(r){var n=this;if(this.endTimestamp===void 0){if(this.name||(ve.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),e.prototype.finish.call(this,r),this.sampled!==!0){ve.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.");var i=this._hub.getClient(),s=i&&i.getTransport&&i.getTransport();s&&s.recordLostEvent&&s.recordLostEvent("sample_rate","transaction");return}var u=this.spanRecorder?this.spanRecorder.spans.filter(function(l){return l!==n&&l.endTimestamp}):[];this._trimEnd&&u.length>0&&(this.endTimestamp=u.reduce(function(l,h){return l.endTimestamp&&h.endTimestamp?l.endTimestamp>h.endTimestamp?l:h:l}).endTimestamp);var o={contexts:{trace:this.getTraceContext()},spans:u,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:this.metadata},a=Object.keys(this._measurements).length>0;return a&&(ve.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),o.measurements=this._measurements),ve.log("[Tracing] Finishing "+this.op+" transaction: "+this.name+"."),this._hub.captureEvent(o)}},t.prototype.toContext=function(){var r=e.prototype.toContext.call(this);return Ui(Be(Be({},r),{name:this.name,trimEnd:this._trimEnd}))},t.prototype.updateWithContext=function(r){var n;return e.prototype.updateWithContext.call(this,r),this.name=(n=r.name,n!=null?n:""),this._trimEnd=r.trimEnd,this},t}(jI),L2=1e3,VI=5e3,UI=function(e){Bg(t,e);function t(r,n,i,s){i===void 0&&(i="");var u=e.call(this,s)||this;return u._pushActivity=r,u._popActivity=n,u.transactionSpanId=i,u}return t.prototype.add=function(r){var n=this;r.spanId!==this.transactionSpanId&&(r.finish=function(i){r.endTimestamp=typeof i=="number"?i:Zs(),n._popActivity(r.spanId)},r.endTimestamp===void 0&&this._pushActivity(r.spanId)),e.prototype.add.call(this,r)},t}(R2),HI=function(e){Bg(t,e);function t(r,n,i,s){i===void 0&&(i=L2),s===void 0&&(s=!1);var u=e.call(this,r,n)||this;return u._idleHub=n,u._idleTimeout=i,u._onScope=s,u.activities={},u._heartbeatCounter=0,u._finished=!1,u._beforeFinishCallbacks=[],n&&s&&(N2(n),ve.log("Setting idle transaction on scope. Span ID: "+u.spanId),n.configureScope(function(o){return o.setSpan(u)})),u._initTimeout=setTimeout(function(){u._finished||u.finish()},u._idleTimeout),u}return t.prototype.finish=function(r){var n,i,s=this;if(r===void 0&&(r=Zs()),this._finished=!0,this.activities={},this.spanRecorder){ve.log("[Tracing] finishing IdleTransaction",new Date(r*1e3).toISOString(),this.op);try{for(var u=II(this._beforeFinishCallbacks),o=u.next();!o.done;o=u.next()){var a=o.value;a(this,r)}}catch(l){n={error:l}}finally{try{o&&!o.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}this.spanRecorder.spans=this.spanRecorder.spans.filter(function(l){if(l.spanId===s.spanId)return!0;l.endTimestamp||(l.endTimestamp=r,l.setStatus("cancelled"),ve.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(l,void 0,2)));var h=l.startTimestamp<r;return h||ve.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(l,void 0,2)),h}),ve.log("[Tracing] flushing IdleTransaction")}else ve.log("[Tracing] No active IdleTransaction");return this._onScope&&N2(this._idleHub),e.prototype.finish.call(this,r)},t.prototype.registerBeforeFinishCallback=function(r){this._beforeFinishCallbacks.push(r)},t.prototype.initSpanRecorder=function(r){var n=this;if(!this.spanRecorder){var i=function(u){n._finished||n._pushActivity(u)},s=function(u){n._finished||n._popActivity(u)};this.spanRecorder=new UI(i,s,this.spanId,r),ve.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)},t.prototype._pushActivity=function(r){this._initTimeout&&(clearTimeout(this._initTimeout),this._initTimeout=void 0),ve.log("[Tracing] pushActivity: "+r),this.activities[r]=!0,ve.log("[Tracing] new activities count",Object.keys(this.activities).length)},t.prototype._popActivity=function(r){var n=this;if(this.activities[r]&&(ve.log("[Tracing] popActivity "+r),delete this.activities[r],ve.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){var i=this._idleTimeout,s=Zs()+i/1e3;setTimeout(function(){n._finished||(n.setTag(Ug,Hg[1]),n.finish(s))},i)}},t.prototype._beat=function(){if(!this._finished){var r=Object.keys(this.activities).join("");r===this._prevHeartbeatString?this._heartbeatCounter+=1:this._heartbeatCounter=1,this._prevHeartbeatString=r,this._heartbeatCounter>=3?(ve.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this.setTag(Ug,Hg[0]),this.finish()):this._pingHeartbeat()}},t.prototype._pingHeartbeat=function(){var r=this;ve.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),setTimeout(function(){r._beat()},VI)},t}(F2);function N2(e){if(e){var t=e.getScope();if(t){var r=t.getTransaction();r&&t.setSpan(void 0)}}}function WI(){var e=this.getScope();if(e){var t=e.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}}function z2(e,t,r){if(!Vg(t))return e.sampled=!1,e;if(e.sampled!==void 0)return e.setMetadata({transactionSampling:{method:"explicitly_set"}}),e;var n;return typeof t.tracesSampler=="function"?(n=t.tracesSampler(r),e.setMetadata({transactionSampling:{method:"client_sampler",rate:Number(n)}})):r.parentSampled!==void 0?(n=r.parentSampled,e.setMetadata({transactionSampling:{method:"inheritance"}})):(n=t.tracesSampleRate,e.setMetadata({transactionSampling:{method:"client_rate",rate:Number(n)}})),YI(n)?n?(e.sampled=Math.random()<n,e.sampled?(ve.log("[Tracing] starting "+e.op+" transaction - "+e.name),e):(ve.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = "+Number(n)+")"),e)):(ve.log("[Tracing] Discarding transaction because "+(typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),e.sampled=!1,e):(ve.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e)}function YI(e){return isNaN(e)||!(typeof e=="number"||typeof e=="boolean")?(ve.warn("[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got "+JSON.stringify(e)+" of type "+JSON.stringify(typeof e)+"."),!1):e<0||e>1?(ve.warn("[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got "+e+"."),!1):!0}function KI(e,t){var r=this.getClient(),n=r&&r.getOptions()||{},i=new F2(e,this);return i=z2(i,n,Be({parentSampled:e.parentSampled,transactionContext:e},t)),i.sampled&&i.initSpanRecorder(n._experiments&&n._experiments.maxSpans),i}function XI(e,t,r,n,i){var s=e.getClient(),u=s&&s.getOptions()||{},o=new HI(t,e,r,n);return o=z2(o,u,Be({parentSampled:t.parentSampled,transactionContext:t},i)),o.sampled&&o.initSpanRecorder(u._experiments&&u._experiments.maxSpans),o}function GI(){var e=fa();!e.__SENTRY__||(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=KI),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=WI))}function qI(){var e=fa();if(!!e.__SENTRY__){var t={mongodb:function(){var n=ai(module,"./integrations/node/mongo");return new n.Mongo},mongoose:function(){var n=ai(module,"./integrations/node/mongo");return new n.Mongo({mongoose:!0})},mysql:function(){var n=ai(module,"./integrations/node/mysql");return new n.Mysql},pg:function(){var n=ai(module,"./integrations/node/postgres");return new n.Postgres}},r=Object.keys(t).filter(function(n){return!!oD(n)}).map(function(n){try{return t[n]()}catch{return}}).filter(function(n){return n});r.length>0&&(e.__SENTRY__.integrations=A2(e.__SENTRY__.integrations||[],r))}}function JI(){GI(),Ks()&&qI(),zI()}var Bc=Ye();function ZI(){Bc&&Bc.document?Bc.document.addEventListener("visibilitychange",function(){var e=jc();if(Bc.document.hidden&&e){var t="cancelled";ve.log("[Tracing] Transaction: "+t+" -> since tab moved to the background, op: "+e.op),e.status||e.setStatus(t),e.setTag("visibilitychange","document.hidden"),e.setTag(Ug,Hg[2]),e.finish()}}):ve.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Wg=function(e,t,r){var n;return function(i){t.value>=0&&(i||r)&&(t.delta=t.value-(n||0),(t.delta||n===void 0)&&(n=t.value,e(t)))}},QI=function(){return"v2-"+Date.now()+"-"+(Math.floor(Math.random()*(9e12-1))+1e12)},Yg=function(e,t){return{name:e,value:t!=null?t:-1,delta:0,entries:[],id:QI()}},Kg=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if(e==="first-input"&&!("PerformanceEventTiming"in self))return;var r=new PerformanceObserver(function(n){return n.getEntries().map(t)});return r.observe({type:e,buffered:!0}),r}}catch{}},Vc=function(e,t){var r=function(n){(n.type==="pagehide"||Ye().document.visibilityState==="hidden")&&(e(n),t&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)},e6=function(e,t){var r=Yg("CLS",0),n,i=0,s=[],u=function(a){if(a&&!a.hadRecentInput){var l=s[0],h=s[s.length-1];i&&s.length!==0&&a.startTime-h.startTime<1e3&&a.startTime-l.startTime<5e3?(i+=a.value,s.push(a)):(i=a.value,s=[a]),i>r.value&&(r.value=i,r.entries=s,n&&n())}},o=Kg("layout-shift",u);o&&(n=Wg(e,r,t),Vc(function(){o.takeRecords().map(u),n(!0)}))},Uc=-1,t6=function(){return Ye().document.visibilityState==="hidden"?0:1/0},r6=function(){Vc(function(e){var t=e.timeStamp;Uc=t},!0)},Xg=function(){return Uc<0&&(Uc=t6(),r6()),{get firstHiddenTime(){return Uc}}},n6=function(e,t){var r=Xg(),n=Yg("FID"),i,s=function(o){i&&o.startTime<r.firstHiddenTime&&(n.value=o.processingStart-o.startTime,n.entries.push(o),i(!0))},u=Kg("first-input",s);u&&(i=Wg(e,n,t),Vc(function(){u.takeRecords().map(s),u.disconnect()},!0))},j2={},i6=function(e,t){var r=Xg(),n=Yg("LCP"),i,s=function(a){var l=a.startTime;l<r.firstHiddenTime&&(n.value=l,n.entries.push(a)),i&&i()},u=Kg("largest-contentful-paint",s);if(u){i=Wg(e,n,t);var o=function(){j2[n.id]||(u.takeRecords().map(s),u.disconnect(),j2[n.id]=!0,i(!0))};["keydown","click"].forEach(function(a){addEventListener(a,o,{once:!0,capture:!0})}),Vc(o,!0)}},Ur=Ye(),o6=function(){function e(t){t===void 0&&(t=!1),this._reportAllChanges=t,this._measurements={},this._performanceCursor=0,!Ks()&&Ur&&Ur.performance&&Ur.document&&(Ur.performance.mark&&Ur.performance.mark("sentry-tracing-init"),this._trackCLS(),this._trackLCP(),this._trackFID())}return e.prototype.addPerformanceEntries=function(t){var r=this;if(!(!Ur||!Ur.performance||!Ur.performance.getEntries||!Qs)){ve.log("[Tracing] Adding & adjusting spans using Performance API");var n=Ot(Qs),i,s;if(Ur.performance.getEntries().slice(this._performanceCursor).forEach(function(o){var a=Ot(o.startTime),l=Ot(o.duration);if(!(t.op==="navigation"&&n+a<t.startTimestamp))switch(o.entryType){case"navigation":{a6(t,o,n),i=n+Ot(o.responseStart),s=n+Ot(o.requestStart);break}case"mark":case"paint":case"measure":{var h=s6(t,o,a,l,n),c=Xg(),f=o.startTime<c.firstHiddenTime;o.name==="first-paint"&&f&&(ve.log("[Measurements] Adding FP"),r._measurements.fp={value:o.startTime},r._measurements["mark.fp"]={value:h}),o.name==="first-contentful-paint"&&f&&(ve.log("[Measurements] Adding FCP"),r._measurements.fcp={value:o.startTime},r._measurements["mark.fcp"]={value:h});break}case"resource":{var d=o.name.replace(Ur.location.origin,"");l6(t,o,d,a,l,n);break}}}),this._performanceCursor=Math.max(performance.getEntries().length-1,0),this._trackNavigator(t),t.op==="pageload"){var u=Ot(Qs);typeof i=="number"&&(ve.log("[Measurements] Adding TTFB"),this._measurements.ttfb={value:(i-t.startTimestamp)*1e3},typeof s=="number"&&s<=i&&(this._measurements["ttfb.requestTime"]={value:(i-s)*1e3})),["fcp","fp","lcp"].forEach(function(o){if(!(!r._measurements[o]||u>=t.startTimestamp)){var a=r._measurements[o].value,l=u+Ot(a),h=Math.abs((l-t.startTimestamp)*1e3),c=h-a;ve.log("[Measurements] Normalized "+o+" from "+a+" to "+h+" ("+c+")"),r._measurements[o].value=h}}),this._measurements["mark.fid"]&&this._measurements.fid&&pa(t,{description:"first input delay",endTimestamp:this._measurements["mark.fid"].value+Ot(this._measurements.fid.value),op:"web.vitals",startTimestamp:this._measurements["mark.fid"].value}),"fcp"in this._measurements||delete this._measurements.cls,t.setMeasurements(this._measurements),c6(t,this._lcpEntry,this._clsEntry),t.setTag("sentry_reportAllChanges",this._reportAllChanges)}}},e.prototype._trackNavigator=function(t){var r=Ur.navigator;if(!!r){var n=r.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),Wc(n.rtt)&&(this._measurements["connection.rtt"]={value:n.rtt}),Wc(n.downlink)&&(this._measurements["connection.downlink"]={value:n.downlink})),Wc(r.deviceMemory)&&t.setTag("deviceMemory",String(r.deviceMemory)),Wc(r.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(r.hardwareConcurrency))}},e.prototype._trackCLS=function(){var t=this;e6(function(r){var n=r.entries.pop();!n||(ve.log("[Measurements] Adding CLS"),t._measurements.cls={value:r.value},t._clsEntry=n)})},e.prototype._trackLCP=function(){var t=this;i6(function(r){var n=r.entries.pop();if(!!n){var i=Ot(Qs),s=Ot(n.startTime);ve.log("[Measurements] Adding LCP"),t._measurements.lcp={value:r.value},t._measurements["mark.lcp"]={value:i+s},t._lcpEntry=n}},this._reportAllChanges)},e.prototype._trackFID=function(){var t=this;n6(function(r){var n=r.entries.pop();if(!!n){var i=Ot(Qs),s=Ot(n.startTime);ve.log("[Measurements] Adding FID"),t._measurements.fid={value:r.value},t._measurements["mark.fid"]={value:i+s}}})},e}();function a6(e,t,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(function(n){Hc(e,t,n,r)}),Hc(e,t,"secureConnection",r,"TLS/SSL","connectEnd"),Hc(e,t,"fetch",r,"cache","domainLookupStart"),Hc(e,t,"domainLookup",r,"DNS"),u6(e,t,r)}function s6(e,t,r,n,i){var s=i+r,u=s+n;return pa(e,{description:t.name,endTimestamp:u,op:t.entryType,startTimestamp:s}),s}function l6(e,t,r,n,i,s){if(!(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")){var u={};"transferSize"in t&&(u["Transfer Size"]=t.transferSize),"encodedBodySize"in t&&(u["Encoded Body Size"]=t.encodedBodySize),"decodedBodySize"in t&&(u["Decoded Body Size"]=t.decodedBodySize);var o=s+n,a=o+i;pa(e,{description:r,endTimestamp:a,op:t.initiatorType?"resource."+t.initiatorType:"resource",startTimestamp:o,data:u})}}function Hc(e,t,r,n,i,s){var u=s?t[s]:t[r+"End"],o=t[r+"Start"];!o||!u||pa(e,{op:"browser",description:i!=null?i:r,startTimestamp:n+Ot(o),endTimestamp:n+Ot(u)})}function u6(e,t,r){pa(e,{op:"browser",description:"request",startTimestamp:r+Ot(t.requestStart),endTimestamp:r+Ot(t.responseEnd)}),pa(e,{op:"browser",description:"response",startTimestamp:r+Ot(t.responseStart),endTimestamp:r+Ot(t.responseEnd)})}function pa(e,t){var r=t.startTimestamp,n=AI(t,["startTimestamp"]);return r&&e.startTimestamp>r&&(e.startTimestamp=r),e.startChild(Be({startTimestamp:r},n))}function Wc(e){return typeof e=="number"&&isFinite(e)}function c6(e,t,r){t&&(ve.log("[Measurements] Adding LCP Data"),t.element&&e.setTag("lcp.element",ua(t.element)),t.id&&e.setTag("lcp.id",t.id),t.url&&e.setTag("lcp.url",t.url.trim().slice(0,200)),e.setTag("lcp.size",t.size)),r&&r.sources&&(ve.log("[Measurements] Adding CLS Data"),r.sources.forEach(function(n,i){return e.setTag("cls.source."+(i+1),ua(n.node))}))}var f6=["localhost",/^\//],Yc={traceFetch:!0,traceXHR:!0,tracingOrigins:f6};function d6(e){var t=Be(Be({},Yc),e),r=t.traceFetch,n=t.traceXHR,i=t.tracingOrigins,s=t.shouldCreateSpanForRequest,u={},o=function(h){if(u[h])return u[h];var c=i;return u[h]=c.some(function(f){return Gs(h,f)})&&!Gs(h,"sentry_key"),u[h]},a=o;typeof s=="function"&&(a=function(h){return o(h)&&s(h)});var l={};r&&vr("fetch",function(h){h6(h,a,l)}),n&&vr("xhr",function(h){p6(h,a,l)})}function h6(e,t,r){if(!(!Vg()||!(e.fetchData&&t(e.fetchData.url)))){if(e.endTimestamp){var n=e.fetchData.__span;if(!n)return;var i=r[n];i&&(e.response?i.setHttpStatus(e.response.status):e.error&&i.setStatus("internal_error"),i.finish(),delete r[n]);return}var s=jc();if(s){var i=s.startChild({data:Be(Be({},e.fetchData),{type:"fetch"}),description:e.fetchData.method+" "+e.fetchData.url,op:"http.client"});e.fetchData.__span=i.spanId,r[i.spanId]=i;var u=e.args[0]=e.args[0],o=e.args[1]=e.args[1]||{},a=o.headers;on(u,Request)&&(a=u.headers),a?typeof a.append=="function"?a.append("sentry-trace",i.toTraceparent()):Array.isArray(a)?a=A2(a,[["sentry-trace",i.toTraceparent()]]):a=Be(Be({},a),{"sentry-trace":i.toTraceparent()}):a={"sentry-trace":i.toTraceparent()},o.headers=a}}}function p6(e,t,r){if(!(!Vg()||e.xhr&&e.xhr.__sentry_own_request__||!(e.xhr&&e.xhr.__sentry_xhr__&&t(e.xhr.__sentry_xhr__.url)))){var n=e.xhr.__sentry_xhr__;if(e.endTimestamp){var i=e.xhr.__sentry_xhr_span_id__;if(!i)return;var s=r[i];s&&(s.setHttpStatus(n.status_code),s.finish(),delete r[i]);return}var u=jc();if(u){var s=u.startChild({data:Be(Be({},n.data),{type:"xhr",method:n.method,url:n.url}),description:n.method+" "+n.url,op:"http.client"});if(e.xhr.__sentry_xhr_span_id__=s.spanId,r[e.xhr.__sentry_xhr_span_id__]=s,e.xhr.setRequestHeader)try{e.xhr.setRequestHeader("sentry-trace",s.toTraceparent())}catch{}}}}var tl=Ye();function g6(e,t,r){if(t===void 0&&(t=!0),r===void 0&&(r=!0),!tl||!tl.location){ve.warn("Could not initialize routing instrumentation due to invalid location");return}var n=tl.location.href,i;t&&(i=e({name:tl.location.pathname,op:"pageload"})),r&&vr("history",function(s){var u=s.to,o=s.from;if(o===void 0&&n&&n.indexOf(u)!==-1){n=void 0;return}o!==u&&(n=void 0,i&&(ve.log("[Tracing] Finishing current transaction with op: "+i.op),i.finish()),i=e({name:tl.location.pathname,op:"navigation"}))})}var m6=600,v6=Be({idleTimeout:L2,markBackgroundTransactions:!0,maxTransactionDuration:m6,routingInstrumentation:g6,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0},Yc),y6=function(){function e(t){this.name=e.id,this._emitOptionsWarning=!1,this._configuredIdleTimeout=void 0;var r=Yc.tracingOrigins;t&&(this._configuredIdleTimeout=t.idleTimeout,t.tracingOrigins&&Array.isArray(t.tracingOrigins)&&t.tracingOrigins.length!==0?r=t.tracingOrigins:this._emitOptionsWarning=!0),this.options=Be(Be(Be({},v6),t),{tracingOrigins:r});var n=this.options._metricOptions;this._metrics=new o6(n&&n._reportAllChanges)}return e.prototype.setupOnce=function(t,r){var n=this;this._getCurrentHub=r,this._emitOptionsWarning&&(ve.warn("[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),ve.warn("[Tracing] We added a reasonable default for you: "+Yc.tracingOrigins));var i=this.options,s=i.routingInstrumentation,u=i.startTransactionOnLocationChange,o=i.startTransactionOnPageLoad,a=i.markBackgroundTransactions,l=i.traceFetch,h=i.traceXHR,c=i.tracingOrigins,f=i.shouldCreateSpanForRequest;s(function(d){return n._createRouteTransaction(d)},o,u),a&&ZI(),d6({traceFetch:l,traceXHR:h,tracingOrigins:c,shouldCreateSpanForRequest:f})},e.prototype._createRouteTransaction=function(t){var r=this;if(!this._getCurrentHub){ve.warn("[Tracing] Did not create "+t.op+" transaction because _getCurrentHub is invalid.");return}var n=this.options,i=n.beforeNavigate,s=n.idleTimeout,u=n.maxTransactionDuration,o=t.op==="pageload"?b6():void 0,a=Be(Be(Be({},t),o),{trimEnd:!0}),l=typeof i=="function"?i(a):a,h=l===void 0?Be(Be({},a),{sampled:!1}):l;h.sampled===!1&&ve.log("[Tracing] Will not send "+h.op+" transaction because of beforeNavigate."),ve.log("[Tracing] Starting "+h.op+" transaction on scope");var c=this._getCurrentHub(),f=Ye().location,d=XI(c,h,s,!0,{location:f});return d.registerBeforeFinishCallback(function(g,m){r._metrics.addPerformanceEntries(g),w6(NI(u),g,m)}),d.setTag("idleTimeout",this._configuredIdleTimeout),d},e.id="BrowserTracing",e}();function b6(){var e=x6("sentry-trace");if(e)return LI(e)}function x6(e){var t=Ye().document.querySelector("meta[name="+e+"]");return t?t.getAttribute("content"):null}function w6(e,t,r){var n=r-t.startTimestamp,i=r&&(n>e||n<0);i&&(t.setStatus("deadline_exceeded"),t.setTag("maxTransactionDurationExceeded","true"))}JI();/*! *****************************************************************************
	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 Gg=function(e,t){return Gg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Gg(e,t)};function br(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Gg(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var oe=function(){return oe=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},oe.apply(this,arguments)};function Lt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function ga(e,t,r,n){function i(s){return s instanceof r?s:new r(function(u){u(s)})}return new(r||(r=Promise))(function(s,u){function o(h){try{l(n.next(h))}catch(c){u(c)}}function a(h){try{l(n.throw(h))}catch(c){u(c)}}function l(h){h.done?s(h.value):i(h.value).then(o,a)}l((n=n.apply(e,t||[])).next())})}function ma(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,u;return u={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function o(l){return function(h){return a([l,h])}}function a(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(h){l=[6,h],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function S6(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Nt(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],u;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){u={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return s}function _6(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Nt(arguments[t]));return e}function Mt(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}function B2(e,t,r){if(r===void 0&&(r=Error),!e)throw new r(t)}var Fe;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(Fe||(Fe={}));var rt;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(rt||(rt={}));var va;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(va||(va={}));function V2(e){return e.type===rt.literal}function T6(e){return e.type===rt.argument}function U2(e){return e.type===rt.number}function H2(e){return e.type===rt.date}function W2(e){return e.type===rt.time}function Y2(e){return e.type===rt.select}function K2(e){return e.type===rt.plural}function C6(e){return e.type===rt.pound}function X2(e){return e.type===rt.tag}function G2(e){return!!(e&&typeof e=="object"&&e.type===va.number)}function qg(e){return!!(e&&typeof e=="object"&&e.type===va.dateTime)}var q2=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,E6=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function P6(e){var t={};return e.replace(E6,function(r){var n=r.length;switch(r[0]){case"G":t.era=n===4?"long":n===5?"narrow":"short";break;case"y":t.year=n===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=n===4?"short":n===5?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var O6=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function M6(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(O6).filter(function(f){return f.length>0}),r=[],n=0,i=t;n<i.length;n++){var s=i[n],u=s.split("/");if(u.length===0)throw new Error("Invalid number skeleton");for(var o=u[0],a=u.slice(1),l=0,h=a;l<h.length;l++){var c=h[l];if(c.length===0)throw new Error("Invalid number skeleton")}r.push({stem:o,options:a})}return r}function k6(e){return e.replace(/^(.*?)-/,"")}var J2=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Z2=/^(@+)?(\+|#+)?[rs]?$/g,$6=/(\*)(0+)|(#+)(0+)|(0+)/g,Q2=/^(0+)$/;function eS(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(Z2,function(r,n,i){return typeof i!="string"?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):i==="+"?t.minimumSignificantDigits=n.length:n[0]==="#"?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+(typeof i=="string"?i.length:0)),""}),t}function tS(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function D6(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if(r==="+!"?(t.signDisplay="always",e=e.slice(2)):r==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Q2.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function rS(e){var t={},r=tS(e);return r||t}function A6(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=k6(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=oe(oe(oe({},t),{notation:"scientific"}),i.options.reduce(function(a,l){return oe(oe({},a),rS(l))},{}));continue;case"engineering":t=oe(oe(oe({},t),{notation:"engineering"}),i.options.reduce(function(a,l){return oe(oe({},a),rS(l))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace($6,function(a,l,h,c,f,d){if(l)t.minimumIntegerDigits=h.length;else{if(c&&f)throw new Error("We currently do not support maximum integer digits");if(d)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Q2.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(J2.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(J2,function(a,l,h,c,f,d){return h==="*"?t.minimumFractionDigits=l.length:c&&c[0]==="#"?t.maximumFractionDigits=c.length:f&&d?(t.minimumFractionDigits=f.length,t.maximumFractionDigits=f.length+d.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var s=i.options[0];s==="w"?t=oe(oe({},t),{trailingZeroDisplay:"stripIfInteger"}):s&&(t=oe(oe({},t),eS(s)));continue}if(Z2.test(i.stem)){t=oe(oe({},t),eS(i.stem));continue}var u=tS(i.stem);u&&(t=oe(oe({},t),u));var o=D6(i.stem);o&&(t=oe(oe({},t),o))}return t}var Jg,I6=new RegExp("^".concat(q2.source,"*")),R6=new RegExp("".concat(q2.source,"*$"));function Le(e,t){return{start:e,end:t}}var F6=!!String.prototype.startsWith,L6=!!String.fromCodePoint,N6=!!Object.fromEntries,z6=!!String.prototype.codePointAt,j6=!!String.prototype.trimStart,B6=!!String.prototype.trimEnd,V6=!!Number.isSafeInteger,U6=V6?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Zg=!0;try{var H6=aS("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Zg=((Jg=H6.exec("a"))===null||Jg===void 0?void 0:Jg[0])==="a"}catch{Zg=!1}var nS=F6?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Qg=L6?String.fromCodePoint:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n="",i=t.length,s=0,u;i>s;){if(u=t[s++],u>1114111)throw RangeError(u+" is not a valid code point");n+=u<65536?String.fromCharCode(u):String.fromCharCode(((u-=65536)>>10)+55296,u%1024+56320)}return n},iS=N6?Object.fromEntries:function(t){for(var r={},n=0,i=t;n<i.length;n++){var s=i[n],u=s[0],o=s[1];r[u]=o}return r},oS=z6?function(t,r){return t.codePointAt(r)}:function(t,r){var n=t.length;if(!(r<0||r>=n)){var i=t.charCodeAt(r),s;return i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?i:(i-55296<<10)+(s-56320)+65536}},W6=j6?function(t){return t.trimStart()}:function(t){return t.replace(I6,"")},Y6=B6?function(t){return t.trimEnd()}:function(t){return t.replace(R6,"")};function aS(e,t){return new RegExp(e,t)}var em;if(Zg){var sS=aS("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");em=function(t,r){var n;sS.lastIndex=r;var i=sS.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}}else em=function(t,r){for(var n=[];;){var i=oS(t,r);if(i===void 0||lS(i)||q6(i))break;n.push(i),r+=i>=65536?2:1}return Qg.apply(void 0,n)};var K6=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var i=[];!this.isEOF();){var s=this.char();if(s===123){var u=this.parseArgument(t,n);if(u.err)return u;i.push(u.val)}else{if(s===125&&t>0)break;if(s===35&&(r==="plural"||r==="selectordinal")){var o=this.clonePosition();this.bump(),i.push({type:rt.pound,location:Le(o,this.clonePosition())})}else if(s===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(Fe.UNMATCHED_CLOSING_TAG,Le(this.clonePosition(),this.clonePosition()))}else if(s===60&&!this.ignoreTag&&tm(this.peek()||0)){var u=this.parseTag(t,r);if(u.err)return u;i.push(u.val)}else{var u=this.parseLiteral(t,r);if(u.err)return u;i.push(u.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:rt.literal,value:"<".concat(i,"/>"),location:Le(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var s=this.parseMessage(t+1,r,!0);if(s.err)return s;var u=s.val,o=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!tm(this.char()))return this.error(Fe.INVALID_TAG,Le(o,this.clonePosition()));var a=this.clonePosition(),l=this.parseTagName();return i!==l?this.error(Fe.UNMATCHED_CLOSING_TAG,Le(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:rt.tag,value:i,children:u,location:Le(n,this.clonePosition())},err:null}:this.error(Fe.INVALID_TAG,Le(o,this.clonePosition())))}else return this.error(Fe.UNCLOSED_TAG,Le(n,this.clonePosition()))}else return this.error(Fe.INVALID_TAG,Le(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&G6(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var s=this.tryParseQuote(r);if(s){i+=s;continue}var u=this.tryParseUnquoted(t,r);if(u){i+=u;continue}var o=this.tryParseLeftAngleBracket();if(o){i+=o;continue}break}var a=Le(n,this.clonePosition());return{val:{type:rt.literal,value:i,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!X6(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Qg.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Qg(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Fe.EXPECT_ARGUMENT_CLOSING_BRACE,Le(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(Fe.EMPTY_ARGUMENT,Le(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(Fe.MALFORMED_ARGUMENT,Le(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Fe.EXPECT_ARGUMENT_CLOSING_BRACE,Le(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:rt.argument,value:i,location:Le(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Fe.EXPECT_ARGUMENT_CLOSING_BRACE,Le(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(Fe.MALFORMED_ARGUMENT,Le(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=em(this.message,r),i=r+n.length;this.bumpTo(i);var s=this.clonePosition(),u=Le(t,s);return{value:n,location:u}},e.prototype.parseArgumentOptions=function(t,r,n,i){var s,u=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(o){case"":return this.error(Fe.EXPECT_ARGUMENT_TYPE,Le(u,a));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var h=this.clonePosition(),c=this.parseSimpleArgStyleIfPossible();if(c.err)return c;var f=Y6(c.val);if(f.length===0)return this.error(Fe.EXPECT_ARGUMENT_STYLE,Le(this.clonePosition(),this.clonePosition()));var d=Le(h,this.clonePosition());l={style:f,styleLocation:d}}var g=this.tryParseArgumentClose(i);if(g.err)return g;var m=Le(i,this.clonePosition());if(l&&nS(l==null?void 0:l.style,"::",0)){var p=W6(l.style.slice(2));if(o==="number"){var c=this.parseNumberSkeletonFromString(p,l.styleLocation);return c.err?c:{val:{type:rt.number,value:n,location:m,style:c.val},err:null}}else{if(p.length===0)return this.error(Fe.EXPECT_DATE_TIME_SKELETON,m);var f={type:va.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?P6(p):{}},v=o==="date"?rt.date:rt.time;return{val:{type:v,value:n,location:m,style:f},err:null}}}return{val:{type:o==="number"?rt.number:o==="date"?rt.date:rt.time,value:n,location:m,style:(s=l==null?void 0:l.style)!==null&&s!==void 0?s:null},err:null}}case"plural":case"selectordinal":case"select":{var y=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Fe.EXPECT_SELECT_ARGUMENT_OPTIONS,Le(y,oe({},y)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),x=0;if(o!=="select"&&b.value==="offset"){if(!this.bumpIf(":"))return this.error(Fe.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Le(this.clonePosition(),this.clonePosition()));this.bumpSpace();var c=this.tryParseDecimalInteger(Fe.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Fe.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(c.err)return c;this.bumpSpace(),b=this.parseIdentifierIfPossible(),x=c.val}var w=this.tryParsePluralOrSelectOptions(t,o,r,b);if(w.err)return w;var g=this.tryParseArgumentClose(i);if(g.err)return g;var T=Le(i,this.clonePosition());return o==="select"?{val:{type:rt.select,value:n,options:iS(w.val),location:T},err:null}:{val:{type:rt.plural,value:n,options:iS(w.val),offset:x,pluralType:o==="plural"?"cardinal":"ordinal",location:T},err:null}}default:return this.error(Fe.INVALID_ARGUMENT_TYPE,Le(u,a))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(Fe.EXPECT_ARGUMENT_CLOSING_BRACE,Le(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Fe.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Le(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=M6(t)}catch{return this.error(Fe.INVALID_NUMBER_SKELETON,r)}return{val:{type:va.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?A6(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var s,u=!1,o=[],a=new Set,l=i.value,h=i.location;;){if(l.length===0){var c=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(Fe.EXPECT_PLURAL_ARGUMENT_SELECTOR,Fe.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;h=Le(c,this.clonePosition()),l=this.message.slice(c.offset,this.offset())}else break}if(a.has(l))return this.error(r==="select"?Fe.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Fe.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);l==="other"&&(u=!0),this.bumpSpace();var d=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?Fe.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Fe.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Le(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(t+1,r,n);if(g.err)return g;var m=this.tryParseArgumentClose(d);if(m.err)return m;o.push([l,{value:g.val,location:Le(d,this.clonePosition())}]),a.add(l),this.bumpSpace(),s=this.parseIdentifierIfPossible(),l=s.value,h=s.location}return o.length===0?this.error(r==="select"?Fe.EXPECT_SELECT_ARGUMENT_SELECTOR:Fe.EXPECT_PLURAL_ARGUMENT_SELECTOR,Le(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!u?this.error(Fe.MISSING_OTHER_CLAUSE,Le(this.clonePosition(),this.clonePosition())):{val:o,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var s=!1,u=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)s=!0,u=u*10+(o-48),this.bump();else break}var a=Le(i,this.clonePosition());return s?(u*=n,U6(u)?{val:u,err:null}:this.error(r,a)):this.error(t,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=oS(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(nS(this.message,t,this.offset())){for(var r=0;r<t.length;r++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var r=this.offset(),n=this.message.indexOf(t,r);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&lS(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n!=null?n:null},e}();function tm(e){return e>=97&&e<=122||e>=65&&e<=90}function X6(e){return tm(e)||e===47}function G6(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function lS(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function q6(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function rm(e){e.forEach(function(t){if(delete t.location,Y2(t)||K2(t))for(var r in t.options)delete t.options[r].location,rm(t.options[r].value);else U2(t)&&G2(t.style)||(H2(t)||W2(t))&&qg(t.style)?delete t.style.location:X2(t)&&rm(t.children)})}function J6(e,t){t===void 0&&(t={}),t=oe({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new K6(e,t).parse();if(r.err){var n=SyntaxError(Fe[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(t==null?void 0:t.captureLocation)||rm(r.val),r.val}function sn(e,t){var r=t&&t.cache?t.cache:nR,n=t&&t.serializer?t.serializer:rR,i=t&&t.strategy?t.strategy:Q6;return i(e,{cache:r,serializer:n})}function Z6(e){return e==null||typeof e=="number"||typeof e=="boolean"}function uS(e,t,r,n){var i=Z6(n)?n:r(n),s=t.get(i);return typeof s=="undefined"&&(s=e.call(this,n),t.set(i,s)),s}function cS(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),s=t.get(i);return typeof s=="undefined"&&(s=e.apply(this,n),t.set(i,s)),s}function nm(e,t,r,n,i){return r.bind(t,e,n,i)}function Q6(e,t){var r=e.length===1?uS:cS;return nm(e,this,r,t.cache.create(),t.serializer)}function eR(e,t){return nm(e,this,cS,t.cache.create(),t.serializer)}function tR(e,t){return nm(e,this,uS,t.cache.create(),t.serializer)}var rR=function(){return JSON.stringify(arguments)};function im(){this.cache=Object.create(null)}im.prototype.get=function(e){return this.cache[e]},im.prototype.set=function(e,t){this.cache[e]=t};var nR={create:function(){return new im}},ln={variadic:eR,monadic:tR},un;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(un||(un={}));var ci=function(e){br(t,e);function t(r,n,i){var s=e.call(this,r)||this;return s.code=n,s.originalMessage=i,s}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),fS=function(e){br(t,e);function t(r,n,i,s){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),un.INVALID_VALUE,s)||this}return t}(ci),iR=function(e){br(t,e);function t(r,n,i){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),un.INVALID_VALUE,i)||this}return t}(ci),oR=function(e){br(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),un.MISSING_VALUE,n)||this}return t}(ci),Zt;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(Zt||(Zt={}));function aR(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==Zt.literal||r.type!==Zt.literal?t.push(r):n.value+=r.value,t},[])}function dS(e){return typeof e=="function"}function Kc(e,t,r,n,i,s,u){if(e.length===1&&V2(e[0]))return[{type:Zt.literal,value:e[0].value}];for(var o=[],a=0,l=e;a<l.length;a++){var h=l[a];if(V2(h)){o.push({type:Zt.literal,value:h.value});continue}if(C6(h)){typeof s=="number"&&o.push({type:Zt.literal,value:r.getNumberFormat(t).format(s)});continue}var c=h.value;if(!(i&&c in i))throw new oR(c,u);var f=i[c];if(T6(h)){(!f||typeof f=="string"||typeof f=="number")&&(f=typeof f=="string"||typeof f=="number"?String(f):""),o.push({type:typeof f=="string"?Zt.literal:Zt.object,value:f});continue}if(H2(h)){var d=typeof h.style=="string"?n.date[h.style]:qg(h.style)?h.style.parsedOptions:void 0;o.push({type:Zt.literal,value:r.getDateTimeFormat(t,d).format(f)});continue}if(W2(h)){var d=typeof h.style=="string"?n.time[h.style]:qg(h.style)?h.style.parsedOptions:void 0;o.push({type:Zt.literal,value:r.getDateTimeFormat(t,d).format(f)});continue}if(U2(h)){var d=typeof h.style=="string"?n.number[h.style]:G2(h.style)?h.style.parsedOptions:void 0;d&&d.scale&&(f=f*(d.scale||1)),o.push({type:Zt.literal,value:r.getNumberFormat(t,d).format(f)});continue}if(X2(h)){var g=h.children,m=h.value,p=i[m];if(!dS(p))throw new iR(m,"function",u);var v=Kc(g,t,r,n,i,s),y=p(v.map(function(w){return w.value}));Array.isArray(y)||(y=[y]),o.push.apply(o,y.map(function(w){return{type:typeof w=="string"?Zt.literal:Zt.object,value:w}}))}if(Y2(h)){var b=h.options[f]||h.options.other;if(!b)throw new fS(h.value,f,Object.keys(h.options),u);o.push.apply(o,Kc(b.value,t,r,n,i));continue}if(K2(h)){var b=h.options["=".concat(f)];if(!b){if(!Intl.PluralRules)throw new ci(`Intl.PluralRules is not available in this environment.
Try polyfilling it using "@formatjs/intl-pluralrules"
`,un.MISSING_INTL_API,u);var x=r.getPluralRules(t,{type:h.pluralType}).select(f-(h.offset||0));b=h.options[x]||h.options.other}if(!b)throw new fS(h.value,f,Object.keys(h.options),u);o.push.apply(o,Kc(b.value,t,r,n,i,f-(h.offset||0)));continue}}return aR(o)}function sR(e,t){return t?oe(oe(oe({},e||{}),t||{}),Object.keys(e).reduce(function(r,n){return r[n]=oe(oe({},e[n]),t[n]||{}),r},{})):e}function lR(e,t){return t?Object.keys(e).reduce(function(r,n){return r[n]=sR(e[n],t[n]),r},oe({},e)):e}function om(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function uR(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:sn(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.NumberFormat).bind.apply(t,Mt([void 0],r,!1)))},{cache:om(e.number),strategy:ln.variadic}),getDateTimeFormat:sn(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.DateTimeFormat).bind.apply(t,Mt([void 0],r,!1)))},{cache:om(e.dateTime),strategy:ln.variadic}),getPluralRules:sn(function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((t=Intl.PluralRules).bind.apply(t,Mt([void 0],r,!1)))},{cache:om(e.pluralRules),strategy:ln.variadic})}}var am=function(){function e(t,r,n,i){var s=this;if(r===void 0&&(r=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(u){var o=s.formatToParts(u);if(o.length===1)return o[0].value;var a=o.reduce(function(l,h){return!l.length||h.type!==Zt.literal||typeof l[l.length-1]!="string"?l.push(h.value):l[l.length-1]+=h.value,l},[]);return a.length<=1?a[0]||"":a},this.formatToParts=function(u){return Kc(s.ast,s.locales,s.formatters,s.formats,u,void 0,s.message)},this.resolvedOptions=function(){return{locale:Intl.NumberFormat.supportedLocalesOf(s.locales)[0]}},this.getAst=function(){return s.ast},typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:i==null?void 0:i.ignoreTag})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=lR(e.formats,n),this.locales=r,this.formatters=i&&i.formatters||uR(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.__parse=J6,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}(),cR=am,Wt;(function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",e.INVALID_CONFIG="INVALID_CONFIG",e.MISSING_DATA="MISSING_DATA",e.MISSING_TRANSLATION="MISSING_TRANSLATION"})(Wt||(Wt={}));var cr=function(e){br(t,e);function t(r,n,i){var s=this,u=i?i instanceof Error?i:new Error(String(i)):void 0;return s=e.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,` 
`).concat(u?`
`.concat(u.message,`
`).concat(u.stack):""))||this,s.code=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(s,t),s}return t}(Error),fR=function(e){br(t,e);function t(r,n){return e.call(this,Wt.UNSUPPORTED_FORMATTER,r,n)||this}return t}(cr),dR=function(e){br(t,e);function t(r,n){return e.call(this,Wt.INVALID_CONFIG,r,n)||this}return t}(cr),hS=function(e){br(t,e);function t(r,n){return e.call(this,Wt.MISSING_DATA,r,n)||this}return t}(cr),sm=function(e){br(t,e);function t(r,n,i){return e.call(this,Wt.FORMAT_ERROR,"".concat(r,` 
Locale: `).concat(n,`
`),i)||this}return t}(cr),lm=function(e){br(t,e);function t(r,n,i,s){var u=e.call(this,"".concat(r,` 
MessageID: `).concat(i==null?void 0:i.id,`
Default Message: `).concat(i==null?void 0:i.defaultMessage,`
Description: `).concat(i==null?void 0:i.description,` 
`),n,s)||this;return u.descriptor=i,u}return t}(sm),hR=function(e){br(t,e);function t(r,n){var i=e.call(this,Wt.MISSING_TRANSLATION,'Missing message: "'.concat(r.id,'" for locale "').concat(n,'", using ').concat(r.defaultMessage?"default message":"id"," as fallback."))||this;return i.descriptor=r,i}return t}(cr);function Ki(e,t,r){return r===void 0&&(r={}),t.reduce(function(n,i){return i in e?n[i]=e[i]:i in r&&(n[i]=r[i]),n},{})}var pR=function(e){},pS={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:pR};function gS(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function Xi(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function gR(e){e===void 0&&(e=gS());var t=Intl.RelativeTimeFormat,r=Intl.ListFormat,n=Intl.DisplayNames,i=sn(function(){for(var o,a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return new((o=Intl.DateTimeFormat).bind.apply(o,Mt([void 0],a,!1)))},{cache:Xi(e.dateTime),strategy:ln.variadic}),s=sn(function(){for(var o,a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return new((o=Intl.NumberFormat).bind.apply(o,Mt([void 0],a,!1)))},{cache:Xi(e.number),strategy:ln.variadic}),u=sn(function(){for(var o,a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return new((o=Intl.PluralRules).bind.apply(o,Mt([void 0],a,!1)))},{cache:Xi(e.pluralRules),strategy:ln.variadic});return{getDateTimeFormat:i,getNumberFormat:s,getMessageFormat:sn(function(o,a,l,h){return new am(o,a,l,oe({formatters:{getNumberFormat:s,getDateTimeFormat:i,getPluralRules:u}},h||{}))},{cache:Xi(e.message),strategy:ln.variadic}),getRelativeTimeFormat:sn(function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return new(t.bind.apply(t,Mt([void 0],o,!1)))},{cache:Xi(e.relativeTime),strategy:ln.variadic}),getPluralRules:u,getListFormat:sn(function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return new(r.bind.apply(r,Mt([void 0],o,!1)))},{cache:Xi(e.list),strategy:ln.variadic}),getDisplayNames:sn(function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return new(n.bind.apply(n,Mt([void 0],o,!1)))},{cache:Xi(e.displayNames),strategy:ln.variadic})}}function um(e,t,r,n){var i=e&&e[t],s;if(i&&(s=i[r]),s)return s;n(new fR("No ".concat(t," format named: ").concat(r)))}function Xc(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=oe({timeZone:t},e[n]),r},{})}function mS(e,t){var r=Object.keys(oe(oe({},e),t));return r.reduce(function(n,i){return n[i]=oe(oe({},e[i]||{}),t[i]||{}),n},{})}function vS(e,t){if(!t)return e;var r=am.formats;return oe(oe(oe({},r),e),{date:mS(Xc(r.date,t),Xc(e.date||{},t)),time:mS(Xc(r.time,t),Xc(e.time||{},t))})}function yS(e,t,r,n,i){var s=e.locale,u=e.formats,o=e.messages,a=e.defaultLocale,l=e.defaultFormats,h=e.fallbackOnEmptyString,c=e.onError,f=e.timeZone,d=e.defaultRichTextElements;r===void 0&&(r={id:""});var g=r.id,m=r.defaultMessage;B2(!!g,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var p=String(g),v=o&&Object.prototype.hasOwnProperty.call(o,p)&&o[p];if(Array.isArray(v)&&v.length===1&&v[0].type===rt.literal)return v[0].value;if(!n&&v&&typeof v=="string"&&!d)return v.replace(/'\{(.*?)\}'/gi,"{$1}");if(n=oe(oe({},d),n||{}),u=vS(u,f),l=vS(l,f),!v){if(h===!1&&v==="")return v;if((!m||s&&s.toLowerCase()!==a.toLowerCase())&&c(new hR(r,s)),m)try{var y=t.getMessageFormat(m,a,l,i);return y.format(n)}catch(b){return c(new lm('Error formatting default message for: "'.concat(p,'", rendering default message verbatim'),s,r,b)),typeof m=="string"?m:p}return p}try{var y=t.getMessageFormat(v,s,u,oe({formatters:t},i||{}));return y.format(n)}catch(b){c(new lm('Error formatting message: "'.concat(p,'", using ').concat(m?"default message":"id"," as fallback."),s,r,b))}if(m)try{var y=t.getMessageFormat(m,a,l,i);return y.format(n)}catch(b){c(new lm('Error formatting the default message for: "'.concat(p,'", rendering message verbatim'),s,r,b))}return typeof v=="string"?v:typeof m=="string"?m:p}var bS=["localeMatcher","formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem"];function Gc(e,t,r,n){var i=e.locale,s=e.formats,u=e.onError,o=e.timeZone;n===void 0&&(n={});var a=n.format,l=oe(oe({},o&&{timeZone:o}),a&&um(s,t,a,u)),h=Ki(n,bS,l);return t==="time"&&!h.hour&&!h.minute&&!h.second&&!h.timeStyle&&!h.dateStyle&&(h=oe(oe({},h),{hour:"numeric",minute:"numeric"})),r(i,h)}function mR(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],u=s===void 0?{}:s,o=typeof i=="string"?new Date(i||0):i;try{return Gc(e,"date",t,u).format(o)}catch(a){e.onError(new cr(Wt.FORMAT_ERROR,"Error formatting date.",a))}return String(o)}function vR(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],u=s===void 0?{}:s,o=typeof i=="string"?new Date(i||0):i;try{return Gc(e,"time",t,u).format(o)}catch(a){e.onError(new cr(Wt.FORMAT_ERROR,"Error formatting time.",a))}return String(o)}function yR(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],u=r[2],o=u===void 0?{}:u,a=e.timeZone,l=e.locale,h=e.onError,c=Ki(o,bS,a?{timeZone:a}:{});try{return t(l,c).formatRange(i,s)}catch(f){h(new cr(Wt.FORMAT_ERROR,"Error formatting date time range.",f))}return String(i)}function bR(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],u=s===void 0?{}:s,o=typeof i=="string"?new Date(i||0):i;try{return Gc(e,"date",t,u).formatToParts(o)}catch(a){e.onError(new cr(Wt.FORMAT_ERROR,"Error formatting date.",a))}return[]}function xR(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[0],s=r[1],u=s===void 0?{}:s,o=typeof i=="string"?new Date(i||0):i;try{return Gc(e,"time",t,u).formatToParts(o)}catch(a){e.onError(new cr(Wt.FORMAT_ERROR,"Error formatting time.",a))}return[]}var wR=["localeMatcher","style","type","fallback"];function SR(e,t,r,n){var i=e.locale,s=e.onError,u=Intl.DisplayNames;u||s(new ci(`Intl.DisplayNames is not available in this environment.
Try polyfilling it using "@formatjs/intl-displaynames"
`,un.MISSING_INTL_API));var o=Ki(n,wR);try{return t(i,o).of(r)}catch(a){s(new cr(Wt.FORMAT_ERROR,"Error formatting display name.",a))}}var _R=["localeMatcher","type","style"],xS=Date.now();function TR(e){return"".concat(xS,"_").concat(e,"_").concat(xS)}function CR(e,t,r,n){n===void 0&&(n={});var i=wS(e,t,r,n).reduce(function(s,u){var o=u.value;return typeof o!="string"?s.push(o):typeof s[s.length-1]=="string"?s[s.length-1]+=o:s.push(o),s},[]);return i.length===1?i[0]:i}function wS(e,t,r,n){var i=e.locale,s=e.onError;n===void 0&&(n={});var u=Intl.ListFormat;u||s(new ci(`Intl.ListFormat is not available in this environment.
Try polyfilling it using "@formatjs/intl-listformat"
`,un.MISSING_INTL_API));var o=Ki(n,_R);try{var a={},l=r.map(function(h,c){if(typeof h=="object"){var f=TR(c);return a[f]=h,f}return String(h)});return t(i,o).formatToParts(l).map(function(h){return h.type==="literal"?h:oe(oe({},h),{value:a[h.value]||h.value})})}catch(h){s(new cr(Wt.FORMAT_ERROR,"Error formatting list.",h))}return r}var ER=["localeMatcher","type"];function PR(e,t,r,n){var i=e.locale,s=e.onError;n===void 0&&(n={}),Intl.PluralRules||s(new ci(`Intl.PluralRules is not available in this environment.
Try polyfilling it using "@formatjs/intl-pluralrules"
`,un.MISSING_INTL_API));var u=Ki(n,ER);try{return t(i,u).select(r)}catch(o){s(new sm("Error formatting plural.",i,o))}return"other"}var OR=["numeric","style"];function MR(e,t,r){var n=e.locale,i=e.formats,s=e.onError;r===void 0&&(r={});var u=r.format,o=!!u&&um(i,"relative",u,s)||{},a=Ki(r,OR,o);return t(n,a)}function kR(e,t,r,n,i){i===void 0&&(i={}),n||(n="second");var s=Intl.RelativeTimeFormat;s||e.onError(new ci(`Intl.RelativeTimeFormat is not available in this environment.
Try polyfilling it using "@formatjs/intl-relativetimeformat"
`,un.MISSING_INTL_API));try{return MR(e,t,i).format(r,n)}catch(u){e.onError(new sm("Error formatting relative time.",e.locale,u))}return String(r)}var $R=["localeMatcher","style","currency","currencyDisplay","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem"];function SS(e,t,r){var n=e.locale,i=e.formats,s=e.onError;r===void 0&&(r={});var u=r.format,o=u&&um(i,"number",u,s)||{},a=Ki(r,$R,o);return t(n,a)}function DR(e,t,r,n){n===void 0&&(n={});try{return SS(e,t,n).format(r)}catch(i){e.onError(new cr(Wt.FORMAT_ERROR,"Error formatting number.",i))}return String(r)}function AR(e,t,r,n){n===void 0&&(n={});try{return SS(e,t,n).formatToParts(r)}catch(i){e.onError(new cr(Wt.FORMAT_ERROR,"Error formatting number.",i))}return[]}function IR(e){var t=e?e[Object.keys(e)[0]]:void 0;return typeof t=="string"}function RR(e){e.defaultRichTextElements&&IR(e.messages||{})&&console.warn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled. 
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function FR(e,t){var r=gR(t),n=oe(oe({},pS),e),i=n.locale,s=n.defaultLocale,u=n.onError;return i?!Intl.NumberFormat.supportedLocalesOf(i).length&&u?u(new hS('Missing locale data for locale: "'.concat(i,'" in Intl.NumberFormat. Using default locale: "').concat(s,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(i).length&&u&&u(new hS('Missing locale data for locale: "'.concat(i,'" in Intl.DateTimeFormat. Using default locale: "').concat(s,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(u&&u(new dR('"locale" was not configured, using "'.concat(s,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),n.locale=n.defaultLocale||"en"),RR(n),oe(oe({},n),{formatters:r,formatNumber:DR.bind(null,n,r.getNumberFormat),formatNumberToParts:AR.bind(null,n,r.getNumberFormat),formatRelativeTime:kR.bind(null,n,r.getRelativeTimeFormat),formatDate:mR.bind(null,n,r.getDateTimeFormat),formatDateToParts:bR.bind(null,n,r.getDateTimeFormat),formatTime:vR.bind(null,n,r.getDateTimeFormat),formatDateTimeRange:yR.bind(null,n,r.getDateTimeFormat),formatTimeToParts:xR.bind(null,n,r.getDateTimeFormat),formatPlural:PR.bind(null,n,r.getPluralRules),formatMessage:yS.bind(null,n,r),formatList:CR.bind(null,n,r.getListFormat),formatListToParts:wS.bind(null,n,r.getListFormat),formatDisplayName:SR.bind(null,n,r.getDisplayNames)})}function _S(e){B2(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var TS=oe(oe({},pS),{textComponent:C.exports.Fragment});function LR(e){return function(t){return e(C.exports.Children.toArray(t))}}function cm(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=Object.keys(e),n=Object.keys(t),i=r.length;if(n.length!==i)return!1;for(var s=0;s<i;s++){var u=r[s];if(e[u]!==t[u]||!Object.prototype.hasOwnProperty.call(t,u))return!1}return!0}var fm=C.exports.createContext(null);fm.Consumer;var NR=fm.Provider,zR=NR,jR=fm;function Gi(){var e=C.exports.useContext(jR);return _S(e),e}function dm(e){return{locale:e.locale,timeZone:e.timeZone,fallbackOnEmptyString:e.fallbackOnEmptyString,formats:e.formats,textComponent:e.textComponent,messages:e.messages,defaultLocale:e.defaultLocale,defaultFormats:e.defaultFormats,onError:e.onError,wrapRichTextChunksInFragment:e.wrapRichTextChunksInFragment,defaultRichTextElements:e.defaultRichTextElements}}function CS(e){return e&&Object.keys(e).reduce(function(t,r){var n=e[r];return t[r]=dS(n)?LR(n):n,t},{})}var BR=function(e,t,r,n){for(var i=[],s=4;s<arguments.length;s++)i[s-4]=arguments[s];var u=CS(n),o=yS.apply(void 0,Mt([e,t,r,u],i,!1));return Array.isArray(o)?C.exports.Children.toArray(o):o},ES=function(e,t){var r=e.defaultRichTextElements,n=Lt(e,["defaultRichTextElements"]),i=CS(r),s=FR(oe(oe(oe({},TS),n),{defaultRichTextElements:i}),t);return oe(oe({},s),{formatMessage:BR.bind(null,{locale:s.locale,timeZone:s.timeZone,fallbackOnEmptyString:s.fallbackOnEmptyString,formats:s.formats,defaultLocale:s.defaultLocale,defaultFormats:s.defaultFormats,messages:s.messages,onError:s.onError,defaultRichTextElements:i},s.formatters)})},VR=function(e){br(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.cache=gS(),r.state={cache:r.cache,intl:ES(dm(r.props),r.cache),prevConfig:dm(r.props)},r}return t.getDerivedStateFromProps=function(r,n){var i=n.prevConfig,s=n.cache,u=dm(r);return cm(i,u)?null:{intl:ES(u,s),prevConfig:u}},t.prototype.render=function(){return _S(this.state.intl),C.exports.createElement(zR,{value:this.state.intl},this.props.children)},t.displayName="IntlProvider",t.defaultProps=TS,t}(C.exports.PureComponent),UR=VR;function HR(e,t){var r=e.values,n=Lt(e,["values"]),i=t.values,s=Lt(t,["values"]);return cm(i,r)&&cm(n,s)}function PS(e){var t=Gi(),r=t.formatMessage,n=t.textComponent,i=n===void 0?C.exports.Fragment:n,s=e.id,u=e.description,o=e.defaultMessage,a=e.values,l=e.children,h=e.tagName,c=h===void 0?i:h,f=e.ignoreTag,d={id:s,description:u,defaultMessage:o},g=r(d,a,{ignoreTag:f});return typeof l=="function"?l(Array.isArray(g)?g:[g]):c?C.exports.createElement(c,null,C.exports.Children.toArray(g)):C.exports.createElement(C.exports.Fragment,null,g)}PS.displayName="FormattedMessage";var OS=C.exports.memo(PS,HR);OS.displayName="MemoizedFormattedMessage";var De=OS;function wq(e){return e}function Sq(e){return e}var hm=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(hm||{}),MS=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(MS||{});const WR=[{name:"circle",type:"Circle"},{name:"square",type:"Rect",options:{lockUniScaling:!1}},{name:"triangle",type:"Triangle"},{name:"ellipse",type:"Ellipse",options:{lockUniScaling:!1}},{name:"Arrow #1",type:"Path",options:{path:"M 294.9 16.4 l 15.7 42.2 c -171.4 70.3 -294 242.3 -289.1 437.4 l 14.7 -1 c 9.1 -0.6 18.1 -1.2 27.1 -1.9 l 14.7 -1 c -4.3 -170.1 102.5 -320 252 -381.3 l 15.7 42.2 c 34.7 -40.5 83.1 -76.6 144.8 -99.8 c -58.1 -26.2 -124.9 -39.6 -195.6 -36.8 z"}},{name:"Arrow #2",type:"Path",options:{path:"M 16 248.4 v 14.9 h 447.5 l -93.2 82.5 l 11.9 10.5 l 113.8 -100.2 l -113.6 -100.4 l -11.8 10.5 l 92.9 82.2 z"}},{name:"Arrow #3",type:"Path",options:{path:"M 496 256 l -118.6 -66 v 40.8 h -361.4 v 50.4 h 361.4 v 40.8 l 118.6 -66 z"}},{name:"Line",type:"Path",options:{path:"M 16 256 h 480",strokeWidth:10,stroke:"#000",padding:10}},{name:"Star",type:"Path",options:{path:"M 256 406.3 l 148.3 78 l -28.3 -165.2 l 120 -117 l -165.8 -24.1 l -74.2 -150.3 l -74.2 150.3 l -165.8 24.1 l 120 117 l -28.3 165.2 z"}},{name:"Polygon",type:"Path",options:{path:"M 256 19.6 l 156.6 57.1 l 83.4 144.3 l -28.9 164.2 l -127.7 107.2 h -166.8 l -127.7 -107.2 l -28.9 -164.2 l 83.4 -144.3 z"}},{name:"Badge",type:"Path",options:{path:"M 257.3 16.2 s -148 58.2 -204.4 81.4 c 0 75.7 -16.8 303.5 204.4 398.2 c 218.7 -94.6 201.9 -322.4 201.9 -398.2 c -62.1 -23.6 -201.9 -81.4 -201.9 -81.4 z"}}],YR=[{name:"emoticons",list:["afro-1","afro","agent","alien-1","alien","angel","angry-1","angry-2","angry-3","angry-4","angry-5","angry","arguing","arrogant","asian-1","asian","avatar","baby-1","baby-2","baby","bully","burglar","businessman","cheeky-1","cheeky","clown","confused-1","confused-2","confused-3","confused","creepy","crying-1","crying-2","crying-3","crying","dazed-1","dazed-2","dazed-3","dazed","dead-1","dead-2","dead-3","dead-4","dead-5","dead-6","dead","desperate-1","desperate","detective","dissapointment","doctor","drunk","dumb","emo-1","emo-2","emo","emoticon","evil","faint-1","faint","flirt-1","flirt-2","flirt","flirty","gangster","geek-1","geek","gentleman-1","gentleman-2","gentleman-3","gentleman-4","gentleman","ginger","girl-1","girl","goofy-1","goofy-2","goofy-3","goofy-4","goofy","grubby-1","grubby","happy-1","happy-10","happy-11","happy-12","happy-13","happy-14","happy-15","happy-16","happy-2","happy-3","happy-4","happy-5","happy-6","happy-7","happy-8","happy-9","happy","harry-potter","heisenberg","hipster-1","hipster-2","hipster","in-love-1","in-love-2","in-love-3","in-love-4","in-love-5","in-love-6","in-love","japan","jew","joyful-1","joyful-2","joyful","kiss-1","kiss-2","kiss-3","kiss-4","kiss","laughing-1","laughing-2","laughing-3","laughing","listening","love","manly","miserly-1","miserly","nerd-1","nerd-2","nerd-3","nerd-4","nerd","ninja","pirate-1","pirate-2","pirate","punk-1","punk-2","punk","rapper","relieved","rich-1","rich-2","rich","rockstar","sad-1","sad-2","sad-3","sad-4","sad-5","sad-6","sad","scared-1","scared-2","scared-3","scared","sceptic-1","sceptic-2","sceptic-3","sceptic-4","sceptic-5","sceptic-6","sceptic-7","sceptic","secret","shocked-1","shocked-2","shocked-3","shocked","sick-1","sick-2","sick-3","sick-4","sick","silent","skeleton","smile","smiling-1","smiling","smoked","smug-1","smug-2","smug-3","smug-4","smug-5","smug-6","smug","sporty","stunned","superhero-1","superhero-2","superhero-3","superhero-4","superhero","surprised-1","surprised","thinking","tired-1","tired-2","tired-3","tired","tough-1","tough","trendy","vampire-1","vampire","wink-1","wink-2","wink","winking-1","winking","yawning-1","yawning-2","yawning-3","yawning","yelling","zombie"],type:"svg",thumbnailUrl:"images/stickers/categories/emoticon.svg"},{name:"doodles",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/doodles.svg"},{name:"landmarks",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/landmark.svg",invertPreview:!0},{name:"bubbles",items:104,type:"png",thumbnailUrl:"images/stickers/categories/speech-bubble.svg"},{name:"transportation",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/transportation.svg",invertPreview:!0},{name:"beach",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/beach.svg",invertPreview:!0}],KR={emoticons:{id:"ndJMAh",defaultMessage:[{type:0,value:"Emoticons"}]},doodles:{id:"XCd0W/",defaultMessage:[{type:0,value:"Doodles"}]},landmarks:{id:"hqIEba",defaultMessage:[{type:0,value:"Landmarks"}]},bubbles:{id:"ovg8vQ",defaultMessage:[{type:0,value:"Bubbles"}]},transportation:{id:"nDt4cJ",defaultMessage:[{type:0,value:"Transportation"}]},beach:{id:"PfXXAT",defaultMessage:[{type:0,value:"Beach"}]}},pm={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},XR=["PencilBrush","SprayBrush","CircleBrush","DiamondBrush","VLineBrush","HLineBrush","SquareBrush"],kS=[1,8,15,20,25];var qc=(e=>(e.DARK="dark",e.LIGHT="light",e))(qc||{});const gm=[{name:qc.LIGHT,colors:{"--be-foreground-base":"0 0 0","--be-primary-light":"191 219 254","--be-primary":"59 130 246","--be-primary-dark":"37 99 235","--be-on-primary":"255 255 255","--be-error":"179 38 30","--be-on-error":"255 255 255","--be-background":"255 255 255","--be-background-alt":"250 250 250","--be-paper":"255 255 255","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"26%","--be-hover-opacity":"4%","--be-focus-opacity":"12%","--be-selected-opacity":"8%","--be-text-main-opacity":"87%","--be-text-muted-opacity":"60%","--be-divider-opacity":"12%"}},{name:qc.DARK,isDark:!0,colors:{"--be-foreground-base":"255 255 255","--be-primary-light":"239 246 255","--be-primary":"191 219 254","--be-primary-dark":"147 197 253","--be-on-primary":"56 30 114","--be-error":"242 184 181","--be-on-error":"96 20 16","--be-background":"20 21 23","--be-background-alt":"26 27 30","--be-paper":"44 46 51","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"30%","--be-hover-opacity":"8%","--be-focus-opacity":"12%","--be-selected-opacity":"16%","--be-text-main-opacity":"100%","--be-text-muted-opacity":"70%","--be-divider-opacity":"12%"}}];var Ge=(e=>(e.FILTER="filter",e.RESIZE="resize",e.CROP="crop",e.DRAW="draw",e.TEXT="text",e.SHAPES="shapes",e.STICKERS="stickers",e.FRAME="frame",e.CORNERS="corners",e.MERGE="merge",e))(Ge||{}),Jc={exports:{}},rl={};/** @license React v17.0.2
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var GR=C.exports,$S=60103;if(rl.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var DS=Symbol.for;$S=DS("react.element"),rl.Fragment=DS("react.fragment")}var qR=GR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,JR=Object.prototype.hasOwnProperty,ZR={key:!0,ref:!0,__self:!0,__source:!0};function AS(e,t,r){var n,i={},s=null,u=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(u=t.ref);for(n in t)JR.call(t,n)&&!ZR.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:$S,type:e,key:s,ref:u,props:i,_owner:qR.current}}rl.jsx=AS,rl.jsxs=AS,Jc.exports=rl;const S=Jc.exports.jsx,ce=Jc.exports.jsxs,xr=Jc.exports.Fragment,QR=C.exports.forwardRef((e,t)=>{const d=e,{attr:r,size:n,title:i,className:s,color:u,style:o,children:a,viewBox:l}=d,h=ze(d,["attr","size","title","className","color","style","children","viewBox"]),c=n||"1em";let f="svg-icon";return s&&(f+=` ${s}`),ce("svg",Y($($({"aria-hidden":!i,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:l||"0 0 24 24"},r),h),{className:f,style:$({color:u},o),ref:t,height:c,width:c,children:[i&&S("title",{children:i}),a]}))});function Pe(e,t=""){const r=(n,i)=>S(QR,Y($({"data-testid":`${t}Icon`,ref:i},n),{children:e}));return ee.memo(ee.forwardRef(r))}function eF(e,t=""){const r=IS(e);return Pe(r,t)}function IS(e){return e&&e.map((t,r)=>ee.createElement(t.tag,$({key:r},t.attr),IS(t.child)))}const RS=Pe(S("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),tF=Pe(S("path",{d:"M21 15h2v2h-2v-2zm0-4h2v2h-2v-2zm2 8h-2v2c1 0 2-1 2-2zM13 3h2v2h-2V3zm8 4h2v2h-2V7zm0-4v2h2c0-1-1-2-2-2zM1 7h2v2H1V7zm16-4h2v2h-2V3zm0 16h2v2h-2v-2zM3 3C2 3 1 4 1 5h2V3zm6 0h2v2H9V3zM5 3h2v2H5V3zm-4 8v8c0 1.1.9 2 2 2h12V11H1zm2 8 2.5-3.21 1.79 2.15 2.5-3.22L13 19H3z"}),"PhotoSizeSelectLargeOutlined"),rF=Pe(S("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),nF=Pe(S("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),iF=Pe(S("path",{d:"M10.5 4.5c.28 0 .5.22.5.5v2h6v6h2c.28 0 .5.22.5.5s-.22.5-.5.5h-2v6h-2.12c-.68-1.75-2.39-3-4.38-3s-3.7 1.25-4.38 3H4v-2.12c1.75-.68 3-2.39 3-4.38 0-1.99-1.24-3.7-2.99-4.38L4 7h6V5c0-.28.22-.5.5-.5m0-2C9.12 2.5 8 3.62 8 5H4c-1.1 0-1.99.9-1.99 2v3.8h.29c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-.3c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7v.3H17c1.1 0 2-.9 2-2v-4c1.38 0 2.5-1.12 2.5-2.5S20.38 11 19 11V7c0-1.1-.9-2-2-2h-4c0-1.38-1.12-2.5-2.5-2.5z"}),"ExtensionOutlined"),oF=Pe(S("path",{d:"M10.25 13c0 .69-.56 1.25-1.25 1.25S7.75 13.69 7.75 13s.56-1.25 1.25-1.25 1.25.56 1.25 1.25zM15 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm7 .25c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10zM10.66 4.12C12.06 6.44 14.6 8 17.5 8c.46 0 .91-.05 1.34-.12C17.44 5.56 14.9 4 12 4c-.46 0-.91.05-1.34.12zM4.42 9.47c1.71-.97 3.03-2.55 3.66-4.44C6.37 6 5.05 7.58 4.42 9.47zM20 12c0-.78-.12-1.53-.33-2.24-.7.15-1.42.24-2.17.24-3.13 0-5.92-1.44-7.76-3.69C8.69 8.87 6.6 10.88 4 11.86c.01.04 0 .09 0 .14 0 4.41 3.59 8 8 8s8-3.59 8-8z"}),"FaceOutlined"),aF=Pe(S("path",{d:"M20 4h-4l-4-4-4 4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H4V6h4.52l3.52-3.5L15.52 6H20v14zM6 18h12V8H6v10zm2-8h8v6H8v-6z"}),"FilterFramesOutlined"),sF=Pe(S("path",{d:"M6.41 21 5 19.59l4.83-4.83c.75-.75 1.17-1.77 1.17-2.83v-5.1L9.41 8.41 8 7l4-4 4 4-1.41 1.41L13 6.83v5.1c0 1.06.42 2.08 1.17 2.83L19 19.59 17.59 21 12 15.41 6.41 21z"}),"MergeOutlined"),lF=Pe(S("path",{d:"M19 19h2v2h-2v-2zm0-2h2v-2h-2v2zM3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm0-4h2V3H3v2zm4 0h2V3H7v2zm8 16h2v-2h-2v2zm-4 0h2v-2h-2v2zm4 0h2v-2h-2v2zm-8 0h2v-2H7v2zm-4 0h2v-2H3v2zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2V8z"}),"RoundedCornerOutlined"),FS=Pe(S("path",{d:"M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}),"PhotoLibraryOutlined"),LS=Pe(S("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"}),"HistoryOutlined"),uF=Pe([S("path",{d:"m2.53 19.65 1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zm-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95-7.35 3.05z"},"0"),S("circle",{cx:"11",cy:"9",r:"1"},"1"),S("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"},"2")],"StyleOutlined"),cF=Pe(S("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}),"DeleteOutlined"),fF=Pe(S("path",{d:"M18.85,10.39l1.06-1.06c0.78-0.78,0.78-2.05,0-2.83L18.5,5.09c-0.78-0.78-2.05-0.78-2.83,0l-1.06,1.06L18.85,10.39z M14.61,11.81L7.41,19H6v-1.41l7.19-7.19L14.61,11.81z M13.19,7.56L4,16.76V21h4.24l9.19-9.19L13.19,7.56L13.19,7.56z M19,17.5 c0,2.19-2.54,3.5-5,3.5c-0.55,0-1-0.45-1-1s0.45-1,1-1c1.54,0,3-0.73,3-1.5c0-0.47-0.48-0.87-1.23-1.2l1.48-1.48 C18.32,15.45,19,16.29,19,17.5z M4.58,13.35C3.61,12.79,3,12.06,3,11c0-1.8,1.89-2.63,3.56-3.36C7.59,7.18,9,6.56,9,6 c0-0.41-0.78-1-2-1C5.74,5,5.2,5.61,5.17,5.64C4.82,6.05,4.19,6.1,3.77,5.76C3.36,5.42,3.28,4.81,3.62,4.38C3.73,4.24,4.76,3,7,3 c2.24,0,4,1.32,4,3c0,1.87-1.93,2.72-3.64,3.47C6.42,9.88,5,10.5,5,11c0,0.31,0.43,0.6,1.07,0.86L4.58,13.35z"}),"Draw"),dF=Pe(S("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),fi={[Ge.FILTER]:{name:{id:"QYTzdT",defaultMessage:[{type:0,value:"Applied Filters"}]},icon:RS},[Ge.RESIZE]:{name:{id:"OEDpaM",defaultMessage:[{type:0,value:"Resized Image"}]},icon:tF},[Ge.CROP]:{name:{id:"Lg6O5a",defaultMessage:[{type:0,value:"Cropped Image"}]},icon:rF},[Ge.DRAW]:{name:{id:"Jc05Ei",defaultMessage:[{type:0,value:"Added Drawing"}]},icon:fF},[Ge.TEXT]:{name:{id:"TBhTYM",defaultMessage:[{type:0,value:"Added Text"}]},icon:nF},[Ge.SHAPES]:{name:{id:"JSL/ji",defaultMessage:[{type:0,value:"Added Shape"}]},icon:iF},[Ge.STICKERS]:{name:{id:"xDTFjk",defaultMessage:[{type:0,value:"Added Sticker"}]},icon:oF},[Ge.FRAME]:{name:{id:"hgv63I",defaultMessage:[{type:0,value:"Added Frame"}]},icon:aF},[Ge.MERGE]:{name:{id:"cXik3L",defaultMessage:[{type:0,value:"Merged Objects"}]},icon:sF},[Ge.CORNERS]:{name:{id:"zjEigN",defaultMessage:[{type:0,value:"Rounded Corner"}]},icon:lF},bgImage:{name:{id:"bSC4J/",defaultMessage:[{type:0,value:"Replaced Background Image"}]},icon:FS},overlayImage:{name:{id:"2PcrJ7",defaultMessage:[{type:0,value:"Added Image"}]},icon:FS},initial:{name:{id:"fCGryv",defaultMessage:[{type:0,value:"Initial"}]},icon:dF},loadedState:{name:{id:"UA9zHK",defaultMessage:[{type:0,value:"Loaded State"}]},icon:LS},objectStyle:{name:{id:"33NkCL",defaultMessage:[{type:0,value:"Changed Style"}]},icon:uF},deletedObject:{name:{id:"7kDDgB",defaultMessage:[{type:0,value:"Deleted object"}]},icon:cF}},hF=Object.values(Ge).map(e=>({name:e,icon:fi[e].icon,action:e===Ge.MERGE?t=>{t.tools.merge.apply()}:e})),pF={filter:{id:"baCdKH",defaultMessage:[{type:0,value:"Filter"}]},resize:{id:"F5usg6",defaultMessage:[{type:0,value:"Resize"}]},crop:{id:"khFxHA",defaultMessage:[{type:0,value:"Crop"}]},draw:{id:"aBdNBx",defaultMessage:[{type:0,value:"Draw"}]},text:{id:"kn9SmW",defaultMessage:[{type:0,value:"Text"}]},shapes:{id:"RpVV/g",defaultMessage:[{type:0,value:"Shapes"}]},Stickers:{id:"mcHXNc",defaultMessage:[{type:0,value:"Stickers"}]},frame:{id:"nuDv1J",defaultMessage:[{type:0,value:"Frame"}]},corners:{id:"+bdU7f",defaultMessage:[{type:0,value:"Corners"}]},merge:{id:"Ln1cJu",defaultMessage:[{type:0,value:"Merge"}]}},gF=Pe(S("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}),"FileDownloadOutlined");var mF={name:"pixie",version:"3.0.2",main:"dist/pixie.umd.js",module:"dist/pixie.es.js",types:"dist/types/pixie.d.ts",private:!0,exports:{".":{import:"./dist/pixie.es.js",require:"./dist/pixie.umd.js"}},files:["dist"],scripts:{dev:"vite --host",build:"vite build && npm run build-umd && npm run build-cc",types:"tsc --skipLibCheck --emitDeclarationOnly --noEmit false --declarationMap false","build-umd":"vite build --config scripts/vite-umd.config.ts","build-cc":"./scripts/build-cc.sh",serve:"vite preview",extract:"formatjs extract 'src/**/*.{ts,tsx}' --out-file lang.json",compile:"formatjs compile"},dependencies:{"@floating-ui/react-dom":"^0.6.0","@internationalized/number":"^3.0.3","@react-aria/button":"^3.3.4","@react-aria/checkbox":"^3.2.3","@react-aria/dialog":"^3.1.4","@react-aria/focus":"^3.5.0","@react-aria/i18n":"^3.3.4","@react-aria/interactions":"^3.7.0","@react-aria/label":"^3.2.1","@react-aria/listbox":"^3.4.0","@react-aria/menu":"^3.3.0","@react-aria/numberfield":"^3.1.1","@react-aria/overlays":"^3.8.0","@react-aria/radio":"^3.1.6","@react-aria/select":"^3.6.0","@react-aria/slider":"^3.0.3","@react-aria/ssr":"^3.1.0","@react-aria/tabs":"^3.1.0","@react-aria/textfield":"^3.5.0","@react-aria/utils":"^3.11.0","@react-aria/visually-hidden":"^3.2.3","@react-stately/checkbox":"^3.0.3","@react-stately/collections":"^3.3.4","@react-stately/list":"^3.4.1","@react-stately/menu":"^3.2.3","@react-stately/numberfield":"^3.0.2","@react-stately/overlays":"^3.1.3","@react-stately/radio":"^3.3.2","@react-stately/select":"^3.1.3","@react-stately/slider":"^3.0.3","@react-stately/tabs":"^3.0.1","@react-stately/toggle":"^3.2.3","@react-stately/tree":"^3.2.0","@sentry/react":"^6.17.4","@sentry/tracing":"^6.17.4","@use-gesture/react":"^10.2.4",clsx:"^1.1.1",color:"^4.2.0",deepmerge:"^4.2.2","dot-object":"^2.1.4",fabric:"^4.6.0","file-saver":"^2.0.5","framer-motion":"^5.3.3",immer:"^9.0.7","number-precision":"^1.5.1","react-colorful":"^5.5.1","react-dropzone":"^11.5.1","react-hot-toast":"^2.2.0","react-intl":"^5.24.0","react-virtual":"^2.10.0","style-inject":"^0.3.0",zustand:"^3.6.9"},peerDependencies:{react:"^17.0.2","react-dom":"^17.0.0"},devDependencies:{"@formatjs/cli":"^4.5.0","@react-types/numberfield":"^3.1.0","@react-types/select":"^3.5.1","@react-types/tabs":"^3.0.1","@types/color":"^3.0.2","@types/fabric":"^4.5.3","@types/file-saver":"^2.0.4","@types/react":"^17.0.0","@types/react-dom":"^17.0.10","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0","@vitejs/plugin-react":"^1.2.0",autoprefixer:"^10.3.7","babel-plugin-formatjs":"^10.3.12",cssnano:"^5.0.16",eslint:"^7.32.0","eslint-config-airbnb":"^18.2.1","eslint-config-airbnb-typescript":"^14.0.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.2","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-react":"^7.26.1","eslint-plugin-react-hooks":"^4.2.0","fast-xml-parser":"^4.0.0-beta.8",postcss:"^8.4.5",prettier:"^2.4.1",tailwindcss:"^3.0.1",typescript:"^4.5.2",vite:"^2.6.14","vite-plugin-checker":"^0.3.4","vite-tsconfig-paths":"^3.3.17"}};const vF=mF.version,NS={selector:"pixie-editor",textureSize:4096,ui:{visible:!0,mode:hm.INLINE,forceOverlayModeOnMobile:!0,activeTheme:qc.LIGHT,themes:gm,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:LS,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:gF,label:{id:"JXdbo8",defaultMessage:[{type:0,value:"Done"}]},align:"right",action:e=>{var t;((t=e.state.config.ui)==null?void 0:t.showExportPanel)?e.state.togglePanel("export",!0):e.tools.export.save("image")}}]},nav:{position:MS.BOTTOM,items:[...hF]},openImageDialog:{show:!0,sampleImages:[{url:"images/samples/sample1.jpg",thumbnail:"images/samples/sample1_thumbnail.jpg"},{url:"images/samples/sample2.jpg",thumbnail:"images/samples/sample2_thumbnail.jpg"},{url:"images/samples/sample3.jpg",thumbnail:"images/samples/sample3_thumbnail.jpg"}]},colorPresets:{items:["rgb(0,0,0)","rgb(255, 255, 255)","rgb(242, 38, 19)","rgb(249, 105, 14)","rgb(253, 227, 167)","rgb(4, 147, 114)","rgb(30, 139, 195)","rgb(142, 68, 173)"]}},objectDefaults:{global:$({},pm),sticker:{fill:void 0},text:{textAlign:"initial",underline:!1,linethrough:!1,fontStyle:"normal",fontFamily:"Times New Roman",fontWeight:"normal",stroke:void 0,fontSize:40}},tools:{filter:{items:["grayscale","blackWhite","sharpen","invert","vintage","polaroid","kodachrome","technicolor","brownie","sepia","removeColor","brightness","gamma","noise","pixelate","blur","emboss","blendColor"]},zoom:{allowUserZoom:!0,fitImageToScreen:!0},crop:{allowCustomRatio:!0,defaultRatio:"1:1",presets:[{ratio:null,name:"Custom"},{ratio:"1:1",name:"Square"},{ratio:"4:3"},{ratio:"16:9"},{ratio:"5:3"},{ratio:"5:4"},{ratio:"6:4"},{ratio:"7:5"},{ratio:"10:8"}]},text:{defaultText:"Double click to edit",items:[{family:"Roboto",src:"fonts/open-sans-v27-latin-ext_latin-regular.woff2"},{family:"Fuzzy Bubbles",src:"fonts/fuzzy-bubbles-v3-latin-700.woff2",descriptors:{weight:"700"}},{family:"Aleo Bold",src:"fonts/aleo-v4-latin-ext_latin-700.woff2",descriptors:{weight:"700"}},{family:"Amatic SC",src:"fonts/amatic-sc-v16-latin-ext_latin-regular.woff2"},{family:"Corinthia Bold",src:"fonts/corinthia-v7-latin-ext_latin-700.woff2"},{family:"Bungee Inline",src:"fonts/bungee-inline-v6-latin-ext_latin-regular.woff2"},{family:"Robot Slab Bold",src:"fonts/roboto-slab-v16-latin-ext_latin-500.woff2"},{family:"Carter One",src:"fonts/carter-one-v12-latin-regular.woff2"},{family:"Cody Star",src:"fonts/codystar-v10-latin-ext_latin-regular.woff2"},{family:"Fira Sans",src:"fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"},{family:"Krona One",src:"fonts/krona-one-v9-latin-ext_latin-regular.woff2"},{family:"Kumar One Outline",src:"fonts/kumar-one-outline-v8-latin-ext_latin-regular.woff2"},{family:"Lobster Two",src:"fonts/lobster-two-v13-latin-regular.woff2"},{family:"Molle Italic",src:"fonts/molle-v11-latin-ext_latin-italic.woff2"},{family:"Monoton",src:"fonts/monoton-v10-latin-regular.woff2"},{family:"Nixie One",src:"fonts/nixie-one-v11-latin-regular.woff2"},{family:"Permanent Marker",src:"fonts/permanent-marker-v10-latin-regular.woff2"},{family:"Sancreek",src:"fonts/sancreek-v13-latin-ext_latin-regular.woff2"},{family:"Stint Ultra Expanded",src:"fonts/stint-ultra-expanded-v10-latin-regular.woff2"},{family:"VT323",src:"fonts/vt323-v12-latin-ext_latin-regular.woff2"},{family:"Trash Hand",src:"fonts/TrashHand.ttf"}]},draw:{brushSizes:kS,brushTypes:XR},shapes:{items:WR.slice()},stickers:{items:YR},import:{validImgExtensions:["png","jpg","jpeg","svg","gif"],fitOverlayToScreen:!0,openDroppedImageAsBackground:!1},export:{defaultFormat:"png",defaultQuality:.8,defaultName:"image"},frame:{items:[{name:"basic",mode:"basic",size:{min:1,max:35,default:10}},{name:"pine",mode:"stretch",size:{min:1,max:35,default:15}},{name:"oak",mode:"stretch",size:{min:1,max:35,default:15}},{name:"rainbow",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge1",display_name:"grunge #1",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge2",display_name:"grunge #2",mode:"stretch",size:{min:1,max:35,default:20}},{name:"ebony",mode:"stretch",size:{min:1,max:35,default:15}},{name:"art1",display_name:"Art #1",mode:"repeat",size:{min:10,max:70,default:55}},{name:"art2",display_name:"Art #2",mode:"repeat",size:{min:10,max:70,default:55}}]}}};function yF(e){let t;const r=new Set,n=(l,h)=>{const c=typeof l=="function"?l(t):l;if(c!==t){const f=t;t=h?c:Object.assign({},t,c),r.forEach(d=>d(t,f))}},i=()=>t,s=(l,h=i,c=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let f=h(t);function d(){const g=h(t);if(!c(f,g)){const m=f;l(f=g,m)}}return r.add(d),()=>r.delete(d)},a={setState:n,getState:i,subscribe:(l,h,c)=>h||c?s(l,h,c):(r.add(l),()=>r.delete(l)),destroy:()=>r.clear()};return t=e(n,i,a),a}const zS=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?C.exports.useEffect:C.exports.useLayoutEffect;function bF(e){const t=typeof e=="function"?yF(e):e,r=(n=t.getState,i=Object.is)=>{const[,s]=C.exports.useReducer(p=>p+1,0),u=t.getState(),o=C.exports.useRef(u),a=C.exports.useRef(n),l=C.exports.useRef(i),h=C.exports.useRef(!1),c=C.exports.useRef();c.current===void 0&&(c.current=n(u));let f,d=!1;(o.current!==u||a.current!==n||l.current!==i||h.current)&&(f=n(u),d=!i(c.current,f)),zS(()=>{d&&(c.current=f),o.current=u,a.current=n,l.current=i,h.current=!1});const g=C.exports.useRef(u);zS(()=>{const p=()=>{try{const y=t.getState(),b=a.current(y);l.current(c.current,b)||(o.current=y,c.current=b,s())}catch{h.current=!0,s()}},v=t.subscribe(p);return t.getState()!==g.current&&p(),v},[]);const m=d?f:c.current;return C.exports.useDebugValue(m),m};return Object.assign(r,t),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[r,t];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},r}const xF=e=>(t,r,n)=>{const i=n.subscribe;return n.subscribe=(u,o,a)=>{let l=u;if(o){const h=(a==null?void 0:a.equalityFn)||Object.is;let c=u(n.getState());l=f=>{const d=u(f);if(!h(c,d)){const g=c;o(c=d,g)}},(a==null?void 0:a.fireImmediately)&&o(c,c)}return i(l)},e(t,r,n)};function Hr(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ya(e){return!!e&&!!e[wr]}function qi(e){return!!e&&(function(t){if(!t||typeof t!="object")return!1;var r=Object.getPrototypeOf(t);if(r===null)return!0;var n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return n===Object||typeof n=="function"&&Function.toString.call(n)===OF}(e)||Array.isArray(e)||!!e[GS]||!!e.constructor[GS]||vm(e)||ym(e))}function nl(e,t,r){r===void 0&&(r=!1),ba(e)===0?(r?Object.keys:km)(e).forEach(function(n){r&&typeof n=="symbol"||t(n,e[n],e)}):e.forEach(function(n,i){return t(i,n,e)})}function ba(e){var t=e[wr];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:vm(e)?2:ym(e)?3:0}function mm(e,t){return ba(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function wF(e,t){return ba(e)===2?e.get(t):e[t]}function jS(e,t,r){var n=ba(e);n===2?e.set(t,r):n===3?(e.delete(t),e.add(r)):e[t]=r}function SF(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function vm(e){return EF&&e instanceof Map}function ym(e){return PF&&e instanceof Set}function Ji(e){return e.o||e.t}function bm(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=MF(e);delete t[wr];for(var r=km(t),n=0;n<r.length;n++){var i=r[n],s=t[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function xm(e,t){return t===void 0&&(t=!1),wm(e)||ya(e)||!qi(e)||(ba(e)>1&&(e.set=e.add=e.clear=e.delete=_F),Object.freeze(e),t&&nl(e,function(r,n){return xm(n,!0)},!0)),e}function _F(){Hr(2)}function wm(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function cn(e){var t=kF[e];return t||Hr(18,e),t}function BS(){return il}function Sm(e,t){t&&(cn("Patches"),e.u=[],e.s=[],e.v=t)}function Zc(e){_m(e),e.p.forEach(TF),e.p=null}function _m(e){e===il&&(il=e.l)}function VS(e){return il={p:[],l:il,h:e,m:!0,_:0}}function TF(e){var t=e[wr];t.i===0||t.i===1?t.j():t.O=!0}function Tm(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.g||cn("ES5").S(t,e,n),n?(r[wr].P&&(Zc(t),Hr(4)),qi(e)&&(e=Qc(t,e),t.l||ef(t,e)),t.u&&cn("Patches").M(r[wr].t,e,t.u,t.s)):e=Qc(t,r,[]),Zc(t),t.u&&t.v(t.u,t.s),e!==XS?e:void 0}function Qc(e,t,r){if(wm(t))return t;var n=t[wr];if(!n)return nl(t,function(s,u){return US(e,n,t,s,u,r)},!0),t;if(n.A!==e)return t;if(!n.P)return ef(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=bm(n.k):n.o;nl(n.i===3?new Set(i):i,function(s,u){return US(e,n,i,s,u,r)}),ef(e,i,!1),r&&e.u&&cn("Patches").R(n,r,e.u,e.s)}return n.o}function US(e,t,r,n,i,s){if(ya(i)){var u=Qc(e,i,s&&t&&t.i!==3&&!mm(t.D,n)?s.concat(n):void 0);if(jS(r,n,u),!ya(u))return;e.m=!1}if(qi(i)&&!wm(i)){if(!e.h.F&&e._<1)return;Qc(e,i),t&&t.A.l||ef(e,i)}}function ef(e,t,r){r===void 0&&(r=!1),e.h.F&&e.m&&xm(t,r)}function Cm(e,t){var r=e[wr];return(r?Ji(r):e)[t]}function HS(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Em(e){e.P||(e.P=!0,e.l&&Em(e.l))}function Pm(e){e.o||(e.o=bm(e.t))}function Om(e,t,r){var n=vm(t)?cn("MapSet").N(t,r):ym(t)?cn("MapSet").T(t,r):e.g?function(i,s){var u=Array.isArray(i),o={i:u?1:0,A:s?s.A:BS(),P:!1,I:!1,D:{},l:s,t:i,k:null,o:null,j:null,C:!1},a=o,l=$m;u&&(a=[o],l=ol);var h=Proxy.revocable(a,l),c=h.revoke,f=h.proxy;return o.k=f,o.j=c,f}(t,r):cn("ES5").J(t,r);return(r?r.A:BS()).p.push(n),n}function CF(e){return ya(e)||Hr(22,e),function t(r){if(!qi(r))return r;var n,i=r[wr],s=ba(r);if(i){if(!i.P&&(i.i<4||!cn("ES5").K(i)))return i.t;i.I=!0,n=WS(r,s),i.I=!1}else n=WS(r,s);return nl(n,function(u,o){i&&wF(i.t,u)===o||jS(n,u,t(o))}),s===3?new Set(n):n}(e)}function WS(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return bm(e)}function Fq(e){return e}var YS,il,Mm=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",EF=typeof Map!="undefined",PF=typeof Set!="undefined",KS=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",XS=Mm?Symbol.for("immer-nothing"):((YS={})["immer-nothing"]=!0,YS),GS=Mm?Symbol.for("immer-draftable"):"__$immer_draftable",wr=Mm?Symbol.for("immer-state"):"__$immer_state",OF=""+Object.prototype.constructor,km=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,MF=Object.getOwnPropertyDescriptors||function(e){var t={};return km(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},kF={},$m={get:function(e,t){if(t===wr)return e;var r=Ji(e);if(!mm(r,t))return function(i,s,u){var o,a=HS(s,u);return a?"value"in a?a.value:(o=a.get)===null||o===void 0?void 0:o.call(i.k):void 0}(e,r,t);var n=r[t];return e.I||!qi(n)?n:n===Cm(e.t,t)?(Pm(e),e.o[t]=Om(e.A.h,n,e)):n},has:function(e,t){return t in Ji(e)},ownKeys:function(e){return Reflect.ownKeys(Ji(e))},set:function(e,t,r){var n=HS(Ji(e),t);if(n==null?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=Cm(Ji(e),t),s=i==null?void 0:i[wr];if(s&&s.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(SF(r,i)&&(r!==void 0||mm(e.t,t)))return!0;Pm(e),Em(e)}return e.o[t]===r&&typeof r!="number"&&(r!==void 0||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return Cm(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,Pm(e),Em(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Ji(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){Hr(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Hr(12)}},ol={};nl($m,function(e,t){ol[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ol.deleteProperty=function(e,t){return ol.set.call(this,e,t,void 0)},ol.set=function(e,t,r){return $m.set.call(this,e[0],t,r,e[0])};var $F=function(){function e(r){var n=this;this.g=KS,this.F=!0,this.produce=function(i,s,u){if(typeof i=="function"&&typeof s!="function"){var o=s;s=i;var a=n;return function(m){var p=this;m===void 0&&(m=o);for(var v=arguments.length,y=Array(v>1?v-1:0),b=1;b<v;b++)y[b-1]=arguments[b];return a.produce(m,function(x){var w;return(w=s).call.apply(w,[p,x].concat(y))})}}var l;if(typeof s!="function"&&Hr(6),u!==void 0&&typeof u!="function"&&Hr(7),qi(i)){var h=VS(n),c=Om(n,i,void 0),f=!0;try{l=s(c),f=!1}finally{f?Zc(h):_m(h)}return typeof Promise!="undefined"&&l instanceof Promise?l.then(function(m){return Sm(h,u),Tm(m,h)},function(m){throw Zc(h),m}):(Sm(h,u),Tm(l,h))}if(!i||typeof i!="object"){if((l=s(i))===void 0&&(l=i),l===XS&&(l=void 0),n.F&&xm(l,!0),u){var d=[],g=[];cn("Patches").M(i,l,d,g),u(d,g)}return l}Hr(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(l){for(var h=arguments.length,c=Array(h>1?h-1:0),f=1;f<h;f++)c[f-1]=arguments[f];return n.produceWithPatches(l,function(d){return i.apply(void 0,[d].concat(c))})};var u,o,a=n.produce(i,s,function(l,h){u=l,o=h});return typeof Promise!="undefined"&&a instanceof Promise?a.then(function(l){return[l,u,o]}):[a,u,o]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){qi(r)||Hr(8),ya(r)&&(r=CF(r));var n=VS(this),i=Om(this,r,void 0);return i[wr].C=!0,_m(n),i},t.finishDraft=function(r,n){var i=r&&r[wr],s=i.A;return Sm(s,n),Tm(void 0,s)},t.setAutoFreeze=function(r){this.F=r},t.setUseProxies=function(r){r&&!KS&&Hr(20),this.g=r},t.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}i>-1&&(n=n.slice(i+1));var u=cn("Patches").$;return ya(r)?u(r,n):this.produce(r,function(o){return u(o,n)})},e}(),Sr=new $F,DF=Sr.produce;Sr.produceWithPatches.bind(Sr),Sr.setAutoFreeze.bind(Sr),Sr.setUseProxies.bind(Sr),Sr.applyPatches.bind(Sr),Sr.createDraft.bind(Sr),Sr.finishDraft.bind(Sr);var AF=DF;function IF(e){return e?e.charAt(0).toLowerCase()+e.slice(1):""}function RF(e,t){const r=Ow(t,e);return qS(r,e)}function qS(e,t){return Object.keys(e).forEach(r=>{if(r.startsWith("replaceDefault")&&e[r]){const n=IF(r.replace("replaceDefault","")||"items");e[n]=t?t[n]:[],delete e[r]}else typeof e[r]=="object"&&e[r]!==null&&qS(e[r],t==null?void 0:t[r])}),e}const FF=(e,t)=>({history:Y($({},JS),{updatePointerById:r=>{const n=t().history.items.findIndex(i=>i.id===r);t().history.update(n)},update:(r,n)=>{e(i=>{i.history.pointer=r,n&&(i.history.items=n),i.history.canUndo=i.history.pointer>0,i.history.canRedo=i.history.items.length>i.history.pointer+1})},reset:()=>{e({history:$($({},t().history),JS)})}})}),JS={items:[],pointer:0,canUndo:!1,canRedo:!1};var Wr=(e=>(e.Filter="filter",e.Frame="frame",e.ActiveObject="activeObj",e.Text="text",e))(Wr||{});const LF=(e,t)=>({filter:Y($({},ZS),{select(r,n=!1){e(i=>{i.filter.selected=r,i.activeToolOverlay=n?Wr.Filter:null,i.dirty=!0})},deselect(r){t().filter.selected===r&&e(n=>{n.filter.selected=null,n.activeToolOverlay=null,n.dirty=!0})},reset(){e({filter:$($({},t().filter),ZS)})}})}),ZS={selected:null,applied:[]},NF=(e,t)=>({crop:Y($({},QS),{setCropzoneRect:r=>{e(n=>{n.crop.zoneRect=r})},setAspectRatio:r=>{e(n=>{n.crop.selectedAspectRatio=r})},setTransformAngle:r=>{e(n=>{n.crop.straightenAngle=r})},apply:async()=>{const r=t().crop.zoneRect;if(r){const n={width:Math.ceil(r.width/t().zoom),height:Math.ceil(r.height/t().zoom),left:Math.ceil(r.left/t().zoom),top:Math.ceil(r.top/t().zoom)};await t().editor.tools.crop.apply(n)}},reset:()=>{e({crop:$($({},t().crop),QS)})}})}),QS={zoneRect:null,selectedAspectRatio:null,straightenAngle:0};function Zi(e){return(e==null?void 0:e.type)==="i-text"}var pt=(e=>(e.Text="text",e.Shape="shape",e.Sticker="sticker",e.Drawing="drawing",e.Image="image",e.MainImage="mainImage",e.StraightenAnchor="straightenHelper",e))(pt||{});const zF={text:{name:{id:"aA8bDw",defaultMessage:[{type:0,value:"Text"}]},icon:fi.text.icon},shape:{name:{id:"5Ws83M",defaultMessage:[{type:0,value:"Shape"}]},icon:fi.shapes.icon},sticker:{name:{id:"2Hku0l",defaultMessage:[{type:0,value:"Sticker"}]},icon:fi.stickers.icon},drawing:{name:{id:"jPQp7Q",defaultMessage:[{type:0,value:"Drawing"}]},icon:fi.draw.icon},image:{name:{id:"+0zv6g",defaultMessage:[{type:0,value:"Image"}]},icon:fi.overlayImage.icon},mainImage:{name:{id:"LOA559",defaultMessage:[{type:0,value:"Background Image"}]},icon:fi.bgImage.icon}};function jF(e){return e.name===pt.Image}const e_={isMoving:!1,editableProps:{},id:null,isText:!1,isImage:!1,name:null};function BF(e){if(!e)return{};const t={fill:e.fill,opacity:e.opacity,backgroundColor:e.backgroundColor,stroke:e.stroke,strokeWidth:e.strokeWidth},r=e.shadow;return r&&(t.shadow={color:r.color,blur:r.blur,offsetX:r.offsetX,offsetY:r.offsetY}),Zi(e)&&(t.textAlign=e.textAlign,t.underline=e.underline,t.linethrough=e.linethrough,t.fontStyle=e.fontStyle,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize),t}const VF=(e,t)=>({objects:Y($({},t_),{setActiveIsMoving:r=>{e(n=>{n.objects.active.isMoving=r})},setIsEditingText:r=>{e(n=>{n.objects.isEditingText=r})},setActive:r=>{e(r?n=>{var i;n.objects.active.editableProps=BF(r),n.objects.active.id=r.data.id,n.objects.active.name=(i=r.name)!=null?i:null,n.objects.active.isText=Zi(r),n.objects.active.isImage=jF(r)}:n=>{var s,u,o,a,l;const i=Y($({},(s=t().config.objectDefaults)==null?void 0:s.global),{fontFamily:(o=(u=t().config.objectDefaults)==null?void 0:u.text)==null?void 0:o.fontFamily,fontSize:(l=(a=t().config.objectDefaults)==null?void 0:a.text)==null?void 0:l.fontSize});n.objects.active=Y($({},e_),{editableProps:i})})},reset(){e({objects:$($({},t().objects),t_)})}})}),t_={all:[],isEditingText:!1,active:e_},UF=(e,t)=>({frame:Y($({},r_),{select:r=>{e(n=>{n.frame.active=r}),t().frame.showOptionsPanel()},deselect:()=>{e(r=>{r.frame.active=null,r.activeToolOverlay=null})},showOptionsPanel:()=>{t().activeTool===Ge.FRAME&&e(r=>{r.activeToolOverlay=Wr.Frame})},reset(){e({frame:$($({},t().frame),r_)})}})}),r_={active:null},HF=(e,t)=>({resize:Y($({},n_),{setFormValue:r=>{e(n=>{Object.entries(r).forEach(([i,s])=>{n.resize.formValue[i]=s})})},apply(){const r=t().resize.formValue,n=t().original;if(r.width===n.width&&r.height===n.height)return!1;t().editor.tools.resize.apply(r)},reset(){e({resize:$($({},t().resize),n_)})}})}),n_={formValue:{width:1,height:1,maintainAspect:!0,usePercentages:!1}},WF=(e,t)=>({corners:Y($({},i_),{setRadius:r=>{e(n=>{n.corners.radius=r})},apply(){return t().editor.tools.corners.apply(t().corners.radius)},reset(){e({corners:$($({},t().corners),i_)})}})}),i_={radius:50},o_={top:0,right:0,bottom:0,left:0,width:0,height:0},pe=bF(xF((e=>(t,r,n)=>e((i,s)=>{const u=typeof i=="function"?AF(i):i;return t(u,s)},r,n))((e,t)=>Y($($($($($($($({editor:null,fabric:null,config:NS,zoom:1,dirty:!1,original:{width:1,height:1},stageSize:o_,canvasSize:o_,activeTool:null,activeToolOverlay:null,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1}},FF(e,t)),VF(e,t)),LF(e,t)),NF(e,t)),UF(e,t)),HF(e,t)),WF(e,t)),{setZoom:r=>e(n=>{n.zoom=r}),setOriginal:(r,n)=>e(i=>{i.original={width:r,height:n}}),setDirty:r=>e(n=>{n.dirty=r}),toggleLoading:r=>e(n=>{n.loading=r}),setStageSize:r=>e(n=>{n.stageSize=r}),setCanvasSize:r=>e(n=>{n.canvasSize=r}),setActiveTool:(r,n)=>e(i=>{i.activeTool=r,i.activeToolOverlay=n}),setConfig:r=>e(n=>{n.config=RF(r,t().config)}),togglePanel:(r,n)=>e(i=>{i.openPanels[r]=n!=null?n:!i.openPanels[r]}),applyChanges:async()=>{var s;const r=t().activeTool;if(!r)return;const n=t()[r],i=await((s=n==null?void 0:n.apply)==null?void 0:s.call(n));e(u=>{u.dirty=!1,u.activeTool=null,u.activeToolOverlay=null}),i!==!1&&t().editor.tools.history.addHistoryItem({name:r}),n==null||n.reset()},cancelChanges:async()=>{const r=t().activeTool;if(!r)return;const n=t().dirty;e(s=>{s.dirty=!1,s.activeTool=null,s.activeToolOverlay=null}),n&&await t().editor.tools.history.reload();const i=t()[r];i==null||i.reset()},reset:()=>{t().editor.tools.transform.resetStraightenAnchor(),e({activeTool:null,activeToolOverlay:null,zoom:1,dirty:!1,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1}}),t().history.reset(),t().objects.reset(),t().filter.reset(),t().crop.reset(),t().frame.reset(),t().resize.reset(),t().corners.reset()}}))));var On=function(e){return{isEnabled:function(t){return e.some(function(r){return!!t[r]})}}},al={measureLayout:On(["layout","layoutId","drag"]),animation:On(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:On(["exit"]),drag:On(["drag","dragControls"]),focus:On(["whileFocus"]),hover:On(["whileHover","onHoverStart","onHoverEnd"]),tap:On(["whileTap","onTap","onTapStart","onTapCancel"]),pan:On(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:On(["whileInView","onViewportEnter","onViewportLeave"])};function Dm(e){for(var t in e)e[t]!==null&&(t==="projectionNodeConstructor"?al.projectionNodeConstructor=e[t]:al[t].Component=e[t])}var YF=function(){},tf=function(){},Am=C.exports.createContext({strict:!1}),a_=Object.keys(al),KF=a_.length;function XF(e,t,r){var n=[];if(C.exports.useContext(Am),!t)return null;for(var i=0;i<KF;i++){var s=a_[i],u=al[s],o=u.isEnabled,a=u.Component;o(e)&&a&&n.push(C.exports.createElement(a,oe({key:s},e,{visualElement:t})))}return n}var GF=C.exports.createContext({transformPagePoint:function(e){return e},isStatic:!1}),rf=C.exports.createContext({});function qF(){return C.exports.useContext(rf).visualElement}var sl=C.exports.createContext(null),ll=typeof window!="undefined",s_=ll?C.exports.useLayoutEffect:C.exports.useEffect;function JF(e,t,r,n){var i=C.exports.useContext(Am),s=qF(),u=C.exports.useContext(sl),o=C.exports.useRef(void 0);n||(n=i.renderer),!o.current&&n&&(o.current=n(e,{visualState:t,parent:s,props:r,presenceId:u==null?void 0:u.id,blockInitialAnimation:(u==null?void 0:u.initial)===!1}));var a=o.current;return s_(function(){a==null||a.syncRender()}),C.exports.useEffect(function(){var l;(l=a==null?void 0:a.animationState)===null||l===void 0||l.animateChanges()}),s_(function(){return function(){return a==null?void 0:a.notifyUnmount()}},[]),a}function l_(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ZF(e,t,r){return C.exports.useCallback(function(n){var i;n&&((i=e.mount)===null||i===void 0||i.call(e,n)),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):l_(r)&&(r.current=n))},[t])}function u_(e){return Array.isArray(e)}function Yr(e){return typeof e=="string"||u_(e)}function QF(e){var t={};return e.forEachValue(function(r,n){return t[n]=r.get()}),t}function eL(e){var t={};return e.forEachValue(function(r,n){return t[n]=r.getVelocity()}),t}function c_(e,t,r,n,i){var s;return n===void 0&&(n={}),i===void 0&&(i={}),typeof t=="function"&&(t=t(r!=null?r:e.custom,n,i)),typeof t=="string"&&(t=(s=e.variants)===null||s===void 0?void 0:s[t]),typeof t=="function"&&(t=t(r!=null?r:e.custom,n,i)),t}function nf(e,t,r){var n=e.getProps();return c_(n,t,r!=null?r:n.custom,QF(e),eL(e))}function of(e){var t;return typeof((t=e.animate)===null||t===void 0?void 0:t.start)=="function"||Yr(e.initial)||Yr(e.animate)||Yr(e.whileHover)||Yr(e.whileDrag)||Yr(e.whileTap)||Yr(e.whileFocus)||Yr(e.exit)}function f_(e){return Boolean(of(e)||e.variants)}function tL(e,t){if(of(e)){var r=e.initial,n=e.animate;return{initial:r===!1||Yr(r)?r:void 0,animate:Yr(n)?n:void 0}}return e.inherit!==!1?t:{}}function rL(e){var t=tL(e,C.exports.useContext(rf)),r=t.initial,n=t.animate;return C.exports.useMemo(function(){return{initial:r,animate:n}},[d_(r),d_(n)])}function d_(e){return Array.isArray(e)?e.join(" "):e}function ul(e){var t=C.exports.useRef(null);return t.current===null&&(t.current=e()),t.current}const h_=1/60*1e3,nL=typeof performance!="undefined"?()=>performance.now():()=>Date.now(),p_=typeof window!="undefined"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(nL()),h_);function iL(e){let t=[],r=[],n=0,i=!1,s=!1;const u=new WeakSet,o={schedule:(a,l=!1,h=!1)=>{const c=h&&i,f=c?t:r;return l&&u.add(a),f.indexOf(a)===-1&&(f.push(a),c&&i&&(n=t.length)),a},cancel:a=>{const l=r.indexOf(a);l!==-1&&r.splice(l,1),u.delete(a)},process:a=>{if(i){s=!0;return}if(i=!0,[t,r]=[r,t],r.length=0,n=t.length,n)for(let l=0;l<n;l++){const h=t[l];h(a),u.has(h)&&(o.schedule(h),e())}i=!1,s&&(s=!1,o.process(a))}};return o}const oL=40;let Im=!0,cl=!1,Rm=!1;const xa={delta:0,timestamp:0},fl=["read","update","preRender","render","postRender"],af=fl.reduce((e,t)=>(e[t]=iL(()=>cl=!0),e),{}),wa=fl.reduce((e,t)=>{const r=af[t];return e[t]=(n,i=!1,s=!1)=>(cl||sL(),r.schedule(n,i,s)),e},{}),Fm=fl.reduce((e,t)=>(e[t]=af[t].cancel,e),{});fl.reduce((e,t)=>(e[t]=()=>af[t].process(xa),e),{});const aL=e=>af[e].process(xa),g_=e=>{cl=!1,xa.delta=Im?h_:Math.max(Math.min(e-xa.timestamp,oL),1),xa.timestamp=e,Rm=!0,fl.forEach(aL),Rm=!1,cl&&(Im=!1,p_(g_))},sL=()=>{cl=!0,Im=!0,Rm||p_(g_)},m_=()=>xa,Lm=(e,t,r)=>Math.min(Math.max(r,e),t),Nm=.001,lL=.01,v_=10,uL=.05,cL=1;function fL({duration:e=800,bounce:t=.25,velocity:r=0,mass:n=1}){let i,s;YF(e<=v_*1e3);let u=1-t;u=Lm(uL,cL,u),e=Lm(lL,v_,e/1e3),u<1?(i=l=>{const h=l*u,c=h*e,f=h-r,d=zm(l,u),g=Math.exp(-c);return Nm-f/d*g},s=l=>{const c=l*u*e,f=c*r+r,d=Math.pow(u,2)*Math.pow(l,2)*e,g=Math.exp(-c),m=zm(Math.pow(l,2),u);return(-i(l)+Nm>0?-1:1)*((f-d)*g)/m}):(i=l=>{const h=Math.exp(-l*e),c=(l-r)*e+1;return-Nm+h*c},s=l=>{const h=Math.exp(-l*e),c=(r-l)*(e*e);return h*c});const o=5/e,a=hL(i,s,o);if(e=e*1e3,isNaN(a))return{stiffness:100,damping:10,duration:e};{const l=Math.pow(a,2)*n;return{stiffness:l,damping:u*2*Math.sqrt(n*l),duration:e}}}const dL=12;function hL(e,t,r){let n=r;for(let i=1;i<dL;i++)n=n-e(n)/t(n);return n}function zm(e,t){return e*Math.sqrt(1-t*t)}const pL=["duration","bounce"],gL=["stiffness","damping","mass"];function y_(e,t){return t.some(r=>e[r]!==void 0)}function mL(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!y_(e,gL)&&y_(e,pL)){const r=fL(e);t=Object.assign(Object.assign(Object.assign({},t),r),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function jm(e){var{from:t=0,to:r=1,restSpeed:n=2,restDelta:i}=e,s=Lt(e,["from","to","restSpeed","restDelta"]);const u={done:!1,value:t};let{stiffness:o,damping:a,mass:l,velocity:h,duration:c,isResolvedFromDuration:f}=mL(s),d=b_,g=b_;function m(){const p=h?-(h/1e3):0,v=r-t,y=a/(2*Math.sqrt(o*l)),b=Math.sqrt(o/l)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-t)/100,.4)),y<1){const x=zm(b,y);d=w=>{const T=Math.exp(-y*b*w);return r-T*((p+y*b*v)/x*Math.sin(x*w)+v*Math.cos(x*w))},g=w=>{const T=Math.exp(-y*b*w);return y*b*T*(Math.sin(x*w)*(p+y*b*v)/x+v*Math.cos(x*w))-T*(Math.cos(x*w)*(p+y*b*v)-x*v*Math.sin(x*w))}}else if(y===1)d=x=>r-Math.exp(-b*x)*(v+(p+b*v)*x);else{const x=b*Math.sqrt(y*y-1);d=w=>{const T=Math.exp(-y*b*w),_=Math.min(x*w,300);return r-T*((p+y*b*v)*Math.sinh(_)+x*v*Math.cosh(_))/x}}}return m(),{next:p=>{const v=d(p);if(f)u.done=p>=c;else{const y=g(p)*1e3,b=Math.abs(y)<=n,x=Math.abs(r-v)<=i;u.done=b&&x}return u.value=u.done?r:v,u},flipTarget:()=>{h=-h,[t,r]=[r,t],m()}}}jm.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const b_=e=>0,x_=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n},Bm=(e,t,r)=>-r*e+r*t+e,w_=(e,t)=>r=>Math.max(Math.min(r,t),e),dl=e=>e%1?Number(e.toFixed(5)):e,hl=/(-)?([\d]*\.?[\d])+/g,Vm=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,vL=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function pl(e){return typeof e=="string"}const Qi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gl=Object.assign(Object.assign({},Qi),{transform:w_(0,1)}),sf=Object.assign(Object.assign({},Qi),{default:1}),ml=e=>({test:t=>pl(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),di=ml("deg"),Sa=ml("%"),ke=ml("px"),yL=ml("vh"),bL=ml("vw"),S_=Object.assign(Object.assign({},Sa),{parse:e=>Sa.parse(e)/100,transform:e=>Sa.transform(e*100)}),Um=(e,t)=>r=>Boolean(pl(r)&&vL.test(r)&&r.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(r,t)),__=(e,t,r)=>n=>{if(!pl(n))return n;const[i,s,u,o]=n.match(hl);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(u),alpha:o!==void 0?parseFloat(o):1}},eo={test:Um("hsl","hue"),parse:__("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Sa.transform(dl(t))+", "+Sa.transform(dl(r))+", "+dl(gl.transform(n))+")"},xL=w_(0,255),Hm=Object.assign(Object.assign({},Qi),{transform:e=>Math.round(xL(e))}),hi={test:Um("rgb","red"),parse:__("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Hm.transform(e)+", "+Hm.transform(t)+", "+Hm.transform(r)+", "+dl(gl.transform(n))+")"};function wL(e){let t="",r="",n="",i="";return e.length>5?(t=e.substr(1,2),r=e.substr(3,2),n=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),r=e.substr(2,1),n=e.substr(3,1),i=e.substr(4,1),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Wm={test:Um("#"),parse:wL,transform:hi.transform},Qt={test:e=>hi.test(e)||Wm.test(e)||eo.test(e),parse:e=>hi.test(e)?hi.parse(e):eo.test(e)?eo.parse(e):Wm.parse(e),transform:e=>pl(e)?e:e.hasOwnProperty("red")?hi.transform(e):eo.transform(e)},T_="${c}",C_="${n}";function SL(e){var t,r,n,i;return isNaN(e)&&pl(e)&&((r=(t=e.match(hl))===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0)+((i=(n=e.match(Vm))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function E_(e){typeof e=="number"&&(e=`${e}`);const t=[];let r=0;const n=e.match(Vm);n&&(r=n.length,e=e.replace(Vm,T_),t.push(...n.map(Qt.parse)));const i=e.match(hl);return i&&(e=e.replace(hl,C_),t.push(...i.map(Qi.parse))),{values:t,numColors:r,tokenised:e}}function P_(e){return E_(e).values}function O_(e){const{values:t,numColors:r,tokenised:n}=E_(e),i=t.length;return s=>{let u=n;for(let o=0;o<i;o++)u=u.replace(o<r?T_:C_,o<r?Qt.transform(s[o]):dl(s[o]));return u}}const _L=e=>typeof e=="number"?0:e;function TL(e){const t=P_(e);return O_(e)(t.map(_L))}const to={test:SL,parse:P_,createTransformer:O_,getAnimatableNone:TL},CL=new Set(["brightness","contrast","saturate","opacity"]);function EL(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(hl)||[];if(!n)return e;const i=r.replace(n,"");let s=CL.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}const PL=/([a-z-]*)\(.*?\)/g,Ym=Object.assign(Object.assign({},to),{getAnimatableNone:e=>{const t=e.match(PL);return t?t.map(EL).join(" "):e}});function Km(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function M_({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,s=0,u=0;if(!t)i=s=u=r;else{const o=r<.5?r*(1+t):r+t-r*t,a=2*r-o;i=Km(a,o,e+1/3),s=Km(a,o,e),u=Km(a,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(u*255),alpha:n}}const OL=(e,t,r)=>{const n=e*e,i=t*t;return Math.sqrt(Math.max(0,r*(i-n)+n))},ML=[Wm,hi,eo],k_=e=>ML.find(t=>t.test(e)),$_=(e,t)=>{let r=k_(e),n=k_(t),i=r.parse(e),s=n.parse(t);r===eo&&(i=M_(i),r=hi),n===eo&&(s=M_(s),n=hi);const u=Object.assign({},i);return o=>{for(const a in u)a!=="alpha"&&(u[a]=OL(i[a],s[a],o));return u.alpha=Bm(i.alpha,s.alpha,o),r.transform(u)}},kL=e=>typeof e=="number",$L=(e,t)=>r=>t(e(r)),Xm=(...e)=>e.reduce($L);function D_(e,t){return kL(e)?r=>Bm(e,t,r):Qt.test(e)?$_(e,t):R_(e,t)}const A_=(e,t)=>{const r=[...e],n=r.length,i=e.map((s,u)=>D_(s,t[u]));return s=>{for(let u=0;u<n;u++)r[u]=i[u](s);return r}},DL=(e,t)=>{const r=Object.assign(Object.assign({},e),t),n={};for(const i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=D_(e[i],t[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}};function I_(e){const t=to.parse(e),r=t.length;let n=0,i=0,s=0;for(let u=0;u<r;u++)n||typeof t[u]=="number"?n++:t[u].hue!==void 0?s++:i++;return{parsed:t,numNumbers:n,numRGB:i,numHSL:s}}const R_=(e,t)=>{const r=to.createTransformer(t),n=I_(e),i=I_(t);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?Xm(A_(n.parsed,i.parsed),r):u=>`${u>0?t:e}`},AL=(e,t)=>r=>Bm(e,t,r);function IL(e){if(typeof e=="number")return AL;if(typeof e=="string")return Qt.test(e)?$_:R_;if(Array.isArray(e))return A_;if(typeof e=="object")return DL}function RL(e,t,r){const n=[],i=r||IL(e[0]),s=e.length-1;for(let u=0;u<s;u++){let o=i(e[u],e[u+1]);if(t){const a=Array.isArray(t)?t[u]:t;o=Xm(a,o)}n.push(o)}return n}function FL([e,t],[r]){return n=>r(x_(e,t,n))}function LL(e,t){const r=e.length,n=r-1;return i=>{let s=0,u=!1;if(i<=e[0]?u=!0:i>=e[n]&&(s=n-1,u=!0),!u){let a=1;for(;a<r&&!(e[a]>i||a===n);a++);s=a-1}const o=x_(e[s],e[s+1],i);return t[s](o)}}function F_(e,t,{clamp:r=!0,ease:n,mixer:i}={}){const s=e.length;tf(s===t.length),tf(!n||!Array.isArray(n)||n.length===s-1),e[0]>e[s-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const u=RL(t,n,i),o=s===2?FL(e,u):LL(e,u);return r?a=>o(Lm(e[0],e[s-1],a)):o}const lf=e=>t=>1-e(1-t),Gm=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,NL=e=>t=>Math.pow(t,e),L_=e=>t=>t*t*((e+1)*t-e),zL=e=>{const t=L_(e);return r=>(r*=2)<1?.5*t(r):.5*(2-Math.pow(2,-10*(r-1)))},N_=1.525,jL=4/11,BL=8/11,VL=9/10,z_=e=>e,qm=NL(2),UL=lf(qm),j_=Gm(qm),B_=e=>1-Math.sin(Math.acos(e)),V_=lf(B_),HL=Gm(V_),Jm=L_(N_),WL=lf(Jm),YL=Gm(Jm),KL=zL(N_),XL=4356/361,GL=35442/1805,qL=16061/1805,uf=e=>{if(e===1||e===0)return e;const t=e*e;return e<jL?7.5625*t:e<BL?9.075*t-9.9*e+3.4:e<VL?XL*t-GL*e+qL:10.8*e*e-20.52*e+10.72},JL=lf(uf),ZL=e=>e<.5?.5*(1-uf(1-e*2)):.5*uf(e*2-1)+.5;function QL(e,t){return e.map(()=>t||j_).splice(0,e.length-1)}function e8(e){const t=e.length;return e.map((r,n)=>n!==0?n/(t-1):0)}function t8(e,t){return e.map(r=>r*t)}function cf({from:e=0,to:t=1,ease:r,offset:n,duration:i=300}){const s={done:!1,value:e},u=Array.isArray(t)?t:[e,t],o=t8(n&&n.length===u.length?n:e8(u),i);function a(){return F_(o,u,{ease:Array.isArray(r)?r:QL(u,r)})}let l=a();return{next:h=>(s.value=l(h),s.done=h>=i,s),flipTarget:()=>{u.reverse(),l=a()}}}function r8({velocity:e=0,from:t=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){const u={done:!1,value:t};let o=r*e;const a=t+o,l=s===void 0?a:s(a);return l!==a&&(o=l-t),{next:h=>{const c=-o*Math.exp(-h/n);return u.done=!(c>i||c<-i),u.value=u.done?l:l+c,u},flipTarget:()=>{}}}const U_={keyframes:cf,spring:jm,decay:r8};function n8(e){if(Array.isArray(e.to))return cf;if(U_[e.type])return U_[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?cf:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?jm:cf}function H_(e,t,r=0){return e-t-r}function i8(e,t,r=0,n=!0){return n?H_(t+-e,t,r):t-(e-t)+r}function o8(e,t,r,n){return n?e>=t+r:e<=-r}const a8=e=>{const t=({delta:r})=>e(r);return{start:()=>wa.update(t,!0),stop:()=>Fm.update(t)}};function W_(e){var t,r,{from:n,autoplay:i=!0,driver:s=a8,elapsed:u=0,repeat:o=0,repeatType:a="loop",repeatDelay:l=0,onPlay:h,onStop:c,onComplete:f,onRepeat:d,onUpdate:g}=e,m=Lt(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:p}=m,v,y=0,b=m.duration,x,w=!1,T=!0,_;const E=n8(m);((r=(t=E).needsInterpolation)===null||r===void 0?void 0:r.call(t,n,p))&&(_=F_([0,100],[n,p],{clamp:!1}),n=0,p=100);const k=E(Object.assign(Object.assign({},m),{from:n,to:p}));function z(){y++,a==="reverse"?(T=y%2===0,u=i8(u,b,l,T)):(u=H_(u,b,l),a==="mirror"&&k.flipTarget()),w=!1,d&&d()}function F(){v.stop(),f&&f()}function j(B){if(T||(B=-B),u+=B,!w){const H=k.next(Math.max(0,u));x=H.value,_&&(x=_(x)),w=T?H.done:u<=0}g==null||g(x),w&&(y===0&&(b!=null||(b=u)),y<o?o8(u,b,l,T)&&z():F())}function K(){h==null||h(),v=s(j),v.start()}return i&&K(),{stop:()=>{c==null||c(),v.stop()}}}function Y_(e,t){return t?e*(1e3/t):0}function s8({from:e=0,velocity:t=0,min:r,max:n,power:i=.8,timeConstant:s=750,bounceStiffness:u=500,bounceDamping:o=10,restDelta:a=1,modifyTarget:l,driver:h,onUpdate:c,onComplete:f,onStop:d}){let g;function m(b){return r!==void 0&&b<r||n!==void 0&&b>n}function p(b){return r===void 0?n:n===void 0||Math.abs(r-b)<Math.abs(n-b)?r:n}function v(b){g==null||g.stop(),g=W_(Object.assign(Object.assign({},b),{driver:h,onUpdate:x=>{var w;c==null||c(x),(w=b.onUpdate)===null||w===void 0||w.call(b,x)},onComplete:f,onStop:d}))}function y(b){v(Object.assign({type:"spring",stiffness:u,damping:o,restDelta:a},b))}if(m(e))y({from:e,velocity:t,to:p(e)});else{let b=i*t+e;typeof l!="undefined"&&(b=l(b));const x=p(b),w=x===r?-1:1;let T,_;const E=k=>{T=_,_=k,t=Y_(k-T,m_().delta),(w===1&&k>x||w===-1&&k<x)&&y({from:k,to:x,velocity:t})};v({type:"decay",from:e,velocity:t,timeConstant:s,power:i,restDelta:a,modifyTarget:l,onUpdate:m(b)?E:void 0})}return{stop:()=>g==null?void 0:g.stop()}}const K_=(e,t)=>1-3*t+3*e,X_=(e,t)=>3*t-6*e,G_=e=>3*e,ff=(e,t,r)=>((K_(t,r)*e+X_(t,r))*e+G_(t))*e,q_=(e,t,r)=>3*K_(t,r)*e*e+2*X_(t,r)*e+G_(t),l8=1e-7,u8=10;function c8(e,t,r,n,i){let s,u,o=0;do u=t+(r-t)/2,s=ff(u,n,i)-e,s>0?r=u:t=u;while(Math.abs(s)>l8&&++o<u8);return u}const f8=8,d8=.001;function h8(e,t,r,n){for(let i=0;i<f8;++i){const s=q_(t,r,n);if(s===0)return t;t-=(ff(t,r,n)-e)/s}return t}const df=11,hf=1/(df-1);function p8(e,t,r,n){if(e===t&&r===n)return z_;const i=new Float32Array(df);for(let u=0;u<df;++u)i[u]=ff(u*hf,e,r);function s(u){let o=0,a=1;const l=df-1;for(;a!==l&&i[a]<=u;++a)o+=hf;--a;const h=(u-i[a])/(i[a+1]-i[a]),c=o+h*hf,f=q_(c,e,r);return f>=d8?h8(u,c,e,r):f===0?c:c8(u,o,o+hf,e,r)}return u=>u===0||u===1?u:ff(s(u),t,n)}function g8(e,t){e.indexOf(t)===-1&&e.push(t)}function m8(e,t){var r=e.indexOf(t);r>-1&&e.splice(r,1)}var pf=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(t){var r=this;return g8(this.subscriptions,t),function(){return m8(r.subscriptions,t)}},e.prototype.notify=function(t,r,n){var i=this.subscriptions.length;if(!!i)if(i===1)this.subscriptions[0](t,r,n);else for(var s=0;s<i;s++){var u=this.subscriptions[s];u&&u(t,r,n)}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),v8=function(e){return!isNaN(parseFloat(e))},y8=function(){function e(t){var r=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new pf,this.velocityUpdateSubscribers=new pf,this.renderSubscribers=new pf,this.canTrackVelocity=!1,this.updateAndNotify=function(n,i){i===void 0&&(i=!0),r.prev=r.current,r.current=n;var s=m_(),u=s.delta,o=s.timestamp;r.lastUpdated!==o&&(r.timeDelta=u,r.lastUpdated=o,wa.postRender(r.scheduleVelocityCheck)),r.prev!==r.current&&r.updateSubscribers.notify(r.current),r.velocityUpdateSubscribers.getSize()&&r.velocityUpdateSubscribers.notify(r.getVelocity()),i&&r.renderSubscribers.notify(r.current)},this.scheduleVelocityCheck=function(){return wa.postRender(r.velocityCheck)},this.velocityCheck=function(n){var i=n.timestamp;i!==r.lastUpdated&&(r.prev=r.current,r.velocityUpdateSubscribers.notify(r.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=v8(this.current)}return e.prototype.onChange=function(t){return this.updateSubscribers.add(t)},e.prototype.clearListeners=function(){this.updateSubscribers.clear()},e.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},e.prototype.attach=function(t){this.passiveEffect=t},e.prototype.set=function(t,r){r===void 0&&(r=!0),!r||!this.passiveEffect?this.updateAndNotify(t,r):this.passiveEffect(t,this.updateAndNotify)},e.prototype.get=function(){return this.current},e.prototype.getPrevious=function(){return this.prev},e.prototype.getVelocity=function(){return this.canTrackVelocity?Y_(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(t){var r=this;return this.stop(),new Promise(function(n){r.hasAnimated=!0,r.stopAnimation=t(n)}).then(function(){return r.clearAnimation()})},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},e}();function vl(e){return new y8(e)}var pi=function(e){return Boolean(e!==null&&typeof e=="object"&&e.getVelocity)},Zm=function(e){return e*1e3},b8={linear:z_,easeIn:qm,easeInOut:j_,easeOut:UL,circIn:B_,circInOut:HL,circOut:V_,backIn:Jm,backInOut:YL,backOut:WL,anticipate:KL,bounceIn:JL,bounceInOut:ZL,bounceOut:uf},J_=function(e){if(Array.isArray(e)){tf(e.length===4);var t=Nt(e,4),r=t[0],n=t[1],i=t[2],s=t[3];return p8(r,n,i,s)}else if(typeof e=="string")return b8[e];return e},x8=function(e){return Array.isArray(e)&&typeof e[0]!="number"},Z_=function(e,t){return e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&to.test(t)&&!t.startsWith("url("))},yl=function(e){return Array.isArray(e)},ro=function(){return{type:"spring",stiffness:500,damping:25,restSpeed:10}},gf=function(e){return{type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}},Qm=function(){return{type:"keyframes",ease:"linear",duration:.3}},w8=function(e){return{type:"keyframes",duration:.8,values:e}},Q_={x:ro,y:ro,z:ro,rotate:ro,rotateX:ro,rotateY:ro,rotateZ:ro,scaleX:gf,scaleY:gf,scale:gf,opacity:Qm,backgroundColor:Qm,color:Qm,default:gf},S8=function(e,t){var r;return yl(t)?r=w8:r=Q_[e]||Q_.default,oe({to:t},r(t))},eT=oe(oe({},Qi),{transform:Math.round}),tT={borderWidth:ke,borderTopWidth:ke,borderRightWidth:ke,borderBottomWidth:ke,borderLeftWidth:ke,borderRadius:ke,radius:ke,borderTopLeftRadius:ke,borderTopRightRadius:ke,borderBottomRightRadius:ke,borderBottomLeftRadius:ke,width:ke,maxWidth:ke,height:ke,maxHeight:ke,size:ke,top:ke,right:ke,bottom:ke,left:ke,padding:ke,paddingTop:ke,paddingRight:ke,paddingBottom:ke,paddingLeft:ke,margin:ke,marginTop:ke,marginRight:ke,marginBottom:ke,marginLeft:ke,rotate:di,rotateX:di,rotateY:di,rotateZ:di,scale:sf,scaleX:sf,scaleY:sf,scaleZ:sf,skew:di,skewX:di,skewY:di,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:gl,originX:S_,originY:S_,originZ:ke,zIndex:eT,fillOpacity:gl,strokeOpacity:gl,numOctaves:eT},_8=oe(oe({},tT),{color:Qt,backgroundColor:Qt,outlineColor:Qt,fill:Qt,stroke:Qt,borderColor:Qt,borderTopColor:Qt,borderRightColor:Qt,borderBottomColor:Qt,borderLeftColor:Qt,filter:Ym,WebkitFilter:Ym}),ev=function(e){return _8[e]};function tv(e,t){var r,n=ev(e);return n!==Ym&&(n=to),(r=n.getAnimatableNone)===null||r===void 0?void 0:r.call(n,t)}var T8={current:!1},C8=function(e){return Boolean(e&&typeof e=="object"&&e.mix&&e.toValue)},rT=function(e){return yl(e)?e[e.length-1]||0:e};function E8(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=Lt(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}function P8(e){var t=e.ease,r=e.times,n=e.yoyo,i=e.flip,s=e.loop,u=Lt(e,["ease","times","yoyo","flip","loop"]),o=oe({},u);return r&&(o.offset=r),u.duration&&(o.duration=Zm(u.duration)),u.repeatDelay&&(o.repeatDelay=Zm(u.repeatDelay)),t&&(o.ease=x8(t)?t.map(J_):J_(t)),u.type==="tween"&&(o.type="keyframes"),(n||s||i)&&(n?o.repeatType="reverse":s?o.repeatType="loop":i&&(o.repeatType="mirror"),o.repeat=s||n||i||u.repeat),u.type!=="spring"&&(o.type="keyframes"),o}function O8(e,t){var r,n,i=oT(e,t)||{};return(n=(r=i.delay)!==null&&r!==void 0?r:e.delay)!==null&&n!==void 0?n:0}function M8(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=Mt([],Nt(e.to),!1),e.to[0]=e.from),e}function k8(e,t,r){var n;return Array.isArray(t.to)&&((n=e.duration)!==null&&n!==void 0||(e.duration=.8)),M8(t),E8(e)||(e=oe(oe({},e),S8(r,t.to))),oe(oe({},t),P8(e))}function $8(e,t,r,n,i){var s,u=oT(n,e),o=(s=u.from)!==null&&s!==void 0?s:t.get(),a=Z_(e,r);o==="none"&&a&&typeof r=="string"?o=tv(e,r):nT(o)&&typeof r=="string"?o=iT(r):!Array.isArray(r)&&nT(r)&&typeof o=="string"&&(r=iT(o));var l=Z_(e,o);function h(){var f={from:o,to:r,velocity:t.getVelocity(),onComplete:i,onUpdate:function(d){return t.set(d)}};return u.type==="inertia"||u.type==="decay"?s8(oe(oe({},f),u)):W_(oe(oe({},k8(u,f,e)),{onUpdate:function(d){var g;f.onUpdate(d),(g=u.onUpdate)===null||g===void 0||g.call(u,d)},onComplete:function(){var d;f.onComplete(),(d=u.onComplete)===null||d===void 0||d.call(u)}}))}function c(){var f,d,g=rT(r);return t.set(g),i(),(f=u==null?void 0:u.onUpdate)===null||f===void 0||f.call(u,g),(d=u==null?void 0:u.onComplete)===null||d===void 0||d.call(u),{stop:function(){}}}return!l||!a||u.type===!1?c:h}function nT(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function iT(e){return typeof e=="number"?0:tv("",e)}function oT(e,t){return e[t]||e.default||e}function D8(e,t,r,n){return n===void 0&&(n={}),T8.current&&(n={type:!1}),t.start(function(i){var s,u,o=$8(e,t,r,n,i),a=O8(n,e),l=function(){return u=o()};return a?s=setTimeout(l,Zm(a)):l(),function(){clearTimeout(s),u==null||u.stop()}})}var A8={},I8=["","X","Y","Z"],R8=["translate","scale","rotate","skew"],bl=["transformPerspective","x","y","z"];R8.forEach(function(e){return I8.forEach(function(t){return bl.push(e+t)})});function F8(e,t){return bl.indexOf(e)-bl.indexOf(t)}var L8=new Set(bl);function mf(e){return L8.has(e)}var N8=new Set(["originX","originY","originZ"]);function aT(e){return N8.has(e)}function z8(e){var t=pi(e)?e.get():e;return C8(t)?t.toValue():t}var j8={hasAnimatedSinceResize:!0,hasEverUpdated:!1},B8=1;function V8(){return ul(function(){if(j8.hasEverUpdated)return B8++})}var sT=C.exports.createContext({}),U8=C.exports.createContext({});function H8(e,t,r,n){var i,s=t.layoutId,u=t.layout,o=t.drag,a=t.dragConstraints,l=t.layoutScroll,h=C.exports.useContext(U8);!n||!r||(r==null?void 0:r.projection)||(r.projection=new n(e,r.getLatestValues(),(i=r.parent)===null||i===void 0?void 0:i.projection),r.projection.setOptions({layoutId:s,layout:u,alwaysMeasureLayout:Boolean(o)||a&&l_(a),visualElement:r,scheduleRender:function(){return r.scheduleRender()},animationType:typeof u=="string"?u:"both",initialPromotionConfig:h,layoutScroll:l}))}var W8=function(e){br(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getSnapshotBeforeUpdate=function(){return this.updateProps(),null},t.prototype.componentDidUpdate=function(){},t.prototype.updateProps=function(){var r=this.props,n=r.visualElement,i=r.props;n&&n.setProps(i)},t.prototype.render=function(){return this.props.children},t}(ee.Component);function Y8(e){var t=e.preloadedFeatures,r=e.createVisualElement,n=e.projectionNodeConstructor,i=e.useRender,s=e.useVisualState,u=e.Component;t&&Dm(t);function o(a,l){var h=K8(a);a=oe(oe({},a),{layoutId:h});var c=C.exports.useContext(GF),f=null,d=rL(a),g=c.isStatic?void 0:V8(),m=s(a,c.isStatic);return!c.isStatic&&ll&&(d.visualElement=JF(u,m,oe(oe({},c),a),r),H8(g,a,d.visualElement,n||al.projectionNodeConstructor),f=XF(a,d.visualElement)),C.exports.createElement(W8,{visualElement:d.visualElement,props:oe(oe({},c),a)},f,C.exports.createElement(rf.Provider,{value:d},i(u,a,g,ZF(m,d.visualElement,l),m,c.isStatic,d.visualElement)))}return C.exports.forwardRef(o)}function K8(e){var t,r=e.layoutId,n=(t=C.exports.useContext(sT))===null||t===void 0?void 0:t.id;return n&&r!==void 0?n+"-"+r:r}function X8(e){function t(n,i){return i===void 0&&(i={}),Y8(e(n,i))}if(typeof Proxy=="undefined")return t;var r=new Map;return new Proxy(t,{get:function(n,i){return r.has(i)||r.set(i,t(i)),r.get(i)}})}var G8=["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 rv(e){return typeof e!="string"||e.includes("-")?!1:!!(G8.indexOf(e)>-1||/[A-Z]/.test(e))}function lT(e,t){var r=t.layout,n=t.layoutId;return mf(e)||aT(e)||(r||n!==void 0)&&(!!A8[e]||e==="opacity")}var q8={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function J8(e,t,r,n){var i=e.transform,s=e.transformKeys,u=t.enableHardwareAcceleration,o=u===void 0?!0:u,a=t.allowTransformNone,l=a===void 0?!0:a,h="";s.sort(F8);for(var c=!1,f=s.length,d=0;d<f;d++){var g=s[d];h+="".concat(q8[g]||g,"(").concat(i[g],") "),g==="z"&&(c=!0)}return!c&&o?h+="translateZ(0)":h=h.trim(),n?h=n(i,r?"":h):l&&r&&(h="none"),h}function Z8(e){var t=e.originX,r=t===void 0?"50%":t,n=e.originY,i=n===void 0?"50%":n,s=e.originZ,u=s===void 0?0:s;return"".concat(r," ").concat(i," ").concat(u)}function uT(e){return e.startsWith("--")}var Q8=function(e,t){return t&&typeof e=="number"?t.transform(e):e};function nv(e,t,r,n){var i,s=e.style,u=e.vars,o=e.transform,a=e.transformKeys,l=e.transformOrigin;a.length=0;var h=!1,c=!1,f=!0;for(var d in t){var g=t[d];if(uT(d)){u[d]=g;continue}var m=tT[d],p=Q8(g,m);if(mf(d)){if(h=!0,o[d]=p,a.push(d),!f)continue;g!==((i=m.default)!==null&&i!==void 0?i:0)&&(f=!1)}else aT(d)?(l[d]=p,c=!0):s[d]=p}h?s.transform=J8(e,r,f,n):n?s.transform=n({},""):!t.transform&&s.transform&&(s.transform="none"),c&&(s.transformOrigin=Z8(l))}var iv=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function cT(e,t,r){for(var n in t)!pi(t[n])&&!lT(n,r)&&(e[n]=t[n])}function e9(e,t,r){var n=e.transformTemplate;return C.exports.useMemo(function(){var i=iv();nv(i,t,{enableHardwareAcceleration:!r},n);var s=i.vars,u=i.style;return oe(oe({},s),u)},[t])}function t9(e,t,r){var n=e.style||{},i={};return cT(i,n,e),Object.assign(i,e9(e,t,r)),e.transformValues&&(i=e.transformValues(i)),i}function r9(e,t,r){var n={},i=t9(e,t,r);return Boolean(e.drag)&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":"pan-".concat(e.drag==="x"?"y":"x")),n.style=i,n}var n9=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover","whileInView","onViewportEnter","onViewportLeave","viewport","layoutScroll"]);function vf(e){return n9.has(e)}var fT=function(e){return!vf(e)};function i9(e){!e||(fT=function(t){return t.startsWith("on")?!vf(t):e(t)})}try{i9(require("@emotion/is-prop-valid").default)}catch{}function o9(e,t,r){var n={};for(var i in e)(fT(i)||r===!0&&vf(i)||!t&&!vf(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}function dT(e,t,r){return typeof e=="string"?e:ke.transform(t+r*e)}function a9(e,t,r){var n=dT(t,e.x,e.width),i=dT(r,e.y,e.height);return"".concat(n," ").concat(i)}var s9={offset:"stroke-dashoffset",array:"stroke-dasharray"},l9={offset:"strokeDashoffset",array:"strokeDasharray"};function u9(e,t,r,n,i){r===void 0&&(r=1),n===void 0&&(n=0),i===void 0&&(i=!0),e.pathLength=1;var s=i?s9:l9;e[s.offset]=ke.transform(-n);var u=ke.transform(t),o=ke.transform(r);e[s.array]="".concat(u," ").concat(o)}function ov(e,t,r,n){var i=t.attrX,s=t.attrY,u=t.originX,o=t.originY,a=t.pathLength,l=t.pathSpacing,h=l===void 0?1:l,c=t.pathOffset,f=c===void 0?0:c,d=Lt(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]);nv(e,d,r,n),e.attrs=e.style,e.style={};var g=e.attrs,m=e.style,p=e.dimensions;g.transform&&(p&&(m.transform=g.transform),delete g.transform),p&&(u!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=a9(p,u!==void 0?u:.5,o!==void 0?o:.5)),i!==void 0&&(g.x=i),s!==void 0&&(g.y=s),a!==void 0&&u9(g,a,h,f,!1)}var hT=function(){return oe(oe({},iv()),{attrs:{}})};function c9(e,t){var r=C.exports.useMemo(function(){var i=hT();return ov(i,t,{enableHardwareAcceleration:!1},e.transformTemplate),oe(oe({},i.attrs),{style:oe({},i.style)})},[t]);if(e.style){var n={};cT(n,e.style,e),r.style=oe(oe({},n),r.style)}return r}function f9(e){e===void 0&&(e=!1);var t=function(r,n,i,s,u,o){var a=u.latestValues,l=rv(r)?c9:r9,h=l(n,a,o),c=o9(n,typeof r=="string",e),f=oe(oe(oe({},c),h),{ref:s});return i&&(f["data-projection-id"]=i),C.exports.createElement(r,f)};return t}var d9=/([a-z])([A-Z])/g,h9="$1-$2",pT=function(e){return e.replace(d9,h9).toLowerCase()};function gT(e,t,r,n){var i=t.style,s=t.vars;Object.assign(e.style,i,n&&n.getProjectionStyles(r));for(var u in s)e.style.setProperty(u,s[u])}var mT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function vT(e,t){gT(e,t);for(var r in t.attrs)e.setAttribute(mT.has(r)?r:pT(r),t.attrs[r])}function av(e){var t=e.style,r={};for(var n in t)(pi(t[n])||lT(n,e))&&(r[n]=t[n]);return r}function yT(e){var t=av(e);for(var r in e)if(pi(e[r])){var n=r==="x"||r==="y"?"attr"+r.toUpperCase():r;t[n]=e[r]}return t}function sv(e){return typeof e=="object"&&typeof e.start=="function"}function bT(e,t,r,n){var i=e.scrapeMotionValuesFromProps,s=e.createRenderState,u=e.onMount,o={latestValues:p9(t,r,n,i),renderState:s()};return u&&(o.mount=function(a){return u(t,a,o)}),o}var xT=function(e){return function(t,r){var n=C.exports.useContext(rf),i=C.exports.useContext(sl);return r?bT(e,t,n,i):ul(function(){return bT(e,t,n,i)})}};function p9(e,t,r,n){var i={},s=(r==null?void 0:r.initial)===!1,u=n(e);for(var o in u)i[o]=z8(u[o]);var a=e.initial,l=e.animate,h=of(e),c=f_(e);t&&c&&!h&&e.inherit!==!1&&(a!=null||(a=t.initial),l!=null||(l=t.animate));var f=s||a===!1,d=f?l:a;if(d&&typeof d!="boolean"&&!sv(d)){var g=Array.isArray(d)?d:[d];g.forEach(function(m){var p=c_(e,m);if(!!p){var v=p.transitionEnd;p.transition;var y=Lt(p,["transitionEnd","transition"]);for(var b in y){var x=y[b];if(Array.isArray(x)){var w=f?x.length-1:0;x=x[w]}x!==null&&(i[b]=x)}for(var b in v)i[b]=v[b]}})}return i}var g9={useVisualState:xT({scrapeMotionValuesFromProps:yT,createRenderState:hT,onMount:function(e,t,r){var n=r.renderState,i=r.latestValues;try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}ov(n,i,{enableHardwareAcceleration:!1},e.transformTemplate),vT(t,n)}})},m9={useVisualState:xT({scrapeMotionValuesFromProps:av,createRenderState:iv})};function v9(e,t,r,n,i){var s=t.forwardMotionProps,u=s===void 0?!1:s,o=rv(e)?g9:m9;return oe(oe({},o),{preloadedFeatures:r,useRender:f9(u),createVisualElement:n,projectionNodeConstructor:i,Component:e})}var ot;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(ot||(ot={}));function wT(e,t,r,n){return e.addEventListener(t,r,n),function(){return e.removeEventListener(t,r,n)}}function lv(e,t,r,n){C.exports.useEffect(function(){var i=e.current;if(r&&i)return wT(i,t,r,n)},[e,t,r,n])}function y9(e){var t=e.whileFocus,r=e.visualElement,n=function(){var s;(s=r.animationState)===null||s===void 0||s.setActive(ot.Focus,!0)},i=function(){var s;(s=r.animationState)===null||s===void 0||s.setActive(ot.Focus,!1)};lv(r,"focus",t?n:void 0),lv(r,"blur",t?i:void 0)}function b9(e){return typeof PointerEvent!="undefined"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function x9(e){var t=!!e.touches;return t}function w9(e){return function(t){var r=t instanceof MouseEvent,n=!r||r&&t.button===0;n&&e(t)}}var S9={pageX:0,pageY:0};function _9(e,t){t===void 0&&(t="page");var r=e.touches[0]||e.changedTouches[0],n=r||S9;return{x:n[t+"X"],y:n[t+"Y"]}}function T9(e,t){return t===void 0&&(t="page"),{x:e[t+"X"],y:e[t+"Y"]}}function C9(e,t){return t===void 0&&(t="page"),{point:x9(e)?_9(e,t):T9(e,t)}}var ST=function(e,t){t===void 0&&(t=!1);var r=function(n){return e(n,C9(n))};return t?w9(r):r},E9=function(){return ll&&window.onpointerdown===null},P9=function(){return ll&&window.ontouchstart===null},O9=function(){return ll&&window.onmousedown===null},M9={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},k9={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function _T(e){return E9()?e:P9()?k9[e]:O9()?M9[e]:e}function TT(e,t,r,n){return wT(e,_T(t),ST(r,t==="pointerdown"),n)}function uv(e,t,r,n){return lv(e,_T(t),r&&ST(r,t==="pointerdown"),n)}function CT(e){var t=null;return function(){var r=function(){t=null};return t===null?(t=e,r):!1}}var ET=CT("dragHorizontal"),PT=CT("dragVertical");function $9(e){var t=!1;if(e==="y")t=PT();else if(e==="x")t=ET();else{var r=ET(),n=PT();r&&n?t=function(){r(),n()}:(r&&r(),n&&n())}return t}function OT(){var e=$9(!0);return e?(e(),!1):!0}function MT(e,t,r){return function(n,i){var s;!b9(n)||OT()||((s=e.animationState)===null||s===void 0||s.setActive(ot.Hover,t),r==null||r(n,i))}}function D9(e){var t=e.onHoverStart,r=e.onHoverEnd,n=e.whileHover,i=e.visualElement;uv(i,"pointerenter",t||n?MT(i,!0,t):void 0),uv(i,"pointerleave",r||n?MT(i,!1,r):void 0)}var kT=function(e,t){return t?e===t?!0:kT(e,t.parentElement):!1};function $T(e){return C.exports.useEffect(function(){return function(){return e()}},[])}function A9(e){var t=e.onTap,r=e.onTapStart,n=e.onTapCancel,i=e.whileTap,s=e.visualElement,u=t||r||n||i,o=C.exports.useRef(!1),a=C.exports.useRef(null);function l(){var g;(g=a.current)===null||g===void 0||g.call(a),a.current=null}function h(){var g;return l(),o.current=!1,(g=s.animationState)===null||g===void 0||g.setActive(ot.Tap,!1),!OT()}function c(g,m){!h()||(kT(s.getInstance(),g.target)?t==null||t(g,m):n==null||n(g,m))}function f(g,m){!h()||n==null||n(g,m)}function d(g,m){var p;l(),!o.current&&(o.current=!0,a.current=Xm(TT(window,"pointerup",c),TT(window,"pointercancel",f)),(p=s.animationState)===null||p===void 0||p.setActive(ot.Tap,!0),r==null||r(g,m))}uv(s,"pointerdown",u?d:void 0),$T(l)}var cv=new WeakMap,fv=new WeakMap,I9=function(e){var t;(t=cv.get(e.target))===null||t===void 0||t(e)},R9=function(e){e.forEach(I9)};function F9(e){var t=e.root,r=Lt(e,["root"]),n=t||document;fv.has(n)||fv.set(n,{});var i=fv.get(n),s=JSON.stringify(r);return i[s]||(i[s]=new IntersectionObserver(R9,oe({root:t},r))),i[s]}function L9(e,t,r){var n=F9(t);return cv.set(e,r),n.observe(e),function(){cv.delete(e),n.unobserve(e)}}function N9(e){var t=e.visualElement,r=e.whileInView,n=e.onViewportEnter,i=e.onViewportLeave,s=e.viewport,u=s===void 0?{}:s,o=C.exports.useRef({hasEnteredView:!1,isInView:!1}),a=Boolean(r||n||i);u.once&&o.current.hasEnteredView&&(a=!1);var l=typeof IntersectionObserver=="undefined"?B9:j9;l(a,o.current,t,u)}var z9={some:0,all:1};function j9(e,t,r,n){var i=n.root,s=n.margin,u=n.amount,o=u===void 0?"some":u,a=n.once;C.exports.useEffect(function(){if(!!e){var l={root:i==null?void 0:i.current,rootMargin:s,threshold:typeof o=="number"?o:z9[o]},h=function(c){var f,d=c.isIntersecting;if(t.isInView!==d&&(t.isInView=d,!(a&&!d&&t.hasEnteredView))){d&&(t.hasEnteredView=!0),(f=r.animationState)===null||f===void 0||f.setActive(ot.InView,d);var g=r.getProps(),m=d?g.onViewportEnter:g.onViewportLeave;m==null||m(c)}};return L9(r.getInstance(),l,h)}},[e,i,s,o])}function B9(e,t,r){C.exports.useEffect(function(){!e||requestAnimationFrame(function(){var n;t.hasEnteredView=!0;var i=r.getProps().onViewportEnter;i==null||i(null),(n=r.animationState)===null||n===void 0||n.setActive(ot.InView,!0)})},[e])}var _a=function(e){return function(t){return e(t),null}},V9={inView:_a(N9),tap:_a(A9),focus:_a(y9),hover:_a(D9)};function U9(){var e=C.exports.useContext(sl);if(e===null)return[!0,null];var t=e.isPresent,r=e.onExitComplete,n=e.register,i=Y9();C.exports.useEffect(function(){return n(i)},[]);var s=function(){return r==null?void 0:r(i)};return!t&&r?[!1,s]:[!0]}var H9=0,W9=function(){return H9++},Y9=function(){return ul(W9)};function DT(e,t){if(!Array.isArray(t))return!1;var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}var K9=function(e){return/^\-?\d*\.?\d+$/.test(e)},X9=function(e){return/^0[^.\s]+$/.test(e)},AT=function(e){return function(t){return t.test(e)}},G9={test:function(e){return e==="auto"},parse:function(e){return e}},IT=[Qi,ke,Sa,di,bL,yL,G9],xl=function(e){return IT.find(AT(e))},q9=Mt(Mt([],Nt(IT),!1),[Qt,to],!1),J9=function(e){return q9.find(AT(e))};function Z9(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,vl(r))}function Q9(e,t){var r=nf(e,t),n=r?e.makeTargetAnimatable(r,!1):{},i=n.transitionEnd,s=i===void 0?{}:i;n.transition;var u=Lt(n,["transitionEnd","transition"]);u=oe(oe({},u),s);for(var o in u){var a=rT(u[o]);Z9(e,o,a)}}function e7(e,t,r){var n,i,s,u,o=Object.keys(t).filter(function(d){return!e.hasValue(d)}),a=o.length;if(!!a)for(var l=0;l<a;l++){var h=o[l],c=t[h],f=null;Array.isArray(c)&&(f=c[0]),f===null&&(f=(i=(n=r[h])!==null&&n!==void 0?n:e.readValue(h))!==null&&i!==void 0?i:t[h]),f!=null&&(typeof f=="string"&&(K9(f)||X9(f))?f=parseFloat(f):!J9(f)&&to.test(c)&&(f=tv(h,c)),e.addValue(h,vl(f)),(s=(u=r)[h])!==null&&s!==void 0||(u[h]=f),e.setBaseTarget(h,f))}}function t7(e,t){if(!!t){var r=t[e]||t.default||t;return r.from}}function r7(e,t,r){var n,i,s={};for(var u in e)s[u]=(n=t7(u,t))!==null&&n!==void 0?n:(i=r.getValue(u))===null||i===void 0?void 0:i.get();return s}function n7(e,t,r){r===void 0&&(r={}),e.notifyAnimationStart(t);var n;if(Array.isArray(t)){var i=t.map(function(u){return dv(e,u,r)});n=Promise.all(i)}else if(typeof t=="string")n=dv(e,t,r);else{var s=typeof t=="function"?nf(e,t,r.custom):t;n=RT(e,s,r)}return n.then(function(){return e.notifyAnimationComplete(t)})}function dv(e,t,r){var n;r===void 0&&(r={});var i=nf(e,t,r.custom),s=(i||{}).transition,u=s===void 0?e.getDefaultTransition()||{}:s;r.transitionOverride&&(u=r.transitionOverride);var o=i?function(){return RT(e,i,r)}:function(){return Promise.resolve()},a=((n=e.variantChildren)===null||n===void 0?void 0:n.size)?function(d){d===void 0&&(d=0);var g=u.delayChildren,m=g===void 0?0:g,p=u.staggerChildren,v=u.staggerDirection;return i7(e,t,m+d,p,v,r)}:function(){return Promise.resolve()},l=u.when;if(l){var h=Nt(l==="beforeChildren"?[o,a]:[a,o],2),c=h[0],f=h[1];return c().then(f)}else return Promise.all([o(),a(r.delay)])}function RT(e,t,r){var n,i=r===void 0?{}:r,s=i.delay,u=s===void 0?0:s,o=i.transitionOverride,a=i.type,l=e.makeTargetAnimatable(t),h=l.transition,c=h===void 0?e.getDefaultTransition():h,f=l.transitionEnd,d=Lt(l,["transition","transitionEnd"]);o&&(c=o);var g=[],m=a&&((n=e.animationState)===null||n===void 0?void 0:n.getState()[a]);for(var p in d){var v=e.getValue(p),y=d[p];if(!(!v||y===void 0||m&&a7(m,p))){var b=D8(p,v,y,oe({delay:u},c));g.push(b)}}return Promise.all(g).then(function(){f&&Q9(e,f)})}function i7(e,t,r,n,i,s){r===void 0&&(r=0),n===void 0&&(n=0),i===void 0&&(i=1);var u=[],o=(e.variantChildren.size-1)*n,a=i===1?function(l){return l===void 0&&(l=0),l*n}:function(l){return l===void 0&&(l=0),o-l*n};return Array.from(e.variantChildren).sort(o7).forEach(function(l,h){u.push(dv(l,t,oe(oe({},s),{delay:r+a(h)})).then(function(){return l.notifyAnimationComplete(t)}))}),Promise.all(u)}function o7(e,t){return e.sortNodePosition(t)}function a7(e,t){var r=e.protectedKeys,n=e.needsAnimating,i=r.hasOwnProperty(t)&&n[t]!==!0;return n[t]=!1,i}var hv=[ot.Animate,ot.InView,ot.Focus,ot.Hover,ot.Tap,ot.Drag,ot.Exit],s7=Mt([],Nt(hv),!1).reverse(),l7=hv.length;function u7(e){return function(t){return Promise.all(t.map(function(r){var n=r.animation,i=r.options;return n7(e,n,i)}))}}function c7(e){var t=u7(e),r=d7(),n={},i=!0,s=function(h,c){var f=nf(e,c);if(f){f.transition;var d=f.transitionEnd,g=Lt(f,["transition","transitionEnd"]);h=oe(oe(oe({},h),g),d)}return h};function u(h){return n[h]!==void 0}function o(h){t=h(e)}function a(h,c){for(var f,d=e.getProps(),g=e.getVariantContext(!0)||{},m=[],p=new Set,v={},y=1/0,b=function(_){var E=s7[_],k=r[E],z=(f=d[E])!==null&&f!==void 0?f:g[E],F=Yr(z),j=E===c?k.isActive:null;j===!1&&(y=_);var K=z===g[E]&&z!==d[E]&&F;if(K&&i&&e.manuallyAnimateOnMount&&(K=!1),k.protectedKeys=oe({},v),!k.isActive&&j===null||!z&&!k.prevProp||sv(z)||typeof z=="boolean")return"continue";var B=f7(k.prevProp,z),H=B||E===c&&k.isActive&&!K&&F||_>y&&F,ue=Array.isArray(z)?z:[z],ge=ue.reduce(s,{});j===!1&&(ge={});var fe=k.prevResolvedValues,L=fe===void 0?{}:fe,Z=oe(oe({},L),ge),M=function(O){H=!0,p.delete(O),k.needsAnimating[O]=!0};for(var D in Z){var R=ge[D],P=L[D];v.hasOwnProperty(D)||(R!==P?yl(R)&&yl(P)?!DT(R,P)||B?M(D):k.protectedKeys[D]=!0:R!==void 0?M(D):p.add(D):R!==void 0&&p.has(D)?M(D):k.protectedKeys[D]=!0)}k.prevProp=z,k.prevResolvedValues=ge,k.isActive&&(v=oe(oe({},v),ge)),i&&e.blockInitialAnimation&&(H=!1),H&&!K&&m.push.apply(m,Mt([],Nt(ue.map(function(O){return{animation:O,options:oe({type:E},h)}})),!1))},x=0;x<l7;x++)b(x);if(n=oe({},v),p.size){var w={};p.forEach(function(_){var E=e.getBaseTarget(_);E!==void 0&&(w[_]=E)}),m.push({animation:w})}var T=Boolean(m.length);return i&&d.initial===!1&&!e.manuallyAnimateOnMount&&(T=!1),i=!1,T?t(m):Promise.resolve()}function l(h,c,f){var d;return r[h].isActive===c?Promise.resolve():((d=e.variantChildren)===null||d===void 0||d.forEach(function(g){var m;return(m=g.animationState)===null||m===void 0?void 0:m.setActive(h,c)}),r[h].isActive=c,a(f,h))}return{isAnimated:u,animateChanges:a,setActive:l,setAnimateFunction:o,getState:function(){return r}}}function f7(e,t){return typeof t=="string"?t!==e:u_(t)?!DT(t,e):!1}function no(e){return e===void 0&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function d7(){var e;return e={},e[ot.Animate]=no(!0),e[ot.InView]=no(),e[ot.Hover]=no(),e[ot.Tap]=no(),e[ot.Drag]=no(),e[ot.Focus]=no(),e[ot.Exit]=no(),e}var h7={animation:_a(function(e){var t=e.visualElement,r=e.animate;t.animationState||(t.animationState=c7(t)),sv(r)&&C.exports.useEffect(function(){return r.subscribe(t)},[r])}),exit:_a(function(e){var t=e.custom,r=e.visualElement,n=Nt(U9(),2),i=n[0],s=n[1],u=C.exports.useContext(sl);C.exports.useEffect(function(){var o,a;r.isPresent=i;var l=(o=r.animationState)===null||o===void 0?void 0:o.setActive(ot.Exit,!i,{custom:(a=u==null?void 0:u.custom)!==null&&a!==void 0?a:t});!i&&(l==null||l.then(s))},[i])})};function p7(e){var t=e.top,r=e.left,n=e.right,i=e.bottom;return{x:{min:r,max:n},y:{min:t,max:i}}}function g7(e,t){if(!t)return e;var r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function m7(e,t){return p7(g7(e.getBoundingClientRect(),t))}var yf=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function v7(){var e=yf.map(function(){return new pf}),t={},r={clearAllListeners:function(){return e.forEach(function(n){return n.clear()})},updatePropListeners:function(n){yf.forEach(function(i){var s,u="on"+i,o=n[u];(s=t[i])===null||s===void 0||s.call(t),o&&(t[i]=r[u](o))})}};return e.forEach(function(n,i){r["on"+yf[i]]=function(s){return n.add(s)},r["notify"+yf[i]]=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];n.notify.apply(n,Mt([],Nt(s),!1))}}),r}function y7(e,t,r){var n;for(var i in t){var s=t[i],u=r[i];if(pi(s))e.addValue(i,s);else if(pi(u))e.addValue(i,vl(s));else if(u!==s)if(e.hasValue(i)){var o=e.getValue(i);!o.hasAnimated&&o.set(s)}else e.addValue(i,vl((n=e.getStaticValue(i))!==null&&n!==void 0?n:s))}for(var i in r)t[i]===void 0&&e.removeValue(i);return t}var FT=function(e){var t=e.treeType,r=t===void 0?"":t,n=e.build,i=e.getBaseTarget,s=e.makeTargetAnimatable,u=e.measureViewportBox,o=e.render,a=e.readValueFromInstance,l=e.removeValueFromRenderState,h=e.sortNodePosition,c=e.scrapeMotionValuesFromProps;return function(f,d){var g=f.parent,m=f.props,p=f.presenceId,v=f.blockInitialAnimation,y=f.visualState;d===void 0&&(d={});var b=!1,x=y.latestValues,w=y.renderState,T,_=v7(),E=new Map,k=new Map,z={},F=oe({},x),j;function K(){!T||!b||(B(),o(T,w,m.style,D.projection))}function B(){n(D,w,x,d,m)}function H(){_.notifyUpdate(x)}function ue(R,P){var O=P.onChange(function(I){x[R]=I,m.onUpdate&&wa.update(H,!1,!0)}),N=P.onRenderRequest(D.scheduleRender);k.set(R,function(){O(),N()})}var ge=c(m);for(var fe in ge){var L=ge[fe];x[fe]!==void 0&&pi(L)&&L.set(x[fe],!1)}var Z=of(m),M=f_(m),D=oe(oe({treeType:r,current:null,depth:g?g.depth+1:0,parent:g,children:new Set,presenceId:p,variantChildren:M?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(g==null?void 0:g.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(T)},mount:function(R){b=!0,T=D.current=R,D.projection&&D.projection.mount(R),M&&g&&!Z&&(j=g==null?void 0:g.addVariantChild(D)),g==null||g.children.add(D),D.setProps(m)},unmount:function(){var R;(R=D.projection)===null||R===void 0||R.unmount(),Fm.update(H),Fm.render(K),k.forEach(function(P){return P()}),j==null||j(),g==null||g.children.delete(D),_.clearAllListeners(),T=void 0,b=!1},addVariantChild:function(R){var P,O=D.getClosestVariantNode();if(O)return(P=O.variantChildren)===null||P===void 0||P.add(R),function(){return O.variantChildren.delete(R)}},sortNodePosition:function(R){return!h||r!==R.treeType?0:h(D.getInstance(),R.getInstance())},getClosestVariantNode:function(){return M?D:g==null?void 0:g.getClosestVariantNode()},getLayoutId:function(){return m.layoutId},getInstance:function(){return T},getStaticValue:function(R){return x[R]},setStaticValue:function(R,P){return x[R]=P},getLatestValues:function(){return x},setVisibility:function(R){D.isVisible!==R&&(D.isVisible=R,D.scheduleRender())},makeTargetAnimatable:function(R,P){return P===void 0&&(P=!0),s(D,R,m,P)},measureViewportBox:function(){return u(T,m)},addValue:function(R,P){D.hasValue(R)&&D.removeValue(R),E.set(R,P),x[R]=P.get(),ue(R,P)},removeValue:function(R){var P;E.delete(R),(P=k.get(R))===null||P===void 0||P(),k.delete(R),delete x[R],l(R,w)},hasValue:function(R){return E.has(R)},getValue:function(R,P){var O=E.get(R);return O===void 0&&P!==void 0&&(O=vl(P),D.addValue(R,O)),O},forEachValue:function(R){return E.forEach(R)},readValue:function(R){var P;return(P=x[R])!==null&&P!==void 0?P:a(T,R,d)},setBaseTarget:function(R,P){F[R]=P},getBaseTarget:function(R){if(i){var P=i(m,R);if(P!==void 0&&!pi(P))return P}return F[R]}},_),{build:function(){return B(),w},scheduleRender:function(){wa.render(K,!1,!0)},syncRender:K,setProps:function(R){(R.transformTemplate||m.transformTemplate)&&D.scheduleRender(),m=R,_.updatePropListeners(R),z=y7(D,c(m),z)},getProps:function(){return m},getVariant:function(R){var P;return(P=m.variants)===null||P===void 0?void 0:P[R]},getDefaultTransition:function(){return m.transition},getTransformPagePoint:function(){return m.transformPagePoint},getVariantContext:function(R){if(R===void 0&&(R=!1),R)return g==null?void 0:g.getVariantContext();if(!Z){var P=(g==null?void 0:g.getVariantContext())||{};return m.initial!==void 0&&(P.initial=m.initial),P}for(var O={},N=0;N<b7;N++){var I=LT[N],q=m[I];(Yr(q)||q===!1)&&(O[I]=q)}return O}});return D}},LT=Mt(["initial"],Nt(hv),!1),b7=LT.length;function pv(e){return typeof e=="string"&&e.startsWith("var(--")}var x7=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function w7(e){var t=x7.exec(e);if(!t)return[,];var r=Nt(t,3),n=r[1],i=r[2];return[n,i]}function gv(e,t,r){var n=Nt(w7(e),2),i=n[0],s=n[1];if(!!i){var u=window.getComputedStyle(t).getPropertyValue(i);return u?u.trim():pv(s)?gv(s,t):s}}function S7(e,t,r){var n,i=Lt(t,[]),s=e.getInstance();if(!(s instanceof Element))return{target:i,transitionEnd:r};r&&(r=oe({},r)),e.forEachValue(function(l){var h=l.get();if(!!pv(h)){var c=gv(h,s);c&&l.set(c)}});for(var u in i){var o=i[u];if(!!pv(o)){var a=gv(o,s);!a||(i[u]=a,r&&((n=r[u])!==null&&n!==void 0||(r[u]=o)))}}return{target:i,transitionEnd:r}}var _7=new Set(["width","height","top","left","right","bottom","x","y"]),NT=function(e){return _7.has(e)},T7=function(e){return Object.keys(e).some(NT)},zT=function(e,t){e.set(t,!1),e.set(t)},jT=function(e){return e===Qi||e===ke},BT;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(BT||(BT={}));var VT=function(e,t){return parseFloat(e.split(", ")[t])},UT=function(e,t){return function(r,n){var i=n.transform;if(i==="none"||!i)return 0;var s=i.match(/^matrix3d\((.+)\)$/);if(s)return VT(s[1],t);var u=i.match(/^matrix\((.+)\)$/);return u?VT(u[1],e):0}},C7=new Set(["x","y","z"]),E7=bl.filter(function(e){return!C7.has(e)});function P7(e){var t=[];return E7.forEach(function(r){var n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t.length&&e.syncRender(),t}var HT={width:function(e,t){var r=e.x,n=t.paddingLeft,i=n===void 0?"0":n,s=t.paddingRight,u=s===void 0?"0":s;return r.max-r.min-parseFloat(i)-parseFloat(u)},height:function(e,t){var r=e.y,n=t.paddingTop,i=n===void 0?"0":n,s=t.paddingBottom,u=s===void 0?"0":s;return r.max-r.min-parseFloat(i)-parseFloat(u)},top:function(e,t){var r=t.top;return parseFloat(r)},left:function(e,t){var r=t.left;return parseFloat(r)},bottom:function(e,t){var r=e.y,n=t.top;return parseFloat(n)+(r.max-r.min)},right:function(e,t){var r=e.x,n=t.left;return parseFloat(n)+(r.max-r.min)},x:UT(4,13),y:UT(5,14)},O7=function(e,t,r){var n=t.measureViewportBox(),i=t.getInstance(),s=getComputedStyle(i),u=s.display,o={};u==="none"&&t.setStaticValue("display",e.display||"block"),r.forEach(function(l){o[l]=HT[l](n,s)}),t.syncRender();var a=t.measureViewportBox();return r.forEach(function(l){var h=t.getValue(l);zT(h,o[l]),e[l]=HT[l](a,s)}),e},M7=function(e,t,r,n){r===void 0&&(r={}),n===void 0&&(n={}),t=oe({},t),n=oe({},n);var i=Object.keys(t).filter(NT),s=[],u=!1,o=[];if(i.forEach(function(l){var h=e.getValue(l);if(!!e.hasValue(l)){var c=r[l],f=xl(c),d=t[l],g;if(yl(d)){var m=d.length,p=d[0]===null?1:0;c=d[p],f=xl(c);for(var v=p;v<m;v++)g?tf(xl(d[v])===g):g=xl(d[v])}else g=xl(d);if(f!==g)if(jT(f)&&jT(g)){var y=h.get();typeof y=="string"&&h.set(parseFloat(y)),typeof d=="string"?t[l]=parseFloat(d):Array.isArray(d)&&g===ke&&(t[l]=d.map(parseFloat))}else(f==null?void 0:f.transform)&&(g==null?void 0:g.transform)&&(c===0||d===0)?c===0?h.set(g.transform(c)):t[l]=f.transform(d):(u||(s=P7(e),u=!0),o.push(l),n[l]=n[l]!==void 0?n[l]:t[l],zT(h,d))}}),o.length){var a=O7(t,e,o);return s.length&&s.forEach(function(l){var h=Nt(l,2),c=h[0],f=h[1];e.getValue(c).set(f)}),e.syncRender(),{target:a,transitionEnd:n}}else return{target:t,transitionEnd:n}};function k7(e,t,r,n){return T7(t)?M7(e,t,r,n):{target:t,transitionEnd:n}}var $7=function(e,t,r,n){var i=S7(e,t,n);return t=i.target,n=i.transitionEnd,k7(e,t,r,n)};function D7(e){return window.getComputedStyle(e)}var WT={treeType:"dom",readValueFromInstance:function(e,t){if(mf(t)){var r=ev(t);return r&&r.default||0}else{var n=D7(e);return(uT(t)?n.getPropertyValue(t):n[t])||0}},sortNodePosition:function(e,t){return e.compareDocumentPosition(t)&2?1:-1},getBaseTarget:function(e,t){var r;return(r=e.style)===null||r===void 0?void 0:r[t]},measureViewportBox:function(e,t){var r=t.transformPagePoint;return m7(e,r)},resetTransform:function(e,t,r){var n=r.transformTemplate;t.style.transform=n?n({},""):"none",e.scheduleRender()},restoreTransform:function(e,t){e.style.transform=t.style.transform},removeValueFromRenderState:function(e,t){var r=t.vars,n=t.style;delete r[e],delete n[e]},makeTargetAnimatable:function(e,t,r,n){var i=r.transformValues;n===void 0&&(n=!0);var s=t.transition,u=t.transitionEnd,o=Lt(t,["transition","transitionEnd"]),a=r7(o,s||{},e);if(i&&(u&&(u=i(u)),o&&(o=i(o)),a&&(a=i(a))),n){e7(e,o,a);var l=$7(e,o,a,u);u=l.transitionEnd,o=l.target}return oe({transition:s,transitionEnd:u},o)},scrapeMotionValuesFromProps:av,build:function(e,t,r,n,i){e.isVisible!==void 0&&(t.style.visibility=e.isVisible?"visible":"hidden"),nv(t,r,n,i.transformTemplate)},render:gT},A7=FT(WT),I7=FT(oe(oe({},WT),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var r;return mf(t)?((r=ev(t))===null||r===void 0?void 0:r.default)||0:(t=mT.has(t)?t:pT(t),e.getAttribute(t))},scrapeMotionValuesFromProps:yT,build:function(e,t,r,n,i){ov(t,r,n,i.transformTemplate)},render:vT})),R7=function(e,t){return rv(e)?I7(t,{enableHardwareAcceleration:!1}):A7(t,{enableHardwareAcceleration:!0})},Yt=X8(v9);function F7(){var e=C.exports.useRef(!1),t=Nt(C.exports.useState(0),2),r=t[0],n=t[1];$T(function(){return e.current=!0});var i=C.exports.useCallback(function(){!e.current&&n(r+1)},[r]),s=C.exports.useCallback(function(){return wa.postRender(i)},[i]);return[s,r]}var YT=0;function L7(){var e=YT;return YT++,e}var mv=function(e){var t=e.children,r=e.initial,n=e.isPresent,i=e.onExitComplete,s=e.custom,u=e.presenceAffectsLayout,o=ul(N7),a=ul(L7),l=C.exports.useMemo(function(){return{id:a,initial:r,isPresent:n,custom:s,onExitComplete:function(h){var c,f;o.set(h,!0);try{for(var d=S6(o.values()),g=d.next();!g.done;g=d.next()){var m=g.value;if(!m)return}}catch(p){c={error:p}}finally{try{g&&!g.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.error}}i==null||i()},register:function(h){return o.set(h,!1),function(){return o.delete(h)}}}},u?void 0:[n]);return C.exports.useMemo(function(){o.forEach(function(h,c){return o.set(c,!1)})},[n]),C.exports.useEffect(function(){!n&&!o.size&&(i==null||i())},[n]),C.exports.createElement(sl.Provider,{value:l},t)};function N7(){return new Map}function Ta(e){return e.key||""}function z7(e,t){e.forEach(function(r){var n=Ta(r);t.set(n,r)})}function j7(e){var t=[];return C.exports.Children.forEach(e,function(r){C.exports.isValidElement(r)&&t.push(r)}),t}var fn=function(e){var t=e.children,r=e.custom,n=e.initial,i=n===void 0?!0:n,s=e.onExitComplete,u=e.exitBeforeEnter,o=e.presenceAffectsLayout,a=o===void 0?!0:o,l=Nt(F7(),1),h=l[0],c=C.exports.useContext(sT).forceRender;c&&(h=c);var f=C.exports.useRef(!0),d=C.exports.useRef(!0);C.exports.useEffect(function(){return function(){d.current=!1}},[]);var g=j7(t),m=C.exports.useRef(g),p=C.exports.useRef(new Map).current,v=C.exports.useRef(new Set).current;if(z7(g,p),f.current)return f.current=!1,C.exports.createElement(C.exports.Fragment,null,g.map(function(E){return C.exports.createElement(mv,{key:Ta(E),isPresent:!0,initial:i?void 0:!1,presenceAffectsLayout:a},E)}));for(var y=Mt([],Nt(g),!1),b=m.current.map(Ta),x=g.map(Ta),w=b.length,T=0;T<w;T++){var _=b[T];x.indexOf(_)===-1?v.add(_):v.delete(_)}return u&&v.size&&(y=[]),v.forEach(function(E){if(x.indexOf(E)===-1){var k=p.get(E);if(!!k){var z=b.indexOf(E),F=function(){p.delete(E),v.delete(E);var j=m.current.findIndex(function(K){return K.key===E});if(m.current.splice(j,1),!v.size){if(m.current=g,d.current===!1)return;h(),s&&s()}};y.splice(z,0,C.exports.createElement(mv,{key:Ta(k),isPresent:!1,onExitComplete:F,custom:r,presenceAffectsLayout:a},k))}}}),y=y.map(function(E){var k=E.key;return v.has(k)?E:C.exports.createElement(mv,{key:Ta(E),isPresent:!0,presenceAffectsLayout:a},E)}),m.current=y,C.exports.createElement(C.exports.Fragment,null,v.size?y:y.map(function(E){return C.exports.cloneElement(E)}))};function B7(e){var t=e.children,r=e.features,n=e.strict,i=n===void 0?!1:n,s=Nt(C.exports.useState(!vv(r)),2),u=s[1],o=C.exports.useRef(void 0);if(!vv(r)){var a=r.renderer,l=Lt(r,["renderer"]);o.current=a,Dm(l)}return C.exports.useEffect(function(){vv(r)&&r().then(function(h){var c=h.renderer,f=Lt(h,["renderer"]);Dm(f),o.current=c,u(!0)})},[]),C.exports.createElement(Am.Provider,{value:{renderer:o.current,strict:i}},t)}function vv(e){return typeof e=="function"}var V7=oe(oe({renderer:R7},h7),V9),KT={exports:{}},U7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",H7=U7,W7=H7;function XT(){}function GT(){}GT.resetWarningCache=XT;var Y7=function(){function e(n,i,s,u,o,a){if(a!==W7){var l=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 l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var r={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:GT,resetWarningCache:XT};return r.PropTypes=r,r};KT.exports=Y7();var Qe=KT.exports,K7=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"],["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 wl(e,t){var r=X7(e);if(typeof r.path!="string"){var n=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof n=="string"&&n.length>0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function X7(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var n=t.split(".").pop().toLowerCase(),i=K7.get(n);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var G7=[".DS_Store","Thumbs.db"];function q7(e){return ga(this,void 0,void 0,function(){return ma(this,function(t){return bf(e)&&J7(e)?[2,tN(e.dataTransfer,e.type)]:Z7(e)?[2,Q7(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,eN(e)]:[2,[]]})})}function J7(e){return bf(e.dataTransfer)}function Z7(e){return bf(e)&&bf(e.target)}function bf(e){return typeof e=="object"&&e!==null}function Q7(e){return yv(e.target.files).map(function(t){return wl(t)})}function eN(e){return ga(this,void 0,void 0,function(){var t;return ma(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(n){return wl(n)})]}})})}function tN(e,t){return ga(this,void 0,void 0,function(){var r,n;return ma(this,function(i){switch(i.label){case 0:return e===null?[2,[]]:e.items?(r=yv(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(rN))]):[3,2];case 1:return n=i.sent(),[2,qT(JT(n))];case 2:return[2,qT(yv(e.files).map(function(s){return wl(s)}))]}})})}function qT(e){return e.filter(function(t){return G7.indexOf(t.name)===-1})}function yv(e){if(e===null)return[];for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(n)}return t}function rN(e){if(typeof e.webkitGetAsEntry!="function")return ZT(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?QT(t):ZT(e)}function JT(e){return e.reduce(function(t,r){return _6(t,Array.isArray(r)?JT(r):[r])},[])}function ZT(e){var t=e.getAsFile();if(!t)return Promise.reject(e+" is not a File");var r=wl(t);return Promise.resolve(r)}function nN(e){return ga(this,void 0,void 0,function(){return ma(this,function(t){return[2,e.isDirectory?QT(e):iN(e)]})})}function QT(e){var t=e.createReader();return new Promise(function(r,n){var i=[];function s(){var u=this;t.readEntries(function(o){return ga(u,void 0,void 0,function(){var a,l,h;return ma(this,function(c){switch(c.label){case 0:if(o.length)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return a=c.sent(),r(a),[3,4];case 3:return l=c.sent(),n(l),[3,4];case 4:return[3,6];case 5:h=Promise.all(o.map(nN)),i.push(h),s(),c.label=6;case 6:return[2]}})})},function(o){n(o)})}s()})}function iN(e){return ga(this,void 0,void 0,function(){return ma(this,function(t){return[2,new Promise(function(r,n){e.file(function(i){var s=wl(i,e.fullPath);r(s)},function(i){n(i)})})]})})}var oN=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return r.some(function(u){var o=u.trim().toLowerCase();return o.charAt(0)==="."?n.toLowerCase().endsWith(o):o.endsWith("/*")?s===o.replace(/\/.*$/,""):i===o})}return!0};function eC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eC(Object(r),!0).forEach(function(n){rC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rC(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nC(e,t){return uN(e)||lN(e,t)||sN(e,t)||aN()}function aN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sN(e,t){if(!!e){if(typeof e=="string")return iC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return iC(e,t)}}function iC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lN(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,u,o;try{for(r=r.call(e);!(i=(u=r.next()).done)&&(n.push(u.value),!(t&&n.length===t));i=!0);}catch(a){s=!0,o=a}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw o}}return n}}function uN(e){if(Array.isArray(e))return e}var cN="file-invalid-type",fN="file-too-large",dN="file-too-small",hN="too-many-files",pN=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var r=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:cN,message:"File type must be ".concat(r)}},oC=function(t){return{code:fN,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},aC=function(t){return{code:dN,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},gN={code:hN,message:"Too many files"};function sC(e,t){var r=e.type==="application/x-moz-file"||oN(e,t);return[r,r?null:pN(t)]}function lC(e,t,r){if(Sl(e.size))if(Sl(t)&&Sl(r)){if(e.size>r)return[!1,oC(r)];if(e.size<t)return[!1,aC(t)]}else{if(Sl(t)&&e.size<t)return[!1,aC(t)];if(Sl(r)&&e.size>r)return[!1,oC(r)]}return[!0,null]}function Sl(e){return e!=null}function mN(e){var t=e.files,r=e.accept,n=e.minSize,i=e.maxSize,s=e.multiple,u=e.maxFiles;return!s&&t.length>1||s&&u>=1&&t.length>u?!1:t.every(function(o){var a=sC(o,r),l=nC(a,1),h=l[0],c=lC(o,n,i),f=nC(c,1),d=f[0];return h&&d})}function xf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble!="undefined"?e.cancelBubble:!1}function wf(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function uC(e){e.preventDefault()}function vN(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yN(e){return e.indexOf("Edge/")!==-1}function bN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return vN(e)||yN(e)}function dn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return t.some(function(o){return!xf(n)&&o&&o.apply(void 0,[n].concat(s)),xf(n)})}}function cC(){return"showOpenFilePicker"in window}function xN(e){return e=typeof e=="string"?e.split(","):e,[{description:"everything",accept:Array.isArray(e)?e.filter(function(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||/\w+\/[-+.\w]+/g.test(t)}).reduce(function(t,r){return tC(tC({},t),{},rC({},r,[]))},{}):{}}]}var wN=["children"],SN=["open"],_N=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],TN=["refKey","onChange","onClick"];function CN(e){return ON(e)||PN(e)||fC(e)||EN()}function EN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PN(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ON(e){if(Array.isArray(e))return xv(e)}function bv(e,t){return $N(e)||kN(e,t)||fC(e,t)||MN()}function MN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fC(e,t){if(!!e){if(typeof e=="string")return xv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xv(e,t)}}function xv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kN(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,u,o;try{for(r=r.call(e);!(i=(u=r.next()).done)&&(n.push(u.value),!(t&&n.length===t));i=!0);}catch(a){s=!0,o=a}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw o}}return n}}function $N(e){if(Array.isArray(e))return e}function dC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function st(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dC(Object(r),!0).forEach(function(n){wv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sf(e,t){if(e==null)return{};var r=DN(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}function DN(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var Sv=C.exports.forwardRef(function(e,t){var r=e.children,n=Sf(e,wN),i=pC(n),s=i.open,u=Sf(i,SN);return C.exports.useImperativeHandle(t,function(){return{open:s}},[s]),S(xr,{children:r(st(st({},u),{},{open:s}))})});Sv.displayName="Dropzone";var hC={disabled:!1,getFilesFromEvent:q7,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1};Sv.defaultProps=hC,Sv.propTypes={children:Qe.func,accept:Qe.oneOfType([Qe.string,Qe.arrayOf(Qe.string)]),multiple:Qe.bool,preventDropOnDocument:Qe.bool,noClick:Qe.bool,noKeyboard:Qe.bool,noDrag:Qe.bool,noDragEventsBubbling:Qe.bool,minSize:Qe.number,maxSize:Qe.number,maxFiles:Qe.number,disabled:Qe.bool,getFilesFromEvent:Qe.func,onFileDialogCancel:Qe.func,onFileDialogOpen:Qe.func,useFsAccessApi:Qe.bool,onDragEnter:Qe.func,onDragLeave:Qe.func,onDragOver:Qe.func,onDrop:Qe.func,onDropAccepted:Qe.func,onDropRejected:Qe.func,validator:Qe.func};var _v={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function pC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=st(st({},hC),e),r=t.accept,n=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,u=t.minSize,o=t.multiple,a=t.maxFiles,l=t.onDragEnter,h=t.onDragLeave,c=t.onDragOver,f=t.onDrop,d=t.onDropAccepted,g=t.onDropRejected,m=t.onFileDialogCancel,p=t.onFileDialogOpen,v=t.useFsAccessApi,y=t.preventDropOnDocument,b=t.noClick,x=t.noKeyboard,w=t.noDrag,T=t.noDragEventsBubbling,_=t.validator,E=C.exports.useMemo(function(){return typeof p=="function"?p:gC},[p]),k=C.exports.useMemo(function(){return typeof m=="function"?m:gC},[m]),z=C.exports.useRef(null),F=C.exports.useRef(null),j=C.exports.useReducer(AN,_v),K=bv(j,2),B=K[0],H=K[1],ue=B.isFocused,ge=B.isFileDialogActive,fe=B.draggedFiles,L=function(){ge&&setTimeout(function(){if(F.current){var se=F.current.files;se.length||(H({type:"closeDialog"}),k())}},300)};C.exports.useEffect(function(){return v&&cC()?function(){}:(window.addEventListener("focus",L,!1),function(){window.removeEventListener("focus",L,!1)})},[F,ge,k,v]);var Z=C.exports.useRef([]),M=function(se){z.current&&z.current.contains(se.target)||(se.preventDefault(),Z.current=[])};C.exports.useEffect(function(){return y&&(document.addEventListener("dragover",uC,!1),document.addEventListener("drop",M,!1)),function(){y&&(document.removeEventListener("dragover",uC),document.removeEventListener("drop",M))}},[z,y]);var D=C.exports.useCallback(function(U){U.preventDefault(),U.persist(),J(U),Z.current=[].concat(CN(Z.current),[U.target]),wf(U)&&Promise.resolve(i(U)).then(function(se){xf(U)&&!T||(H({draggedFiles:se,isDragActive:!0,type:"setDraggedFiles"}),l&&l(U))})},[i,l,T]),R=C.exports.useCallback(function(U){U.preventDefault(),U.persist(),J(U);var se=wf(U);if(se&&U.dataTransfer)try{U.dataTransfer.dropEffect="copy"}catch{}return se&&c&&c(U),!1},[c,T]),P=C.exports.useCallback(function(U){U.preventDefault(),U.persist(),J(U);var se=Z.current.filter(function(_e){return z.current&&z.current.contains(_e)}),me=se.indexOf(U.target);me!==-1&&se.splice(me,1),Z.current=se,!(se.length>0)&&(H({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),wf(U)&&h&&h(U))},[z,h,T]),O=C.exports.useCallback(function(U,se){var me=[],_e=[];U.forEach(function(Ie){var Ue=sC(Ie,r),Ne=bv(Ue,2),Ae=Ne[0],ft=Ne[1],ir=lC(Ie,u,s),pr=bv(ir,2),Gr=pr[0],Gt=pr[1],nu=_?_(Ie):null;if(Ae&&Gr&&!nu)me.push(Ie);else{var iu=[ft,Gt];nu&&(iu=iu.concat(nu)),_e.push({file:Ie,errors:iu.filter(function(vq){return vq})})}}),(!o&&me.length>1||o&&a>=1&&me.length>a)&&(me.forEach(function(Ie){_e.push({file:Ie,errors:[gN]})}),me.splice(0)),H({acceptedFiles:me,fileRejections:_e,type:"setFiles"}),f&&f(me,_e,se),_e.length>0&&g&&g(_e,se),me.length>0&&d&&d(me,se)},[H,o,r,u,s,a,f,d,g,_]),N=C.exports.useCallback(function(U){U.preventDefault(),U.persist(),J(U),Z.current=[],wf(U)&&Promise.resolve(i(U)).then(function(se){xf(U)&&!T||O(se,U)}),H({type:"reset"})},[i,O,T]),I=C.exports.useCallback(function(){if(v&&cC()){H({type:"openDialog"}),E();var U={multiple:o,types:xN(r)};window.showOpenFilePicker(U).then(function(se){return i(se)}).then(function(se){return O(se,null)}).catch(function(se){return k(se)}).finally(function(){return H({type:"closeDialog"})});return}F.current&&(H({type:"openDialog"}),E(),F.current.value=null,F.current.click())},[H,E,k,v,O,r,o]),q=C.exports.useCallback(function(U){!z.current||!z.current.isEqualNode(U.target)||(U.keyCode===32||U.keyCode===13)&&(U.preventDefault(),I())},[z,F,I]),X=C.exports.useCallback(function(){H({type:"focus"})},[]),ne=C.exports.useCallback(function(){H({type:"blur"})},[]),re=C.exports.useCallback(function(){b||(bN()?setTimeout(I,0):I())},[F,b,I]),ae=function(se){return n?null:se},G=function(se){return x?null:ae(se)},W=function(se){return w?null:ae(se)},J=function(se){T&&se.stopPropagation()},te=C.exports.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=U.refKey,me=se===void 0?"ref":se,_e=U.role,Ie=U.onKeyDown,Ue=U.onFocus,Ne=U.onBlur,Ae=U.onClick,ft=U.onDragEnter,ir=U.onDragOver,pr=U.onDragLeave,Gr=U.onDrop,Gt=Sf(U,_N);return st(st(wv({onKeyDown:G(dn(Ie,q)),onFocus:G(dn(Ue,X)),onBlur:G(dn(Ne,ne)),onClick:ae(dn(Ae,re)),onDragEnter:W(dn(ft,D)),onDragOver:W(dn(ir,R)),onDragLeave:W(dn(pr,P)),onDrop:W(dn(Gr,N)),role:typeof _e=="string"&&_e!==""?_e:"button"},me,z),!n&&!x?{tabIndex:0}:{}),Gt)}},[z,q,X,ne,re,D,R,P,N,x,w,n]),Q=C.exports.useCallback(function(U){U.stopPropagation()},[]),le=C.exports.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=U.refKey,me=se===void 0?"ref":se,_e=U.onChange,Ie=U.onClick,Ue=Sf(U,TN),Ne=wv({accept:r,multiple:o,type:"file",style:{display:"none"},onChange:ae(dn(_e,N)),onClick:ae(dn(Ie,Q)),autoComplete:"off",tabIndex:-1},me,F);return st(st({},Ne),Ue)}},[F,r,o,N,n]),ie=fe.length,ye=ie>0&&mN({files:fe,accept:r,minSize:u,maxSize:s,multiple:o,maxFiles:a}),he=ie>0&&!ye;return st(st({},B),{},{isDragAccept:ye,isDragReject:he,isFocused:ue&&!n,getRootProps:te,getInputProps:le,rootRef:z,inputRef:F,open:ae(I)})}function AN(e,t){switch(t.type){case"focus":return st(st({},e),{},{isFocused:!0});case"blur":return st(st({},e),{},{isFocused:!1});case"openDialog":return st(st({},_v),{},{isFileDialogActive:!0});case"closeDialog":return st(st({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var r=t.isDragActive,n=t.draggedFiles;return st(st({},e),{},{draggedFiles:n,isDragActive:r});case"setFiles":return st(st({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return st({},_v);default:return e}}function gC(){}function mC(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=mC(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ee(){for(var e=0,t,r,n="";e<arguments.length;)(t=arguments[e++])&&(r=mC(t))&&(n&&(n+=" "),n+=r);return n}function Tv(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var Cv={};Tv(Cv,"SSRProvider",()=>IN),Tv(Cv,"useSSRSafeId",()=>vC),Tv(Cv,"useIsSSR",()=>Cf);const _f={prefix:String(Math.round(Math.random()*1e10)),current:0},Tf=ee.createContext(_f);function IN(e){let t=C.exports.useContext(Tf),r=C.exports.useMemo(()=>({prefix:t===_f?"":`${t.prefix}-${++t.current}`,current:0}),[t]);return ee.createElement(Tf.Provider,{value:r},e.children)}let RN=Boolean(typeof window!="undefined"&&window.document&&window.document.createElement);function vC(e){let t=C.exports.useContext(Tf);return t===_f&&!RN&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server."),C.exports.useMemo(()=>e||`react-aria${t.prefix}-${++t.current}`,[e])}function Cf(){let t=C.exports.useContext(Tf)!==_f,[r,n]=C.exports.useState(t);return typeof window!="undefined"&&t&&C.exports.useLayoutEffect(()=>{n(!1)},[]),r}function Ef(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var FN={};Ef(FN,"useControlledState",()=>Mn);function Mn(e,t,r){let[n,i]=C.exports.useState(e||t),s=C.exports.useRef(e!==void 0),u=s.current,o=e!==void 0,a=C.exports.useRef(n);u!==o&&console.warn(`WARN: A component changed from ${u?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}.`),s.current=o;let l=C.exports.useCallback((h,...c)=>{let f=(d,...g)=>{r&&(Object.is(a.current,d)||r(d,...g)),o||(a.current=d)};typeof h=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),i((g,...m)=>{let p=h(o?a.current:g,...m);return f(p,...c),o?g:p})):(o||i(h),f(h,...c))},[o,r]);return o?a.current=e:e=n,[e,l]}var Ev={};Ef(Ev,"clamp",()=>Ca),Ef(Ev,"snapValueToStep",()=>hn),Ef(Ev,"toFixedNumber",()=>LN);function Ca(e,t=-1/0,r=1/0){return Math.min(Math.max(e,t),r)}function hn(e,t,r,n){let i=(e-(isNaN(t)?0:t))%n,s=Math.abs(i)*2>=n?e+Math.sign(i)*(n-Math.abs(i)):e-i;isNaN(t)?!isNaN(r)&&s>r&&(s=Math.floor(r/n)*n):s<t?s=t:!isNaN(r)&&s>r&&(s=t+Math.floor((r-t)/n)*n);let u=n.toString(),o=u.indexOf("."),a=o>=0?u.length-o:0;if(a>0){let l=Math.pow(10,a);s=Math.round(s*l)/l}return s}function LN(e,t,r=10){const n=Math.pow(r,t);return Math.round(e*n)/n}function Ve(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var Pv={};Ve(Pv,"useId",()=>Kt),Ve(Pv,"mergeIds",()=>yC),Ve(Pv,"useSlotId",()=>kn);var NN={};Ve(NN,"useLayoutEffect",()=>mt);const mt=typeof window!="undefined"?ee.useLayoutEffect:()=>{};let Pf=new Map;function Kt(e){let t=C.exports.useRef(!0);t.current=!0;let[r,n]=C.exports.useState(e),i=C.exports.useRef(null),s=vC(r),u=o=>{t.current?i.current=o:n(o)};return Pf.set(s,u),mt(()=>{t.current=!1},[u]),mt(()=>{let o=s;return()=>{Pf.delete(o)}},[s]),C.exports.useEffect(()=>{let o=i.current;o&&(n(o),i.current=null)},[n,u]),s}function yC(e,t){if(e===t)return e;let r=Pf.get(e);if(r)return r(t),t;let n=Pf.get(t);return n?(n(e),e):t}function kn(e=[]){let t=Kt(),[r,n]=$C(t),i=C.exports.useCallback(()=>{n(function*(){yield t,yield document.getElementById(t)?t:null})},[t,n]);return mt(i,[t,i,...e]),r}var zN={};Ve(zN,"chain",()=>io);function io(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}var jN={};Ve(jN,"mergeProps",()=>Ce);function Ce(...e){let t=$({},e[0]);for(let r=1;r<e.length;r++){let n=e[r];for(let i in n){let s=t[i],u=n[i];typeof s=="function"&&typeof u=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?t[i]=io(s,u):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof u=="string"?t[i]=Ee(s,u):i==="id"&&s&&u?t.id=yC(s,u):t[i]=u!==void 0?u:s}}return t}var BN={};Ve(BN,"filterDOMProps",()=>_r);const VN=new Set(["id"]),UN=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),HN=/^(data-.*)$/;function _r(e,t={}){let{labelable:r,propNames:n}=t,i={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(VN.has(s)||r&&UN.has(s)||(n==null?void 0:n.has(s))||HN.test(s))&&(i[s]=e[s]);return i}var WN={};Ve(WN,"focusWithoutScrolling",()=>pn);function pn(e){if(YN())e.focus({preventScroll:!0});else{let t=KN(e);e.focus(),XN(t)}}let Of=null;function YN(){if(Of==null){Of=!1;try{var e=document.createElement("div");e.focus({get preventScroll(){return Of=!0,!0}})}catch{}}return Of}function KN(e){for(var t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}function XN(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}var GN={};Ve(GN,"getOffset",()=>bC);function bC(e,t,r="horizontal"){let n=e.getBoundingClientRect();return t?r==="horizontal"?n.right:n.bottom:r==="horizontal"?n.left:n.top}var xC={};Ve(xC,"clamp",()=>Ca),Ve(xC,"snapValueToStep",()=>hn);var qN={};Ve(qN,"runAfterTransition",()=>Mv);let Ea=new Map,Ov=new Set;function wC(){if(typeof window=="undefined")return;let e=r=>{let n=Ea.get(r.target);n||(n=new Set,Ea.set(r.target,n),r.target.addEventListener("transitioncancel",t)),n.add(r.propertyName)},t=r=>{let n=Ea.get(r.target);if(!!n&&(n.delete(r.propertyName),n.size===0&&(r.target.removeEventListener("transitioncancel",t),Ea.delete(r.target)),Ea.size===0)){for(let i of Ov)i();Ov.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?wC():document.addEventListener("DOMContentLoaded",wC));function Mv(e){requestAnimationFrame(()=>{Ea.size===0?e():Ov.add(e)})}var JN={};Ve(JN,"useDrag1D",()=>ZN);const Mf=[];function ZN(e){console.warn("useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html");let{containerRef:t,reverse:r,orientation:n,onHover:i,onDrag:s,onPositionChange:u,onIncrement:o,onDecrement:a,onIncrementToMax:l,onDecrementToMin:h,onCollapseToggle:c}=e,f=_=>n==="horizontal"?_.clientX:_.clientY,d=_=>{let E=bC(t.current,r,n),k=f(_);return r?E-k:k-E},g=C.exports.useRef(!1),m=C.exports.useRef(0),p=C.exports.useRef({onPositionChange:u,onDrag:s});p.current.onDrag=s,p.current.onPositionChange=u;let v=_=>{_.preventDefault();let E=d(_);g.current||(g.current=!0,p.current.onDrag&&p.current.onDrag(!0),p.current.onPositionChange&&p.current.onPositionChange(E)),m.current!==E&&(m.current=E,u&&u(E))},y=_=>{const E=_.target;g.current=!1;let k=d(_);p.current.onDrag&&p.current.onDrag(!1),p.current.onPositionChange&&p.current.onPositionChange(k),Mf.splice(Mf.indexOf(E),1),window.removeEventListener("mouseup",y,!1),window.removeEventListener("mousemove",v,!1)};return{onMouseDown:_=>{const E=_.currentTarget;Mf.some(k=>E.contains(k))||(Mf.push(E),window.addEventListener("mousemove",v,!1),window.addEventListener("mouseup",y,!1))},onMouseEnter:()=>{i&&i(!0)},onMouseOut:()=>{i&&i(!1)},onKeyDown:_=>{switch(_.key){case"Left":case"ArrowLeft":n==="horizontal"&&(_.preventDefault(),a&&!r?a():o&&r&&o());break;case"Up":case"ArrowUp":n==="vertical"&&(_.preventDefault(),a&&!r?a():o&&r&&o());break;case"Right":case"ArrowRight":n==="horizontal"&&(_.preventDefault(),o&&!r?o():a&&r&&a());break;case"Down":case"ArrowDown":n==="vertical"&&(_.preventDefault(),o&&!r?o():a&&r&&a());break;case"Home":_.preventDefault(),h&&h();break;case"End":_.preventDefault(),l&&l();break;case"Enter":_.preventDefault(),c&&c();break}}}}var QN={};Ve(QN,"useGlobalListeners",()=>oo);function oo(){let e=C.exports.useRef(new Map),t=C.exports.useCallback((i,s,u,o)=>{let a=(o==null?void 0:o.once)?(...l)=>{e.current.delete(u),u(...l)}:u;e.current.set(u,{type:s,eventTarget:i,fn:a,options:o}),i.addEventListener(s,u,o)},[]),r=C.exports.useCallback((i,s,u,o)=>{var a;let l=((a=e.current.get(u))===null||a===void 0?void 0:a.fn)||u;i.removeEventListener(s,l,o),e.current.delete(u)},[]),n=C.exports.useCallback(()=>{e.current.forEach((i,s)=>{r(i.eventTarget,i.type,s,i.options)})},[r]);return C.exports.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}var ez={};Ve(ez,"useLabels",()=>_l);function _l(e,t){let{id:r,"aria-label":n,"aria-labelledby":i}=e;return r=Kt(r),i&&n?i=[...new Set([...i.trim().split(/\s+/),r])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!n&&!i&&t&&(n=t),{id:r,"aria-label":n,"aria-labelledby":i}}var tz={};Ve(tz,"useObjectRef",()=>kv);function kv(e){const t=C.exports.useRef();return mt(()=>{!e||(typeof e=="function"?e(t.current):e.current=t.current)},[e]),t}var rz={};Ve(rz,"useUpdateEffect",()=>nz);function nz(e,t){const r=C.exports.useRef(!0);C.exports.useEffect(()=>{r.current?r.current=!1:e()},t)}var iz={};Ve(iz,"useResizeObserver",()=>SC);function oz(){return typeof window.ResizeObserver!="undefined"}function SC(e){const{ref:t,onResize:r}=e;C.exports.useEffect(()=>{let n=t==null?void 0:t.current;if(!!n)if(oz()){const i=new window.ResizeObserver(s=>{!s.length||r()});return i.observe(n),()=>{n&&i.unobserve(n)}}else return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}},[r,t])}var az={};Ve(az,"useSyncRef",()=>kf);function kf(e,t){mt(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}},[e,t])}var sz={};Ve(sz,"getScrollParent",()=>$v);function $v(e){for(;e&&!lz(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function lz(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}var uz={};Ve(uz,"useViewportSize",()=>_C);let gn=typeof window!="undefined"&&window.visualViewport;function _C(){let[e,t]=C.exports.useState(()=>TC());return C.exports.useEffect(()=>{let r=()=>{t(n=>{let i=TC();return i.width===n.width&&i.height===n.height?n:i})};return gn?gn.addEventListener("resize",r):window.addEventListener("resize",r),()=>{gn?gn.removeEventListener("resize",r):window.removeEventListener("resize",r)}},[]),e}function TC(){return{width:(gn==null?void 0:gn.width)||window.innerWidth,height:(gn==null?void 0:gn.height)||window.innerHeight}}var cz={};Ve(cz,"useDescription",()=>CC);let fz=0;const Dv=new Map;function CC(e){let[t,r]=C.exports.useState(null);return mt(()=>{if(!e)return;let n=Dv.get(e);if(n)r(n.element.id);else{let i=`react-aria-description-${fz++}`;r(i);let s=document.createElement("div");s.id=i,s.style.display="none",s.textContent=e,document.body.appendChild(s),n={refCount:0,element:s},Dv.set(e,n)}return n.refCount++,()=>{--n.refCount===0&&(n.element.remove(),Dv.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}var gi={};Ve(gi,"isMac",()=>ao),Ve(gi,"isIPhone",()=>Rv),Ve(gi,"isIPad",()=>EC),Ve(gi,"isIOS",()=>Pa),Ve(gi,"isAppleDevice",()=>PC),Ve(gi,"isWebKit",()=>OC),Ve(gi,"isChrome",()=>MC),Ve(gi,"isAndroid",()=>kC);function Av(e){var t;return typeof window=="undefined"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(r=>e.test(r.brand)))||e.test(window.navigator.userAgent)}function Iv(e){return typeof window!="undefined"&&window.navigator!=null?e.test((window.navigator.userAgentData||window.navigator).platform):!1}function ao(){return Iv(/^Mac/i)}function Rv(){return Iv(/^iPhone/i)}function EC(){return Iv(/^iPad/i)||ao()&&navigator.maxTouchPoints>1}function Pa(){return Rv()||EC()}function PC(){return ao()||Pa()}function OC(){return Av(/AppleWebKit/i)&&!MC()}function MC(){return Av(/Chrome/i)}function kC(){return Av(/Android/i)}var dz={};Ve(dz,"useEvent",()=>Fv);function Fv(e,t,r,n){let i=C.exports.useRef(r);i.current=r;let s=r==null;C.exports.useEffect(()=>{if(s)return;let u=e.current,o=a=>i.current.call(this,a);return u.addEventListener(t,o,n),()=>{u.removeEventListener(t,o,n)}},[e,t,n,s])}var hz={};Ve(hz,"useValueEffect",()=>$C);function $C(e){let[t,r]=C.exports.useState(e),n=C.exports.useRef(t),i=C.exports.useRef(null);n.current=t;let s=C.exports.useRef(null);s.current=()=>{let o=i.current.next();if(o.done){i.current=null;return}t===o.value?s.current():r(o.value)},mt(()=>{i.current&&s.current()});let u=C.exports.useCallback(o=>{i.current=o(n.current),s.current()},[i,s]);return[t,u]}var pz={};Ve(pz,"scrollIntoView",()=>Lv);function Lv(e,t){let r=DC(e,t,"left"),n=DC(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight,u=e.scrollLeft,o=e.scrollTop,a=u+e.offsetWidth,l=o+e.offsetHeight;r<=u?u=r:r+i>a&&(u+=r+i-a),n<=o?o=n:n+s>l&&(o+=n+s-l),e.scrollLeft=u,e.scrollTop=o}function DC(e,t,r){const n=r==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[n],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[n];break}t=t.offsetParent}return i}function zt(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var gz={};zt(gz,"Pressable",()=>Sz);var mz={};zt(mz,"usePress",()=>mi);let Oa="default",Nv="",$f=new WeakMap;function zv(e){Pa()?(Oa==="default"&&(Nv=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),Oa="disabled"):e&&($f.set(e,e.style.userSelect),e.style.userSelect="none")}function Tl(e){if(Pa()){if(Oa!=="disabled")return;Oa="restoring",setTimeout(()=>{Mv(()=>{Oa==="restoring"&&(document.documentElement.style.webkitUserSelect==="none"&&(document.documentElement.style.webkitUserSelect=Nv||""),Nv="",Oa="default")})},300)}else if(e&&$f.has(e)){let t=$f.get(e);e.style.userSelect==="none"&&(e.style.userSelect=t),e.getAttribute("style")===""&&e.removeAttribute("style"),$f.delete(e)}}function jv(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}const Df=ee.createContext(null);Df.displayName="PressResponderContext";function vz(e){let t=C.exports.useContext(Df);if(t){let r=t,{register:n}=r,i=ze(r,["register"]);e=Ce(i,e),n()}return kf(t,e.ref),e}function mi(e){let x=vz(e),{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:s,isDisabled:u,isPressed:o,preventFocusOnPress:a,shouldCancelOnPointerExit:l,allowTextSelectionOnPress:h,ref:c}=x,f=ze(x,["onPress","onPressChange","onPressStart","onPressEnd","onPressUp","isDisabled","isPressed","preventFocusOnPress","shouldCancelOnPointerExit","allowTextSelectionOnPress","ref"]),d=C.exports.useRef(null);d.current={onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:s,isDisabled:u,shouldCancelOnPointerExit:l};let[g,m]=C.exports.useState(!1),p=C.exports.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:v,removeAllGlobalListeners:y}=oo(),b=C.exports.useMemo(()=>{let w=p.current,T=(j,K)=>{let{onPressStart:B,onPressChange:H,isDisabled:ue}=d.current;ue||w.didFirePressStart||(B&&B({type:"pressstart",pointerType:K,target:j.currentTarget,shiftKey:j.shiftKey,metaKey:j.metaKey,ctrlKey:j.ctrlKey,altKey:j.altKey}),H&&H(!0),w.didFirePressStart=!0,m(!0))},_=(j,K,B=!0)=>{let{onPressEnd:H,onPressChange:ue,onPress:ge,isDisabled:fe}=d.current;!w.didFirePressStart||(w.ignoreClickAfterPress=!0,w.didFirePressStart=!1,H&&H({type:"pressend",pointerType:K,target:j.currentTarget,shiftKey:j.shiftKey,metaKey:j.metaKey,ctrlKey:j.ctrlKey,altKey:j.altKey}),ue&&ue(!1),m(!1),ge&&B&&!fe&&ge({type:"press",pointerType:K,target:j.currentTarget,shiftKey:j.shiftKey,metaKey:j.metaKey,ctrlKey:j.ctrlKey,altKey:j.altKey}))},E=(j,K)=>{let{onPressUp:B,isDisabled:H}=d.current;H||B&&B({type:"pressup",pointerType:K,target:j.currentTarget,shiftKey:j.shiftKey,metaKey:j.metaKey,ctrlKey:j.ctrlKey,altKey:j.altKey})},k=j=>{w.isPressed&&(w.isOverTarget&&_($n(w.target,j),w.pointerType,!1),w.isPressed=!1,w.isOverTarget=!1,w.activePointerId=null,w.pointerType=null,y(),h||Tl(w.target))},z={onKeyDown(j){Bv(j.nativeEvent)&&j.currentTarget.contains(j.target)&&(RC(j.target)&&j.preventDefault(),j.stopPropagation(),!w.isPressed&&!j.repeat&&(w.target=j.currentTarget,w.isPressed=!0,T(j,"keyboard"),v(document,"keyup",F,!1)))},onKeyUp(j){Bv(j.nativeEvent)&&!j.repeat&&j.currentTarget.contains(j.target)&&E($n(w.target,j),"keyboard")},onClick(j){j&&!j.currentTarget.contains(j.target)||j&&j.button===0&&(j.stopPropagation(),u&&j.preventDefault(),!w.ignoreClickAfterPress&&!w.ignoreEmulatedMouseEvents&&(w.pointerType==="virtual"||jv(j.nativeEvent))&&(!u&&!a&&pn(j.currentTarget),T(j,"virtual"),E(j,"virtual"),_(j,"virtual")),w.ignoreEmulatedMouseEvents=!1,w.ignoreClickAfterPress=!1)}},F=j=>{if(w.isPressed&&Bv(j)){RC(j.target)&&j.preventDefault(),j.stopPropagation(),w.isPressed=!1;let K=j.target;_($n(w.target,j),"keyboard",w.target.contains(K)),y(),(w.target.contains(K)&&AC(w.target)||w.target.getAttribute("role")==="link")&&w.target.click()}};if(typeof PointerEvent!="undefined"){z.onPointerDown=H=>{if(!(H.button!==0||!H.currentTarget.contains(H.target))){if(wz(H.nativeEvent)){w.pointerType="virtual";return}Vv(H.currentTarget)&&H.preventDefault(),w.pointerType=H.pointerType,H.stopPropagation(),w.isPressed||(w.isPressed=!0,w.isOverTarget=!0,w.activePointerId=H.pointerId,w.target=H.currentTarget,!u&&!a&&pn(H.currentTarget),h||zv(w.target),T(H,w.pointerType),v(document,"pointermove",j,!1),v(document,"pointerup",K,!1),v(document,"pointercancel",B,!1))}},z.onMouseDown=H=>{!H.currentTarget.contains(H.target)||H.button===0&&(Vv(H.currentTarget)&&H.preventDefault(),H.stopPropagation())},z.onPointerUp=H=>{!H.currentTarget.contains(H.target)||w.pointerType==="virtual"||H.button===0&&Ma(H,H.currentTarget)&&E(H,w.pointerType||H.pointerType)};let j=H=>{H.pointerId===w.activePointerId&&(Ma(H,w.target)?w.isOverTarget||(w.isOverTarget=!0,T($n(w.target,H),w.pointerType)):w.isOverTarget&&(w.isOverTarget=!1,_($n(w.target,H),w.pointerType,!1),d.current.shouldCancelOnPointerExit&&k(H)))},K=H=>{H.pointerId===w.activePointerId&&w.isPressed&&H.button===0&&(Ma(H,w.target)?_($n(w.target,H),w.pointerType):w.isOverTarget&&_($n(w.target,H),w.pointerType,!1),w.isPressed=!1,w.isOverTarget=!1,w.activePointerId=null,w.pointerType=null,y(),h||Tl(w.target))},B=H=>{k(H)};z.onDragStart=H=>{!H.currentTarget.contains(H.target)||k(H)}}else{z.onMouseDown=B=>{B.button!==0||!B.currentTarget.contains(B.target)||(Vv(B.currentTarget)&&B.preventDefault(),B.stopPropagation(),!w.ignoreEmulatedMouseEvents&&(w.isPressed=!0,w.isOverTarget=!0,w.target=B.currentTarget,w.pointerType=jv(B.nativeEvent)?"virtual":"mouse",!u&&!a&&pn(B.currentTarget),T(B,w.pointerType),v(document,"mouseup",j,!1)))},z.onMouseEnter=B=>{!B.currentTarget.contains(B.target)||(B.stopPropagation(),w.isPressed&&!w.ignoreEmulatedMouseEvents&&(w.isOverTarget=!0,T(B,w.pointerType)))},z.onMouseLeave=B=>{!B.currentTarget.contains(B.target)||(B.stopPropagation(),w.isPressed&&!w.ignoreEmulatedMouseEvents&&(w.isOverTarget=!1,_(B,w.pointerType,!1),d.current.shouldCancelOnPointerExit&&k(B)))},z.onMouseUp=B=>{!B.currentTarget.contains(B.target)||!w.ignoreEmulatedMouseEvents&&B.button===0&&E(B,w.pointerType)};let j=B=>{if(B.button===0){if(w.isPressed=!1,y(),w.ignoreEmulatedMouseEvents){w.ignoreEmulatedMouseEvents=!1;return}Ma(B,w.target)?_($n(w.target,B),w.pointerType):w.isOverTarget&&_($n(w.target,B),w.pointerType,!1),w.isOverTarget=!1}};z.onTouchStart=B=>{if(!B.currentTarget.contains(B.target))return;B.stopPropagation();let H=yz(B.nativeEvent);!H||(w.activePointerId=H.identifier,w.ignoreEmulatedMouseEvents=!0,w.isOverTarget=!0,w.isPressed=!0,w.target=B.currentTarget,w.pointerType="touch",!u&&!a&&pn(B.currentTarget),h||zv(w.target),T(B,w.pointerType),v(window,"scroll",K,!0))},z.onTouchMove=B=>{if(!B.currentTarget.contains(B.target)||(B.stopPropagation(),!w.isPressed))return;let H=IC(B.nativeEvent,w.activePointerId);H&&Ma(H,B.currentTarget)?w.isOverTarget||(w.isOverTarget=!0,T(B,w.pointerType)):w.isOverTarget&&(w.isOverTarget=!1,_(B,w.pointerType,!1),d.current.shouldCancelOnPointerExit&&k(B))},z.onTouchEnd=B=>{if(!B.currentTarget.contains(B.target)||(B.stopPropagation(),!w.isPressed))return;let H=IC(B.nativeEvent,w.activePointerId);H&&Ma(H,B.currentTarget)?(E(B,w.pointerType),_(B,w.pointerType)):w.isOverTarget&&_(B,w.pointerType,!1),w.isPressed=!1,w.activePointerId=null,w.isOverTarget=!1,w.ignoreEmulatedMouseEvents=!0,h||Tl(w.target),y()},z.onTouchCancel=B=>{!B.currentTarget.contains(B.target)||(B.stopPropagation(),w.isPressed&&k(B))};let K=B=>{w.isPressed&&B.target.contains(w.target)&&k({currentTarget:w.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};z.onDragStart=B=>{!B.currentTarget.contains(B.target)||k(B)}}return z},[v,u,a,y,h]);return C.exports.useEffect(()=>()=>{h||Tl(p.current.target)},[h]),{isPressed:o||g,pressProps:Ce(f,b)}}function AC(e){return e.tagName==="A"&&e.hasAttribute("href")}function Bv(e){const{key:t,code:r,target:n}=e,i=n,{tagName:s,isContentEditable:u}=i,o=i.getAttribute("role");return(t==="Enter"||t===" "||t==="Spacebar"||r==="Space")&&s!=="INPUT"&&s!=="TEXTAREA"&&u!==!0&&(!AC(i)||o==="button"&&t!=="Enter")&&!(o==="link"&&t!=="Enter")}function yz(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function IC(e,t){const r=e.changedTouches;for(let n=0;n<r.length;n++){const i=r[n];if(i.identifier===t)return i}return null}function $n(e,t){return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey}}function bz(e){let t=e.width/2||e.radiusX||0,r=e.height/2||e.radiusY||0;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function xz(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function Ma(e,t){let r=t.getBoundingClientRect(),n=bz(e);return xz(r,n)}function Vv(e){return!e.draggable}function RC(e){return!((e.tagName==="INPUT"||e.tagName==="BUTTON")&&e.type==="submit")}function wz(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0}const Sz=ee.forwardRef((n,r)=>{var i=n,{children:e}=i,t=ze(i,["children"]);let s=C.exports.useRef();r=r!=null?r:s;let{pressProps:u}=mi(Y($({},t),{ref:r})),o=ee.Children.only(e);return ee.cloneElement(o,$({ref:r},Ce(o.props,u)))});var _z={};zt(_z,"PressResponder",()=>Tz);const Tz=ee.forwardRef((n,r)=>{var i=n,{children:e}=i,t=ze(i,["children"]);let s=C.exports.useRef(!1),u=C.exports.useContext(Df),o=Ce(u||{},Y($({},t),{ref:r||(u==null?void 0:u.ref),register(){s.current=!0,u&&u.register()}}));return kf(u,r),C.exports.useEffect(()=>{s.current||console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component.")},[]),ee.createElement(Df.Provider,{value:o},e)});var Cz={};zt(Cz,"useFocus",()=>Cl);function Cl(e){if(e.isDisabled)return{focusProps:{}};let t,r;return(e.onFocus||e.onFocusChange)&&(t=n=>{n.target===n.currentTarget&&(e.onFocus&&e.onFocus(n),e.onFocusChange&&e.onFocusChange(!0))}),(e.onBlur||e.onFocusChange)&&(r=n=>{n.target===n.currentTarget&&(e.onBlur&&e.onBlur(n),e.onFocusChange&&e.onFocusChange(!1))}),{focusProps:{onFocus:t,onBlur:r}}}var ka={};zt(ka,"isFocusVisible",()=>lo),zt(ka,"getInteractionModality",()=>NC),zt(ka,"setInteractionModality",()=>Hv),zt(ka,"useInteractionModality",()=>zC),zt(ka,"useFocusVisible",()=>Dz),zt(ka,"useFocusVisibleListener",()=>Wv);let Dn=null,El=new Set,FC=!1,so=!1,Uv=!1;const Ez={Tab:!0,Escape:!0};function Af(e,t){for(let r of El)r(e,t)}function Pz(e){return!(e.metaKey||!ao()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function LC(e){so=!0,Pz(e)&&(Dn="keyboard",Af("keyboard",e))}function $a(e){Dn="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(so=!0,Af("pointer",e))}function Oz(e){jv(e)&&(so=!0,Dn="virtual")}function Mz(e){e.target===window||e.target===document||(!so&&!Uv&&(Dn="virtual",Af("virtual",e)),so=!1,Uv=!1)}function kz(){so=!1,Uv=!0}function If(){if(typeof window=="undefined"||FC)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){so=!0,e.apply(this,arguments)},document.addEventListener("keydown",LC,!0),document.addEventListener("keyup",LC,!0),document.addEventListener("click",Oz,!0),window.addEventListener("focus",Mz,!0),window.addEventListener("blur",kz,!1),typeof PointerEvent!="undefined"?(document.addEventListener("pointerdown",$a,!0),document.addEventListener("pointermove",$a,!0),document.addEventListener("pointerup",$a,!0)):(document.addEventListener("mousedown",$a,!0),document.addEventListener("mousemove",$a,!0),document.addEventListener("mouseup",$a,!0)),FC=!0}typeof document!="undefined"&&(document.readyState!=="loading"?If():document.addEventListener("DOMContentLoaded",If));function lo(){return Dn!=="pointer"}function NC(){return Dn}function Hv(e){Dn=e,Af(e,null)}function zC(){If();let[e,t]=C.exports.useState(Dn);return C.exports.useEffect(()=>{let r=()=>{t(Dn)};return El.add(r),()=>{El.delete(r)}},[]),e}function $z(e,t,r){return!(e&&t==="keyboard"&&r instanceof KeyboardEvent&&!Ez[r.key])}function Dz(e={}){let{isTextInput:t,autoFocus:r}=e,[n,i]=C.exports.useState(r||lo());return Wv(s=>{i(s)},[t],{isTextInput:t}),{isFocusVisible:n}}function Wv(e,t,r){If(),C.exports.useEffect(()=>{let n=(i,s)=>{!$z(r==null?void 0:r.isTextInput,i,s)||e(lo())};return El.add(n),()=>{El.delete(n)}},t)}var Az={};zt(Az,"useFocusWithin",()=>Da);function Da(e){let t=C.exports.useRef({isFocusWithin:!1}).current;return e.isDisabled?{focusWithinProps:{}}:{focusWithinProps:{onFocus:i=>{t.isFocusWithin||(e.onFocusWithin&&e.onFocusWithin(i),e.onFocusWithinChange&&e.onFocusWithinChange(!0),t.isFocusWithin=!0)},onBlur:i=>{t.isFocusWithin&&!i.currentTarget.contains(i.relatedTarget)&&(e.onBlurWithin&&e.onBlurWithin(i),e.onFocusWithinChange&&e.onFocusWithinChange(!1),t.isFocusWithin=!1)}}}}var Iz={};zt(Iz,"useHover",()=>vi);let Rf=!1,Yv=0;function Kv(){Rf=!0,setTimeout(()=>{Rf=!1},50)}function jC(e){e.pointerType==="touch"&&Kv()}function Rz(){if(typeof document!="undefined")return typeof PointerEvent!="undefined"?document.addEventListener("pointerup",jC):document.addEventListener("touchend",Kv),Yv++,()=>{Yv--,!(Yv>0)&&(typeof PointerEvent!="undefined"?document.removeEventListener("pointerup",jC):document.removeEventListener("touchend",Kv))}}function vi(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:i}=e,[s,u]=C.exports.useState(!1),o=C.exports.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;C.exports.useEffect(Rz,[]);let{hoverProps:a,triggerHoverEnd:l}=C.exports.useMemo(()=>{let h=(d,g)=>{if(o.pointerType=g,i||g==="touch"||o.isHovered||!d.currentTarget.contains(d.target))return;o.isHovered=!0;let m=d.currentTarget;o.target=m,t&&t({type:"hoverstart",target:m,pointerType:g}),r&&r(!0),u(!0)},c=(d,g)=>{if(o.pointerType="",o.target=null,g==="touch"||!o.isHovered)return;o.isHovered=!1;let m=d.currentTarget;n&&n({type:"hoverend",target:m,pointerType:g}),r&&r(!1),u(!1)},f={};return typeof PointerEvent!="undefined"?(f.onPointerEnter=d=>{Rf&&d.pointerType==="mouse"||h(d,d.pointerType)},f.onPointerLeave=d=>{!i&&d.currentTarget.contains(d.target)&&c(d,d.pointerType)}):(f.onTouchStart=()=>{o.ignoreEmulatedMouseEvents=!0},f.onMouseEnter=d=>{!o.ignoreEmulatedMouseEvents&&!Rf&&h(d,"mouse"),o.ignoreEmulatedMouseEvents=!1},f.onMouseLeave=d=>{!i&&d.currentTarget.contains(d.target)&&c(d,"mouse")}),{hoverProps:f,triggerHoverEnd:c}},[t,r,n,i,o]);return C.exports.useEffect(()=>{i&&l({currentTarget:o.target},o.pointerType)},[i]),{hoverProps:a,isHovered:s}}var Fz={};zt(Fz,"useInteractOutside",()=>BC);function BC(e){let{ref:t,onInteractOutside:r,isDisabled:n,onInteractOutsideStart:i}=e,u=C.exports.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1,onInteractOutside:r,onInteractOutsideStart:i}).current;u.onInteractOutside=r,u.onInteractOutsideStart=i,C.exports.useEffect(()=>{if(n)return;let o=a=>{Ff(a,t)&&u.onInteractOutside&&(u.onInteractOutsideStart&&u.onInteractOutsideStart(a),u.isPointerDown=!0)};if(typeof PointerEvent!="undefined"){let a=l=>{u.isPointerDown&&u.onInteractOutside&&Ff(l,t)&&(u.isPointerDown=!1,u.onInteractOutside(l))};return document.addEventListener("pointerdown",o,!0),document.addEventListener("pointerup",a,!0),()=>{document.removeEventListener("pointerdown",o,!0),document.removeEventListener("pointerup",a,!0)}}else{let a=h=>{u.ignoreEmulatedMouseEvents?u.ignoreEmulatedMouseEvents=!1:u.isPointerDown&&u.onInteractOutside&&Ff(h,t)&&(u.isPointerDown=!1,u.onInteractOutside(h))},l=h=>{u.ignoreEmulatedMouseEvents=!0,u.onInteractOutside&&u.isPointerDown&&Ff(h,t)&&(u.isPointerDown=!1,u.onInteractOutside(h))};return document.addEventListener("mousedown",o,!0),document.addEventListener("mouseup",a,!0),document.addEventListener("touchstart",o,!0),document.addEventListener("touchend",l,!0),()=>{document.removeEventListener("mousedown",o,!0),document.removeEventListener("mouseup",a,!0),document.removeEventListener("touchstart",o,!0),document.removeEventListener("touchend",l,!0)}}},[t,u,n])}function Ff(e,t){if(e.button>0)return!1;if(e.target){const r=e.target.ownerDocument;if(!r||!r.documentElement.contains(e.target))return!1}return t.current&&!t.current.contains(e.target)}var Lz={};zt(Lz,"useKeyboard",()=>UC);function VC(e){if(!e)return;let t=!0;return r=>{let n=Y($({},r),{preventDefault(){r.preventDefault()},isDefaultPrevented(){return r.isDefaultPrevented()},stopPropagation(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation(){t=!1}});e(n),t&&r.stopPropagation()}}function UC(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:VC(e.onKeyDown),onKeyUp:VC(e.onKeyUp)}}}var Nz={};zt(Nz,"useMove",()=>Xv);function Xv(e){let{onMoveStart:t,onMove:r,onMoveEnd:n}=e,i=C.exports.useRef({didMove:!1,lastPosition:null,id:null}),{addGlobalListener:s,removeGlobalListener:u}=oo();return{moveProps:C.exports.useMemo(()=>{let a={},l=()=>{zv(),i.current.didMove=!1},h=(d,g,m,p)=>{m===0&&p===0||(i.current.didMove||(i.current.didMove=!0,t==null||t({type:"movestart",pointerType:g,shiftKey:d.shiftKey,metaKey:d.metaKey,ctrlKey:d.ctrlKey,altKey:d.altKey})),r({type:"move",pointerType:g,deltaX:m,deltaY:p,shiftKey:d.shiftKey,metaKey:d.metaKey,ctrlKey:d.ctrlKey,altKey:d.altKey}))},c=(d,g)=>{Tl(),i.current.didMove&&(n==null||n({type:"moveend",pointerType:g,shiftKey:d.shiftKey,metaKey:d.metaKey,ctrlKey:d.ctrlKey,altKey:d.altKey}))};if(typeof PointerEvent=="undefined"){let d=v=>{v.button===0&&(h(v,"mouse",v.pageX-i.current.lastPosition.pageX,v.pageY-i.current.lastPosition.pageY),i.current.lastPosition={pageX:v.pageX,pageY:v.pageY})},g=v=>{v.button===0&&(c(v,"mouse"),u(window,"mousemove",d,!1),u(window,"mouseup",g,!1))};a.onMouseDown=v=>{v.button===0&&(l(),v.stopPropagation(),v.preventDefault(),i.current.lastPosition={pageX:v.pageX,pageY:v.pageY},s(window,"mousemove",d,!1),s(window,"mouseup",g,!1))};let m=v=>{let y=[...v.changedTouches].findIndex(({identifier:b})=>b===i.current.id);if(y>=0){let{pageX:b,pageY:x}=v.changedTouches[y];h(v,"touch",b-i.current.lastPosition.pageX,x-i.current.lastPosition.pageY),i.current.lastPosition={pageX:b,pageY:x}}},p=v=>{[...v.changedTouches].findIndex(({identifier:b})=>b===i.current.id)>=0&&(c(v,"touch"),i.current.id=null,u(window,"touchmove",m),u(window,"touchend",p),u(window,"touchcancel",p))};a.onTouchStart=v=>{if(v.changedTouches.length===0||i.current.id!=null)return;let{pageX:y,pageY:b,identifier:x}=v.changedTouches[0];l(),v.stopPropagation(),v.preventDefault(),i.current.lastPosition={pageX:y,pageY:b},i.current.id=x,s(window,"touchmove",m,!1),s(window,"touchend",p,!1),s(window,"touchcancel",p,!1)}}else{let d=m=>{if(m.pointerId===i.current.id){let p=m.pointerType||"mouse";h(m,p,m.pageX-i.current.lastPosition.pageX,m.pageY-i.current.lastPosition.pageY),i.current.lastPosition={pageX:m.pageX,pageY:m.pageY}}},g=m=>{if(m.pointerId===i.current.id){let p=m.pointerType||"mouse";c(m,p),i.current.id=null,u(window,"pointermove",d,!1),u(window,"pointerup",g,!1),u(window,"pointercancel",g,!1)}};a.onPointerDown=m=>{m.button===0&&i.current.id==null&&(l(),m.stopPropagation(),m.preventDefault(),i.current.lastPosition={pageX:m.pageX,pageY:m.pageY},i.current.id=m.pointerId,s(window,"pointermove",d,!1),s(window,"pointerup",g,!1),s(window,"pointercancel",g,!1))}}let f=(d,g,m)=>{l(),h(d,"keyboard",g,m),c(d,"keyboard")};return a.onKeyDown=d=>{switch(d.key){case"Left":case"ArrowLeft":d.preventDefault(),d.stopPropagation(),f(d,-1,0);break;case"Right":case"ArrowRight":d.preventDefault(),d.stopPropagation(),f(d,1,0);break;case"Up":case"ArrowUp":d.preventDefault(),d.stopPropagation(),f(d,0,-1);break;case"Down":case"ArrowDown":d.preventDefault(),d.stopPropagation(),f(d,0,1);break}},a},[i,t,r,n,s,u])}}var zz={};zt(zz,"useScrollWheel",()=>HC);function HC(e,t){let{onScroll:r,isDisabled:n}=e,i=C.exports.useCallback(s=>{s.ctrlKey||(s.preventDefault(),s.stopPropagation(),r&&r({deltaX:s.deltaX,deltaY:s.deltaY}))},[r]);Fv(t,"wheel",n?null:i)}var jz={};zt(jz,"useLongPress",()=>Gv);const Bz=500;function Gv(e){let{isDisabled:t,onLongPressStart:r,onLongPressEnd:n,onLongPress:i,threshold:s=Bz,accessibilityDescription:u}=e;const o=C.exports.useRef(null);let{addGlobalListener:a,removeGlobalListener:l}=oo(),{pressProps:h}=mi({isDisabled:t,onPressStart(f){if((f.pointerType==="mouse"||f.pointerType==="touch")&&(r&&r(Y($({},f),{type:"longpressstart"})),o.current=setTimeout(()=>{f.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),i&&i(Y($({},f),{type:"longpress"})),o.current=null},s),f.pointerType==="touch")){let d=g=>{g.preventDefault()};a(f.target,"contextmenu",d,{once:!0}),a(window,"pointerup",()=>{setTimeout(()=>{l(f.target,"contextmenu",d)},30)},{once:!0})}},onPressEnd(f){o.current&&clearTimeout(o.current),n&&(f.pointerType==="mouse"||f.pointerType==="touch")&&n(Y($({},f),{type:"longpressend"}))}}),c=CC(i&&!t?u:null);return{longPressProps:Ce(h,c)}}function WC(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var YC={};WC(YC,"useVisuallyHidden",()=>qv),WC(YC,"VisuallyHidden",()=>uo);const KC={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:1,whiteSpace:"nowrap"};function qv(e={}){let{style:t,isFocusable:r}=e,[n,i]=C.exports.useState(!1),{focusProps:s}=Cl({isDisabled:!r,onFocusChange:i}),u=C.exports.useMemo(()=>n?t:t?$($({},KC),t):KC,[n]);return{visuallyHiddenProps:Y($({},s),{style:u})}}function uo(e){let o=e,{children:t,elementType:r="div",isFocusable:n,style:i}=o,s=ze(o,["children","elementType","isFocusable","style"]),{visuallyHiddenProps:u}=qv(e);return ee.createElement(r,Ce(s,u),t)}var Me={},Vz={},Uz=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:Vz}),Jv=vt(Uz);(function(e){/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */var t=t||{version:"4.6.0"};if(e.fabric=t,typeof document!="undefined"&&typeof window!="undefined")document instanceof(typeof HTMLDocument!="undefined"?HTMLDocument:Document)?t.document=document:t.document=document.implementation.createHTMLDocument(""),t.window=window;else{var r=Jv,n=new r.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;t.document=n.document,t.jsdomImplForWrapper=Jv.implForWrapper,t.nodeCanvas=Jv.Canvas,t.window=n,DOMParser=t.window.DOMParser}t.isTouchSupported="ontouchstart"in t.window||"ontouchstart"in t.document||t.window&&t.window.navigator&&t.window.navigator.maxTouchPoints>0,t.isLikelyNode=typeof Buffer!="undefined"&&typeof window=="undefined",t.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],t.DPI=96,t.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",t.commaWsp="(?:\\s+,?\\s*|,\\s*)",t.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,t.reNonWord=/[ \n\.,;!\?\-]/,t.fontPaths={},t.iMatrix=[1,0,0,1,0,0],t.svgNS="http://www.w3.org/2000/svg",t.perfLimitSizeTotal=2097152,t.maxCacheSideLimit=4096,t.minCacheSideLimit=256,t.charWidthsCache={},t.textureSize=2048,t.disableStyleCopyPaste=!1,t.enableGLFiltering=!0,t.devicePixelRatio=t.window.devicePixelRatio||t.window.webkitDevicePixelRatio||t.window.mozDevicePixelRatio||1,t.browserShadowBlurConstant=1,t.arcToSegmentsCache={},t.boundsOfCurveCache={},t.cachesBoundsOfCurve=!0,t.forceGLPutImageData=!1,t.initFilterBackend=function(){if(t.enableGLFiltering&&t.isWebglSupported&&t.isWebglSupported(t.textureSize))return console.log("max texture size: "+t.maxTextureSize),new t.WebglFilterBackend({tileSize:t.textureSize});if(t.Canvas2dFilterBackend)return new t.Canvas2dFilterBackend},typeof document!="undefined"&&typeof window!="undefined"&&(window.fabric=t),function(){function o(d,g){if(!!this.__eventListeners[d]){var m=this.__eventListeners[d];g?m[m.indexOf(g)]=!1:t.util.array.fill(m,!1)}}function a(d,g){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var m in d)this.on(m,d[m]);else this.__eventListeners[d]||(this.__eventListeners[d]=[]),this.__eventListeners[d].push(g);return this}function l(d,g){var m=function(){g.apply(this,arguments),this.off(d,m)}.bind(this);this.on(d,m)}function h(d,g){if(arguments.length===1)for(var m in d)l.call(this,m,d[m]);else l.call(this,d,g);return this}function c(d,g){if(!this.__eventListeners)return this;if(arguments.length===0)for(d in this.__eventListeners)o.call(this,d);else if(arguments.length===1&&typeof arguments[0]=="object")for(var m in d)o.call(this,m,d[m]);else o.call(this,d,g);return this}function f(d,g){if(!this.__eventListeners)return this;var m=this.__eventListeners[d];if(!m)return this;for(var p=0,v=m.length;p<v;p++)m[p]&&m[p].call(this,g||{});return this.__eventListeners[d]=m.filter(function(y){return y!==!1}),this}t.Observable={fire:f,on:a,once:h,off:c}}(),t.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var o=0,a=arguments.length;o<a;o++)this._onObjectAdded(arguments[o]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(o,a,l){var h=this._objects;return l?h[a]=o:h.splice(a,0,o),this._onObjectAdded&&this._onObjectAdded(o),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var o=this._objects,a,l=!1,h=0,c=arguments.length;h<c;h++)a=o.indexOf(arguments[h]),a!==-1&&(l=!0,o.splice(a,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[h]));return this.renderOnAddRemove&&l&&this.requestRenderAll(),this},forEachObject:function(o,a){for(var l=this.getObjects(),h=0,c=l.length;h<c;h++)o.call(a,l[h],h,l);return this},getObjects:function(o){return typeof o=="undefined"?this._objects.concat():this._objects.filter(function(a){return a.type===o})},item:function(o){return this._objects[o]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(o,a){return this._objects.indexOf(o)>-1?!0:a?this._objects.some(function(l){return typeof l.contains=="function"&&l.contains(o,!0)}):!1},complexity:function(){return this._objects.reduce(function(o,a){return o+=a.complexity?a.complexity():0,o},0)}},t.CommonMethods={_setOptions:function(o){for(var a in o)this.set(a,o[a])},_initGradient:function(o,a){o&&o.colorStops&&!(o instanceof t.Gradient)&&this.set(a,new t.Gradient(o))},_initPattern:function(o,a,l){o&&o.source&&!(o instanceof t.Pattern)?this.set(a,new t.Pattern(o,l)):l&&l()},_setObject:function(o){for(var a in o)this._set(a,o[a])},set:function(o,a){return typeof o=="object"?this._setObject(o):this._set(o,a),this},_set:function(o,a){this[o]=a},toggle:function(o){var a=this.get(o);return typeof a=="boolean"&&this.set(o,!a),this},get:function(o){return this[o]}},function(o){var a=Math.sqrt,l=Math.atan2,h=Math.pow,c=Math.PI/180,f=Math.PI/2;t.util={cos:function(d){if(d===0)return 1;d<0&&(d=-d);var g=d/f;switch(g){case 1:case 3:return 0;case 2:return-1}return Math.cos(d)},sin:function(d){if(d===0)return 0;var g=d/f,m=1;switch(d<0&&(m=-1),g){case 1:return m;case 2:return 0;case 3:return-m}return Math.sin(d)},removeFromArray:function(d,g){var m=d.indexOf(g);return m!==-1&&d.splice(m,1),d},getRandomInt:function(d,g){return Math.floor(Math.random()*(g-d+1))+d},degreesToRadians:function(d){return d*c},radiansToDegrees:function(d){return d/c},rotatePoint:function(d,g,m){var p=new t.Point(d.x-g.x,d.y-g.y),v=t.util.rotateVector(p,m);return new t.Point(v.x,v.y).addEquals(g)},rotateVector:function(d,g){var m=t.util.sin(g),p=t.util.cos(g),v=d.x*p-d.y*m,y=d.x*m+d.y*p;return{x:v,y}},transformPoint:function(d,g,m){return m?new t.Point(g[0]*d.x+g[2]*d.y,g[1]*d.x+g[3]*d.y):new t.Point(g[0]*d.x+g[2]*d.y+g[4],g[1]*d.x+g[3]*d.y+g[5])},makeBoundingBoxFromPoints:function(d,g){if(g)for(var m=0;m<d.length;m++)d[m]=t.util.transformPoint(d[m],g);var p=[d[0].x,d[1].x,d[2].x,d[3].x],v=t.util.array.min(p),y=t.util.array.max(p),b=y-v,x=[d[0].y,d[1].y,d[2].y,d[3].y],w=t.util.array.min(x),T=t.util.array.max(x),_=T-w;return{left:v,top:w,width:b,height:_}},invertTransform:function(d){var g=1/(d[0]*d[3]-d[1]*d[2]),m=[g*d[3],-g*d[1],-g*d[2],g*d[0]],p=t.util.transformPoint({x:d[4],y:d[5]},m,!0);return m[4]=-p.x,m[5]=-p.y,m},toFixed:function(d,g){return parseFloat(Number(d).toFixed(g))},parseUnit:function(d,g){var m=/\D{0,2}$/.exec(d),p=parseFloat(d);switch(g||(g=t.Text.DEFAULT_SVG_FONT_SIZE),m[0]){case"mm":return p*t.DPI/25.4;case"cm":return p*t.DPI/2.54;case"in":return p*t.DPI;case"pt":return p*t.DPI/72;case"pc":return p*t.DPI/72*12;case"em":return p*g;default:return p}},falseFunction:function(){return!1},getKlass:function(d,g){return d=t.util.string.camelize(d.charAt(0).toUpperCase()+d.slice(1)),t.util.resolveNamespace(g)[d]},getSvgAttributes:function(d){var g=["instantiated_by_use","style","id","class"];switch(d){case"linearGradient":g=g.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":g=g.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":g=g.concat(["offset","stop-color","stop-opacity"]);break}return g},resolveNamespace:function(d){if(!d)return t;var g=d.split("."),m=g.length,p,v=o||t.window;for(p=0;p<m;++p)v=v[g[p]];return v},loadImage:function(d,g,m,p){if(!d){g&&g.call(m,d);return}var v=t.util.createImage(),y=function(){g&&g.call(m,v,!1),v=v.onload=v.onerror=null};v.onload=y,v.onerror=function(){t.log("Error loading "+v.src),g&&g.call(m,null,!0),v=v.onload=v.onerror=null},d.indexOf("data")!==0&&p!==void 0&&p!==null&&(v.crossOrigin=p),d.substring(0,14)==="data:image/svg"&&(v.onload=null,t.util.loadImageInDom(v,y)),v.src=d},loadImageInDom:function(d,g){var m=t.document.createElement("div");m.style.width=m.style.height="1px",m.style.left=m.style.top="-100%",m.style.position="absolute",m.appendChild(d),t.document.querySelector("body").appendChild(m),d.onload=function(){g(),m.parentNode.removeChild(m),m=null}},enlivenObjects:function(d,g,m,p){d=d||[];var v=[],y=0,b=d.length;function x(){++y===b&&g&&g(v.filter(function(w){return w}))}if(!b){g&&g(v);return}d.forEach(function(w,T){if(!w||!w.type){x();return}var _=t.util.getKlass(w.type,m);_.fromObject(w,function(E,k){k||(v[T]=E),p&&p(w,E,k),x()})})},enlivenPatterns:function(d,g){d=d||[];function m(){++v===y&&g&&g(p)}var p=[],v=0,y=d.length;if(!y){g&&g(p);return}d.forEach(function(b,x){b&&b.source?new t.Pattern(b,function(w){p[x]=w,m()}):(p[x]=b,m())})},groupSVGElements:function(d,g,m){var p;return d&&d.length===1?d[0]:(g&&(g.width&&g.height?g.centerPoint={x:g.width/2,y:g.height/2}:(delete g.width,delete g.height)),p=new t.Group(d,g),typeof m!="undefined"&&(p.sourcePath=m),p)},populateWithProperties:function(d,g,m){if(m&&Object.prototype.toString.call(m)==="[object Array]")for(var p=0,v=m.length;p<v;p++)m[p]in d&&(g[m[p]]=d[m[p]])},drawDashedLine:function(d,g,m,p,v,y){var b=p-g,x=v-m,w=a(b*b+x*x),T=l(x,b),_=y.length,E=0,k=!0;for(d.save(),d.translate(g,m),d.moveTo(0,0),d.rotate(T),g=0;w>g;)g+=y[E++%_],g>w&&(g=w),d[k?"lineTo":"moveTo"](g,0),k=!k;d.restore()},createCanvasElement:function(){return t.document.createElement("canvas")},copyCanvasElement:function(d){var g=t.util.createCanvasElement();return g.width=d.width,g.height=d.height,g.getContext("2d").drawImage(d,0,0),g},toDataURL:function(d,g,m){return d.toDataURL("image/"+g,m)},createImage:function(){return t.document.createElement("img")},multiplyTransformMatrices:function(d,g,m){return[d[0]*g[0]+d[2]*g[1],d[1]*g[0]+d[3]*g[1],d[0]*g[2]+d[2]*g[3],d[1]*g[2]+d[3]*g[3],m?0:d[0]*g[4]+d[2]*g[5]+d[4],m?0:d[1]*g[4]+d[3]*g[5]+d[5]]},qrDecompose:function(d){var g=l(d[1],d[0]),m=h(d[0],2)+h(d[1],2),p=a(m),v=(d[0]*d[3]-d[2]*d[1])/p,y=l(d[0]*d[2]+d[1]*d[3],m);return{angle:g/c,scaleX:p,scaleY:v,skewX:y/c,skewY:0,translateX:d[4],translateY:d[5]}},calcRotateMatrix:function(d){if(!d.angle)return t.iMatrix.concat();var g=t.util.degreesToRadians(d.angle),m=t.util.cos(g),p=t.util.sin(g);return[m,p,-p,m,0,0]},calcDimensionsMatrix:function(d){var g=typeof d.scaleX=="undefined"?1:d.scaleX,m=typeof d.scaleY=="undefined"?1:d.scaleY,p=[d.flipX?-g:g,0,0,d.flipY?-m:m,0,0],v=t.util.multiplyTransformMatrices,y=t.util.degreesToRadians;return d.skewX&&(p=v(p,[1,0,Math.tan(y(d.skewX)),1],!0)),d.skewY&&(p=v(p,[1,Math.tan(y(d.skewY)),0,1],!0)),p},composeMatrix:function(d){var g=[1,0,0,1,d.translateX||0,d.translateY||0],m=t.util.multiplyTransformMatrices;return d.angle&&(g=m(g,t.util.calcRotateMatrix(d))),(d.scaleX!==1||d.scaleY!==1||d.skewX||d.skewY||d.flipX||d.flipY)&&(g=m(g,t.util.calcDimensionsMatrix(d))),g},resetObjectTransform:function(d){d.scaleX=1,d.scaleY=1,d.skewX=0,d.skewY=0,d.flipX=!1,d.flipY=!1,d.rotate(0)},saveObjectTransform:function(d){return{scaleX:d.scaleX,scaleY:d.scaleY,skewX:d.skewX,skewY:d.skewY,angle:d.angle,left:d.left,flipX:d.flipX,flipY:d.flipY,top:d.top}},isTransparent:function(d,g,m,p){p>0&&(g>p?g-=p:g=0,m>p?m-=p:m=0);var v=!0,y,b,x=d.getImageData(g,m,p*2||1,p*2||1),w=x.data.length;for(y=3;y<w&&(b=x.data[y],v=b<=0,v!==!1);y+=4);return x=null,v},parsePreserveAspectRatioAttribute:function(d){var g="meet",m="Mid",p="Mid",v=d.split(" "),y;return v&&v.length&&(g=v.pop(),g!=="meet"&&g!=="slice"?(y=g,g="meet"):v.length&&(y=v.pop())),m=y!=="none"?y.slice(1,4):"none",p=y!=="none"?y.slice(5,8):"none",{meetOrSlice:g,alignX:m,alignY:p}},clearFabricFontCache:function(d){d=(d||"").toLowerCase(),d?t.charWidthsCache[d]&&delete t.charWidthsCache[d]:t.charWidthsCache={}},limitDimsByArea:function(d,g){var m=Math.sqrt(g*d),p=Math.floor(g/m);return{x:Math.floor(m),y:p}},capValue:function(d,g,m){return Math.max(d,Math.min(g,m))},findScaleToFit:function(d,g){return Math.min(g.width/d.width,g.height/d.height)},findScaleToCover:function(d,g){return Math.max(g.width/d.width,g.height/d.height)},matrixToSVG:function(d){return"matrix("+d.map(function(g){return t.util.toFixed(g,t.Object.NUM_FRACTION_DIGITS)}).join(" ")+")"},removeTransformFromObject:function(d,g){var m=t.util.invertTransform(g),p=t.util.multiplyTransformMatrices(m,d.calcOwnMatrix());t.util.applyTransformToObject(d,p)},addTransformToObject:function(d,g){t.util.applyTransformToObject(d,t.util.multiplyTransformMatrices(g,d.calcOwnMatrix()))},applyTransformToObject:function(d,g){var m=t.util.qrDecompose(g),p=new t.Point(m.translateX,m.translateY);d.flipX=!1,d.flipY=!1,d.set("scaleX",m.scaleX),d.set("scaleY",m.scaleY),d.skewX=m.skewX,d.skewY=m.skewY,d.angle=m.angle,d.setPositionByOrigin(p,"center","center")},sizeAfterTransform:function(d,g,m){var p=d/2,v=g/2,y=[{x:-p,y:-v},{x:p,y:-v},{x:-p,y:v},{x:p,y:v}],b=t.util.calcDimensionsMatrix(m),x=t.util.makeBoundingBoxFromPoints(y,b);return{x:x.width,y:x.height}}}}(e),function(){var o=Array.prototype.join,a={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},l={m:"l",M:"L"};function h(M,D,R,P,O,N,I,q,X,ne,re){var ae=t.util.cos(M),G=t.util.sin(M),W=t.util.cos(D),J=t.util.sin(D),te=R*O*W-P*N*J+I,Q=P*O*W+R*N*J+q,le=ne+X*(-R*O*G-P*N*ae),ie=re+X*(-P*O*G+R*N*ae),ye=te+X*(R*O*J+P*N*W),he=Q+X*(P*O*J-R*N*W);return["C",le,ie,ye,he,te,Q]}function c(M,D,R,P,O,N,I){var q=Math.PI,X=I*q/180,ne=t.util.sin(X),re=t.util.cos(X),ae=0,G=0;R=Math.abs(R),P=Math.abs(P);var W=-re*M*.5-ne*D*.5,J=-re*D*.5+ne*M*.5,te=R*R,Q=P*P,le=J*J,ie=W*W,ye=te*Q-te*le-Q*ie,he=0;if(ye<0){var U=Math.sqrt(1-ye/(te*Q));R*=U,P*=U}else he=(O===N?-1:1)*Math.sqrt(ye/(te*le+Q*ie));var se=he*R*J/P,me=-he*P*W/R,_e=re*se-ne*me+M*.5,Ie=ne*se+re*me+D*.5,Ue=f(1,0,(W-se)/R,(J-me)/P),Ne=f((W-se)/R,(J-me)/P,(-W-se)/R,(-J-me)/P);N===0&&Ne>0?Ne-=2*q:N===1&&Ne<0&&(Ne+=2*q);for(var Ae=Math.ceil(Math.abs(Ne/q*2)),ft=[],ir=Ne/Ae,pr=8/3*Math.sin(ir/4)*Math.sin(ir/4)/Math.sin(ir/2),Gr=Ue+ir,Gt=0;Gt<Ae;Gt++)ft[Gt]=h(Ue,Gr,re,ne,R,P,_e,Ie,pr,ae,G),ae=ft[Gt][5],G=ft[Gt][6],Ue=Gr,Gr+=ir;return ft}function f(M,D,R,P){var O=Math.atan2(D,M),N=Math.atan2(P,R);return N>=O?N-O:2*Math.PI-(O-N)}function d(M,D,R,P,O,N,I,q){var X;if(t.cachesBoundsOfCurve&&(X=o.call(arguments),t.boundsOfCurveCache[X]))return t.boundsOfCurveCache[X];var ne=Math.sqrt,re=Math.min,ae=Math.max,G=Math.abs,W=[],J=[[],[]],te,Q,le,ie,ye,he,U,se;Q=6*M-12*R+6*O,te=-3*M+9*R-9*O+3*I,le=3*R-3*M;for(var me=0;me<2;++me){if(me>0&&(Q=6*D-12*P+6*N,te=-3*D+9*P-9*N+3*q,le=3*P-3*D),G(te)<1e-12){if(G(Q)<1e-12)continue;ie=-le/Q,0<ie&&ie<1&&W.push(ie);continue}U=Q*Q-4*le*te,!(U<0)&&(se=ne(U),ye=(-Q+se)/(2*te),0<ye&&ye<1&&W.push(ye),he=(-Q-se)/(2*te),0<he&&he<1&&W.push(he))}for(var _e,Ie,Ue=W.length,Ne=Ue,Ae;Ue--;)ie=W[Ue],Ae=1-ie,_e=Ae*Ae*Ae*M+3*Ae*Ae*ie*R+3*Ae*ie*ie*O+ie*ie*ie*I,J[0][Ue]=_e,Ie=Ae*Ae*Ae*D+3*Ae*Ae*ie*P+3*Ae*ie*ie*N+ie*ie*ie*q,J[1][Ue]=Ie;J[0][Ne]=M,J[1][Ne]=D,J[0][Ne+1]=I,J[1][Ne+1]=q;var ft=[{x:re.apply(null,J[0]),y:re.apply(null,J[1])},{x:ae.apply(null,J[0]),y:ae.apply(null,J[1])}];return t.cachesBoundsOfCurve&&(t.boundsOfCurveCache[X]=ft),ft}function g(M,D,R){for(var P=R[1],O=R[2],N=R[3],I=R[4],q=R[5],X=R[6],ne=R[7],re=c(X-M,ne-D,P,O,I,q,N),ae=0,G=re.length;ae<G;ae++)re[ae][1]+=M,re[ae][2]+=D,re[ae][3]+=M,re[ae][4]+=D,re[ae][5]+=M,re[ae][6]+=D;return re}function m(M){var D=0,R=0,P=M.length,O=0,N=0,I,q,X,ne=[],re,ae,G;for(q=0;q<P;++q){switch(X=!1,I=M[q].slice(0),I[0]){case"l":I[0]="L",I[1]+=D,I[2]+=R;case"L":D=I[1],R=I[2];break;case"h":I[1]+=D;case"H":I[0]="L",I[2]=R,D=I[1];break;case"v":I[1]+=R;case"V":I[0]="L",R=I[1],I[1]=D,I[2]=R;break;case"m":I[0]="M",I[1]+=D,I[2]+=R;case"M":D=I[1],R=I[2],O=I[1],N=I[2];break;case"c":I[0]="C",I[1]+=D,I[2]+=R,I[3]+=D,I[4]+=R,I[5]+=D,I[6]+=R;case"C":ae=I[3],G=I[4],D=I[5],R=I[6];break;case"s":I[0]="S",I[1]+=D,I[2]+=R,I[3]+=D,I[4]+=R;case"S":re==="C"?(ae=2*D-ae,G=2*R-G):(ae=D,G=R),D=I[3],R=I[4],I[0]="C",I[5]=I[3],I[6]=I[4],I[3]=I[1],I[4]=I[2],I[1]=ae,I[2]=G,ae=I[3],G=I[4];break;case"q":I[0]="Q",I[1]+=D,I[2]+=R,I[3]+=D,I[4]+=R;case"Q":ae=I[1],G=I[2],D=I[3],R=I[4];break;case"t":I[0]="T",I[1]+=D,I[2]+=R;case"T":re==="Q"?(ae=2*D-ae,G=2*R-G):(ae=D,G=R),I[0]="Q",D=I[1],R=I[2],I[1]=ae,I[2]=G,I[3]=D,I[4]=R;break;case"a":I[0]="A",I[6]+=D,I[7]+=R;case"A":X=!0,ne=ne.concat(g(D,R,I)),D=I[6],R=I[7];break;case"z":case"Z":D=O,R=N;break}X||ne.push(I),re=I[0]}return ne}function p(M,D,R,P){return Math.sqrt((R-M)*(R-M)+(P-D)*(P-D))}function v(M){return M*M*M}function y(M){return 3*M*M*(1-M)}function b(M){return 3*M*(1-M)*(1-M)}function x(M){return(1-M)*(1-M)*(1-M)}function w(M,D,R,P,O,N,I,q){return function(X){var ne=v(X),re=y(X),ae=b(X),G=x(X);return{x:I*ne+O*re+R*ae+M*G,y:q*ne+N*re+P*ae+D*G}}}function T(M,D,R,P,O,N,I,q){return function(X){var ne=1-X,re=3*ne*ne*(R-M)+6*ne*X*(O-R)+3*X*X*(I-O),ae=3*ne*ne*(P-D)+6*ne*X*(N-P)+3*X*X*(q-N);return Math.atan2(ae,re)}}function _(M){return M*M}function E(M){return 2*M*(1-M)}function k(M){return(1-M)*(1-M)}function z(M,D,R,P,O,N){return function(I){var q=_(I),X=E(I),ne=k(I);return{x:O*q+R*X+M*ne,y:N*q+P*X+D*ne}}}function F(M,D,R,P,O,N){return function(I){var q=1-I,X=2*q*(R-M)+2*I*(O-R),ne=2*q*(P-D)+2*I*(N-P);return Math.atan2(ne,X)}}function j(M,D,R){var P={x:D,y:R},O,N=0,I;for(I=1;I<=100;I+=1)O=M(I/100),N+=p(P.x,P.y,O.x,O.y),P=O;return N}function K(M,D){for(var R=0,P=0,O=M.iterator,N={x:M.x,y:M.y},I,q,X=.01,ne=M.angleFinder,re;P<D&&R<=1&&X>1e-4;)I=O(R),re=R,q=p(N.x,N.y,I.x,I.y),q+P>D?(X/=2,R-=X):(N=I,R+=X,P+=q);return I.angle=ne(re),I}function B(M){for(var D=0,R=M.length,P,O=0,N=0,I=0,q=0,X=[],ne,re,ae,G=0;G<R;G++){switch(P=M[G],re={x:O,y:N,command:P[0]},P[0]){case"M":re.length=0,I=O=P[1],q=N=P[2];break;case"L":re.length=p(O,N,P[1],P[2]),O=P[1],N=P[2];break;case"C":ne=w(O,N,P[1],P[2],P[3],P[4],P[5],P[6]),ae=T(O,N,P[1],P[2],P[3],P[4],P[5],P[6]),re.iterator=ne,re.angleFinder=ae,re.length=j(ne,O,N),O=P[5],N=P[6];break;case"Q":ne=z(O,N,P[1],P[2],P[3],P[4]),ae=F(O,N,P[1],P[2],P[3],P[4]),re.iterator=ne,re.angleFinder=ae,re.length=j(ne,O,N),O=P[3],N=P[4];break;case"Z":case"z":re.destX=I,re.destY=q,re.length=p(O,N,I,q),O=I,N=q;break}D+=re.length,X.push(re)}return X.push({length:D,x:O,y:N}),X}function H(M,D,R){R||(R=B(M));for(var P=0;D-R[P].length>0&&P<R.length-2;)D-=R[P].length,P++;var O=R[P],N=D/O.length,I=O.command,q=M[P],X;switch(I){case"M":return{x:O.x,y:O.y,angle:0};case"Z":case"z":return X=new t.Point(O.x,O.y).lerp(new t.Point(O.destX,O.destY),N),X.angle=Math.atan2(O.destY-O.y,O.destX-O.x),X;case"L":return X=new t.Point(O.x,O.y).lerp(new t.Point(q[1],q[2]),N),X.angle=Math.atan2(q[2]-O.y,q[1]-O.x),X;case"C":return K(O,D);case"Q":return K(O,D)}}function ue(M){var D=[],R=[],P,O,N=t.rePathCommand,I="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",q="("+I+")"+t.commaWsp,X="([01])"+t.commaWsp+"?",ne=q+"?"+q+"?"+q+X+X+q+"?("+I+")",re=new RegExp(ne,"g"),ae,G,W;if(!M||!M.match)return D;W=M.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);for(var J=0,te,Q=W.length;J<Q;J++){P=W[J],G=P.slice(1).trim(),R.length=0;var le=P.charAt(0);if(te=[le],le.toLowerCase()==="a")for(var ie;ie=re.exec(G);)for(var ye=1;ye<ie.length;ye++)R.push(ie[ye]);else for(;ae=N.exec(G);)R.push(ae[0]);for(var ye=0,he=R.length;ye<he;ye++)O=parseFloat(R[ye]),isNaN(O)||te.push(O);var U=a[le.toLowerCase()],se=l[le]||le;if(te.length-1>U)for(var me=1,_e=te.length;me<_e;me+=U)D.push([le].concat(te.slice(me,me+U))),le=se;else D.push(te)}return D}function ge(M,D){var R=[],P,O=new t.Point(M[0].x,M[0].y),N=new t.Point(M[1].x,M[1].y),I=M.length,q=1,X=0,ne=I>2;for(D=D||0,ne&&(q=M[2].x<N.x?-1:M[2].x===N.x?0:1,X=M[2].y<N.y?-1:M[2].y===N.y?0:1),R.push(["M",O.x-q*D,O.y-X*D]),P=1;P<I;P++){if(!O.eq(N)){var re=O.midPointFrom(N);R.push(["Q",O.x,O.y,re.x,re.y])}O=M[P],P+1<M.length&&(N=M[P+1])}return ne&&(q=O.x>M[P-2].x?1:O.x===M[P-2].x?0:-1,X=O.y>M[P-2].y?1:O.y===M[P-2].y?0:-1),R.push(["L",O.x+q*D,O.y+X*D]),R}function fe(M,D,R){return R&&(D=t.util.multiplyTransformMatrices(D,[1,0,0,1,-R.x,-R.y])),M.map(function(P){for(var O=P.slice(0),N={},I=1;I<P.length-1;I+=2)N.x=P[I],N.y=P[I+1],N=t.util.transformPoint(N,D),O[I]=N.x,O[I+1]=N.y;return O})}function L(M,D,R,P,O,N,I,q,X){for(var ne=0,re=0,ae,G=[],W=c(q-M,X-D,R,P,N,I,O),J=0,te=W.length;J<te;J++)ae=d(ne,re,W[J][1],W[J][2],W[J][3],W[J][4],W[J][5],W[J][6]),G.push({x:ae[0].x+M,y:ae[0].y+D}),G.push({x:ae[1].x+M,y:ae[1].y+D}),ne=W[J][5],re=W[J][6];return G}function Z(M,D,R,P){P=P.slice(0).unshift("X");var O=g(D,R,P);O.forEach(function(N){M.bezierCurveTo.apply(M,N.slice(1))})}t.util.joinPath=function(M){return M.map(function(D){return D.join(" ")}).join(" ")},t.util.parsePath=ue,t.util.makePathSimpler=m,t.util.getSmoothPathFromPoints=ge,t.util.getPathSegmentsInfo=B,t.util.getBoundsOfCurve=d,t.util.getPointOnPath=H,t.util.transformPath=fe,t.util.fromArcToBeizers=g,t.util.getBoundsOfArc=L,t.util.drawArc=Z}(),function(){var o=Array.prototype.slice;function a(d,g){for(var m=o.call(arguments,2),p=[],v=0,y=d.length;v<y;v++)p[v]=m.length?d[v][g].apply(d[v],m):d[v][g].call(d[v]);return p}function l(d,g){return f(d,g,function(m,p){return m>=p})}function h(d,g){return f(d,g,function(m,p){return m<p})}function c(d,g){for(var m=d.length;m--;)d[m]=g;return d}function f(d,g,m){if(!(!d||d.length===0)){var p=d.length-1,v=g?d[p][g]:d[p];if(g)for(;p--;)m(d[p][g],v)&&(v=d[p][g]);else for(;p--;)m(d[p],v)&&(v=d[p]);return v}}t.util.array={fill:c,invoke:a,min:h,max:l}}(),function(){function o(l,h,c){if(c)if(!t.isLikelyNode&&h instanceof Element)l=h;else if(h instanceof Array){l=[];for(var f=0,d=h.length;f<d;f++)l[f]=o({},h[f],c)}else if(h&&typeof h=="object")for(var g in h)g==="canvas"||g==="group"?l[g]=null:h.hasOwnProperty(g)&&(l[g]=o({},h[g],c));else l=h;else for(var g in h)l[g]=h[g];return l}function a(l,h){return o({},l,h)}t.util.object={extend:o,clone:a},t.util.object.extend(t.util,t.Observable)}(),function(){function o(f){return f.replace(/-+(.)?/g,function(d,g){return g?g.toUpperCase():""})}function a(f,d){return f.charAt(0).toUpperCase()+(d?f.slice(1):f.slice(1).toLowerCase())}function l(f){return f.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function h(f){var d=0,g,m=[];for(d=0,g;d<f.length;d++)(g=c(f,d))!==!1&&m.push(g);return m}function c(f,d){var g=f.charCodeAt(d);if(isNaN(g))return"";if(g<55296||g>57343)return f.charAt(d);if(55296<=g&&g<=56319){if(f.length<=d+1)throw"High surrogate without following low surrogate";var m=f.charCodeAt(d+1);if(56320>m||m>57343)throw"High surrogate without following low surrogate";return f.charAt(d)+f.charAt(d+1)}if(d===0)throw"Low surrogate without preceding high surrogate";var p=f.charCodeAt(d-1);if(55296>p||p>56319)throw"Low surrogate without preceding high surrogate";return!1}t.util.string={camelize:o,capitalize:a,escapeXml:l,graphemeSplit:h}}(),function(){var o=Array.prototype.slice,a=function(){},l=function(){for(var g in{toString:1})if(g==="toString")return!1;return!0}(),h=function(g,m,p){for(var v in m)v in g.prototype&&typeof g.prototype[v]=="function"&&(m[v]+"").indexOf("callSuper")>-1?g.prototype[v]=function(y){return function(){var b=this.constructor.superclass;this.constructor.superclass=p;var x=m[y].apply(this,arguments);if(this.constructor.superclass=b,y!=="initialize")return x}}(v):g.prototype[v]=m[v],l&&(m.toString!==Object.prototype.toString&&(g.prototype.toString=m.toString),m.valueOf!==Object.prototype.valueOf&&(g.prototype.valueOf=m.valueOf))};function c(){}function f(g){for(var m=null,p=this;p.constructor.superclass;){var v=p.constructor.superclass.prototype[g];if(p[g]!==v){m=v;break}p=p.constructor.superclass.prototype}return m?arguments.length>1?m.apply(this,o.call(arguments,1)):m.call(this):console.log("tried to callSuper "+g+", method not found in prototype chain",this)}function d(){var g=null,m=o.call(arguments,0);typeof m[0]=="function"&&(g=m.shift());function p(){this.initialize.apply(this,arguments)}p.superclass=g,p.subclasses=[],g&&(c.prototype=g.prototype,p.prototype=new c,g.subclasses.push(p));for(var v=0,y=m.length;v<y;v++)h(p,m[v],g);return p.prototype.initialize||(p.prototype.initialize=a),p.prototype.constructor=p,p.prototype.callSuper=f,p}t.util.createClass=d}(),function(){var o=!!t.document.createElement("div").attachEvent,a=["touchstart","touchmove","touchend"];t.util.addListener=function(h,c,f,d){h&&h.addEventListener(c,f,o?!1:d)},t.util.removeListener=function(h,c,f,d){h&&h.removeEventListener(c,f,o?!1:d)};function l(h){var c=h.changedTouches;return c&&c[0]?c[0]:h}t.util.getPointer=function(h){var c=h.target,f=t.util.getScrollLeftTop(c),d=l(h);return{x:d.clientX+f.left,y:d.clientY+f.top}},t.util.isTouchEvent=function(h){return a.indexOf(h.type)>-1||h.pointerType==="touch"}}(),function(){function o(d,g){var m=d.style;if(!m)return d;if(typeof g=="string")return d.style.cssText+=";"+g,g.indexOf("opacity")>-1?f(d,g.match(/opacity:\s*(\d?\.?\d*)/)[1]):d;for(var p in g)if(p==="opacity")f(d,g[p]);else{var v=p==="float"||p==="cssFloat"?typeof m.styleFloat=="undefined"?"cssFloat":"styleFloat":p;m[v]=g[p]}return d}var a=t.document.createElement("div"),l=typeof a.style.opacity=="string",h=typeof a.style.filter=="string",c=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,f=function(d){return d};l?f=function(d,g){return d.style.opacity=g,d}:h&&(f=function(d,g){var m=d.style;return d.currentStyle&&!d.currentStyle.hasLayout&&(m.zoom=1),c.test(m.filter)?(g=g>=.9999?"":"alpha(opacity="+g*100+")",m.filter=m.filter.replace(c,g)):m.filter+=" alpha(opacity="+g*100+")",d}),t.util.setStyle=o}(),function(){var o=Array.prototype.slice;function a(x){return typeof x=="string"?t.document.getElementById(x):x}var l,h=function(x){return o.call(x,0)};try{l=h(t.document.childNodes)instanceof Array}catch{}l||(h=function(x){for(var w=new Array(x.length),T=x.length;T--;)w[T]=x[T];return w});function c(x,w){var T=t.document.createElement(x);for(var _ in w)_==="class"?T.className=w[_]:_==="for"?T.htmlFor=w[_]:T.setAttribute(_,w[_]);return T}function f(x,w){x&&(" "+x.className+" ").indexOf(" "+w+" ")===-1&&(x.className+=(x.className?" ":"")+w)}function d(x,w,T){return typeof w=="string"&&(w=c(w,T)),x.parentNode&&x.parentNode.replaceChild(w,x),w.appendChild(x),w}function g(x){for(var w=0,T=0,_=t.document.documentElement,E=t.document.body||{scrollLeft:0,scrollTop:0};x&&(x.parentNode||x.host)&&(x=x.parentNode||x.host,x===t.document?(w=E.scrollLeft||_.scrollLeft||0,T=E.scrollTop||_.scrollTop||0):(w+=x.scrollLeft||0,T+=x.scrollTop||0),!(x.nodeType===1&&x.style.position==="fixed")););return{left:w,top:T}}function m(x){var w,T=x&&x.ownerDocument,_={left:0,top:0},E={left:0,top:0},k,z={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!T)return E;for(var F in z)E[z[F]]+=parseInt(p(x,F),10)||0;return w=T.documentElement,typeof x.getBoundingClientRect!="undefined"&&(_=x.getBoundingClientRect()),k=g(x),{left:_.left+k.left-(w.clientLeft||0)+E.left,top:_.top+k.top-(w.clientTop||0)+E.top}}var p;t.document.defaultView&&t.document.defaultView.getComputedStyle?p=function(x,w){var T=t.document.defaultView.getComputedStyle(x,null);return T?T[w]:void 0}:p=function(x,w){var T=x.style[w];return!T&&x.currentStyle&&(T=x.currentStyle[w]),T},function(){var x=t.document.documentElement.style,w="userSelect"in x?"userSelect":"MozUserSelect"in x?"MozUserSelect":"WebkitUserSelect"in x?"WebkitUserSelect":"KhtmlUserSelect"in x?"KhtmlUserSelect":"";function T(E){return typeof E.onselectstart!="undefined"&&(E.onselectstart=t.util.falseFunction),w?E.style[w]="none":typeof E.unselectable=="string"&&(E.unselectable="on"),E}function _(E){return typeof E.onselectstart!="undefined"&&(E.onselectstart=null),w?E.style[w]="":typeof E.unselectable=="string"&&(E.unselectable=""),E}t.util.makeElementUnselectable=T,t.util.makeElementSelectable=_}();function v(x){var w=t.jsdomImplForWrapper(x);return w._canvas||w._image}function y(x){if(!!t.isLikelyNode){var w=t.jsdomImplForWrapper(x);w&&(w._image=null,w._canvas=null,w._currentSrc=null,w._attributes=null,w._classList=null)}}function b(x,w){x.imageSmoothingEnabled=x.imageSmoothingEnabled||x.webkitImageSmoothingEnabled||x.mozImageSmoothingEnabled||x.msImageSmoothingEnabled||x.oImageSmoothingEnabled,x.imageSmoothingEnabled=w}t.util.setImageSmoothing=b,t.util.getById=a,t.util.toArray=h,t.util.addClass=f,t.util.makeElement=c,t.util.wrapElement=d,t.util.getScrollLeftTop=g,t.util.getElementOffset=m,t.util.getNodeCanvas=v,t.util.cleanUpJsdomNode=y}(),function(){function o(h,c){return h+(/\?/.test(h)?"&":"?")+c}function a(){}function l(h,c){c||(c={});var f=c.method?c.method.toUpperCase():"GET",d=c.onComplete||function(){},g=new t.window.XMLHttpRequest,m=c.body||c.parameters;return g.onreadystatechange=function(){g.readyState===4&&(d(g),g.onreadystatechange=a)},f==="GET"&&(m=null,typeof c.parameters=="string"&&(h=o(h,c.parameters))),g.open(f,h,!0),(f==="POST"||f==="PUT")&&g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(m),g}t.util.request=l}(),t.log=console.log,t.warn=console.warn,function(){function o(){return!1}function a(g,m,p,v){return-p*Math.cos(g/v*(Math.PI/2))+p+m}function l(g){var m=!1;return f(function(p){g||(g={});var v=p||+new Date,y=g.duration||500,b=v+y,x,w=g.onChange||o,T=g.abort||o,_=g.onComplete||o,E=g.easing||a,k="startValue"in g?g.startValue:0,z="endValue"in g?g.endValue:100,F=g.byValue||z-k;g.onStart&&g.onStart(),function j(K){x=K||+new Date;var B=x>b?y:x-v,H=B/y,ue=E(B,k,F,y),ge=Math.abs((ue-k)/F);if(!m){if(T(ue,ge,H)){_(z,1,1);return}if(x>b){w(z,1,1),_(z,1,1);return}else w(ue,ge,H),f(j)}}(v)}),function(){m=!0}}var h=t.window.requestAnimationFrame||t.window.webkitRequestAnimationFrame||t.window.mozRequestAnimationFrame||t.window.oRequestAnimationFrame||t.window.msRequestAnimationFrame||function(g){return t.window.setTimeout(g,1e3/60)},c=t.window.cancelAnimationFrame||t.window.clearTimeout;function f(){return h.apply(t.window,arguments)}function d(){return c.apply(t.window,arguments)}t.util.animate=l,t.util.requestAnimFrame=f,t.util.cancelAnimFrame=d}(),function(){function o(l,h,c){var f="rgba("+parseInt(l[0]+c*(h[0]-l[0]),10)+","+parseInt(l[1]+c*(h[1]-l[1]),10)+","+parseInt(l[2]+c*(h[2]-l[2]),10);return f+=","+(l&&h?parseFloat(l[3]+c*(h[3]-l[3])):1),f+=")",f}function a(l,h,c,f){var d=new t.Color(l).getSource(),g=new t.Color(h).getSource(),m=f.onComplete,p=f.onChange;return f=f||{},t.util.animate(t.util.object.extend(f,{duration:c||500,startValue:d,endValue:g,byValue:g,easing:function(v,y,b,x){var w=f.colorEasing?f.colorEasing(v,x):1-Math.cos(v/x*(Math.PI/2));return o(y,b,w)},onComplete:function(v,y,b){if(m)return m(o(g,g,0),y,b)},onChange:function(v,y,b){if(p){if(Array.isArray(v))return p(o(v,v,0),y,b);p(v,y,b)}}}))}t.util.animateColor=a}(),function(){function o(L,Z,M,D){return L<Math.abs(Z)?(L=Z,D=M/4):Z===0&&L===0?D=M/(2*Math.PI)*Math.asin(1):D=M/(2*Math.PI)*Math.asin(Z/L),{a:L,c:Z,p:M,s:D}}function a(L,Z,M){return L.a*Math.pow(2,10*(Z-=1))*Math.sin((Z*M-L.s)*(2*Math.PI)/L.p)}function l(L,Z,M,D){return M*((L=L/D-1)*L*L+1)+Z}function h(L,Z,M,D){return L/=D/2,L<1?M/2*L*L*L+Z:M/2*((L-=2)*L*L+2)+Z}function c(L,Z,M,D){return M*(L/=D)*L*L*L+Z}function f(L,Z,M,D){return-M*((L=L/D-1)*L*L*L-1)+Z}function d(L,Z,M,D){return L/=D/2,L<1?M/2*L*L*L*L+Z:-M/2*((L-=2)*L*L*L-2)+Z}function g(L,Z,M,D){return M*(L/=D)*L*L*L*L+Z}function m(L,Z,M,D){return M*((L=L/D-1)*L*L*L*L+1)+Z}function p(L,Z,M,D){return L/=D/2,L<1?M/2*L*L*L*L*L+Z:M/2*((L-=2)*L*L*L*L+2)+Z}function v(L,Z,M,D){return-M*Math.cos(L/D*(Math.PI/2))+M+Z}function y(L,Z,M,D){return M*Math.sin(L/D*(Math.PI/2))+Z}function b(L,Z,M,D){return-M/2*(Math.cos(Math.PI*L/D)-1)+Z}function x(L,Z,M,D){return L===0?Z:M*Math.pow(2,10*(L/D-1))+Z}function w(L,Z,M,D){return L===D?Z+M:M*(-Math.pow(2,-10*L/D)+1)+Z}function T(L,Z,M,D){return L===0?Z:L===D?Z+M:(L/=D/2,L<1?M/2*Math.pow(2,10*(L-1))+Z:M/2*(-Math.pow(2,-10*--L)+2)+Z)}function _(L,Z,M,D){return-M*(Math.sqrt(1-(L/=D)*L)-1)+Z}function E(L,Z,M,D){return M*Math.sqrt(1-(L=L/D-1)*L)+Z}function k(L,Z,M,D){return L/=D/2,L<1?-M/2*(Math.sqrt(1-L*L)-1)+Z:M/2*(Math.sqrt(1-(L-=2)*L)+1)+Z}function z(L,Z,M,D){var R=1.70158,P=0,O=M;if(L===0)return Z;if(L/=D,L===1)return Z+M;P||(P=D*.3);var N=o(O,M,P,R);return-a(N,L,D)+Z}function F(L,Z,M,D){var R=1.70158,P=0,O=M;if(L===0)return Z;if(L/=D,L===1)return Z+M;P||(P=D*.3);var N=o(O,M,P,R);return N.a*Math.pow(2,-10*L)*Math.sin((L*D-N.s)*(2*Math.PI)/N.p)+N.c+Z}function j(L,Z,M,D){var R=1.70158,P=0,O=M;if(L===0)return Z;if(L/=D/2,L===2)return Z+M;P||(P=D*(.3*1.5));var N=o(O,M,P,R);return L<1?-.5*a(N,L,D)+Z:N.a*Math.pow(2,-10*(L-=1))*Math.sin((L*D-N.s)*(2*Math.PI)/N.p)*.5+N.c+Z}function K(L,Z,M,D,R){return R===void 0&&(R=1.70158),M*(L/=D)*L*((R+1)*L-R)+Z}function B(L,Z,M,D,R){return R===void 0&&(R=1.70158),M*((L=L/D-1)*L*((R+1)*L+R)+1)+Z}function H(L,Z,M,D,R){return R===void 0&&(R=1.70158),L/=D/2,L<1?M/2*(L*L*(((R*=1.525)+1)*L-R))+Z:M/2*((L-=2)*L*(((R*=1.525)+1)*L+R)+2)+Z}function ue(L,Z,M,D){return M-ge(D-L,0,M,D)+Z}function ge(L,Z,M,D){return(L/=D)<1/2.75?M*(7.5625*L*L)+Z:L<2/2.75?M*(7.5625*(L-=1.5/2.75)*L+.75)+Z:L<2.5/2.75?M*(7.5625*(L-=2.25/2.75)*L+.9375)+Z:M*(7.5625*(L-=2.625/2.75)*L+.984375)+Z}function fe(L,Z,M,D){return L<D/2?ue(L*2,0,M,D)*.5+Z:ge(L*2-D,0,M,D)*.5+M*.5+Z}t.util.ease={easeInQuad:function(L,Z,M,D){return M*(L/=D)*L+Z},easeOutQuad:function(L,Z,M,D){return-M*(L/=D)*(L-2)+Z},easeInOutQuad:function(L,Z,M,D){return L/=D/2,L<1?M/2*L*L+Z:-M/2*(--L*(L-2)-1)+Z},easeInCubic:function(L,Z,M,D){return M*(L/=D)*L*L+Z},easeOutCubic:l,easeInOutCubic:h,easeInQuart:c,easeOutQuart:f,easeInOutQuart:d,easeInQuint:g,easeOutQuint:m,easeInOutQuint:p,easeInSine:v,easeOutSine:y,easeInOutSine:b,easeInExpo:x,easeOutExpo:w,easeInOutExpo:T,easeInCirc:_,easeOutCirc:E,easeInOutCirc:k,easeInElastic:z,easeOutElastic:F,easeInOutElastic:j,easeInBack:K,easeOutBack:B,easeInOutBack:H,easeInBounce:ue,easeOutBounce:ge,easeInOutBounce:fe}}(),function(o){var a=o.fabric||(o.fabric={}),l=a.util.object.extend,h=a.util.object.clone,c=a.util.toFixed,f=a.util.parseUnit,d=a.util.multiplyTransformMatrices,g=["path","circle","polygon","polyline","ellipse","rect","line","image","text"],m=["symbol","image","marker","pattern","view","svg"],p=["pattern","defs","symbol","metadata","clipPath","mask","desc"],v=["symbol","g","a","svg","clipPath","defs"],y={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},b={stroke:"strokeOpacity",fill:"fillOpacity"},x="font-size",w="clip-path";a.svgValidTagNamesRegEx=E(g),a.svgViewBoxElementsRegEx=E(m),a.svgInvalidAncestorsRegEx=E(p),a.svgValidParentsRegEx=E(v),a.cssRules={},a.gradientDefs={},a.clipPaths={};function T(P){return P in y?y[P]:P}function _(P,O,N,I){var q=Object.prototype.toString.call(O)==="[object Array]",X;if((P==="fill"||P==="stroke")&&O==="none")O="";else{if(P==="strokeUniform")return O==="non-scaling-stroke";if(P==="strokeDashArray")O==="none"?O=null:O=O.replace(/,/g," ").split(/\s+/).map(parseFloat);else if(P==="transformMatrix")N&&N.transformMatrix?O=d(N.transformMatrix,a.parseTransformAttribute(O)):O=a.parseTransformAttribute(O);else if(P==="visible")O=O!=="none"&&O!=="hidden",N&&N.visible===!1&&(O=!1);else if(P==="opacity")O=parseFloat(O),N&&typeof N.opacity!="undefined"&&(O*=N.opacity);else if(P==="textAnchor")O=O==="start"?"left":O==="end"?"right":"center";else if(P==="charSpacing")X=f(O,I)/I*1e3;else if(P==="paintFirst"){var ne=O.indexOf("fill"),re=O.indexOf("stroke"),O="fill";(ne>-1&&re>-1&&re<ne||ne===-1&&re>-1)&&(O="stroke")}else{if(P==="href"||P==="xlink:href"||P==="font")return O;if(P==="imageSmoothing")return O==="optimizeQuality";X=q?O.map(f):f(O,I)}}return!q&&isNaN(X)?O:X}function E(P){return new RegExp("^("+P.join("|")+")\\b","i")}function k(P){for(var O in b)if(!(typeof P[b[O]]=="undefined"||P[O]==="")){if(typeof P[O]=="undefined"){if(!a.Object.prototype[O])continue;P[O]=a.Object.prototype[O]}if(P[O].indexOf("url(")!==0){var N=new a.Color(P[O]);P[O]=N.setAlpha(c(N.getAlpha()*P[b[O]],2)).toRgba()}}return P}function z(P,O){var N,I=[],q,X,ne;for(X=0,ne=O.length;X<ne;X++)N=O[X],q=P.getElementsByTagName(N),I=I.concat(Array.prototype.slice.call(q));return I}a.parseTransformAttribute=function(){function P(U,se){var me=a.util.cos(se[0]),_e=a.util.sin(se[0]),Ie=0,Ue=0;se.length===3&&(Ie=se[1],Ue=se[2]),U[0]=me,U[1]=_e,U[2]=-_e,U[3]=me,U[4]=Ie-(me*Ie-_e*Ue),U[5]=Ue-(_e*Ie+me*Ue)}function O(U,se){var me=se[0],_e=se.length===2?se[1]:se[0];U[0]=me,U[3]=_e}function N(U,se,me){U[me]=Math.tan(a.util.degreesToRadians(se[0]))}function I(U,se){U[4]=se[0],se.length===2&&(U[5]=se[1])}var q=a.iMatrix,X=a.reNum,ne=a.commaWsp,re="(?:(skewX)\\s*\\(\\s*("+X+")\\s*\\))",ae="(?:(skewY)\\s*\\(\\s*("+X+")\\s*\\))",G="(?:(rotate)\\s*\\(\\s*("+X+")(?:"+ne+"("+X+")"+ne+"("+X+"))?\\s*\\))",W="(?:(scale)\\s*\\(\\s*("+X+")(?:"+ne+"("+X+"))?\\s*\\))",J="(?:(translate)\\s*\\(\\s*("+X+")(?:"+ne+"("+X+"))?\\s*\\))",te="(?:(matrix)\\s*\\(\\s*("+X+")"+ne+"("+X+")"+ne+"("+X+")"+ne+"("+X+")"+ne+"("+X+")"+ne+"("+X+")\\s*\\))",Q="(?:"+te+"|"+J+"|"+W+"|"+G+"|"+re+"|"+ae+")",le="(?:"+Q+"(?:"+ne+"*"+Q+")*)",ie="^\\s*(?:"+le+"?)\\s*$",ye=new RegExp(ie),he=new RegExp(Q,"g");return function(U){var se=q.concat(),me=[];if(!U||U&&!ye.test(U))return se;U.replace(he,function(Ie){var Ue=new RegExp(Q).exec(Ie).filter(function(ft){return!!ft}),Ne=Ue[1],Ae=Ue.slice(2).map(parseFloat);switch(Ne){case"translate":I(se,Ae);break;case"rotate":Ae[0]=a.util.degreesToRadians(Ae[0]),P(se,Ae);break;case"scale":O(se,Ae);break;case"skewX":N(se,Ae,2);break;case"skewY":N(se,Ae,1);break;case"matrix":se=Ae;break}me.push(se.concat()),se=q.concat()});for(var _e=me[0];me.length>1;)me.shift(),_e=a.util.multiplyTransformMatrices(_e,me[0]);return _e}}();function F(P,O){var N,I;P.replace(/;\s*$/,"").split(";").forEach(function(q){var X=q.split(":");N=X[0].trim().toLowerCase(),I=X[1].trim(),O[N]=I})}function j(P,O){var N,I;for(var q in P)typeof P[q]!="undefined"&&(N=q.toLowerCase(),I=P[q],O[N]=I)}function K(P,O){var N={};for(var I in a.cssRules[O])if(B(P,I.split(" ")))for(var q in a.cssRules[O][I])N[q]=a.cssRules[O][I][q];return N}function B(P,O){var N,I=!0;return N=ue(P,O.pop()),N&&O.length&&(I=H(P,O)),N&&I&&O.length===0}function H(P,O){for(var N,I=!0;P.parentNode&&P.parentNode.nodeType===1&&O.length;)I&&(N=O.pop()),P=P.parentNode,I=ue(P,N);return O.length===0}function ue(P,O){var N=P.nodeName,I=P.getAttribute("class"),q=P.getAttribute("id"),X,ne;if(X=new RegExp("^"+N,"i"),O=O.replace(X,""),q&&O.length&&(X=new RegExp("#"+q+"(?![a-zA-Z\\-]+)","i"),O=O.replace(X,"")),I&&O.length)for(I=I.split(" "),ne=I.length;ne--;)X=new RegExp("\\."+I[ne]+"(?![a-zA-Z\\-]+)","i"),O=O.replace(X,"");return O.length===0}function ge(P,O){var N;if(P.getElementById&&(N=P.getElementById(O)),N)return N;var I,q,X,ne=P.getElementsByTagName("*");for(q=0,X=ne.length;q<X;q++)if(I=ne[q],O===I.getAttribute("id"))return I}function fe(P){for(var O=z(P,["use","svg:use"]),N=0;O.length&&N<O.length;){var I=O[N],q=I.getAttribute("xlink:href")||I.getAttribute("href");if(q===null)return;var X=q.substr(1),ne=I.getAttribute("x")||0,re=I.getAttribute("y")||0,ae=ge(P,X).cloneNode(!0),G=(ae.getAttribute("transform")||"")+" translate("+ne+", "+re+")",W,J=O.length,te,Q,le,ie,ye=a.svgNS;if(Z(ae),/^svg$/i.test(ae.nodeName)){var he=ae.ownerDocument.createElementNS(ye,"g");for(Q=0,le=ae.attributes,ie=le.length;Q<ie;Q++)te=le.item(Q),he.setAttributeNS(ye,te.nodeName,te.nodeValue);for(;ae.firstChild;)he.appendChild(ae.firstChild);ae=he}for(Q=0,le=I.attributes,ie=le.length;Q<ie;Q++)te=le.item(Q),!(te.nodeName==="x"||te.nodeName==="y"||te.nodeName==="xlink:href"||te.nodeName==="href")&&(te.nodeName==="transform"?G=te.nodeValue+" "+G:ae.setAttribute(te.nodeName,te.nodeValue));ae.setAttribute("transform",G),ae.setAttribute("instantiated_by_use","1"),ae.removeAttribute("id"),W=I.parentNode,W.replaceChild(ae,I),O.length===J&&N++}}var L=new RegExp("^\\s*("+a.reNum+"+)\\s*,?\\s*("+a.reNum+"+)\\s*,?\\s*("+a.reNum+"+)\\s*,?\\s*("+a.reNum+"+)\\s*$");function Z(P){if(!a.svgViewBoxElementsRegEx.test(P.nodeName))return{};var O=P.getAttribute("viewBox"),N=1,I=1,q=0,X=0,ne,re,ae,G,W=P.getAttribute("width"),J=P.getAttribute("height"),te=P.getAttribute("x")||0,Q=P.getAttribute("y")||0,le=P.getAttribute("preserveAspectRatio")||"",ie=!O||!(O=O.match(L)),ye=!W||!J||W==="100%"||J==="100%",he=ie&&ye,U={},se="",me=0,_e=0;if(U.width=0,U.height=0,U.toBeParsed=he,ie&&(te||Q)&&P.parentNode&&P.parentNode.nodeName!=="#document"&&(se=" translate("+f(te)+" "+f(Q)+") ",ae=(P.getAttribute("transform")||"")+se,P.setAttribute("transform",ae),P.removeAttribute("x"),P.removeAttribute("y")),he)return U;if(ie)return U.width=f(W),U.height=f(J),U;if(q=-parseFloat(O[1]),X=-parseFloat(O[2]),ne=parseFloat(O[3]),re=parseFloat(O[4]),U.minX=q,U.minY=X,U.viewBoxWidth=ne,U.viewBoxHeight=re,ye?(U.width=ne,U.height=re):(U.width=f(W),U.height=f(J),N=U.width/ne,I=U.height/re),le=a.util.parsePreserveAspectRatioAttribute(le),le.alignX!=="none"&&(le.meetOrSlice==="meet"&&(I=N=N>I?I:N),le.meetOrSlice==="slice"&&(I=N=N>I?N:I),me=U.width-ne*N,_e=U.height-re*N,le.alignX==="Mid"&&(me/=2),le.alignY==="Mid"&&(_e/=2),le.alignX==="Min"&&(me=0),le.alignY==="Min"&&(_e=0)),N===1&&I===1&&q===0&&X===0&&te===0&&Q===0)return U;if((te||Q)&&P.parentNode.nodeName!=="#document"&&(se=" translate("+f(te)+" "+f(Q)+") "),ae=se+" matrix("+N+" 0 0 "+I+" "+(q*N+me)+" "+(X*I+_e)+") ",P.nodeName==="svg"){for(G=P.ownerDocument.createElementNS(a.svgNS,"g");P.firstChild;)G.appendChild(P.firstChild);P.appendChild(G)}else G=P,G.removeAttribute("x"),G.removeAttribute("y"),ae=G.getAttribute("transform")+ae;return G.setAttribute("transform",ae),U}function M(P,O){for(;P&&(P=P.parentNode);)if(P.nodeName&&O.test(P.nodeName.replace("svg:",""))&&!P.getAttribute("instantiated_by_use"))return!0;return!1}a.parseSVGDocument=function(P,O,N,I){if(!!P){fe(P);var q=a.Object.__uid++,X,ne,re=Z(P),ae=a.util.toArray(P.getElementsByTagName("*"));if(re.crossOrigin=I&&I.crossOrigin,re.svgUid=q,ae.length===0&&a.isLikelyNode){ae=P.selectNodes('//*[name(.)!="svg"]');var G=[];for(X=0,ne=ae.length;X<ne;X++)G[X]=ae[X];ae=G}var W=ae.filter(function(te){return Z(te),a.svgValidTagNamesRegEx.test(te.nodeName.replace("svg:",""))&&!M(te,a.svgInvalidAncestorsRegEx)});if(!W||W&&!W.length){O&&O([],{});return}var J={};ae.filter(function(te){return te.nodeName.replace("svg:","")==="clipPath"}).forEach(function(te){var Q=te.getAttribute("id");J[Q]=a.util.toArray(te.getElementsByTagName("*")).filter(function(le){return a.svgValidTagNamesRegEx.test(le.nodeName.replace("svg:",""))})}),a.gradientDefs[q]=a.getGradientDefs(P),a.cssRules[q]=a.getCSSRules(P),a.clipPaths[q]=J,a.parseElements(W,function(te,Q){O&&(O(te,re,Q,ae),delete a.gradientDefs[q],delete a.cssRules[q],delete a.clipPaths[q])},h(re),N,I)}};function D(P,O){var N=["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"],I="xlink:href",q=O.getAttribute(I).substr(1),X=ge(P,q);if(X&&X.getAttribute(I)&&D(P,X),N.forEach(function(re){X&&!O.hasAttribute(re)&&X.hasAttribute(re)&&O.setAttribute(re,X.getAttribute(re))}),!O.children.length)for(var ne=X.cloneNode(!0);ne.firstChild;)O.appendChild(ne.firstChild);O.removeAttribute(I)}var R=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+a.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+a.reNum+"))?\\s+(.*)");l(a,{parseFontDeclaration:function(P,O){var N=P.match(R);if(!!N){var I=N[1],q=N[3],X=N[4],ne=N[5],re=N[6];I&&(O.fontStyle=I),q&&(O.fontWeight=isNaN(parseFloat(q))?q:parseFloat(q)),X&&(O.fontSize=f(X)),re&&(O.fontFamily=re),ne&&(O.lineHeight=ne==="normal"?1:ne)}},getGradientDefs:function(P){var O=["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"],N=z(P,O),I,q=0,X={};for(q=N.length;q--;)I=N[q],I.getAttribute("xlink:href")&&D(P,I),X[I.getAttribute("id")]=I;return X},parseAttributes:function(P,O,N){if(!!P){var I,q={},X,ne;typeof N=="undefined"&&(N=P.getAttribute("svgUid")),P.parentNode&&a.svgValidParentsRegEx.test(P.parentNode.nodeName)&&(q=a.parseAttributes(P.parentNode,O,N));var re=O.reduce(function(le,ie){return I=P.getAttribute(ie),I&&(le[ie]=I),le},{}),ae=l(K(P,N),a.parseStyleAttribute(P));re=l(re,ae),ae[w]&&P.setAttribute(w,ae[w]),X=ne=q.fontSize||a.Text.DEFAULT_SVG_FONT_SIZE,re[x]&&(re[x]=X=f(re[x],ne));var G,W,J={};for(var te in re)G=T(te),W=_(G,re[te],q,X),J[G]=W;J&&J.font&&a.parseFontDeclaration(J.font,J);var Q=l(q,J);return a.svgValidParentsRegEx.test(P.nodeName)?Q:k(Q)}},parseElements:function(P,O,N,I,q){new a.ElementsParser(P,O,N,I,q).parse()},parseStyleAttribute:function(P){var O={},N=P.getAttribute("style");return N&&(typeof N=="string"?F(N,O):j(N,O)),O},parsePointsAttribute:function(P){if(!P)return null;P=P.replace(/,/g," ").trim(),P=P.split(/\s+/);var O=[],N,I;for(N=0,I=P.length;N<I;N+=2)O.push({x:parseFloat(P[N]),y:parseFloat(P[N+1])});return O},getCSSRules:function(P){var O=P.getElementsByTagName("style"),N,I,q={},X;for(N=0,I=O.length;N<I;N++){var ne=O[N].textContent;ne=ne.replace(/\/\*[\s\S]*?\*\//g,""),ne.trim()!==""&&(X=ne.match(/[^{]*\{[\s\S]*?\}/g),X=X.map(function(re){return re.trim()}),X.forEach(function(re){var ae=re.match(/([\s\S]*?)\s*\{([^}]*)\}/),G={},W=ae[2].trim(),J=W.replace(/;$/,"").split(/\s*;\s*/);for(N=0,I=J.length;N<I;N++){var te=J[N].split(/\s*:\s*/),Q=te[0],le=te[1];G[Q]=le}re=ae[1],re.split(",").forEach(function(ie){ie=ie.replace(/^svg/i,"").trim(),ie!==""&&(q[ie]?a.util.object.extend(q[ie],G):q[ie]=a.util.object.clone(G))})}))}return q},loadSVGFromURL:function(P,O,N,I){P=P.replace(/^\n\s*/,"").trim(),new a.util.request(P,{method:"get",onComplete:q});function q(X){var ne=X.responseXML;if(!ne||!ne.documentElement)return O&&O(null),!1;a.parseSVGDocument(ne.documentElement,function(re,ae,G,W){O&&O(re,ae,G,W)},N,I)}},loadSVGFromString:function(P,O,N,I){var q=new a.window.DOMParser,X=q.parseFromString(P.trim(),"text/xml");a.parseSVGDocument(X.documentElement,function(ne,re,ae,G){O(ne,re,ae,G)},N,I)}})}(e),t.ElementsParser=function(o,a,l,h,c,f){this.elements=o,this.callback=a,this.options=l,this.reviver=h,this.svgUid=l&&l.svgUid||0,this.parsingOptions=c,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=f},function(o){o.parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},o.createObjects=function(){var a=this;this.elements.forEach(function(l,h){l.setAttribute("svgUid",a.svgUid),a.createObject(l,h)})},o.findTag=function(a){return t[t.util.string.capitalize(a.tagName.replace("svg:",""))]},o.createObject=function(a,l){var h=this.findTag(a);if(h&&h.fromElement)try{h.fromElement(a,this.createCallback(l,a),this.options)}catch(c){t.log(c)}else this.checkIfDone()},o.createCallback=function(a,l){var h=this;return function(c){var f;h.resolveGradient(c,l,"fill"),h.resolveGradient(c,l,"stroke"),c instanceof t.Image&&c._originalElement&&(f=c.parsePreserveAspectRatioAttribute(l)),c._removeTransformMatrix(f),h.resolveClipPath(c,l),h.reviver&&h.reviver(l,c),h.instances[a]=c,h.checkIfDone()}},o.extractPropertyDefinition=function(a,l,h){var c=a[l],f=this.regexUrl;if(!!f.test(c)){f.lastIndex=0;var d=f.exec(c)[1];return f.lastIndex=0,t[h][this.svgUid][d]}},o.resolveGradient=function(a,l,h){var c=this.extractPropertyDefinition(a,h,"gradientDefs");if(c){var f=l.getAttribute(h+"-opacity"),d=t.Gradient.fromElement(c,a,f,this.options);a.set(h,d)}},o.createClipPathCallback=function(a,l){return function(h){h._removeTransformMatrix(),h.fillRule=h.clipRule,l.push(h)}},o.resolveClipPath=function(a,l){var h=this.extractPropertyDefinition(a,"clipPath","clipPaths"),c,f,d,g,m,p;if(h){g=[],d=t.util.invertTransform(a.calcTransformMatrix());for(var v=h[0].parentNode,y=l;y.parentNode&&y.getAttribute("clip-path")!==a.clipPath;)y=y.parentNode;y.parentNode.appendChild(v);for(var b=0;b<h.length;b++)c=h[b],f=this.findTag(c),f.fromElement(c,this.createClipPathCallback(a,g),this.options);g.length===1?h=g[0]:h=new t.Group(g),m=t.util.multiplyTransformMatrices(d,h.calcTransformMatrix()),h.clipPath&&this.resolveClipPath(h,y);var p=t.util.qrDecompose(m);h.flipX=!1,h.flipY=!1,h.set("scaleX",p.scaleX),h.set("scaleY",p.scaleY),h.angle=p.angle,h.skewX=p.skewX,h.skewY=0,h.setPositionByOrigin({x:p.translateX,y:p.translateY},"center","center"),a.clipPath=h}else delete a.clipPath},o.checkIfDone=function(){--this.numElements===0&&(this.instances=this.instances.filter(function(a){return a!=null}),this.callback(this.instances,this.elements))}}(t.ElementsParser.prototype),function(o){var a=o.fabric||(o.fabric={});if(a.Point){a.warn("fabric.Point is already defined");return}a.Point=l;function l(h,c){this.x=h,this.y=c}l.prototype={type:"point",constructor:l,add:function(h){return new l(this.x+h.x,this.y+h.y)},addEquals:function(h){return this.x+=h.x,this.y+=h.y,this},scalarAdd:function(h){return new l(this.x+h,this.y+h)},scalarAddEquals:function(h){return this.x+=h,this.y+=h,this},subtract:function(h){return new l(this.x-h.x,this.y-h.y)},subtractEquals:function(h){return this.x-=h.x,this.y-=h.y,this},scalarSubtract:function(h){return new l(this.x-h,this.y-h)},scalarSubtractEquals:function(h){return this.x-=h,this.y-=h,this},multiply:function(h){return new l(this.x*h,this.y*h)},multiplyEquals:function(h){return this.x*=h,this.y*=h,this},divide:function(h){return new l(this.x/h,this.y/h)},divideEquals:function(h){return this.x/=h,this.y/=h,this},eq:function(h){return this.x===h.x&&this.y===h.y},lt:function(h){return this.x<h.x&&this.y<h.y},lte:function(h){return this.x<=h.x&&this.y<=h.y},gt:function(h){return this.x>h.x&&this.y>h.y},gte:function(h){return this.x>=h.x&&this.y>=h.y},lerp:function(h,c){return typeof c=="undefined"&&(c=.5),c=Math.max(Math.min(1,c),0),new l(this.x+(h.x-this.x)*c,this.y+(h.y-this.y)*c)},distanceFrom:function(h){var c=this.x-h.x,f=this.y-h.y;return Math.sqrt(c*c+f*f)},midPointFrom:function(h){return this.lerp(h)},min:function(h){return new l(Math.min(this.x,h.x),Math.min(this.y,h.y))},max:function(h){return new l(Math.max(this.x,h.x),Math.max(this.y,h.y))},toString:function(){return this.x+","+this.y},setXY:function(h,c){return this.x=h,this.y=c,this},setX:function(h){return this.x=h,this},setY:function(h){return this.y=h,this},setFromPoint:function(h){return this.x=h.x,this.y=h.y,this},swap:function(h){var c=this.x,f=this.y;this.x=h.x,this.y=h.y,h.x=c,h.y=f},clone:function(){return new l(this.x,this.y)}}}(e),function(o){var a=o.fabric||(o.fabric={});if(a.Intersection){a.warn("fabric.Intersection is already defined");return}function l(h){this.status=h,this.points=[]}a.Intersection=l,a.Intersection.prototype={constructor:l,appendPoint:function(h){return this.points.push(h),this},appendPoints:function(h){return this.points=this.points.concat(h),this}},a.Intersection.intersectLineLine=function(h,c,f,d){var g,m=(d.x-f.x)*(h.y-f.y)-(d.y-f.y)*(h.x-f.x),p=(c.x-h.x)*(h.y-f.y)-(c.y-h.y)*(h.x-f.x),v=(d.y-f.y)*(c.x-h.x)-(d.x-f.x)*(c.y-h.y);if(v!==0){var y=m/v,b=p/v;0<=y&&y<=1&&0<=b&&b<=1?(g=new l("Intersection"),g.appendPoint(new a.Point(h.x+y*(c.x-h.x),h.y+y*(c.y-h.y)))):g=new l}else m===0||p===0?g=new l("Coincident"):g=new l("Parallel");return g},a.Intersection.intersectLinePolygon=function(h,c,f){var d=new l,g=f.length,m,p,v,y;for(y=0;y<g;y++)m=f[y],p=f[(y+1)%g],v=l.intersectLineLine(h,c,m,p),d.appendPoints(v.points);return d.points.length>0&&(d.status="Intersection"),d},a.Intersection.intersectPolygonPolygon=function(h,c){var f=new l,d=h.length,g;for(g=0;g<d;g++){var m=h[g],p=h[(g+1)%d],v=l.intersectLinePolygon(m,p,c);f.appendPoints(v.points)}return f.points.length>0&&(f.status="Intersection"),f},a.Intersection.intersectPolygonRectangle=function(h,c,f){var d=c.min(f),g=c.max(f),m=new a.Point(g.x,d.y),p=new a.Point(d.x,g.y),v=l.intersectLinePolygon(d,m,h),y=l.intersectLinePolygon(m,g,h),b=l.intersectLinePolygon(g,p,h),x=l.intersectLinePolygon(p,d,h),w=new l;return w.appendPoints(v.points),w.appendPoints(y.points),w.appendPoints(b.points),w.appendPoints(x.points),w.points.length>0&&(w.status="Intersection"),w}}(e),function(o){var a=o.fabric||(o.fabric={});if(a.Color){a.warn("fabric.Color is already defined.");return}function l(c){c?this._tryParsingColor(c):this.setSource([0,0,0,1])}a.Color=l,a.Color.prototype={_tryParsingColor:function(c){var f;c in l.colorNameMap&&(c=l.colorNameMap[c]),c==="transparent"&&(f=[255,255,255,0]),f||(f=l.sourceFromHex(c)),f||(f=l.sourceFromRgb(c)),f||(f=l.sourceFromHsl(c)),f||(f=[0,0,0,1]),f&&this.setSource(f)},_rgbToHsl:function(c,f,d){c/=255,f/=255,d/=255;var g,m,p,v=a.util.array.max([c,f,d]),y=a.util.array.min([c,f,d]);if(p=(v+y)/2,v===y)g=m=0;else{var b=v-y;switch(m=p>.5?b/(2-v-y):b/(v+y),v){case c:g=(f-d)/b+(f<d?6:0);break;case f:g=(d-c)/b+2;break;case d:g=(c-f)/b+4;break}g/=6}return[Math.round(g*360),Math.round(m*100),Math.round(p*100)]},getSource:function(){return this._source},setSource:function(c){this._source=c},toRgb:function(){var c=this.getSource();return"rgb("+c[0]+","+c[1]+","+c[2]+")"},toRgba:function(){var c=this.getSource();return"rgba("+c[0]+","+c[1]+","+c[2]+","+c[3]+")"},toHsl:function(){var c=this.getSource(),f=this._rgbToHsl(c[0],c[1],c[2]);return"hsl("+f[0]+","+f[1]+"%,"+f[2]+"%)"},toHsla:function(){var c=this.getSource(),f=this._rgbToHsl(c[0],c[1],c[2]);return"hsla("+f[0]+","+f[1]+"%,"+f[2]+"%,"+c[3]+")"},toHex:function(){var c=this.getSource(),f,d,g;return f=c[0].toString(16),f=f.length===1?"0"+f:f,d=c[1].toString(16),d=d.length===1?"0"+d:d,g=c[2].toString(16),g=g.length===1?"0"+g:g,f.toUpperCase()+d.toUpperCase()+g.toUpperCase()},toHexa:function(){var c=this.getSource(),f;return f=Math.round(c[3]*255),f=f.toString(16),f=f.length===1?"0"+f:f,this.toHex()+f.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(c){var f=this.getSource();return f[3]=c,this.setSource(f),this},toGrayscale:function(){var c=this.getSource(),f=parseInt((c[0]*.3+c[1]*.59+c[2]*.11).toFixed(0),10),d=c[3];return this.setSource([f,f,f,d]),this},toBlackWhite:function(c){var f=this.getSource(),d=(f[0]*.3+f[1]*.59+f[2]*.11).toFixed(0),g=f[3];return c=c||127,d=Number(d)<Number(c)?0:255,this.setSource([d,d,d,g]),this},overlayWith:function(c){c instanceof l||(c=new l(c));var f=[],d=this.getAlpha(),g=.5,m=this.getSource(),p=c.getSource(),v;for(v=0;v<3;v++)f.push(Math.round(m[v]*(1-g)+p[v]*g));return f[3]=d,this.setSource(f),this}},a.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,a.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,a.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,a.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};function h(c,f,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?c+(f-c)*6*d:d<1/2?f:d<2/3?c+(f-c)*(2/3-d)*6:c}a.Color.fromRgb=function(c){return l.fromSource(l.sourceFromRgb(c))},a.Color.sourceFromRgb=function(c){var f=c.match(l.reRGBa);if(f){var d=parseInt(f[1],10)/(/%$/.test(f[1])?100:1)*(/%$/.test(f[1])?255:1),g=parseInt(f[2],10)/(/%$/.test(f[2])?100:1)*(/%$/.test(f[2])?255:1),m=parseInt(f[3],10)/(/%$/.test(f[3])?100:1)*(/%$/.test(f[3])?255:1);return[parseInt(d,10),parseInt(g,10),parseInt(m,10),f[4]?parseFloat(f[4]):1]}},a.Color.fromRgba=l.fromRgb,a.Color.fromHsl=function(c){return l.fromSource(l.sourceFromHsl(c))},a.Color.sourceFromHsl=function(c){var f=c.match(l.reHSLa);if(!!f){var d=(parseFloat(f[1])%360+360)%360/360,g=parseFloat(f[2])/(/%$/.test(f[2])?100:1),m=parseFloat(f[3])/(/%$/.test(f[3])?100:1),p,v,y;if(g===0)p=v=y=m;else{var b=m<=.5?m*(g+1):m+g-m*g,x=m*2-b;p=h(x,b,d+1/3),v=h(x,b,d),y=h(x,b,d-1/3)}return[Math.round(p*255),Math.round(v*255),Math.round(y*255),f[4]?parseFloat(f[4]):1]}},a.Color.fromHsla=l.fromHsl,a.Color.fromHex=function(c){return l.fromSource(l.sourceFromHex(c))},a.Color.sourceFromHex=function(c){if(c.match(l.reHex)){var f=c.slice(c.indexOf("#")+1),d=f.length===3||f.length===4,g=f.length===8||f.length===4,m=d?f.charAt(0)+f.charAt(0):f.substring(0,2),p=d?f.charAt(1)+f.charAt(1):f.substring(2,4),v=d?f.charAt(2)+f.charAt(2):f.substring(4,6),y=g?d?f.charAt(3)+f.charAt(3):f.substring(6,8):"FF";return[parseInt(m,16),parseInt(p,16),parseInt(v,16),parseFloat((parseInt(y,16)/255).toFixed(2))]}},a.Color.fromSource=function(c){var f=new l;return f.setSource(c),f}}(e),function(o){var a=o.fabric||(o.fabric={}),l=["e","se","s","sw","w","nw","n","ne","e"],h=["ns","nesw","ew","nwse"],c={},f="left",d="top",g="right",m="bottom",p="center",v={top:m,bottom:d,left:g,right:f,center:p},y=a.util.radiansToDegrees,b=Math.sign||function(G){return(G>0)-(G<0)||+G};function x(G,W){var J=G.angle+y(Math.atan2(W.y,W.x))+360;return Math.round(J%360/45)}function w(G,W){var J=W.transform.target,te=J.canvas,Q=a.util.object.clone(W);Q.target=J,te&&te.fire("object:"+G,Q),J.fire(G,W)}function T(G,W){var J=W.canvas,te=J.uniScaleKey,Q=G[te];return J.uniformScaling&&!Q||!J.uniformScaling&&Q}function _(G){return G.originX===p&&G.originY===p}function E(G,W,J){var te=G.lockScalingX,Q=G.lockScalingY;return!!(te&&Q||!W&&(te||Q)&&J||te&&W==="x"||Q&&W==="y")}function k(G,W,J){var te="not-allowed",Q=T(G,J),le="";if(W.x!==0&&W.y===0?le="x":W.x===0&&W.y!==0&&(le="y"),E(J,le,Q))return te;var ie=x(J,W);return l[ie]+"-resize"}function z(G,W,J){var te="not-allowed";if(W.x!==0&&J.lockSkewingY||W.y!==0&&J.lockSkewingX)return te;var Q=x(J,W)%4;return h[Q]+"-resize"}function F(G,W,J){return G[J.canvas.altActionKey]?c.skewCursorStyleHandler(G,W,J):c.scaleCursorStyleHandler(G,W,J)}function j(G,W,J){var te=G[J.canvas.altActionKey];if(W.x===0)return te?"skewX":"scaleY";if(W.y===0)return te?"skewY":"scaleX"}function K(G,W,J){return J.lockRotation?"not-allowed":W.cursorStyle}function B(G,W,J,te){return{e:G,transform:W,pointer:{x:J,y:te}}}function H(G){return function(W,J,te,Q){var le=J.target,ie=le.getCenterPoint(),ye=le.translateToOriginPoint(ie,J.originX,J.originY),he=G(W,J,te,Q);return le.setPositionByOrigin(ye,J.originX,J.originY),he}}function ue(G,W){return function(J,te,Q,le){var ie=W(J,te,Q,le);return ie&&w(G,B(J,te,Q,le)),ie}}function ge(G,W,J,te,Q){var le=G.target,ie=le.controls[G.corner],ye=le.canvas.getZoom(),he=le.padding/ye,U=le.toLocalPoint(new a.Point(te,Q),W,J);return U.x>=he&&(U.x-=he),U.x<=-he&&(U.x+=he),U.y>=he&&(U.y-=he),U.y<=he&&(U.y+=he),U.x-=ie.offsetX,U.y-=ie.offsetY,U}function fe(G){return G.flipX!==G.flipY}function L(G,W,J,te,Q){if(G[W]!==0){var le=G._getTransformedDimensions()[te],ie=Q/le*G[J];G.set(J,ie)}}function Z(G,W,J,te){var Q=W.target,le=Q._getTransformedDimensions(0,Q.skewY),ie=ge(W,W.originX,W.originY,J,te),ye=Math.abs(ie.x*2)-le.x,he=Q.skewX,U;ye<2?U=0:(U=y(Math.atan2(ye/Q.scaleX,le.y/Q.scaleY)),W.originX===f&&W.originY===m&&(U=-U),W.originX===g&&W.originY===d&&(U=-U),fe(Q)&&(U=-U));var se=he!==U;if(se){var me=Q._getTransformedDimensions().y;Q.set("skewX",U),L(Q,"skewY","scaleY","y",me)}return se}function M(G,W,J,te){var Q=W.target,le=Q._getTransformedDimensions(Q.skewX,0),ie=ge(W,W.originX,W.originY,J,te),ye=Math.abs(ie.y*2)-le.y,he=Q.skewY,U;ye<2?U=0:(U=y(Math.atan2(ye/Q.scaleY,le.x/Q.scaleX)),W.originX===f&&W.originY===m&&(U=-U),W.originX===g&&W.originY===d&&(U=-U),fe(Q)&&(U=-U));var se=he!==U;if(se){var me=Q._getTransformedDimensions().x;Q.set("skewY",U),L(Q,"skewX","scaleX","x",me)}return se}function D(G,W,J,te){var Q=W.target,le=Q.skewX,ie,ye=W.originY;if(Q.lockSkewingX)return!1;if(le===0){var he=ge(W,p,p,J,te);he.x>0?ie=f:ie=g}else le>0&&(ie=ye===d?f:g),le<0&&(ie=ye===d?g:f),fe(Q)&&(ie=ie===f?g:f);W.originX=ie;var U=ue("skewing",H(Z));return U(G,W,J,te)}function R(G,W,J,te){var Q=W.target,le=Q.skewY,ie,ye=W.originX;if(Q.lockSkewingY)return!1;if(le===0){var he=ge(W,p,p,J,te);he.y>0?ie=d:ie=m}else le>0&&(ie=ye===f?d:m),le<0&&(ie=ye===f?m:d),fe(Q)&&(ie=ie===d?m:d);W.originY=ie;var U=ue("skewing",H(M));return U(G,W,J,te)}function P(G,W,J,te){var Q=W,le=Q.target,ie=le.translateToOriginPoint(le.getCenterPoint(),Q.originX,Q.originY);if(le.lockRotation)return!1;var ye=Math.atan2(Q.ey-ie.y,Q.ex-ie.x),he=Math.atan2(te-ie.y,J-ie.x),U=y(he-ye+Q.theta),se=!0;if(le.snapAngle>0){var me=le.snapAngle,_e=le.snapThreshold||me,Ie=Math.ceil(U/me)*me,Ue=Math.floor(U/me)*me;Math.abs(U-Ue)<_e?U=Ue:Math.abs(U-Ie)<_e&&(U=Ie)}return U<0&&(U=360+U),U%=360,se=le.angle!==U,le.angle=U,se}function O(G,W,J,te,Q){Q=Q||{};var le=W.target,ie=le.lockScalingX,ye=le.lockScalingY,he=Q.by,U,se,me,_e,Ie=T(G,le),Ue=E(le,he,Ie),Ne,Ae,ft=W.gestureScale;if(Ue)return!1;if(ft)se=W.scaleX*ft,me=W.scaleY*ft;else{if(U=ge(W,W.originX,W.originY,J,te),Ne=he!=="y"?b(U.x):1,Ae=he!=="x"?b(U.y):1,W.signX||(W.signX=Ne),W.signY||(W.signY=Ae),le.lockScalingFlip&&(W.signX!==Ne||W.signY!==Ae))return!1;if(_e=le._getTransformedDimensions(),Ie&&!he){var ir=Math.abs(U.x)+Math.abs(U.y),pr=W.original,Gr=Math.abs(_e.x*pr.scaleX/le.scaleX)+Math.abs(_e.y*pr.scaleY/le.scaleY),Gt=ir/Gr;se=pr.scaleX*Gt,me=pr.scaleY*Gt}else se=Math.abs(U.x*le.scaleX/_e.x),me=Math.abs(U.y*le.scaleY/_e.y);_(W)&&(se*=2,me*=2),W.signX!==Ne&&he!=="y"&&(W.originX=v[W.originX],se*=-1,W.signX=Ne),W.signY!==Ae&&he!=="x"&&(W.originY=v[W.originY],me*=-1,W.signY=Ae)}var nu=le.scaleX,iu=le.scaleY;return he?(he==="x"&&le.set("scaleX",se),he==="y"&&le.set("scaleY",me)):(!ie&&le.set("scaleX",se),!ye&&le.set("scaleY",me)),nu!==le.scaleX||iu!==le.scaleY}function N(G,W,J,te){return O(G,W,J,te)}function I(G,W,J,te){return O(G,W,J,te,{by:"x"})}function q(G,W,J,te){return O(G,W,J,te,{by:"y"})}function X(G,W,J,te){return G[W.target.canvas.altActionKey]?c.skewHandlerX(G,W,J,te):c.scalingY(G,W,J,te)}function ne(G,W,J,te){return G[W.target.canvas.altActionKey]?c.skewHandlerY(G,W,J,te):c.scalingX(G,W,J,te)}function re(G,W,J,te){var Q=W.target,le=ge(W,W.originX,W.originY,J,te),ie=Q.strokeWidth/(Q.strokeUniform?Q.scaleX:1),ye=_(W)?2:1,he=Q.width,U=Math.abs(le.x*ye/Q.scaleX)-ie;return Q.set("width",Math.max(U,0)),he!==U}function ae(G,W,J,te){var Q=W.target,le=J-W.offsetX,ie=te-W.offsetY,ye=!Q.get("lockMovementX")&&Q.left!==le,he=!Q.get("lockMovementY")&&Q.top!==ie;return ye&&Q.set("left",le),he&&Q.set("top",ie),(ye||he)&&w("moving",B(G,W,J,te)),ye||he}c.scaleCursorStyleHandler=k,c.skewCursorStyleHandler=z,c.scaleSkewCursorStyleHandler=F,c.rotationWithSnapping=ue("rotating",H(P)),c.scalingEqually=ue("scaling",H(N)),c.scalingX=ue("scaling",H(I)),c.scalingY=ue("scaling",H(q)),c.scalingYOrSkewingX=X,c.scalingXOrSkewingY=ne,c.changeWidth=ue("resizing",H(re)),c.skewHandlerX=D,c.skewHandlerY=R,c.dragHandler=ae,c.scaleOrSkewActionName=j,c.rotationStyleHandler=K,c.fireEvent=w,c.wrapWithFixedAnchor=H,c.wrapWithFireEvent=ue,c.getLocalPoint=ge,a.controlsUtils=c}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.util.degreesToRadians,h=a.controlsUtils;function c(d,g,m,p,v){p=p||{};var y=this.sizeX||p.cornerSize||v.cornerSize,b=this.sizeY||p.cornerSize||v.cornerSize,x=typeof p.transparentCorners!="undefined"?p.transparentCorners:v.transparentCorners,w=x?"stroke":"fill",T=!x&&(p.cornerStrokeColor||v.cornerStrokeColor),_=g,E=m,k;d.save(),d.fillStyle=p.cornerColor||v.cornerColor,d.strokeStyle=p.cornerStrokeColor||v.cornerStrokeColor,y>b?(k=y,d.scale(1,b/y),E=m*y/b):b>y?(k=b,d.scale(y/b,1),_=g*b/y):k=y,d.lineWidth=1,d.beginPath(),d.arc(_,E,k/2,0,2*Math.PI,!1),d[w](),T&&d.stroke(),d.restore()}function f(d,g,m,p,v){p=p||{};var y=this.sizeX||p.cornerSize||v.cornerSize,b=this.sizeY||p.cornerSize||v.cornerSize,x=typeof p.transparentCorners!="undefined"?p.transparentCorners:v.transparentCorners,w=x?"stroke":"fill",T=!x&&(p.cornerStrokeColor||v.cornerStrokeColor),_=y/2,E=b/2;d.save(),d.fillStyle=p.cornerColor||v.cornerColor,d.strokeStyle=p.cornerStrokeColor||v.cornerStrokeColor,d.lineWidth=1,d.translate(g,m),d.rotate(l(v.angle)),d[w+"Rect"](-_,-E,y,b),T&&d.strokeRect(-_,-E,y,b),d.restore()}h.renderCircleControl=c,h.renderSquareControl=f}(e),function(o){var a=o.fabric||(o.fabric={});function l(h){for(var c in h)this[c]=h[c]}a.Control=l,a.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(h,c){return c.cursorStyle},getActionName:function(h,c){return c.actionName},getVisibility:function(h,c){var f=h._controlsVisibility;return f&&typeof f[c]!="undefined"?f[c]:this.visible},setVisibility:function(h){this.visible=h},positionHandler:function(h,c){var f=a.util.transformPoint({x:this.x*h.x+this.offsetX,y:this.y*h.y+this.offsetY},c);return f},calcCornerCoords:function(h,c,f,d,g){var m,p,v,y,b=g?this.touchSizeX:this.sizeX,x=g?this.touchSizeY:this.sizeY;if(b&&x&&b!==x){var w=Math.atan2(x,b),T=Math.sqrt(b*b+x*x)/2,_=w-a.util.degreesToRadians(h),E=Math.PI/2-w-a.util.degreesToRadians(h);m=T*a.util.cos(_),p=T*a.util.sin(_),v=T*a.util.cos(E),y=T*a.util.sin(E)}else{var k=b&&x?b:c;T=k*.7071067812;var _=a.util.degreesToRadians(45-h);m=v=T*a.util.cos(_),p=y=T*a.util.sin(_)}return{tl:{x:f-y,y:d-v},tr:{x:f+m,y:d-p},bl:{x:f-m,y:d+p},br:{x:f+y,y:d+v}}},render:function(h,c,f,d,g){switch(d=d||{},d.cornerStyle||g.cornerStyle){case"circle":a.controlsUtils.renderCircleControl.call(this,h,c,f,d,g);break;default:a.controlsUtils.renderSquareControl.call(this,h,c,f,d,g)}}}}(e),function(){function o(f,d){var g=f.getAttribute("style"),m=f.getAttribute("offset")||0,p,v,y,b;if(m=parseFloat(m)/(/%$/.test(m)?100:1),m=m<0?0:m>1?1:m,g){var x=g.split(/\s*;\s*/);for(x[x.length-1]===""&&x.pop(),b=x.length;b--;){var w=x[b].split(/\s*:\s*/),T=w[0].trim(),_=w[1].trim();T==="stop-color"?p=_:T==="stop-opacity"&&(y=_)}}return p||(p=f.getAttribute("stop-color")||"rgb(0,0,0)"),y||(y=f.getAttribute("stop-opacity")),p=new t.Color(p),v=p.getAlpha(),y=isNaN(parseFloat(y))?1:parseFloat(y),y*=v*d,{offset:m,color:p.toRgb(),opacity:y}}function a(f){return{x1:f.getAttribute("x1")||0,y1:f.getAttribute("y1")||0,x2:f.getAttribute("x2")||"100%",y2:f.getAttribute("y2")||0}}function l(f){return{x1:f.getAttribute("fx")||f.getAttribute("cx")||"50%",y1:f.getAttribute("fy")||f.getAttribute("cy")||"50%",r1:0,x2:f.getAttribute("cx")||"50%",y2:f.getAttribute("cy")||"50%",r2:f.getAttribute("r")||"50%"}}var h=t.util.object.clone;t.Gradient=t.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(f){f||(f={}),f.coords||(f.coords={});var d,g=this;Object.keys(f).forEach(function(m){g[m]=f[m]}),this.id?this.id+="_"+t.Object.__uid++:this.id=t.Object.__uid++,d={x1:f.coords.x1||0,y1:f.coords.y1||0,x2:f.coords.x2||0,y2:f.coords.y2||0},this.type==="radial"&&(d.r1=f.coords.r1||0,d.r2=f.coords.r2||0),this.coords=d,this.colorStops=f.colorStops.slice()},addColorStop:function(f){for(var d in f){var g=new t.Color(f[d]);this.colorStops.push({offset:parseFloat(d),color:g.toRgb(),opacity:g.getAlpha()})}return this},toObject:function(f){var d={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return t.util.populateWithProperties(this,d,f),d},toSVG:function(f,v){var g=h(this.coords,!0),m,p,v=v||{},y,b,x=h(this.colorStops,!0),w=g.r1>g.r2,T=this.gradientTransform?this.gradientTransform.concat():t.iMatrix.concat(),_=-this.offsetX,E=-this.offsetY,k=!!v.additionalTransform,z=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(x.sort(function(H,ue){return H.offset-ue.offset}),z==="objectBoundingBox"?(_/=f.width,E/=f.height):(_+=f.width/2,E+=f.height/2),f.type==="path"&&this.gradientUnits!=="percentage"&&(_-=f.pathOffset.x,E-=f.pathOffset.y),T[4]-=_,T[5]-=E,b='id="SVGID_'+this.id+'" gradientUnits="'+z+'"',b+=' gradientTransform="'+(k?v.additionalTransform+" ":"")+t.util.matrixToSVG(T)+'" ',this.type==="linear"?y=["<linearGradient ",b,' x1="',g.x1,'" y1="',g.y1,'" x2="',g.x2,'" y2="',g.y2,`">
`]:this.type==="radial"&&(y=["<radialGradient ",b,' cx="',w?g.x1:g.x2,'" cy="',w?g.y1:g.y2,'" r="',w?g.r1:g.r2,'" fx="',w?g.x2:g.x1,'" fy="',w?g.y2:g.y1,`">
`]),this.type==="radial"){if(w)for(x=x.concat(),x.reverse(),m=0,p=x.length;m<p;m++)x[m].offset=1-x[m].offset;var F=Math.min(g.r1,g.r2);if(F>0){var j=Math.max(g.r1,g.r2),K=F/j;for(m=0,p=x.length;m<p;m++)x[m].offset+=K*(1-x[m].offset)}}for(m=0,p=x.length;m<p;m++){var B=x[m];y.push("<stop ",'offset="',B.offset*100+"%",'" style="stop-color:',B.color,typeof B.opacity!="undefined"?";stop-opacity: "+B.opacity:";",`"/>
`)}return y.push(this.type==="linear"?`</linearGradient>
`:`</radialGradient>
`),y.join("")},toLive:function(f){var d,g=t.util.object.clone(this.coords),m,p;if(!!this.type){for(this.type==="linear"?d=f.createLinearGradient(g.x1,g.y1,g.x2,g.y2):this.type==="radial"&&(d=f.createRadialGradient(g.x1,g.y1,g.r1,g.x2,g.y2,g.r2)),m=0,p=this.colorStops.length;m<p;m++){var v=this.colorStops[m].color,y=this.colorStops[m].opacity,b=this.colorStops[m].offset;typeof y!="undefined"&&(v=new t.Color(v).setAlpha(y).toRgba()),d.addColorStop(b,v)}return d}}}),t.util.object.extend(t.Gradient,{fromElement:function(f,d,g,m){var p=parseFloat(g)/(/%$/.test(g)?100:1);p=p<0?0:p>1?1:p,isNaN(p)&&(p=1);var v=f.getElementsByTagName("stop"),y,b=f.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage",x=f.getAttribute("gradientTransform")||"",w=[],T,_,E=0,k=0,z;for(f.nodeName==="linearGradient"||f.nodeName==="LINEARGRADIENT"?(y="linear",T=a(f)):(y="radial",T=l(f)),_=v.length;_--;)w.push(o(v[_],p));z=t.parseTransformAttribute(x),c(d,T,m,b),b==="pixels"&&(E=-d.left,k=-d.top);var F=new t.Gradient({id:f.getAttribute("id"),type:y,coords:T,colorStops:w,gradientUnits:b,gradientTransform:z,offsetX:E,offsetY:k});return F}});function c(f,d,g,m){var p,v;Object.keys(d).forEach(function(y){p=d[y],p==="Infinity"?v=1:p==="-Infinity"?v=0:(v=parseFloat(d[y],10),typeof p=="string"&&/^(\d+\.\d+)%|(\d+)%$/.test(p)&&(v*=.01,m==="pixels"&&((y==="x1"||y==="x2"||y==="r2")&&(v*=g.viewBoxWidth||g.width),(y==="y1"||y==="y2")&&(v*=g.viewBoxHeight||g.height)))),d[y]=v})}}(),function(){var o=t.util.toFixed;t.Pattern=t.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(a,l){if(a||(a={}),this.id=t.Object.__uid++,this.setOptions(a),!a.source||a.source&&typeof a.source!="string"){l&&l(this);return}else{var h=this;this.source=t.util.createImage(),t.util.loadImage(a.source,function(c,f){h.source=c,l&&l(h,f)},null,this.crossOrigin)}},toObject:function(a){var l=t.Object.NUM_FRACTION_DIGITS,h,c;return typeof this.source.src=="string"?h=this.source.src:typeof this.source=="object"&&this.source.toDataURL&&(h=this.source.toDataURL()),c={type:"pattern",source:h,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:o(this.offsetX,l),offsetY:o(this.offsetY,l),patternTransform:this.patternTransform?this.patternTransform.concat():null},t.util.populateWithProperties(this,c,a),c},toSVG:function(a){var l=typeof this.source=="function"?this.source():this.source,h=l.width/a.width,c=l.height/a.height,f=this.offsetX/a.width,d=this.offsetY/a.height,g="";return(this.repeat==="repeat-x"||this.repeat==="no-repeat")&&(c=1,d&&(c+=Math.abs(d))),(this.repeat==="repeat-y"||this.repeat==="no-repeat")&&(h=1,f&&(h+=Math.abs(f))),l.src?g=l.src:l.toDataURL&&(g=l.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+f+'" y="'+d+'" width="'+h+'" height="'+c+`">
<image x="0" y="0" width="`+l.width+'" height="'+l.height+'" xlink:href="'+g+`"></image>
</pattern>
`},setOptions:function(a){for(var l in a)this[l]=a[l]},toLive:function(a){var l=this.source;return!l||typeof l.src!="undefined"&&(!l.complete||l.naturalWidth===0||l.naturalHeight===0)?"":a.createPattern(l,this.repeat)}})}(),function(o){var a=o.fabric||(o.fabric={}),l=a.util.toFixed;if(a.Shadow){a.warn("fabric.Shadow is already defined.");return}a.Shadow=a.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(h){typeof h=="string"&&(h=this._parseShadow(h));for(var c in h)this[c]=h[c];this.id=a.Object.__uid++},_parseShadow:function(h){var c=h.trim(),f=a.Shadow.reOffsetsAndBlur.exec(c)||[],d=c.replace(a.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:d.trim(),offsetX:parseFloat(f[1],10)||0,offsetY:parseFloat(f[2],10)||0,blur:parseFloat(f[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(h){var c=40,f=40,d=a.Object.NUM_FRACTION_DIGITS,g=a.util.rotateVector({x:this.offsetX,y:this.offsetY},a.util.degreesToRadians(-h.angle)),m=20,p=new a.Color(this.color);return h.width&&h.height&&(c=l((Math.abs(g.x)+this.blur)/h.width,d)*100+m,f=l((Math.abs(g.y)+this.blur)/h.height,d)*100+m),h.flipX&&(g.x*=-1),h.flipY&&(g.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+f+'%" height="'+(100+2*f)+'%" x="-'+c+'%" width="'+(100+2*c)+`%" >
	<feGaussianBlur in="SourceAlpha" stdDeviation="`+l(this.blur?this.blur/2:0,d)+`"></feGaussianBlur>
	<feOffset dx="`+l(g.x,d)+'" dy="'+l(g.y,d)+`" result="oBlur" ></feOffset>
	<feFlood flood-color="`+p.toRgb()+'" flood-opacity="'+p.getAlpha()+`"/>
	<feComposite in2="oBlur" operator="in" />
	<feMerge>
		<feMergeNode></feMergeNode>
		<feMergeNode in="SourceGraphic"></feMergeNode>
	</feMerge>
</filter>
`},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var h={},c=a.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(f){this[f]!==c[f]&&(h[f]=this[f])},this),h}}),a.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(e),function(){if(t.StaticCanvas){t.warn("fabric.StaticCanvas is already defined.");return}var o=t.util.object.extend,a=t.util.getElementOffset,l=t.util.removeFromArray,h=t.util.toFixed,c=t.util.transformPoint,f=t.util.invertTransform,d=t.util.getNodeCanvas,g=t.util.createCanvasElement,m=new Error("Could not initialize `canvas` element");t.StaticCanvas=t.util.createClass(t.CommonMethods,{initialize:function(p,v){v||(v={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(p,v)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:t.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(p,v){var y=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(p),this._initOptions(v),this.interactive||this._initRetinaScaling(),v.overlayImage&&this.setOverlayImage(v.overlayImage,y),v.backgroundImage&&this.setBackgroundImage(v.backgroundImage,y),v.backgroundColor&&this.setBackgroundColor(v.backgroundColor,y),v.overlayColor&&this.setOverlayColor(v.overlayColor,y),this.calcOffset()},_isRetinaScaling:function(){return t.devicePixelRatio!==1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?t.devicePixelRatio:1},_initRetinaScaling:function(){if(!!this._isRetinaScaling()){var p=t.devicePixelRatio;this.__initRetinaScaling(p,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(p,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(p,v,y){v.setAttribute("width",this.width*p),v.setAttribute("height",this.height*p),y.scale(p,p)},calcOffset:function(){return this._offset=a(this.lowerCanvasEl),this},setOverlayImage:function(p,v,y){return this.__setBgOverlayImage("overlayImage",p,v,y)},setBackgroundImage:function(p,v,y){return this.__setBgOverlayImage("backgroundImage",p,v,y)},setOverlayColor:function(p,v){return this.__setBgOverlayColor("overlayColor",p,v)},setBackgroundColor:function(p,v){return this.__setBgOverlayColor("backgroundColor",p,v)},__setBgOverlayImage:function(p,v,y,b){return typeof v=="string"?t.util.loadImage(v,function(x,w){if(x){var T=new t.Image(x,b);this[p]=T,T.canvas=this}y&&y(x,w)},this,b&&b.crossOrigin):(b&&v.setOptions(b),this[p]=v,v&&(v.canvas=this),y&&y(v,!1)),this},__setBgOverlayColor:function(p,v,y){return this[p]=v,this._initGradient(v,p),this._initPattern(v,p,y),this},_createCanvasElement:function(){var p=g();if(!p||(p.style||(p.style={}),typeof p.getContext=="undefined"))throw m;return p},_initOptions:function(p){var v=this.lowerCanvasEl;this._setOptions(p),this.width=this.width||parseInt(v.width,10)||0,this.height=this.height||parseInt(v.height,10)||0,!!this.lowerCanvasEl.style&&(v.width=this.width,v.height=this.height,v.style.width=this.width+"px",v.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(p){p&&p.getContext?this.lowerCanvasEl=p:this.lowerCanvasEl=t.util.getById(p)||this._createCanvasElement(),t.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(p,v){return this.setDimensions({width:p},v)},setHeight:function(p,v){return this.setDimensions({height:p},v)},setDimensions:function(p,v){var y;v=v||{};for(var b in p)y=p[b],v.cssOnly||(this._setBackstoreDimension(b,p[b]),y+="px",this.hasLostContext=!0),v.backstoreOnly||this._setCssDimension(b,y);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),v.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(p,v){return this.lowerCanvasEl[p]=v,this.upperCanvasEl&&(this.upperCanvasEl[p]=v),this.cacheCanvasEl&&(this.cacheCanvasEl[p]=v),this[p]=v,this},_setCssDimension:function(p,v){return this.lowerCanvasEl.style[p]=v,this.upperCanvasEl&&(this.upperCanvasEl.style[p]=v),this.wrapperEl&&(this.wrapperEl.style[p]=v),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(p){var v=this._activeObject,y=this.backgroundImage,b=this.overlayImage,x,w,T;for(this.viewportTransform=p,w=0,T=this._objects.length;w<T;w++)x=this._objects[w],x.group||x.setCoords(!0);return v&&v.setCoords(),y&&y.setCoords(!0),b&&b.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(p,v){var y=p,b=this.viewportTransform.slice(0);p=c(p,f(this.viewportTransform)),b[0]=v,b[3]=v;var x=c(p,b);return b[4]+=y.x-x.x,b[5]+=y.y-x.y,this.setViewportTransform(b)},setZoom:function(p){return this.zoomToPoint(new t.Point(0,0),p),this},absolutePan:function(p){var v=this.viewportTransform.slice(0);return v[4]=-p.x,v[5]=-p.y,this.setViewportTransform(v)},relativePan:function(p){return this.absolutePan(new t.Point(-p.x-this.viewportTransform[4],-p.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(p){this.stateful&&p.setupState(),p._set("canvas",this),p.setCoords(),this.fire("object:added",{target:p}),p.fire("added")},_onObjectRemoved:function(p){this.fire("object:removed",{target:p}),p.fire("removed"),delete p.canvas},clearContext:function(p){return p.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var p=this.contextContainer;return this.renderCanvas(p,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=t.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var p={},v=this.width,y=this.height,b=f(this.viewportTransform);return p.tl=c({x:0,y:0},b),p.br=c({x:v,y},b),p.tr=new t.Point(p.br.x,p.tl.y),p.bl=new t.Point(p.tl.x,p.br.y),this.vptCoords=p,p},cancelRequestedRender:function(){this.isRendering&&(t.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(p,v){var y=this.viewportTransform,b=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(p),t.util.setImageSmoothing(p,this.imageSmoothingEnabled),this.fire("before:render",{ctx:p}),this._renderBackground(p),p.save(),p.transform(y[0],y[1],y[2],y[3],y[4],y[5]),this._renderObjects(p,v),p.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(p),b&&(b.canvas=this,b.shouldCache(),b._transformDone=!0,b.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(p)),this._renderOverlay(p),this.controlsAboveOverlay&&this.interactive&&this.drawControls(p),this.fire("after:render",{ctx:p})},drawClipPathOnCanvas:function(p){var v=this.viewportTransform,y=this.clipPath;p.save(),p.transform(v[0],v[1],v[2],v[3],v[4],v[5]),p.globalCompositeOperation="destination-in",y.transform(p),p.scale(1/y.zoomX,1/y.zoomY),p.drawImage(y._cacheCanvas,-y.cacheTranslationX,-y.cacheTranslationY),p.restore()},_renderObjects:function(p,v){var y,b;for(y=0,b=v.length;y<b;++y)v[y]&&v[y].render(p)},_renderBackgroundOrOverlay:function(p,v){var y=this[v+"Color"],b=this[v+"Image"],x=this.viewportTransform,w=this[v+"Vpt"];if(!(!y&&!b)){if(y){p.save(),p.beginPath(),p.moveTo(0,0),p.lineTo(this.width,0),p.lineTo(this.width,this.height),p.lineTo(0,this.height),p.closePath(),p.fillStyle=y.toLive?y.toLive(p,this):y,w&&p.transform(x[0],x[1],x[2],x[3],x[4],x[5]),p.transform(1,0,0,1,y.offsetX||0,y.offsetY||0);var T=y.gradientTransform||y.patternTransform;T&&p.transform(T[0],T[1],T[2],T[3],T[4],T[5]),p.fill(),p.restore()}b&&(p.save(),w&&p.transform(x[0],x[1],x[2],x[3],x[4],x[5]),b.render(p),p.restore())}},_renderBackground:function(p){this._renderBackgroundOrOverlay(p,"background")},_renderOverlay:function(p){this._renderBackgroundOrOverlay(p,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},centerObjectH:function(p){return this._centerObject(p,new t.Point(this.getCenter().left,p.getCenterPoint().y))},centerObjectV:function(p){return this._centerObject(p,new t.Point(p.getCenterPoint().x,this.getCenter().top))},centerObject:function(p){var v=this.getCenter();return this._centerObject(p,new t.Point(v.left,v.top))},viewportCenterObject:function(p){var v=this.getVpCenter();return this._centerObject(p,v)},viewportCenterObjectH:function(p){var v=this.getVpCenter();return this._centerObject(p,new t.Point(v.x,p.getCenterPoint().y)),this},viewportCenterObjectV:function(p){var v=this.getVpCenter();return this._centerObject(p,new t.Point(p.getCenterPoint().x,v.y))},getVpCenter:function(){var p=this.getCenter(),v=f(this.viewportTransform);return c({x:p.left,y:p.top},v)},_centerObject:function(p,v){return p.setPositionByOrigin(v,"center","center"),p.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(p){return this.toDatalessObject(p)},toObject:function(p){return this._toObjectMethod("toObject",p)},toDatalessObject:function(p){return this._toObjectMethod("toDatalessObject",p)},_toObjectMethod:function(p,v){var y=this.clipPath,b={version:t.version,objects:this._toObjects(p,v)};return y&&!y.excludeFromExport&&(b.clipPath=this._toObject(this.clipPath,p,v)),o(b,this.__serializeBgOverlay(p,v)),t.util.populateWithProperties(this,b,v),b},_toObjects:function(p,v){return this._objects.filter(function(y){return!y.excludeFromExport}).map(function(y){return this._toObject(y,p,v)},this)},_toObject:function(p,v,y){var b;this.includeDefaultValues||(b=p.includeDefaultValues,p.includeDefaultValues=!1);var x=p[v](y);return this.includeDefaultValues||(p.includeDefaultValues=b),x},__serializeBgOverlay:function(p,v){var y={},b=this.backgroundImage,x=this.overlayImage,w=this.backgroundColor,T=this.overlayColor;return w&&w.toObject?w.excludeFromExport||(y.background=w.toObject(v)):w&&(y.background=w),T&&T.toObject?T.excludeFromExport||(y.overlay=T.toObject(v)):T&&(y.overlay=T),b&&!b.excludeFromExport&&(y.backgroundImage=this._toObject(b,p,v)),x&&!x.excludeFromExport&&(y.overlayImage=this._toObject(x,p,v)),y},svgViewportTransformation:!0,toSVG:function(p,v){p||(p={}),p.reviver=v;var y=[];return this._setSVGPreamble(y,p),this._setSVGHeader(y,p),this.clipPath&&y.push('<g clip-path="url(#'+this.clipPath.clipPathId+`)" >
`),this._setSVGBgOverlayColor(y,"background"),this._setSVGBgOverlayImage(y,"backgroundImage",v),this._setSVGObjects(y,v),this.clipPath&&y.push(`</g>
`),this._setSVGBgOverlayColor(y,"overlay"),this._setSVGBgOverlayImage(y,"overlayImage",v),y.push("</svg>"),y.join("")},_setSVGPreamble:function(p,v){v.suppressPreamble||p.push('<?xml version="1.0" encoding="',v.encoding||"UTF-8",`" standalone="no" ?>
`,'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ',`"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
`)},_setSVGHeader:function(p,v){var y=v.width||this.width,b=v.height||this.height,x,w='viewBox="0 0 '+this.width+" "+this.height+'" ',T=t.Object.NUM_FRACTION_DIGITS;v.viewBox?w='viewBox="'+v.viewBox.x+" "+v.viewBox.y+" "+v.viewBox.width+" "+v.viewBox.height+'" ':this.svgViewportTransformation&&(x=this.viewportTransform,w='viewBox="'+h(-x[4]/x[0],T)+" "+h(-x[5]/x[3],T)+" "+h(this.width/x[0],T)+" "+h(this.height/x[3],T)+'" '),p.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',y,'" ','height="',b,'" ',w,`xml:space="preserve">
`,"<desc>Created with Fabric.js ",t.version,`</desc>
`,`<defs>
`,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(v),`</defs>
`)},createSVGClipPathMarkup:function(p){var v=this.clipPath;return v?(v.clipPathId="CLIPPATH_"+t.Object.__uid++,'<clipPath id="'+v.clipPathId+`" >
`+this.clipPath.toClipPathSVG(p.reviver)+`</clipPath>
`):""},createSVGRefElementsMarkup:function(){var p=this,v=["background","overlay"].map(function(y){var b=p[y+"Color"];if(b&&b.toLive){var x=p[y+"Vpt"],w=p.viewportTransform,T={width:p.width/(x?w[0]:1),height:p.height/(x?w[3]:1)};return b.toSVG(T,{additionalTransform:x?t.util.matrixToSVG(w):""})}});return v.join("")},createSVGFontFacesMarkup:function(){var p="",v={},y,b,x,w,T,_,E,k,z,F=t.fontPaths,j=[];for(this._objects.forEach(function B(H){j.push(H),H._objects&&H._objects.forEach(B)}),k=0,z=j.length;k<z;k++)if(y=j[k],b=y.fontFamily,!(y.type.indexOf("text")===-1||v[b]||!F[b])&&(v[b]=!0,!!y.styles)){x=y.styles;for(T in x){w=x[T];for(E in w)_=w[E],b=_.fontFamily,!v[b]&&F[b]&&(v[b]=!0)}}for(var K in v)p+=[`		@font-face {
`,"			font-family: '",K,`';
`,"			src: url('",F[K],`');
`,`		}
`].join("");return p&&(p=['	<style type="text/css">',`<![CDATA[
`,p,"]]>",`</style>
`].join("")),p},_setSVGObjects:function(p,v){var y,b,x,w=this._objects;for(b=0,x=w.length;b<x;b++)y=w[b],!y.excludeFromExport&&this._setSVGObject(p,y,v)},_setSVGObject:function(p,v,y){p.push(v.toSVG(y))},_setSVGBgOverlayImage:function(p,v,y){this[v]&&!this[v].excludeFromExport&&this[v].toSVG&&p.push(this[v].toSVG(y))},_setSVGBgOverlayColor:function(p,v){var y=this[v+"Color"],b=this.viewportTransform,x=this.width,w=this.height;if(!!y)if(y.toLive){var T=y.repeat,_=t.util.invertTransform(b),E=this[v+"Vpt"],k=E?t.util.matrixToSVG(_):"";p.push('<rect transform="'+k+" translate(",x/2,",",w/2,')"',' x="',y.offsetX-x/2,'" y="',y.offsetY-w/2,'" ','width="',T==="repeat-y"||T==="no-repeat"?y.source.width:x,'" height="',T==="repeat-x"||T==="no-repeat"?y.source.height:w,'" fill="url(#SVGID_'+y.id+')"',`></rect>
`)}else p.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',y,'"',`></rect>
`)},sendToBack:function(p){if(!p)return this;var v=this._activeObject,y,b,x;if(p===v&&p.type==="activeSelection")for(x=v._objects,y=x.length;y--;)b=x[y],l(this._objects,b),this._objects.unshift(b);else l(this._objects,p),this._objects.unshift(p);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(p){if(!p)return this;var v=this._activeObject,y,b,x;if(p===v&&p.type==="activeSelection")for(x=v._objects,y=0;y<x.length;y++)b=x[y],l(this._objects,b),this._objects.push(b);else l(this._objects,p),this._objects.push(p);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(p,v){if(!p)return this;var y=this._activeObject,b,x,w,T,_,E=0;if(p===y&&p.type==="activeSelection")for(_=y._objects,b=0;b<_.length;b++)x=_[b],w=this._objects.indexOf(x),w>0+E&&(T=w-1,l(this._objects,x),this._objects.splice(T,0,x)),E++;else w=this._objects.indexOf(p),w!==0&&(T=this._findNewLowerIndex(p,w,v),l(this._objects,p),this._objects.splice(T,0,p));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(p,v,y){var b,x;if(y)for(b=v,x=v-1;x>=0;--x){var w=p.intersectsWithObject(this._objects[x])||p.isContainedWithinObject(this._objects[x])||this._objects[x].isContainedWithinObject(p);if(w){b=x;break}}else b=v-1;return b},bringForward:function(p,v){if(!p)return this;var y=this._activeObject,b,x,w,T,_,E=0;if(p===y&&p.type==="activeSelection")for(_=y._objects,b=_.length;b--;)x=_[b],w=this._objects.indexOf(x),w<this._objects.length-1-E&&(T=w+1,l(this._objects,x),this._objects.splice(T,0,x)),E++;else w=this._objects.indexOf(p),w!==this._objects.length-1&&(T=this._findNewUpperIndex(p,w,v),l(this._objects,p),this._objects.splice(T,0,p));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(p,v,y){var b,x,w;if(y)for(b=v,x=v+1,w=this._objects.length;x<w;++x){var T=p.intersectsWithObject(this._objects[x])||p.isContainedWithinObject(this._objects[x])||this._objects[x].isContainedWithinObject(p);if(T){b=x;break}}else b=v+1;return b},moveTo:function(p,v){return l(this._objects,p),this._objects.splice(v,0,p),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(t.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(p){p.dispose&&p.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),this.lowerCanvasEl.style=this._originalCanvasStyle,delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),t.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),o(t.StaticCanvas.prototype,t.Observable),o(t.StaticCanvas.prototype,t.Collection),o(t.StaticCanvas.prototype,t.DataURLExporter),o(t.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(p){var v=g();if(!v||!v.getContext)return null;var y=v.getContext("2d");if(!y)return null;switch(p){case"setLineDash":return typeof y.setLineDash!="undefined";default:return null}}}),t.StaticCanvas.prototype.toJSON=t.StaticCanvas.prototype.toObject,t.isLikelyNode&&(t.StaticCanvas.prototype.createPNGStream=function(){var p=d(this.lowerCanvasEl);return p&&p.createPNGStream()},t.StaticCanvas.prototype.createJPEGStream=function(p){var v=d(this.lowerCanvasEl);return v&&v.createJPEGStream(p)})}(),t.BaseBrush=t.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var o=this.canvas.contextTop;o.strokeStyle=this.color,o.lineWidth=this.width,o.lineCap=this.strokeLineCap,o.miterLimit=this.strokeMiterLimit,o.lineJoin=this.strokeLineJoin,o.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(o){var a=this.canvas.viewportTransform;o.save(),o.transform(a[0],a[1],a[2],a[3],a[4],a[5])},_setShadow:function(){if(!!this.shadow){var o=this.canvas,a=this.shadow,l=o.contextTop,h=o.getZoom();o&&o._isRetinaScaling()&&(h*=t.devicePixelRatio),l.shadowColor=a.color,l.shadowBlur=a.blur*h,l.shadowOffsetX=a.offsetX*h,l.shadowOffsetY=a.offsetY*h}},needsFullRender:function(){var o=new t.Color(this.color);return o.getAlpha()<1||!!this.shadow},_resetShadow:function(){var o=this.canvas.contextTop;o.shadowColor="",o.shadowBlur=o.shadowOffsetX=o.shadowOffsetY=0},_isOutSideCanvas:function(o){return o.x<0||o.x>this.canvas.getWidth()||o.y<0||o.y>this.canvas.getHeight()}}),function(){t.PencilBrush=t.util.createClass(t.BaseBrush,{decimate:.4,initialize:function(o){this.canvas=o,this._points=[]},_drawSegment:function(o,a,l){var h=a.midPointFrom(l);return o.quadraticCurveTo(a.x,a.y,h.x,h.y),h},onMouseDown:function(o,a){!this.canvas._isMainEvent(a.e)||(this._prepareForDrawing(o),this._captureDrawingPath(o),this._render())},onMouseMove:function(o,a){if(!!this.canvas._isMainEvent(a.e)&&!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(o))&&this._captureDrawingPath(o)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var l=this._points,h=l.length,c=this.canvas.contextTop;this._saveAndTransform(c),this.oldEnd&&(c.beginPath(),c.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(c,l[h-2],l[h-1],!0),c.stroke(),c.restore()}},onMouseUp:function(o){return this.canvas._isMainEvent(o.e)?(this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(o){var a=new t.Point(o.x,o.y);this._reset(),this._addPoint(a),this.canvas.contextTop.moveTo(a.x,a.y)},_addPoint:function(o){return this._points.length>1&&o.eq(this._points[this._points.length-1])?!1:(this._points.push(o),!0)},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(o){var a=new t.Point(o.x,o.y);return this._addPoint(a)},_render:function(){var o=this.canvas.contextTop,a,l,h=this._points[0],c=this._points[1];if(this._saveAndTransform(o),o.beginPath(),this._points.length===2&&h.x===c.x&&h.y===c.y){var f=this.width/1e3;h=new t.Point(h.x,h.y),c=new t.Point(c.x,c.y),h.x-=f,c.x+=f}for(o.moveTo(h.x,h.y),a=1,l=this._points.length;a<l;a++)this._drawSegment(o,h,c),h=this._points[a],c=this._points[a+1];o.lineTo(h.x,h.y),o.stroke(),o.restore()},convertPointsToSVGPath:function(o){var a=this.width/1e3;return t.util.getSmoothPathFromPoints(o,a)},_isEmptySVGPath:function(o){var a=t.util.joinPath(o);return a==="M 0 0 Q 0 0 0 0 L 0 0"},createPath:function(o){var a=new t.Path(o,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,a.shadow=new t.Shadow(this.shadow)),a},decimatePoints:function(o,a){if(o.length<=2)return o;var l=this.canvas.getZoom(),h=Math.pow(a/l,2),c,f=o.length-1,d=o[0],g=[d],m;for(c=1;c<f-1;c++)m=Math.pow(d.x-o[c].x,2)+Math.pow(d.y-o[c].y,2),m>=h&&(d=o[c],g.push(d));return g.push(o[f]),g},_finalizeAndAddPath:function(){var o=this.canvas.contextTop;o.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var a=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(a)){this.canvas.requestRenderAll();return}var l=this.createPath(a);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:l}),this.canvas.add(l),this.canvas.requestRenderAll(),l.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:l})}})}(),t.CircleBrush=t.util.createClass(t.BaseBrush,{width:10,initialize:function(o){this.canvas=o,this.points=[]},drawDot:function(o){var a=this.addPoint(o),l=this.canvas.contextTop;this._saveAndTransform(l),this.dot(l,a),l.restore()},dot:function(o,a){o.fillStyle=a.fill,o.beginPath(),o.arc(a.x,a.y,a.radius,0,Math.PI*2,!1),o.closePath(),o.fill()},onMouseDown:function(o){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(o)},_render:function(){var o=this.canvas.contextTop,a,l,h=this.points;for(this._saveAndTransform(o),a=0,l=h.length;a<l;a++)this.dot(o,h[a]);o.restore()},onMouseMove:function(o){this.limitedToCanvasSize===!0&&this._isOutSideCanvas(o)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(o),this._render()):this.drawDot(o))},onMouseUp:function(){var o=this.canvas.renderOnAddRemove,a,l;this.canvas.renderOnAddRemove=!1;var h=[];for(a=0,l=this.points.length;a<l;a++){var c=this.points[a],f=new t.Circle({radius:c.radius,left:c.x,top:c.y,originX:"center",originY:"center",fill:c.fill});this.shadow&&(f.shadow=new t.Shadow(this.shadow)),h.push(f)}var d=new t.Group(h);d.canvas=this.canvas,this.canvas.fire("before:path:created",{path:d}),this.canvas.add(d),this.canvas.fire("path:created",{path:d}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=o,this.canvas.requestRenderAll()},addPoint:function(o){var a=new t.Point(o.x,o.y),l=t.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,h=new t.Color(this.color).setAlpha(t.util.getRandomInt(0,100)/100).toRgba();return a.radius=l,a.fill=h,this.points.push(a),a}}),t.SprayBrush=t.util.createClass(t.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(o){this.canvas=o,this.sprayChunks=[]},onMouseDown:function(o){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(o),this.render(this.sprayChunkPoints)},onMouseMove:function(o){this.limitedToCanvasSize===!0&&this._isOutSideCanvas(o)||(this.addSprayChunk(o),this.render(this.sprayChunkPoints))},onMouseUp:function(){var o=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var a=[],l=0,h=this.sprayChunks.length;l<h;l++)for(var c=this.sprayChunks[l],f=0,d=c.length;f<d;f++){var g=new t.Rect({width:c[f].width,height:c[f].width,left:c[f].x+1,top:c[f].y+1,originX:"center",originY:"center",fill:this.color});a.push(g)}this.optimizeOverlapping&&(a=this._getOptimizedRects(a));var m=new t.Group(a);this.shadow&&m.set("shadow",new t.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:m}),this.canvas.add(m),this.canvas.fire("path:created",{path:m}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=o,this.canvas.requestRenderAll()},_getOptimizedRects:function(o){var a={},l,h,c;for(h=0,c=o.length;h<c;h++)l=o[h].left+""+o[h].top,a[l]||(a[l]=o[h]);var f=[];for(l in a)f.push(a[l]);return f},render:function(o){var a=this.canvas.contextTop,l,h;for(a.fillStyle=this.color,this._saveAndTransform(a),l=0,h=o.length;l<h;l++){var c=o[l];typeof c.opacity!="undefined"&&(a.globalAlpha=c.opacity),a.fillRect(c.x,c.y,c.width,c.width)}a.restore()},_render:function(){var o=this.canvas.contextTop,a,l;for(o.fillStyle=this.color,this._saveAndTransform(o),a=0,l=this.sprayChunks.length;a<l;a++)this.render(this.sprayChunks[a]);o.restore()},addSprayChunk:function(o){this.sprayChunkPoints=[];var a,l,h,c=this.width/2,f;for(f=0;f<this.density;f++){a=t.util.getRandomInt(o.x-c,o.x+c),l=t.util.getRandomInt(o.y-c,o.y+c),this.dotWidthVariance?h=t.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):h=this.dotWidth;var d=new t.Point(a,l);d.width=h,this.randomOpacity&&(d.opacity=t.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(d)}this.sprayChunks.push(this.sprayChunkPoints)}}),t.PatternBrush=t.util.createClass(t.PencilBrush,{getPatternSrc:function(){var o=20,a=5,l=t.util.createCanvasElement(),h=l.getContext("2d");return l.width=l.height=o+a,h.fillStyle=this.color,h.beginPath(),h.arc(o/2,o/2,o/2,0,Math.PI*2,!1),h.closePath(),h.fill(),l},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(o){var a=this.callSuper("createPath",o),l=a._getLeftTopCoords().scalarAdd(a.strokeWidth/2);return a.stroke=new t.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-l.x,offsetY:-l.y}),a}}),function(){var o=t.util.getPointer,a=t.util.degreesToRadians,l=t.util.isTouchEvent;t.Canvas=t.util.createClass(t.StaticCanvas,{initialize:function(c,f){f||(f={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(c,f),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",rotationCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=t.PencilBrush&&new t.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var c=this.getActiveObjects(),f,d,g;if(c.length>0&&!this.preserveObjectStacking){d=[],g=[];for(var m=0,p=this._objects.length;m<p;m++)f=this._objects[m],c.indexOf(f)===-1?d.push(f):g.push(f);c.length>1&&(this._activeObject._objects=g),d.push.apply(d,g)}else d=this._objects;return d},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var c=this.contextContainer;return this.renderCanvas(c,this._chooseObjectsToRender()),this},renderTopLayer:function(c){c.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(c),this.contextTopDirty=!0),c.restore()},renderTop:function(){var c=this.contextTop;return this.clearContext(c),this.renderTopLayer(c),this.fire("after:render"),this},_normalizePointer:function(c,f){var d=c.calcTransformMatrix(),g=t.util.invertTransform(d),m=this.restorePointerVpt(f);return t.util.transformPoint(m,g)},isTargetTransparent:function(c,f,d){if(c.shouldCache()&&c._cacheCanvas&&c!==this._activeObject){var g=this._normalizePointer(c,{x:f,y:d}),m=Math.max(c.cacheTranslationX+g.x*c.zoomX,0),p=Math.max(c.cacheTranslationY+g.y*c.zoomY,0),x=t.util.isTransparent(c._cacheContext,Math.round(m),Math.round(p),this.targetFindTolerance);return x}var v=this.contextCache,y=c.selectionBackgroundColor,b=this.viewportTransform;c.selectionBackgroundColor="",this.clearContext(v),v.save(),v.transform(b[0],b[1],b[2],b[3],b[4],b[5]),c.render(v),v.restore(),c.selectionBackgroundColor=y;var x=t.util.isTransparent(v,f,d,this.targetFindTolerance);return x},_isSelectionKeyPressed:function(c){var f=!1;return Object.prototype.toString.call(this.selectionKey)==="[object Array]"?f=!!this.selectionKey.find(function(d){return c[d]===!0}):f=c[this.selectionKey],f},_shouldClearSelection:function(c,f){var d=this.getActiveObjects(),g=this._activeObject;return!f||f&&g&&d.length>1&&d.indexOf(f)===-1&&g!==f&&!this._isSelectionKeyPressed(c)||f&&!f.evented||f&&!f.selectable&&g&&g!==f},_shouldCenterTransform:function(c,f,d){if(!!c){var g;return f==="scale"||f==="scaleX"||f==="scaleY"||f==="resizing"?g=this.centeredScaling||c.centeredScaling:f==="rotate"&&(g=this.centeredRotation||c.centeredRotation),g?!d:d}},_getOriginFromCorner:function(c,f){var d={x:c.originX,y:c.originY};return f==="ml"||f==="tl"||f==="bl"?d.x="right":(f==="mr"||f==="tr"||f==="br")&&(d.x="left"),f==="tl"||f==="mt"||f==="tr"?d.y="bottom":(f==="bl"||f==="mb"||f==="br")&&(d.y="top"),d},_getActionFromCorner:function(c,f,d,g){if(!f||!c)return"drag";var m=g.controls[f];return m.getActionName(d,m,g)},_setupCurrentTransform:function(c,f,d){if(!!f){var g=this.getPointer(c),m=f.__corner,p=f.controls[m],v=d&&m?p.getActionHandler(c,f,p):t.controlsUtils.dragHandler,y=this._getActionFromCorner(d,m,c,f),b=this._getOriginFromCorner(f,m),x=c[this.centeredKey],w={target:f,action:y,actionHandler:v,corner:m,scaleX:f.scaleX,scaleY:f.scaleY,skewX:f.skewX,skewY:f.skewY,offsetX:g.x-f.left,offsetY:g.y-f.top,originX:b.x,originY:b.y,ex:g.x,ey:g.y,lastX:g.x,lastY:g.y,theta:a(f.angle),width:f.width*f.scaleX,shiftKey:c.shiftKey,altKey:x,original:t.util.saveObjectTransform(f)};this._shouldCenterTransform(f,y,x)&&(w.originX="center",w.originY="center"),w.original.originX=b.x,w.original.originY=b.y,this._currentTransform=w,this._beforeTransform(c)}},setCursor:function(c){this.upperCanvasEl.style.cursor=c},_drawSelection:function(c){var f=this._groupSelector,d=new t.Point(f.ex,f.ey),g=t.util.transformPoint(d,this.viewportTransform),m=new t.Point(f.ex+f.left,f.ey+f.top),p=t.util.transformPoint(m,this.viewportTransform),v=Math.min(g.x,p.x),y=Math.min(g.y,p.y),b=Math.max(g.x,p.x),x=Math.max(g.y,p.y),w=this.selectionLineWidth/2;this.selectionColor&&(c.fillStyle=this.selectionColor,c.fillRect(v,y,b-v,x-y)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(c.lineWidth=this.selectionLineWidth,c.strokeStyle=this.selectionBorderColor,v+=w,y+=w,b-=w,x-=w,t.Object.prototype._setLineDash.call(this,c,this.selectionDashArray),c.strokeRect(v,y,b-v,x-y))},findTarget:function(c,f){if(!this.skipTargetFind){var d=!0,g=this.getPointer(c,d),m=this._activeObject,p=this.getActiveObjects(),v,y,b=l(c),x=p.length>1&&!f||p.length===1;if(this.targets=[],x&&m._findTargetCorner(g,b)||p.length>1&&!f&&m===this._searchPossibleTargets([m],g))return m;if(p.length===1&&m===this._searchPossibleTargets([m],g))if(this.preserveObjectStacking)v=m,y=this.targets,this.targets=[];else return m;var w=this._searchPossibleTargets(this._objects,g);return c[this.altSelectionKey]&&w&&v&&w!==v&&(w=v,this.targets=y),w}},_checkTarget:function(c,f,d){if(f&&f.visible&&f.evented&&f.containsPoint(c))if((this.perPixelTargetFind||f.perPixelTargetFind)&&!f.isEditing){var g=this.isTargetTransparent(f,d.x,d.y);if(!g)return!0}else return!0},_searchPossibleTargets:function(c,f){for(var d,g=c.length,m;g--;){var p=c[g],v=p.group?this._normalizePointer(p.group,f):f;if(this._checkTarget(v,p,f)){d=c[g],d.subTargetCheck&&d instanceof t.Group&&(m=this._searchPossibleTargets(d._objects,f),m&&this.targets.push(m));break}}return d},restorePointerVpt:function(c){return t.util.transformPoint(c,t.util.invertTransform(this.viewportTransform))},getPointer:function(c,f){if(this._absolutePointer&&!f)return this._absolutePointer;if(this._pointer&&f)return this._pointer;var d=o(c),g=this.upperCanvasEl,m=g.getBoundingClientRect(),p=m.width||0,v=m.height||0,y;(!p||!v)&&("top"in m&&"bottom"in m&&(v=Math.abs(m.top-m.bottom)),"right"in m&&"left"in m&&(p=Math.abs(m.right-m.left))),this.calcOffset(),d.x=d.x-this._offset.left,d.y=d.y-this._offset.top,f||(d=this.restorePointerVpt(d));var b=this.getRetinaScaling();return b!==1&&(d.x/=b,d.y/=b),p===0||v===0?y={width:1,height:1}:y={width:g.width/p,height:g.height/v},{x:d.x*y.width,y:d.y*y.height}},_createUpperCanvas:function(){var c=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),f=this.lowerCanvasEl,d=this.upperCanvasEl;d?d.className="":(d=this._createCanvasElement(),this.upperCanvasEl=d),t.util.addClass(d,"upper-canvas "+c),this.wrapperEl.appendChild(d),this._copyCanvasStyle(f,d),this._applyCanvasStyle(d),this.contextTop=d.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=t.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),t.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),t.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(c){var f=this.width||c.width,d=this.height||c.height;t.util.setStyle(c,{position:"absolute",width:f+"px",height:d+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),c.width=f,c.height=d,t.util.makeElementUnselectable(c)},_copyCanvasStyle:function(c,f){f.style.cssText=c.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var c=this._activeObject;return c?c.type==="activeSelection"&&c._objects?c._objects.slice(0):[c]:[]},_onObjectRemoved:function(c){c===this._activeObject&&(this.fire("before:selection:cleared",{target:c}),this._discardActiveObject(),this.fire("selection:cleared",{target:c}),c.fire("deselected")),c===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",c)},_fireSelectionEvents:function(c,f){var d=!1,g=this.getActiveObjects(),m=[],p=[];c.forEach(function(v){g.indexOf(v)===-1&&(d=!0,v.fire("deselected",{e:f,target:v}),p.push(v))}),g.forEach(function(v){c.indexOf(v)===-1&&(d=!0,v.fire("selected",{e:f,target:v}),m.push(v))}),c.length>0&&g.length>0?d&&this.fire("selection:updated",{e:f,selected:m,deselected:p,updated:m[0]||p[0],target:this._activeObject}):g.length>0?this.fire("selection:created",{e:f,selected:m,target:this._activeObject}):c.length>0&&this.fire("selection:cleared",{e:f,deselected:p})},setActiveObject:function(c,f){var d=this.getActiveObjects();return this._setActiveObject(c,f),this._fireSelectionEvents(d,f),this},_setActiveObject:function(c,f){return this._activeObject===c||!this._discardActiveObject(f,c)||c.onSelect({e:f})?!1:(this._activeObject=c,!0)},_discardActiveObject:function(c,f){var d=this._activeObject;if(d){if(d.onDeselect({e:c,object:f}))return!1;this._activeObject=null}return!0},discardActiveObject:function(c){var f=this.getActiveObjects(),d=this.getActiveObject();return f.length&&this.fire("before:selection:cleared",{target:d,e:c}),this._discardActiveObject(c),this._fireSelectionEvents(f,c),this},dispose:function(){var c=this.wrapperEl;return this.removeListeners(),c.removeChild(this.upperCanvasEl),c.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(f){t.util.cleanUpJsdomNode(this[f]),this[f]=void 0}.bind(this)),c.parentNode&&c.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,t.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(c){var f=this._activeObject;f&&f._renderControls(c)},_toObject:function(c,f,d){var g=this._realizeGroupTransformOnObject(c),m=this.callSuper("_toObject",c,f,d);return this._unwindGroupTransformOnObject(c,g),m},_realizeGroupTransformOnObject:function(c){if(c.group&&c.group.type==="activeSelection"&&this._activeObject===c.group){var f=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],d={};return f.forEach(function(g){d[g]=c[g]}),t.util.addTransformToObject(c,this._activeObject.calcOwnMatrix()),d}else return null},_unwindGroupTransformOnObject:function(c,f){f&&c.set(f)},_setSVGObject:function(c,f,d){var g=this._realizeGroupTransformOnObject(f);this.callSuper("_setSVGObject",c,f,d),this._unwindGroupTransformOnObject(f,g)},setViewportTransform:function(c){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),t.StaticCanvas.prototype.setViewportTransform.call(this,c)}});for(var h in t.StaticCanvas)h!=="prototype"&&(t.Canvas[h]=t.StaticCanvas[h])}(),function(){var o=t.util.addListener,a=t.util.removeListener,l=3,h=2,c=1,f={passive:!1};function d(g,m){return g.button&&g.button===m-1}t.util.object.extend(t.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(o,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(g,m){var p=this.upperCanvasEl,v=this._getEventPrefix();g(t.window,"resize",this._onResize),g(p,v+"down",this._onMouseDown),g(p,v+"move",this._onMouseMove,f),g(p,v+"out",this._onMouseOut),g(p,v+"enter",this._onMouseEnter),g(p,"wheel",this._onMouseWheel),g(p,"contextmenu",this._onContextMenu),g(p,"dblclick",this._onDoubleClick),g(p,"dragover",this._onDragOver),g(p,"dragenter",this._onDragEnter),g(p,"dragleave",this._onDragLeave),g(p,"drop",this._onDrop),this.enablePointerEvents||g(p,"touchstart",this._onTouchStart,f),typeof eventjs!="undefined"&&m in eventjs&&(eventjs[m](p,"gesture",this._onGesture),eventjs[m](p,"drag",this._onDrag),eventjs[m](p,"orientation",this._onOrientationChange),eventjs[m](p,"shake",this._onShake),eventjs[m](p,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(a,"remove");var g=this._getEventPrefix();a(t.document,g+"up",this._onMouseUp),a(t.document,"touchend",this._onTouchEnd,f),a(t.document,g+"move",this._onMouseMove,f),a(t.document,"touchmove",this._onMouseMove,f)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(g,m){this.__onTransformGesture&&this.__onTransformGesture(g,m)},_onDrag:function(g,m){this.__onDrag&&this.__onDrag(g,m)},_onMouseWheel:function(g){this.__onMouseWheel(g)},_onMouseOut:function(g){var m=this._hoveredTarget;this.fire("mouse:out",{target:m,e:g}),this._hoveredTarget=null,m&&m.fire("mouseout",{e:g});var p=this;this._hoveredTargets.forEach(function(v){p.fire("mouse:out",{target:m,e:g}),v&&m.fire("mouseout",{e:g})}),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach(function(v){v.isEditing&&v.hiddenTextarea.focus()})},_onMouseEnter:function(g){!this._currentTransform&&!this.findTarget(g)&&(this.fire("mouse:over",{target:null,e:g}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(g,m){this.__onOrientationChange&&this.__onOrientationChange(g,m)},_onShake:function(g,m){this.__onShake&&this.__onShake(g,m)},_onLongPress:function(g,m){this.__onLongPress&&this.__onLongPress(g,m)},_onDragOver:function(g){g.preventDefault();var m=this._simpleEventHandler("dragover",g);this._fireEnterLeaveEvents(m,g)},_onContextMenu:function(g){return this.stopContextMenu&&(g.stopPropagation(),g.preventDefault()),!1},_onDoubleClick:function(g){this._cacheTransformEventData(g),this._handleEvent(g,"dblclick"),this._resetTransformEventData(g)},getPointerId:function(g){var m=g.changedTouches;return m?m[0]&&m[0].identifier:this.enablePointerEvents?g.pointerId:-1},_isMainEvent:function(g){return g.isPrimary===!0?!0:g.isPrimary===!1?!1:g.type==="touchend"&&g.touches.length===0?!0:g.changedTouches?g.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(g){g.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(g)),this.__onMouseDown(g),this._resetTransformEventData();var m=this.upperCanvasEl,p=this._getEventPrefix();o(t.document,"touchend",this._onTouchEnd,f),o(t.document,"touchmove",this._onMouseMove,f),a(m,p+"down",this._onMouseDown)},_onMouseDown:function(g){this.__onMouseDown(g),this._resetTransformEventData();var m=this.upperCanvasEl,p=this._getEventPrefix();a(m,p+"move",this._onMouseMove,f),o(t.document,p+"up",this._onMouseUp),o(t.document,p+"move",this._onMouseMove,f)},_onTouchEnd:function(g){if(!(g.touches.length>0)){this.__onMouseUp(g),this._resetTransformEventData(),this.mainTouchId=null;var m=this._getEventPrefix();a(t.document,"touchend",this._onTouchEnd,f),a(t.document,"touchmove",this._onMouseMove,f);var p=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){o(p.upperCanvasEl,m+"down",p._onMouseDown),p._willAddMouseDown=0},400)}},_onMouseUp:function(g){this.__onMouseUp(g),this._resetTransformEventData();var m=this.upperCanvasEl,p=this._getEventPrefix();this._isMainEvent(g)&&(a(t.document,p+"up",this._onMouseUp),a(t.document,p+"move",this._onMouseMove,f),o(m,p+"move",this._onMouseMove,f))},_onMouseMove:function(g){!this.allowTouchScrolling&&g.preventDefault&&g.preventDefault(),this.__onMouseMove(g)},_onResize:function(){this.calcOffset()},_shouldRender:function(g){var m=this._activeObject;return!!m!=!!g||m&&g&&m!==g?!0:(m&&m.isEditing,!1)},__onMouseUp:function(g){var m,p=this._currentTransform,v=this._groupSelector,y=!1,b=!v||v.left===0&&v.top===0;if(this._cacheTransformEventData(g),m=this._target,this._handleEvent(g,"up:before"),d(g,l)){this.fireRightClick&&this._handleEvent(g,"up",l,b);return}if(d(g,h)){this.fireMiddleClick&&this._handleEvent(g,"up",h,b),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(g);return}if(!!this._isMainEvent(g)){if(p&&(this._finalizeCurrentTransform(g),y=p.actionPerformed),!b){var x=m===this._activeObject;this._maybeGroupObjects(g),y||(y=this._shouldRender(m)||!x&&m===this._activeObject)}if(m){if(m.selectable&&m!==this._activeObject&&m.activeOn==="up")this.setActiveObject(m,g),y=!0;else{var w=m._findTargetCorner(this.getPointer(g,!0),t.util.isTouchEvent(g)),T=m.controls[w],_=T&&T.getMouseUpHandler(g,m,T);if(_){var E=this.getPointer(g);_(g,p,E.x,E.y)}}m.isMoving=!1}this._setCursorFromEvent(g,m),this._handleEvent(g,"up",c,b),this._groupSelector=null,this._currentTransform=null,m&&(m.__corner=0),y?this.requestRenderAll():b||this.renderTop()}},_simpleEventHandler:function(g,m){var p=this.findTarget(m),v=this.targets,y={e:m,target:p,subTargets:v};if(this.fire(g,y),p&&p.fire(g,y),!v)return p;for(var b=0;b<v.length;b++)v[b].fire(g,y);return p},_handleEvent:function(g,m,p,v){var y=this._target,b=this.targets||[],x={e:g,target:y,subTargets:b,button:p||c,isClick:v||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};m==="up"&&(x.currentTarget=this.findTarget(g),x.currentSubTargets=this.targets),this.fire("mouse:"+m,x),y&&y.fire("mouse"+m,x);for(var w=0;w<b.length;w++)b[w].fire("mouse"+m,x)},_finalizeCurrentTransform:function(g){var m=this._currentTransform,p=m.target,v,y={e:g,target:p,transform:m,action:m.action};p._scaling&&(p._scaling=!1),p.setCoords(),(m.actionPerformed||this.stateful&&p.hasStateChanged())&&(m.actionPerformed&&(v=this._addEventOptions(y,m),this._fire(v,y)),this._fire("modified",y))},_addEventOptions:function(g,m){var p,v;switch(m.action){case"scaleX":p="scaled",v="x";break;case"scaleY":p="scaled",v="y";break;case"skewX":p="skewed",v="x";break;case"skewY":p="skewed",v="y";break;case"scale":p="scaled",v="equally";break;case"rotate":p="rotated";break;case"drag":p="moved";break}return g.by=v,p},_onMouseDownInDrawingMode:function(g){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(g).requestRenderAll();var m=this.getPointer(g);this.freeDrawingBrush.onMouseDown(m,{e:g,pointer:m}),this._handleEvent(g,"down")},_onMouseMoveInDrawingMode:function(g){if(this._isCurrentlyDrawing){var m=this.getPointer(g);this.freeDrawingBrush.onMouseMove(m,{e:g,pointer:m})}this.setCursor(this.freeDrawingCursor),this._handleEvent(g,"move")},_onMouseUpInDrawingMode:function(g){var m=this.getPointer(g);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:g,pointer:m}),this._handleEvent(g,"up")},__onMouseDown:function(g){this._cacheTransformEventData(g),this._handleEvent(g,"down:before");var m=this._target;if(d(g,l)){this.fireRightClick&&this._handleEvent(g,"down",l);return}if(d(g,h)){this.fireMiddleClick&&this._handleEvent(g,"down",h);return}if(this.isDrawingMode){this._onMouseDownInDrawingMode(g);return}if(!!this._isMainEvent(g)&&!this._currentTransform){var p=this._pointer;this._previousPointer=p;var v=this._shouldRender(m),y=this._shouldGroup(g,m);if(this._shouldClearSelection(g,m)?this.discardActiveObject(g):y&&(this._handleGrouping(g,m),m=this._activeObject),this.selection&&(!m||!m.selectable&&!m.isEditing&&m!==this._activeObject)&&(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),m){var b=m===this._activeObject;m.selectable&&m.activeOn==="down"&&this.setActiveObject(m,g);var x=m._findTargetCorner(this.getPointer(g,!0),t.util.isTouchEvent(g));if(m.__corner=x,m===this._activeObject&&(x||!y)){this._setupCurrentTransform(g,m,b);var w=m.controls[x],p=this.getPointer(g),T=w&&w.getMouseDownHandler(g,m,w);T&&T(g,this._currentTransform,p.x,p.y)}}this._handleEvent(g,"down"),(v||y)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(g){this._resetTransformEventData(),this._pointer=this.getPointer(g,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(g)||null},_beforeTransform:function(g){var m=this._currentTransform;this.stateful&&m.target.saveState(),this.fire("before:transform",{e:g,transform:m})},__onMouseMove:function(g){this._handleEvent(g,"move:before"),this._cacheTransformEventData(g);var m,p;if(this.isDrawingMode){this._onMouseMoveInDrawingMode(g);return}if(!!this._isMainEvent(g)){var v=this._groupSelector;v?(p=this._absolutePointer,v.left=p.x-v.ex,v.top=p.y-v.ey,this.renderTop()):this._currentTransform?this._transformObject(g):(m=this.findTarget(g)||null,this._setCursorFromEvent(g,m),this._fireOverOutEvents(m,g)),this._handleEvent(g,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(g,m){var p=this._hoveredTarget,v=this._hoveredTargets,y=this.targets,b=Math.max(v.length,y.length);this.fireSyntheticInOutEvents(g,m,{oldTarget:p,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var x=0;x<b;x++)this.fireSyntheticInOutEvents(y[x],m,{oldTarget:v[x],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=g,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(g,m){var p=this._draggedoverTarget,v=this._hoveredTargets,y=this.targets,b=Math.max(v.length,y.length);this.fireSyntheticInOutEvents(g,m,{oldTarget:p,evtOut:"dragleave",evtIn:"dragenter"});for(var x=0;x<b;x++)this.fireSyntheticInOutEvents(y[x],m,{oldTarget:v[x],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=g},fireSyntheticInOutEvents:function(g,m,p){var v,y,b=p.oldTarget,x,w,T=b!==g,_=p.canvasEvtIn,E=p.canvasEvtOut;T&&(v={e:m,target:g,previousTarget:b},y={e:m,target:b,nextTarget:g}),w=g&&T,x=b&&T,x&&(E&&this.fire(E,y),b.fire(p.evtOut,y)),w&&(_&&this.fire(_,v),g.fire(p.evtIn,v))},__onMouseWheel:function(g){this._cacheTransformEventData(g),this._handleEvent(g,"wheel"),this._resetTransformEventData()},_transformObject:function(g){var m=this.getPointer(g),p=this._currentTransform;p.reset=!1,p.shiftKey=g.shiftKey,p.altKey=g[this.centeredKey],this._performTransformAction(g,p,m),p.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(g,m,p){var v=p.x,y=p.y,b=m.action,x=!1,w=m.actionHandler;w&&(x=w(g,m,v,y)),b==="drag"&&x&&(m.target.isMoving=!0,this.setCursor(m.target.moveCursor||this.moveCursor)),m.actionPerformed=m.actionPerformed||x},_fire:t.controlsUtils.fireEvent,_setCursorFromEvent:function(g,m){if(!m)return this.setCursor(this.defaultCursor),!1;var p=m.hoverCursor||this.hoverCursor,v=this._activeObject&&this._activeObject.type==="activeSelection"?this._activeObject:null,y=(!v||!v.contains(m))&&m._findTargetCorner(this.getPointer(g,!0));y?this.setCursor(this.getCornerCursor(y,m,g)):(m.subTargetCheck&&this.targets.concat().reverse().map(function(b){p=b.hoverCursor||p}),this.setCursor(p))},getCornerCursor:function(g,m,p){var v=m.controls[g];return v.cursorStyleHandler(p,v,m)}})}(),function(){var o=Math.min,a=Math.max;t.util.object.extend(t.Canvas.prototype,{_shouldGroup:function(l,h){var c=this._activeObject;return c&&this._isSelectionKeyPressed(l)&&h&&h.selectable&&this.selection&&(c!==h||c.type==="activeSelection")&&!h.onSelect({e:l})},_handleGrouping:function(l,h){var c=this._activeObject;c.__corner||h===c&&(h=this.findTarget(l,!0),!h||!h.selectable)||(c&&c.type==="activeSelection"?this._updateActiveSelection(h,l):this._createActiveSelection(h,l))},_updateActiveSelection:function(l,h){var c=this._activeObject,f=c._objects.slice(0);c.contains(l)?(c.removeWithUpdate(l),this._hoveredTarget=l,this._hoveredTargets=this.targets.concat(),c.size()===1&&this._setActiveObject(c.item(0),h)):(c.addWithUpdate(l),this._hoveredTarget=c,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(f,h)},_createActiveSelection:function(l,h){var c=this.getActiveObjects(),f=this._createGroup(l);this._hoveredTarget=f,this._setActiveObject(f,h),this._fireSelectionEvents(c,h)},_createGroup:function(l){var h=this._objects,c=h.indexOf(this._activeObject)<h.indexOf(l),f=c?[this._activeObject,l]:[l,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new t.ActiveSelection(f,{canvas:this})},_groupSelectedObjects:function(l){var h=this._collectObjects(l),c;h.length===1?this.setActiveObject(h[0],l):h.length>1&&(c=new t.ActiveSelection(h.reverse(),{canvas:this}),this.setActiveObject(c,l))},_collectObjects:function(l){for(var h=[],c,f=this._groupSelector.ex,d=this._groupSelector.ey,g=f+this._groupSelector.left,m=d+this._groupSelector.top,p=new t.Point(o(f,g),o(d,m)),v=new t.Point(a(f,g),a(d,m)),y=!this.selectionFullyContained,b=f===g&&d===m,x=this._objects.length;x--&&(c=this._objects[x],!(!(!c||!c.selectable||!c.visible)&&(y&&c.intersectsWithRect(p,v,!0)||c.isContainedWithinRect(p,v,!0)||y&&c.containsPoint(p,null,!0)||y&&c.containsPoint(v,null,!0))&&(h.push(c),b))););return h.length>1&&(h=h.filter(function(w){return!w.onSelect({e:l})})),h},_maybeGroupObjects:function(l){this.selection&&this._groupSelector&&this._groupSelectedObjects(l),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){t.util.object.extend(t.StaticCanvas.prototype,{toDataURL:function(o){o||(o={});var a=o.format||"png",l=o.quality||1,h=(o.multiplier||1)*(o.enableRetinaScaling?this.getRetinaScaling():1),c=this.toCanvasElement(h,o);return t.util.toDataURL(c,a,l)},toCanvasElement:function(o,a){o=o||1,a=a||{};var l=(a.width||this.width)*o,h=(a.height||this.height)*o,c=this.getZoom(),f=this.width,d=this.height,g=c*o,m=this.viewportTransform,p=(m[4]-(a.left||0))*o,v=(m[5]-(a.top||0))*o,y=this.interactive,b=[g,0,0,g,p,v],x=this.enableRetinaScaling,w=t.util.createCanvasElement(),T=this.contextTop;return w.width=l,w.height=h,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=b,this.width=l,this.height=h,this.calcViewportBoundaries(),this.renderCanvas(w.getContext("2d"),this._objects),this.viewportTransform=m,this.width=f,this.height=d,this.calcViewportBoundaries(),this.interactive=y,this.enableRetinaScaling=x,this.contextTop=T,w}})}(),t.util.object.extend(t.StaticCanvas.prototype,{loadFromJSON:function(o,a,l){if(!!o){var h=typeof o=="string"?JSON.parse(o):t.util.object.clone(o),c=this,f=h.clipPath,d=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete h.clipPath,this._enlivenObjects(h.objects,function(g){c.clear(),c._setBgOverlay(h,function(){f?c._enlivenObjects([f],function(m){c.clipPath=m[0],c.__setupCanvas.call(c,h,g,d,a)}):c.__setupCanvas.call(c,h,g,d,a)})},l),this}},__setupCanvas:function(o,a,l,h){var c=this;a.forEach(function(f,d){c.insertAt(f,d)}),this.renderOnAddRemove=l,delete o.objects,delete o.backgroundImage,delete o.overlayImage,delete o.background,delete o.overlay,this._setOptions(o),this.renderAll(),h&&h()},_setBgOverlay:function(o,a){var l={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!o.backgroundImage&&!o.overlayImage&&!o.background&&!o.overlay){a&&a();return}var h=function(){l.backgroundImage&&l.overlayImage&&l.backgroundColor&&l.overlayColor&&a&&a()};this.__setBgOverlay("backgroundImage",o.backgroundImage,l,h),this.__setBgOverlay("overlayImage",o.overlayImage,l,h),this.__setBgOverlay("backgroundColor",o.background,l,h),this.__setBgOverlay("overlayColor",o.overlay,l,h)},__setBgOverlay:function(o,a,l,h){var c=this;if(!a){l[o]=!0,h&&h();return}o==="backgroundImage"||o==="overlayImage"?t.util.enlivenObjects([a],function(f){c[o]=f[0],l[o]=!0,h&&h()}):this["set"+t.util.string.capitalize(o,!0)](a,function(){l[o]=!0,h&&h()})},_enlivenObjects:function(o,a,l){if(!o||o.length===0){a&&a([]);return}t.util.enlivenObjects(o,function(h){a&&a(h)},null,l)},_toDataURL:function(o,a){this.clone(function(l){a(l.toDataURL(o))})},_toDataURLWithMultiplier:function(o,a,l){this.clone(function(h){l(h.toDataURLWithMultiplier(o,a))})},clone:function(o,a){var l=JSON.stringify(this.toJSON(a));this.cloneWithoutData(function(h){h.loadFromJSON(l,function(){o&&o(h)})})},cloneWithoutData:function(o){var a=t.util.createCanvasElement();a.width=this.width,a.height=this.height;var l=new t.Canvas(a);this.backgroundImage?(l.setBackgroundImage(this.backgroundImage.src,function(){l.renderAll(),o&&o(l)}),l.backgroundImageOpacity=this.backgroundImageOpacity,l.backgroundImageStretch=this.backgroundImageStretch):o&&o(l)}}),function(o){var a=o.fabric||(o.fabric={}),l=a.util.object.extend,h=a.util.object.clone,c=a.util.toFixed,f=a.util.string.capitalize,d=a.util.degreesToRadians,g=!a.isLikelyNode,m=2;a.Object||(a.Object=a.util.createClass(a.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:g,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(p){p&&this.setOptions(p)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=a.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(p){var v=a.perfLimitSizeTotal,y=p.width,b=p.height,x=a.maxCacheSideLimit,w=a.minCacheSideLimit;if(y<=x&&b<=x&&y*b<=v)return y<w&&(p.width=w),b<w&&(p.height=w),p;var T=y/b,_=a.util.limitDimsByArea(T,v),E=a.util.capValue,k=E(w,_.x,x),z=E(w,_.y,x);return y>k&&(p.zoomX/=y/k,p.width=k,p.capped=!0),b>z&&(p.zoomY/=b/z,p.height=z,p.capped=!0),p},_getCacheCanvasDimensions:function(){var p=this.getTotalObjectScaling(),v=this._getTransformedDimensions(0,0),y=v.x*p.scaleX/this.scaleX,b=v.y*p.scaleY/this.scaleY;return{width:y+m,height:b+m,zoomX:p.scaleX,zoomY:p.scaleY,x:y,y:b}},_updateCacheCanvas:function(){var p=this.canvas;if(this.noScaleCache&&p&&p._currentTransform){var v=p._currentTransform.target,y=p._currentTransform.action;if(this===v&&y.slice&&y.slice(0,5)==="scale")return!1}var b=this._cacheCanvas,x=this._limitCacheSize(this._getCacheCanvasDimensions()),w=a.minCacheSideLimit,T=x.width,_=x.height,E,k,z=x.zoomX,F=x.zoomY,j=T!==this.cacheWidth||_!==this.cacheHeight,K=this.zoomX!==z||this.zoomY!==F,B=j||K,H=0,ue=0,ge=!1;if(j){var fe=this._cacheCanvas.width,L=this._cacheCanvas.height,Z=T>fe||_>L,M=(T<fe*.9||_<L*.9)&&fe>w&&L>w;ge=Z||M,Z&&!x.capped&&(T>w||_>w)&&(H=T*.1,ue=_*.1)}return this instanceof a.Text&&this.path&&(B=!0,ge=!0,H+=this.getHeightOfLine(0)*this.zoomX,ue+=this.getHeightOfLine(0)*this.zoomY),B?(ge?(b.width=Math.ceil(T+H),b.height=Math.ceil(_+ue)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,b.width,b.height)),E=x.x/2,k=x.y/2,this.cacheTranslationX=Math.round(b.width/2-E)+E,this.cacheTranslationY=Math.round(b.height/2-k)+k,this.cacheWidth=T,this.cacheHeight=_,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(z,F),this.zoomX=z,this.zoomY=F,!0):!1},setOptions:function(p){this._setOptions(p),this._initGradient(p.fill,"fill"),this._initGradient(p.stroke,"stroke"),this._initPattern(p.fill,"fill"),this._initPattern(p.stroke,"stroke")},transform:function(p){var v=this.group&&!this.group._transformDone||this.group&&this.canvas&&p===this.canvas.contextTop,y=this.calcTransformMatrix(!v);p.transform(y[0],y[1],y[2],y[3],y[4],y[5])},toObject:function(p){var v=a.Object.NUM_FRACTION_DIGITS,y={type:this.type,version:a.version,originX:this.originX,originY:this.originY,left:c(this.left,v),top:c(this.top,v),width:c(this.width,v),height:c(this.height,v),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:c(this.strokeWidth,v),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:c(this.strokeMiterLimit,v),scaleX:c(this.scaleX,v),scaleY:c(this.scaleY,v),angle:c(this.angle,v),flipX:this.flipX,flipY:this.flipY,opacity:c(this.opacity,v),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:c(this.skewX,v),skewY:c(this.skewY,v)};return this.clipPath&&!this.clipPath.excludeFromExport&&(y.clipPath=this.clipPath.toObject(p),y.clipPath.inverted=this.clipPath.inverted,y.clipPath.absolutePositioned=this.clipPath.absolutePositioned),a.util.populateWithProperties(this,y,p),this.includeDefaultValues||(y=this._removeDefaultValues(y)),y},toDatalessObject:function(p){return this.toObject(p)},_removeDefaultValues:function(p){var v=a.util.getKlass(p.type).prototype,y=v.stateProperties;return y.forEach(function(b){if(!(b==="left"||b==="top")){p[b]===v[b]&&delete p[b];var x=Object.prototype.toString.call(p[b])==="[object Array]"&&Object.prototype.toString.call(v[b])==="[object Array]";x&&p[b].length===0&&v[b].length===0&&delete p[b]}}),p},toString:function(){return"#<fabric."+f(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var p=a.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(p.scaleX),scaleY:Math.abs(p.scaleY)}},getTotalObjectScaling:function(){var p=this.getObjectScaling(),v=p.scaleX,y=p.scaleY;if(this.canvas){var b=this.canvas.getZoom(),x=this.canvas.getRetinaScaling();v*=b*x,y*=b*x}return{scaleX:v,scaleY:y}},getObjectOpacity:function(){var p=this.opacity;return this.group&&(p*=this.group.getObjectOpacity()),p},_set:function(p,v){var y=p==="scaleX"||p==="scaleY",b=this[p]!==v,x=!1;return y&&(v=this._constrainScale(v)),p==="scaleX"&&v<0?(this.flipX=!this.flipX,v*=-1):p==="scaleY"&&v<0?(this.flipY=!this.flipY,v*=-1):p==="shadow"&&v&&!(v instanceof a.Shadow)?v=new a.Shadow(v):p==="dirty"&&this.group&&this.group.set("dirty",v),this[p]=v,b&&(x=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(p)>-1?(this.dirty=!0,x&&this.group.set("dirty",!0)):x&&this.stateProperties.indexOf(p)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:a.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(p){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(p.save(),this._setupCompositeOperation(p),this.drawSelectionBackground(p),this.transform(p),this._setOpacity(p),this._setShadow(p,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(p)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(p),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),p.restore())},renderCache:function(p){p=p||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,p.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!=="transparent"&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!=="transparent"},needsItsOwnCache:function(){return!!(this.paintFirst==="stroke"&&this.hasFill()&&this.hasStroke()&&typeof this.shadow=="object"||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(p){var v=this.clipPath;if(p.save(),v.inverted?p.globalCompositeOperation="destination-out":p.globalCompositeOperation="destination-in",v.absolutePositioned){var y=a.util.invertTransform(this.calcTransformMatrix());p.transform(y[0],y[1],y[2],y[3],y[4],y[5])}v.transform(p),p.scale(1/v.zoomX,1/v.zoomY),p.drawImage(v._cacheCanvas,-v.cacheTranslationX,-v.cacheTranslationY),p.restore()},drawObject:function(p,v){var y=this.fill,b=this.stroke;v?(this.fill="black",this.stroke="",this._setClippingProperties(p)):this._renderBackground(p),this._render(p),this._drawClipPath(p),this.fill=y,this.stroke=b},_drawClipPath:function(p){var v=this.clipPath;!v||(v.canvas=this.canvas,v.shouldCache(),v._transformDone=!0,v.renderCache({forClipping:!0}),this.drawClipPathOnCache(p))},drawCacheOnCanvas:function(p){p.scale(1/this.zoomX,1/this.zoomY),p.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(p){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!p&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!p){var v=this.cacheWidth/this.zoomX,y=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-v/2,-y/2,v,y)}return!0}return!1},_renderBackground:function(p){if(!!this.backgroundColor){var v=this._getNonTransformedDimensions();p.fillStyle=this.backgroundColor,p.fillRect(-v.x/2,-v.y/2,v.x,v.y),this._removeShadow(p)}},_setOpacity:function(p){this.group&&!this.group._transformDone?p.globalAlpha=this.getObjectOpacity():p.globalAlpha*=this.opacity},_setStrokeStyles:function(p,v){var y=v.stroke;y&&(p.lineWidth=v.strokeWidth,p.lineCap=v.strokeLineCap,p.lineDashOffset=v.strokeDashOffset,p.lineJoin=v.strokeLineJoin,p.miterLimit=v.strokeMiterLimit,y.toLive?y.gradientUnits==="percentage"||y.gradientTransform||y.patternTransform?this._applyPatternForTransformedGradient(p,y):(p.strokeStyle=y.toLive(p,this),this._applyPatternGradientTransform(p,y)):p.strokeStyle=v.stroke)},_setFillStyles:function(p,v){var y=v.fill;y&&(y.toLive?(p.fillStyle=y.toLive(p,this),this._applyPatternGradientTransform(p,v.fill)):p.fillStyle=y)},_setClippingProperties:function(p){p.globalAlpha=1,p.strokeStyle="transparent",p.fillStyle="#000000"},_setLineDash:function(p,v){!v||v.length===0||(1&v.length&&v.push.apply(v,v),p.setLineDash(v))},_renderControls:function(p,v){var y=this.getViewportTransform(),b=this.calcTransformMatrix(),x,w,T;v=v||{},w=typeof v.hasBorders!="undefined"?v.hasBorders:this.hasBorders,T=typeof v.hasControls!="undefined"?v.hasControls:this.hasControls,b=a.util.multiplyTransformMatrices(y,b),x=a.util.qrDecompose(b),p.save(),p.translate(x.translateX,x.translateY),p.lineWidth=1*this.borderScaleFactor,this.group||(p.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),p.rotate(d(x.angle)),v.forActiveSelection||this.group?w&&this.drawBordersInGroup(p,x,v):w&&this.drawBorders(p,v),T&&this.drawControls(p,v),p.restore()},_setShadow:function(p){if(!!this.shadow){var v=this.shadow,y=this.canvas,b,x=y&&y.viewportTransform[0]||1,w=y&&y.viewportTransform[3]||1;v.nonScaling?b={scaleX:1,scaleY:1}:b=this.getObjectScaling(),y&&y._isRetinaScaling()&&(x*=a.devicePixelRatio,w*=a.devicePixelRatio),p.shadowColor=v.color,p.shadowBlur=v.blur*a.browserShadowBlurConstant*(x+w)*(b.scaleX+b.scaleY)/4,p.shadowOffsetX=v.offsetX*x*b.scaleX,p.shadowOffsetY=v.offsetY*w*b.scaleY}},_removeShadow:function(p){!this.shadow||(p.shadowColor="",p.shadowBlur=p.shadowOffsetX=p.shadowOffsetY=0)},_applyPatternGradientTransform:function(p,v){if(!v||!v.toLive)return{offsetX:0,offsetY:0};var y=v.gradientTransform||v.patternTransform,b=-this.width/2+v.offsetX||0,x=-this.height/2+v.offsetY||0;return v.gradientUnits==="percentage"?p.transform(this.width,0,0,this.height,b,x):p.transform(1,0,0,1,b,x),y&&p.transform(y[0],y[1],y[2],y[3],y[4],y[5]),{offsetX:b,offsetY:x}},_renderPaintInOrder:function(p){this.paintFirst==="stroke"?(this._renderStroke(p),this._renderFill(p)):(this._renderFill(p),this._renderStroke(p))},_render:function(){},_renderFill:function(p){!this.fill||(p.save(),this._setFillStyles(p,this),this.fillRule==="evenodd"?p.fill("evenodd"):p.fill(),p.restore())},_renderStroke:function(p){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(p),p.save(),this.strokeUniform&&this.group){var v=this.getObjectScaling();p.scale(1/v.scaleX,1/v.scaleY)}else this.strokeUniform&&p.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(p,this.strokeDashArray),this._setStrokeStyles(p,this),p.stroke(),p.restore()}},_applyPatternForTransformedGradient:function(p,v){var y=this._limitCacheSize(this._getCacheCanvasDimensions()),b=a.util.createCanvasElement(),x,w=this.canvas.getRetinaScaling(),T=y.x/this.scaleX/w,_=y.y/this.scaleY/w;b.width=T,b.height=_,x=b.getContext("2d"),x.beginPath(),x.moveTo(0,0),x.lineTo(T,0),x.lineTo(T,_),x.lineTo(0,_),x.closePath(),x.translate(T/2,_/2),x.scale(y.zoomX/this.scaleX/w,y.zoomY/this.scaleY/w),this._applyPatternGradientTransform(x,v),x.fillStyle=v.toLive(p),x.fill(),p.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),p.scale(w*this.scaleX/y.zoomX,w*this.scaleY/y.zoomY),p.strokeStyle=x.createPattern(b,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var p=a.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",p.scaleX),this.set("scaleY",p.scaleY),this.angle=p.angle,this.skewX=p.skewX,this.skewY=0}},_removeTransformMatrix:function(p){var v=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),v=a.util.transformPoint(v,this.transformMatrix)),this.transformMatrix=null,p&&(this.scaleX*=p.scaleX,this.scaleY*=p.scaleY,this.cropX=p.cropX,this.cropY=p.cropY,v.x+=p.offsetLeft,v.y+=p.offsetTop,this.width=p.width,this.height=p.height),this.setPositionByOrigin(v,"center","center")},clone:function(p,v){var y=this.toObject(v);this.constructor.fromObject?this.constructor.fromObject(y,p):a.Object._fromObject("Object",y,p)},cloneAsImage:function(p,v){var y=this.toCanvasElement(v);return p&&p(new a.Image(y)),this},toCanvasElement:function(p){p||(p={});var v=a.util,y=v.saveObjectTransform(this),b=this.group,x=this.shadow,w=Math.abs,T=(p.multiplier||1)*(p.enableRetinaScaling?a.devicePixelRatio:1);delete this.group,p.withoutTransform&&v.resetObjectTransform(this),p.withoutShadow&&(this.shadow=null);var _=a.util.createCanvasElement(),E=this.getBoundingRect(!0,!0),k=this.shadow,z,F={x:0,y:0},j,K,B;k&&(j=k.blur,k.nonScaling?z={scaleX:1,scaleY:1}:z=this.getObjectScaling(),F.x=2*Math.round(w(k.offsetX)+j)*w(z.scaleX),F.y=2*Math.round(w(k.offsetY)+j)*w(z.scaleY)),K=E.width+F.x,B=E.height+F.y,_.width=Math.ceil(K),_.height=Math.ceil(B);var H=new a.StaticCanvas(_,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});p.format==="jpeg"&&(H.backgroundColor="#fff"),this.setPositionByOrigin(new a.Point(H.width/2,H.height/2),"center","center");var ue=this.canvas;H.add(this);var ge=H.toCanvasElement(T||1,p);return this.shadow=x,this.set("canvas",ue),b&&(this.group=b),this.set(y).setCoords(),H._objects=[],H.dispose(),H=null,ge},toDataURL:function(p){return p||(p={}),a.util.toDataURL(this.toCanvasElement(p),p.format||"png",p.quality||1)},isType:function(p){return this.type===p},complexity:function(){return 1},toJSON:function(p){return this.toObject(p)},rotate:function(p){var v=(this.originX!=="center"||this.originY!=="center")&&this.centeredRotation;return v&&this._setOriginToCenter(),this.set("angle",p),v&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(p,v){v=v||this.canvas.getPointer(p);var y=new a.Point(v.x,v.y),b=this._getLeftTopCoords();return this.angle&&(y=a.util.rotatePoint(y,b,d(-this.angle))),{x:y.x-b.x,y:y.y-b.y}},_setupCompositeOperation:function(p){this.globalCompositeOperation&&(p.globalCompositeOperation=this.globalCompositeOperation)}}),a.util.createAccessors&&a.util.createAccessors(a.Object),l(a.Object.prototype,a.Observable),a.Object.NUM_FRACTION_DIGITS=2,a.Object._fromObject=function(p,v,y,b){var x=a[p];v=h(v,!0),a.util.enlivenPatterns([v.fill,v.stroke],function(w){typeof w[0]!="undefined"&&(v.fill=w[0]),typeof w[1]!="undefined"&&(v.stroke=w[1]),a.util.enlivenObjects([v.clipPath],function(T){v.clipPath=T[0];var _=b?new x(v[b],v):new x(v);y&&y(_)})})},a.Object.__uid=0)}(e),function(){var o=t.util.degreesToRadians,a={left:-.5,center:0,right:.5},l={top:-.5,center:0,bottom:.5};t.util.object.extend(t.Object.prototype,{translateToGivenOrigin:function(h,c,f,d,g){var m=h.x,p=h.y,v,y,b;return typeof c=="string"?c=a[c]:c-=.5,typeof d=="string"?d=a[d]:d-=.5,v=d-c,typeof f=="string"?f=l[f]:f-=.5,typeof g=="string"?g=l[g]:g-=.5,y=g-f,(v||y)&&(b=this._getTransformedDimensions(),m=h.x+v*b.x,p=h.y+y*b.y),new t.Point(m,p)},translateToCenterPoint:function(h,c,f){var d=this.translateToGivenOrigin(h,c,f,"center","center");return this.angle?t.util.rotatePoint(d,h,o(this.angle)):d},translateToOriginPoint:function(h,c,f){var d=this.translateToGivenOrigin(h,"center","center",c,f);return this.angle?t.util.rotatePoint(d,h,o(this.angle)):d},getCenterPoint:function(){var h=new t.Point(this.left,this.top);return this.translateToCenterPoint(h,this.originX,this.originY)},getPointByOrigin:function(h,c){var f=this.getCenterPoint();return this.translateToOriginPoint(f,h,c)},toLocalPoint:function(h,c,f){var d=this.getCenterPoint(),g,m;return typeof c!="undefined"&&typeof f!="undefined"?g=this.translateToGivenOrigin(d,"center","center",c,f):g=new t.Point(this.left,this.top),m=new t.Point(h.x,h.y),this.angle&&(m=t.util.rotatePoint(m,d,-o(this.angle))),m.subtractEquals(g)},setPositionByOrigin:function(h,c,f){var d=this.translateToCenterPoint(h,c,f),g=this.translateToOriginPoint(d,this.originX,this.originY);this.set("left",g.x),this.set("top",g.y)},adjustPosition:function(h){var c=o(this.angle),f=this.getScaledWidth(),d=t.util.cos(c)*f,g=t.util.sin(c)*f,m,p;typeof this.originX=="string"?m=a[this.originX]:m=this.originX-.5,typeof h=="string"?p=a[h]:p=h-.5,this.left+=d*(p-m),this.top+=g*(p-m),this.setCoords(),this.originX=h},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var h=this.getCenterPoint();this.originX="center",this.originY="center",this.left=h.x,this.top=h.y},_resetOrigin:function(){var h=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=h.x,this.top=h.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function o(f){return[new t.Point(f.tl.x,f.tl.y),new t.Point(f.tr.x,f.tr.y),new t.Point(f.br.x,f.br.y),new t.Point(f.bl.x,f.bl.y)]}var a=t.util,l=a.degreesToRadians,h=a.multiplyTransformMatrices,c=a.transformPoint;a.object.extend(t.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(f,d){return d?f?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),f?this.aCoords:this.lineCoords)},getCoords:function(f,d){return o(this._getCoords(f,d))},intersectsWithRect:function(f,d,g,m){var p=this.getCoords(g,m),v=t.Intersection.intersectPolygonRectangle(p,f,d);return v.status==="Intersection"},intersectsWithObject:function(f,d,g){var m=t.Intersection.intersectPolygonPolygon(this.getCoords(d,g),f.getCoords(d,g));return m.status==="Intersection"||f.isContainedWithinObject(this,d,g)||this.isContainedWithinObject(f,d,g)},isContainedWithinObject:function(f,d,g){for(var m=this.getCoords(d,g),p=d?f.aCoords:f.lineCoords,v=0,y=f._getImageLines(p);v<4;v++)if(!f.containsPoint(m[v],y))return!1;return!0},isContainedWithinRect:function(f,d,g,m){var p=this.getBoundingRect(g,m);return p.left>=f.x&&p.left+p.width<=d.x&&p.top>=f.y&&p.top+p.height<=d.y},containsPoint:function(f,v,g,m){var p=this._getCoords(g,m),v=v||this._getImageLines(p),y=this._findCrossPoints(f,v);return y!==0&&y%2===1},isOnScreen:function(f){if(!this.canvas)return!1;var d=this.canvas.vptCoords.tl,g=this.canvas.vptCoords.br,m=this.getCoords(!0,f);return m.some(function(p){return p.x<=g.x&&p.x>=d.x&&p.y<=g.y&&p.y>=d.y})||this.intersectsWithRect(d,g,!0,f)?!0:this._containsCenterOfCanvas(d,g,f)},_containsCenterOfCanvas:function(f,d,g){var m={x:(f.x+d.x)/2,y:(f.y+d.y)/2};return!!this.containsPoint(m,null,!0,g)},isPartiallyOnScreen:function(f){if(!this.canvas)return!1;var d=this.canvas.vptCoords.tl,g=this.canvas.vptCoords.br;if(this.intersectsWithRect(d,g,!0,f))return!0;var m=this.getCoords(!0,f).every(function(p){return(p.x>=g.x||p.x<=d.x)&&(p.y>=g.y||p.y<=d.y)});return m&&this._containsCenterOfCanvas(d,g,f)},_getImageLines:function(f){var d={topline:{o:f.tl,d:f.tr},rightline:{o:f.tr,d:f.br},bottomline:{o:f.br,d:f.bl},leftline:{o:f.bl,d:f.tl}};return d},_findCrossPoints:function(f,d){var g,m,p,v,y,b=0,x;for(var w in d)if(x=d[w],!(x.o.y<f.y&&x.d.y<f.y)&&!(x.o.y>=f.y&&x.d.y>=f.y)&&(x.o.x===x.d.x&&x.o.x>=f.x?y=x.o.x:(g=0,m=(x.d.y-x.o.y)/(x.d.x-x.o.x),p=f.y-g*f.x,v=x.o.y-m*x.o.x,y=-(p-v)/(g-m)),y>=f.x&&(b+=1),b===2))break;return b},getBoundingRect:function(f,d){var g=this.getCoords(f,d);return a.makeBoundingBoxFromPoints(g)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(f){return Math.abs(f)<this.minScaleLimit?f<0?-this.minScaleLimit:this.minScaleLimit:f===0?1e-4:f},scale:function(f){return this._set("scaleX",f),this._set("scaleY",f),this.setCoords()},scaleToWidth:function(f,d){var g=this.getBoundingRect(d).width/this.getScaledWidth();return this.scale(f/this.width/g)},scaleToHeight:function(f,d){var g=this.getBoundingRect(d).height/this.getScaledHeight();return this.scale(f/this.height/g)},calcCoords:function(f){return f?this.calcACoords():this.calcOCoords()},calcLineCoords:function(){var f=this.getViewportTransform(),d=this.padding,g=l(this.angle),m=a.cos(g),p=a.sin(g),v=m*d,y=p*d,b=v+y,x=v-y,w=this.calcACoords(),T={tl:c(w.tl,f),tr:c(w.tr,f),bl:c(w.bl,f),br:c(w.br,f)};return d&&(T.tl.x-=x,T.tl.y-=b,T.tr.x+=b,T.tr.y-=x,T.bl.x-=b,T.bl.y+=x,T.br.x+=x,T.br.y+=b),T},calcOCoords:function(){var f=this._calcRotateMatrix(),d=this._calcTranslateMatrix(),g=this.getViewportTransform(),m=h(g,d),p=h(m,f),p=h(p,[1/g[0],0,0,1/g[3],0,0]),v=this._calculateCurrentDimensions(),y={};return this.forEachControl(function(b,x,w){y[x]=b.positionHandler(v,p,w)}),y},calcACoords:function(){var f=this._calcRotateMatrix(),d=this._calcTranslateMatrix(),g=h(d,f),m=this._getTransformedDimensions(),p=m.x/2,v=m.y/2;return{tl:c({x:-p,y:-v},g),tr:c({x:p,y:-v},g),bl:c({x:-p,y:v},g),br:c({x:p,y:v},g)}},setCoords:function(f){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),f?this:(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords(),this)},_calcRotateMatrix:function(){return a.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var f=this.getCenterPoint();return[1,0,0,1,f.x,f.y]},transformMatrixKey:function(f){var d="_",g="";return!f&&this.group&&(g=this.group.transformMatrixKey(f)+d),g+this.top+d+this.left+d+this.scaleX+d+this.scaleY+d+this.skewX+d+this.skewY+d+this.angle+d+this.originX+d+this.originY+d+this.width+d+this.height+d+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(f){var d=this.calcOwnMatrix();if(f||!this.group)return d;var g=this.transformMatrixKey(f),m=this.matrixCache||(this.matrixCache={});return m.key===g?m.value:(this.group&&(d=h(this.group.calcTransformMatrix(!1),d)),m.key=g,m.value=d,d)},calcOwnMatrix:function(){var f=this.transformMatrixKey(!0),d=this.ownMatrixCache||(this.ownMatrixCache={});if(d.key===f)return d.value;var g=this._calcTranslateMatrix(),m={angle:this.angle,translateX:g[4],translateY:g[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return d.key=f,d.value=a.composeMatrix(m),d.value},_calcDimensionsTransformMatrix:function(f,d,g){return a.calcDimensionsMatrix({skewX:f,skewY:d,scaleX:this.scaleX*(g&&this.flipX?-1:1),scaleY:this.scaleY*(g&&this.flipY?-1:1)})},_getNonTransformedDimensions:function(){var f=this.strokeWidth,d=this.width+f,g=this.height+f;return{x:d,y:g}},_getTransformedDimensions:function(f,d){typeof f=="undefined"&&(f=this.skewX),typeof d=="undefined"&&(d=this.skewY);var g,m,p,v=f===0&&d===0;if(this.strokeUniform?(m=this.width,p=this.height):(g=this._getNonTransformedDimensions(),m=g.x,p=g.y),v)return this._finalizeDimensions(m*this.scaleX,p*this.scaleY);var y=a.sizeAfterTransform(m,p,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:f,skewY:d});return this._finalizeDimensions(y.x,y.y)},_finalizeDimensions:function(f,d){return this.strokeUniform?{x:f+this.strokeWidth,y:d+this.strokeWidth}:{x:f,y:d}},_calculateCurrentDimensions:function(){var f=this.getViewportTransform(),d=this._getTransformedDimensions(),g=c(d,f,!0);return g.scalarAdd(2*this.padding)}})}(),t.util.object.extend(t.Object.prototype,{sendToBack:function(){return this.group?t.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?t.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(o){return this.group?t.StaticCanvas.prototype.sendBackwards.call(this.group,this,o):this.canvas&&this.canvas.sendBackwards(this,o),this},bringForward:function(o){return this.group?t.StaticCanvas.prototype.bringForward.call(this.group,this,o):this.canvas&&this.canvas.bringForward(this,o),this},moveTo:function(o){return this.group&&this.group.type!=="activeSelection"?t.StaticCanvas.prototype.moveTo.call(this.group,this,o):this.canvas&&this.canvas.moveTo(this,o),this}}),function(){function o(l,h){if(h){if(h.toLive)return l+": url(#SVGID_"+h.id+"); ";var c=new t.Color(h),f=l+": "+c.toRgb()+"; ",d=c.getAlpha();return d!==1&&(f+=l+"-opacity: "+d.toString()+"; "),f}else return l+": none; "}var a=t.util.toFixed;t.util.object.extend(t.Object.prototype,{getSvgStyles:function(l){var h=this.fillRule?this.fillRule:"nonzero",c=this.strokeWidth?this.strokeWidth:"0",f=this.strokeDashArray?this.strokeDashArray.join(" "):"none",d=this.strokeDashOffset?this.strokeDashOffset:"0",g=this.strokeLineCap?this.strokeLineCap:"butt",m=this.strokeLineJoin?this.strokeLineJoin:"miter",p=this.strokeMiterLimit?this.strokeMiterLimit:"4",v=typeof this.opacity!="undefined"?this.opacity:"1",y=this.visible?"":" visibility: hidden;",b=l?"":this.getSvgFilter(),x=o("fill",this.fill),w=o("stroke",this.stroke);return[w,"stroke-width: ",c,"; ","stroke-dasharray: ",f,"; ","stroke-linecap: ",g,"; ","stroke-dashoffset: ",d,"; ","stroke-linejoin: ",m,"; ","stroke-miterlimit: ",p,"; ",x,"fill-rule: ",h,"; ","opacity: ",v,";",b,y].join("")},getSvgSpanStyles:function(l,h){var c="; ",d=l.fontFamily?"font-family: "+(l.fontFamily.indexOf("'")===-1&&l.fontFamily.indexOf('"')===-1?"'"+l.fontFamily+"'":l.fontFamily)+c:"",f=l.strokeWidth?"stroke-width: "+l.strokeWidth+c:"",d=d,g=l.fontSize?"font-size: "+l.fontSize+"px"+c:"",m=l.fontStyle?"font-style: "+l.fontStyle+c:"",p=l.fontWeight?"font-weight: "+l.fontWeight+c:"",v=l.fill?o("fill",l.fill):"",y=l.stroke?o("stroke",l.stroke):"",b=this.getSvgTextDecoration(l),x=l.deltaY?"baseline-shift: "+-l.deltaY+"; ":"";return b&&(b="text-decoration: "+b+c),[y,f,d,g,m,p,b,v,x,h?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(l){return["overline","underline","line-through"].filter(function(h){return l[h.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(l,h){var c=l?this.calcTransformMatrix():this.calcOwnMatrix(),f='transform="'+t.util.matrixToSVG(c);return f+(h||"")+'" '},_setSVGBg:function(l){if(this.backgroundColor){var h=t.Object.NUM_FRACTION_DIGITS;l.push("		<rect ",this._getFillAttributes(this.backgroundColor),' x="',a(-this.width/2,h),'" y="',a(-this.height/2,h),'" width="',a(this.width,h),'" height="',a(this.height,h),`"></rect>
`)}},toSVG:function(l){return this._createBaseSVGMarkup(this._toSVG(l),{reviver:l})},toClipPathSVG:function(l){return"	"+this._createBaseClipPathSVGMarkup(this._toSVG(l),{reviver:l})},_createBaseClipPathSVGMarkup:function(l,h){h=h||{};var c=h.reviver,f=h.additionalTransform||"",d=[this.getSvgTransform(!0,f),this.getSvgCommons()].join(""),g=l.indexOf("COMMON_PARTS");return l[g]=d,c?c(l.join("")):l.join("")},_createBaseSVGMarkup:function(l,h){h=h||{};var c=h.noStyle,f=h.reviver,d=c?"":'style="'+this.getSvgStyles()+'" ',g=h.withShadow?'style="'+this.getSvgFilter()+'" ':"",m=this.clipPath,p=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",v=m&&m.absolutePositioned,y=this.stroke,b=this.fill,x=this.shadow,w,T=[],_,E=l.indexOf("COMMON_PARTS"),k=h.additionalTransform;return m&&(m.clipPathId="CLIPPATH_"+t.Object.__uid++,_='<clipPath id="'+m.clipPathId+`" >
`+m.toClipPathSVG(f)+`</clipPath>
`),v&&T.push("<g ",g,this.getSvgCommons(),` >
`),T.push("<g ",this.getSvgTransform(!1),v?"":g+this.getSvgCommons(),` >
`),w=[d,p,c?"":this.addPaintOrder()," ",k?'transform="'+k+'" ':""].join(""),l[E]=w,b&&b.toLive&&T.push(b.toSVG(this)),y&&y.toLive&&T.push(y.toSVG(this)),x&&T.push(x.toSVG(this)),m&&T.push(_),T.push(l.join("")),T.push(`</g>
`),v&&T.push(`</g>
`),f?f(T.join("")):T.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var o=t.util.object.extend,a="stateProperties";function l(c,f,d){var g={},m=!0;d.forEach(function(p){g[p]=c[p]}),o(c[f],g,m)}function h(c,f,d){if(c===f)return!0;if(Array.isArray(c)){if(!Array.isArray(f)||c.length!==f.length)return!1;for(var g=0,m=c.length;g<m;g++)if(!h(c[g],f[g]))return!1;return!0}else if(c&&typeof c=="object"){var p=Object.keys(c),v;if(!f||typeof f!="object"||!d&&p.length!==Object.keys(f).length)return!1;for(var g=0,m=p.length;g<m;g++)if(v=p[g],!(v==="canvas"||v==="group")&&!h(c[v],f[v]))return!1;return!0}}t.util.object.extend(t.Object.prototype,{hasStateChanged:function(c){c=c||a;var f="_"+c;return Object.keys(this[f]).length<this[c].length?!0:!h(this[f],this,!0)},saveState:function(c){var f=c&&c.propertySet||a,d="_"+f;return this[d]?(l(this,d,this[f]),c&&c.stateProperties&&l(this,d,c.stateProperties),this):this.setupState(c)},setupState:function(c){c=c||{};var f=c.propertySet||a;return c.propertySet=f,this["_"+f]={},this.saveState(c),this}})}(),function(){var o=t.util.degreesToRadians;t.util.object.extend(t.Object.prototype,{_findTargetCorner:function(a,l){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var h=a.x,c=a.y,f,d,g=Object.keys(this.oCoords),m=g.length-1,p;for(this.__corner=0;m>=0;m--)if(p=g[m],!!this.isControlVisible(p)&&(d=this._getImageLines(l?this.oCoords[p].touchCorner:this.oCoords[p].corner),f=this._findCrossPoints({x:h,y:c},d),f!==0&&f%2===1))return this.__corner=p,p;return!1},forEachControl:function(a){for(var l in this.controls)a(this.controls[l],l,this)},_setCornerCoords:function(){var a=this.oCoords;for(var l in a){var h=this.controls[l];a[l].corner=h.calcCornerCoords(this.angle,this.cornerSize,a[l].x,a[l].y,!1),a[l].touchCorner=h.calcCornerCoords(this.angle,this.touchCornerSize,a[l].x,a[l].y,!0)}},drawSelectionBackground:function(a){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;a.save();var l=this.getCenterPoint(),h=this._calculateCurrentDimensions(),c=this.canvas.viewportTransform;return a.translate(l.x,l.y),a.scale(1/c[0],1/c[3]),a.rotate(o(this.angle)),a.fillStyle=this.selectionBackgroundColor,a.fillRect(-h.x/2,-h.y/2,h.x,h.y),a.restore(),this},drawBorders:function(a,l){l=l||{};var h=this._calculateCurrentDimensions(),c=this.borderScaleFactor,f=h.x+c,d=h.y+c,g=typeof l.hasControls!="undefined"?l.hasControls:this.hasControls,m=!1;return a.save(),a.strokeStyle=l.borderColor||this.borderColor,this._setLineDash(a,l.borderDashArray||this.borderDashArray),a.strokeRect(-f/2,-d/2,f,d),g&&(a.beginPath(),this.forEachControl(function(p,v,y){p.withConnection&&p.getVisibility(y,v)&&(m=!0,a.moveTo(p.x*f,p.y*d),a.lineTo(p.x*f+p.offsetX,p.y*d+p.offsetY))}),m&&a.stroke()),a.restore(),this},drawBordersInGroup:function(a,l,h){h=h||{};var c=t.util.sizeAfterTransform(this.width,this.height,l),f=this.strokeWidth,d=this.strokeUniform,g=this.borderScaleFactor,m=c.x+f*(d?this.canvas.getZoom():l.scaleX)+g,p=c.y+f*(d?this.canvas.getZoom():l.scaleY)+g;return a.save(),this._setLineDash(a,h.borderDashArray||this.borderDashArray),a.strokeStyle=h.borderColor||this.borderColor,a.strokeRect(-m/2,-p/2,m,p),a.restore(),this},drawControls:function(a,l){l=l||{},a.save();var h=this.canvas.getRetinaScaling(),c,f;return a.setTransform(h,0,0,h,0,0),a.strokeStyle=a.fillStyle=l.cornerColor||this.cornerColor,this.transparentCorners||(a.strokeStyle=l.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(a,l.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(c=this.group.calcTransformMatrix()),this.forEachControl(function(d,g,m){f=m.oCoords[g],d.getVisibility(m,g)&&(c&&(f=t.util.transformPoint(f,c)),d.render(a,f.x,f.y,l,m))}),a.restore(),this},isControlVisible:function(a){return this.controls[a]&&this.controls[a].getVisibility(this,a)},setControlVisible:function(a,l){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[a]=l,this},setControlsVisibility:function(a){a||(a={});for(var l in a)this.setControlVisible(l,a[l]);return this},onDeselect:function(){},onSelect:function(){}})}(),t.util.object.extend(t.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(o,a){a=a||{};var l=function(){},h=a.onComplete||l,c=a.onChange||l,f=this;return t.util.animate({startValue:o.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(d){o.set("left",d),f.requestRenderAll(),c()},onComplete:function(){o.setCoords(),h()}}),this},fxCenterObjectV:function(o,a){a=a||{};var l=function(){},h=a.onComplete||l,c=a.onChange||l,f=this;return t.util.animate({startValue:o.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(d){o.set("top",d),f.requestRenderAll(),c()},onComplete:function(){o.setCoords(),h()}}),this},fxRemove:function(o,a){a=a||{};var l=function(){},h=a.onComplete||l,c=a.onChange||l,f=this;return t.util.animate({startValue:o.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(d){o.set("opacity",d),f.requestRenderAll(),c()},onComplete:function(){f.remove(o),h()}}),this}}),t.util.object.extend(t.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]=="object"){var o=[],a,l;for(a in arguments[0])o.push(a);for(var h=0,c=o.length;h<c;h++)a=o[h],l=h!==c-1,this._animate(a,arguments[0][a],arguments[1],l)}else this._animate.apply(this,arguments);return this},_animate:function(o,a,l,h){var c=this,f;a=a.toString(),l?l=t.util.object.clone(l):l={},~o.indexOf(".")&&(f=o.split("."));var d=c.colorProperties.indexOf(o)>-1||f&&c.colorProperties.indexOf(f[1])>-1,g=f?this.get(f[0])[f[1]]:this.get(o);"from"in l||(l.from=g),d||(~a.indexOf("=")?a=g+parseFloat(a.replace("=","")):a=parseFloat(a));var m={startValue:l.from,endValue:a,byValue:l.by,easing:l.easing,duration:l.duration,abort:l.abort&&function(p,v,y){return l.abort.call(c,p,v,y)},onChange:function(p,v,y){f?c[f[0]][f[1]]=p:c.set(o,p),!h&&l.onChange&&l.onChange(p,v,y)},onComplete:function(p,v,y){h||(c.setCoords(),l.onComplete&&l.onComplete(p,v,y))}};return d?t.util.animateColor(m.startValue,m.endValue,m.duration,m):t.util.animate(m)}}),function(o){var a=o.fabric||(o.fabric={}),l=a.util.object.extend,h=a.util.object.clone,c={x1:1,x2:1,y1:1,y2:1};if(a.Line){a.warn("fabric.Line is already defined");return}a.Line=a.util.createClass(a.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:a.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(d,g){d||(d=[0,0,0,0]),this.callSuper("initialize",g),this.set("x1",d[0]),this.set("y1",d[1]),this.set("x2",d[2]),this.set("y2",d[3]),this._setWidthHeight(g)},_setWidthHeight:function(d){d||(d={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in d?d.left:this._getLeftToOriginX(),this.top="top"in d?d.top:this._getTopToOriginY()},_set:function(d,g){return this.callSuper("_set",d,g),typeof c[d]!="undefined"&&this._setWidthHeight(),this},_getLeftToOriginX:f({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:f({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(d){d.beginPath();var g=this.calcLinePoints();d.moveTo(g.x1,g.y1),d.lineTo(g.x2,g.y2),d.lineWidth=this.strokeWidth;var m=d.strokeStyle;d.strokeStyle=this.stroke||d.fillStyle,this.stroke&&this._renderStroke(d),d.strokeStyle=m},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(d){return l(this.callSuper("toObject",d),this.calcLinePoints())},_getNonTransformedDimensions:function(){var d=this.callSuper("_getNonTransformedDimensions");return this.strokeLineCap==="butt"&&(this.width===0&&(d.y-=this.strokeWidth),this.height===0&&(d.x-=this.strokeWidth)),d},calcLinePoints:function(){var d=this.x1<=this.x2?-1:1,g=this.y1<=this.y2?-1:1,m=d*this.width*.5,p=g*this.height*.5,v=d*this.width*-.5,y=g*this.height*-.5;return{x1:m,x2:v,y1:p,y2:y}},_toSVG:function(){var d=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',d.x1,'" y1="',d.y1,'" x2="',d.x2,'" y2="',d.y2,`" />
`]}}),a.Line.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),a.Line.fromElement=function(d,g,m){m=m||{};var p=a.parseAttributes(d,a.Line.ATTRIBUTE_NAMES),v=[p.x1||0,p.y1||0,p.x2||0,p.y2||0];g(new a.Line(v,l(p,m)))},a.Line.fromObject=function(d,g){function m(v){delete v.points,g&&g(v)}var p=h(d,!0);p.points=[d.x1,d.y1,d.x2,d.y2],a.Object._fromObject("Line",p,m,"points")};function f(d,g){var m=d.origin,p=d.axis1,v=d.axis2,y=d.dimension,b=g.nearest,x=g.center,w=g.farthest;return function(){switch(this.get(m)){case b:return Math.min(this.get(p),this.get(v));case x:return Math.min(this.get(p),this.get(v))+.5*this.get(y);case w:return Math.max(this.get(p),this.get(v))}}}}(e),function(o){var a=o.fabric||(o.fabric={}),l=Math.PI;if(a.Circle){a.warn("fabric.Circle is already defined.");return}a.Circle=a.util.createClass(a.Object,{type:"circle",radius:0,startAngle:0,endAngle:l*2,cacheProperties:a.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(c,f){return this.callSuper("_set",c,f),c==="radius"&&this.setRadius(f),this},toObject:function(c){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(c))},_toSVG:function(){var c,f=0,d=0,g=(this.endAngle-this.startAngle)%(2*l);if(g===0)c=["<circle ","COMMON_PARTS",'cx="'+f+'" cy="'+d+'" ','r="',this.radius,`" />
`];else{var m=a.util.cos(this.startAngle)*this.radius,p=a.util.sin(this.startAngle)*this.radius,v=a.util.cos(this.endAngle)*this.radius,y=a.util.sin(this.endAngle)*this.radius,b=g>l?"1":"0";c=['<path d="M '+m+" "+p," A "+this.radius+" "+this.radius," 0 ",+b+" 1"," "+v+" "+y,'" ',"COMMON_PARTS",` />
`]}return c},_render:function(c){c.beginPath(),c.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(c)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(c){return this.radius=c,this.set("width",c*2).set("height",c*2)}}),a.Circle.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),a.Circle.fromElement=function(c,f){var d=a.parseAttributes(c,a.Circle.ATTRIBUTE_NAMES);if(!h(d))throw new Error("value of `r` attribute is required and can not be negative");d.left=(d.left||0)-d.radius,d.top=(d.top||0)-d.radius,f(new a.Circle(d))};function h(c){return"radius"in c&&c.radius>=0}a.Circle.fromObject=function(c,f){a.Object._fromObject("Circle",c,f)}}(e),function(o){var a=o.fabric||(o.fabric={});if(a.Triangle){a.warn("fabric.Triangle is already defined");return}a.Triangle=a.util.createClass(a.Object,{type:"triangle",width:100,height:100,_render:function(l){var h=this.width/2,c=this.height/2;l.beginPath(),l.moveTo(-h,c),l.lineTo(0,-c),l.lineTo(h,c),l.closePath(),this._renderPaintInOrder(l)},_toSVG:function(){var l=this.width/2,h=this.height/2,c=[-l+" "+h,"0 "+-h,l+" "+h].join(",");return["<polygon ","COMMON_PARTS",'points="',c,'" />']}}),a.Triangle.fromObject=function(l,h){return a.Object._fromObject("Triangle",l,h)}}(e),function(o){var a=o.fabric||(o.fabric={}),l=Math.PI*2;if(a.Ellipse){a.warn("fabric.Ellipse is already defined.");return}a.Ellipse=a.util.createClass(a.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:a.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(h){this.callSuper("initialize",h),this.set("rx",h&&h.rx||0),this.set("ry",h&&h.ry||0)},_set:function(h,c){switch(this.callSuper("_set",h,c),h){case"rx":this.rx=c,this.set("width",c*2);break;case"ry":this.ry=c,this.set("height",c*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(h){return this.callSuper("toObject",["rx","ry"].concat(h))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,`" />
`]},_render:function(h){h.beginPath(),h.save(),h.transform(1,0,0,this.ry/this.rx,0,0),h.arc(0,0,this.rx,0,l,!1),h.restore(),this._renderPaintInOrder(h)}}),a.Ellipse.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),a.Ellipse.fromElement=function(h,c){var f=a.parseAttributes(h,a.Ellipse.ATTRIBUTE_NAMES);f.left=(f.left||0)-f.rx,f.top=(f.top||0)-f.ry,c(new a.Ellipse(f))},a.Ellipse.fromObject=function(h,c){a.Object._fromObject("Ellipse",h,c)}}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.util.object.extend;if(a.Rect){a.warn("fabric.Rect is already defined");return}a.Rect=a.util.createClass(a.Object,{stateProperties:a.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:a.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(h){this.callSuper("initialize",h),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(h){var c=this.rx?Math.min(this.rx,this.width/2):0,f=this.ry?Math.min(this.ry,this.height/2):0,d=this.width,g=this.height,m=-this.width/2,p=-this.height/2,v=c!==0||f!==0,y=1-.5522847498;h.beginPath(),h.moveTo(m+c,p),h.lineTo(m+d-c,p),v&&h.bezierCurveTo(m+d-y*c,p,m+d,p+y*f,m+d,p+f),h.lineTo(m+d,p+g-f),v&&h.bezierCurveTo(m+d,p+g-y*f,m+d-y*c,p+g,m+d-c,p+g),h.lineTo(m+c,p+g),v&&h.bezierCurveTo(m+y*c,p+g,m,p+g-y*f,m,p+g-f),h.lineTo(m,p+f),v&&h.bezierCurveTo(m,p+y*f,m+y*c,p,m+c,p),h.closePath(),this._renderPaintInOrder(h)},toObject:function(h){return this.callSuper("toObject",["rx","ry"].concat(h))},_toSVG:function(){var h=-this.width/2,c=-this.height/2;return["<rect ","COMMON_PARTS",'x="',h,'" y="',c,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,`" />
`]}}),a.Rect.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),a.Rect.fromElement=function(h,c,f){if(!h)return c(null);f=f||{};var d=a.parseAttributes(h,a.Rect.ATTRIBUTE_NAMES);d.left=d.left||0,d.top=d.top||0,d.height=d.height||0,d.width=d.width||0;var g=new a.Rect(l(f?a.util.object.clone(f):{},d));g.visible=g.visible&&g.width>0&&g.height>0,c(g)},a.Rect.fromObject=function(h,c){return a.Object._fromObject("Rect",h,c)}}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.util.object.extend,h=a.util.array.min,c=a.util.array.max,f=a.util.toFixed;if(a.Polyline){a.warn("fabric.Polyline is already defined");return}a.Polyline=a.util.createClass(a.Object,{type:"polyline",points:null,cacheProperties:a.Object.prototype.cacheProperties.concat("points"),initialize:function(d,g){g=g||{},this.points=d||[],this.callSuper("initialize",g),this._setPositionDimensions(g)},_setPositionDimensions:function(d){var g=this._calcDimensions(d),m;this.width=g.width,this.height=g.height,d.fromSVG||(m=this.translateToGivenOrigin({x:g.left-this.strokeWidth/2,y:g.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),typeof d.left=="undefined"&&(this.left=d.fromSVG?g.left:m.x),typeof d.top=="undefined"&&(this.top=d.fromSVG?g.top:m.y),this.pathOffset={x:g.left+this.width/2,y:g.top+this.height/2}},_calcDimensions:function(){var d=this.points,g=h(d,"x")||0,m=h(d,"y")||0,p=c(d,"x")||0,v=c(d,"y")||0,y=p-g,b=v-m;return{left:g,top:m,width:y,height:b}},toObject:function(d){return l(this.callSuper("toObject",d),{points:this.points.concat()})},_toSVG:function(){for(var d=[],g=this.pathOffset.x,m=this.pathOffset.y,p=a.Object.NUM_FRACTION_DIGITS,v=0,y=this.points.length;v<y;v++)d.push(f(this.points[v].x-g,p),",",f(this.points[v].y-m,p)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',d.join(""),`" />
`]},commonRender:function(d){var g,m=this.points.length,p=this.pathOffset.x,v=this.pathOffset.y;if(!m||isNaN(this.points[m-1].y))return!1;d.beginPath(),d.moveTo(this.points[0].x-p,this.points[0].y-v);for(var y=0;y<m;y++)g=this.points[y],d.lineTo(g.x-p,g.y-v);return!0},_render:function(d){!this.commonRender(d)||this._renderPaintInOrder(d)},complexity:function(){return this.get("points").length}}),a.Polyline.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat(),a.Polyline.fromElementGenerator=function(d){return function(g,m,p){if(!g)return m(null);p||(p={});var v=a.parsePointsAttribute(g.getAttribute("points")),y=a.parseAttributes(g,a[d].ATTRIBUTE_NAMES);y.fromSVG=!0,m(new a[d](v,l(y,p)))}},a.Polyline.fromElement=a.Polyline.fromElementGenerator("Polyline"),a.Polyline.fromObject=function(d,g){return a.Object._fromObject("Polyline",d,g,"points")}}(e),function(o){var a=o.fabric||(o.fabric={});if(a.Polygon){a.warn("fabric.Polygon is already defined");return}a.Polygon=a.util.createClass(a.Polyline,{type:"polygon",_render:function(l){!this.commonRender(l)||(l.closePath(),this._renderPaintInOrder(l))}}),a.Polygon.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat(),a.Polygon.fromElement=a.Polyline.fromElementGenerator("Polygon"),a.Polygon.fromObject=function(l,h){a.Object._fromObject("Polygon",l,h,"points")}}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.util.array.min,h=a.util.array.max,c=a.util.object.extend,f=Object.prototype.toString,d=a.util.toFixed;if(a.Path){a.warn("fabric.Path is already defined");return}a.Path=a.util.createClass(a.Object,{type:"path",path:null,cacheProperties:a.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:a.Object.prototype.stateProperties.concat("path"),initialize:function(g,m){m=m||{},this.callSuper("initialize",m),g||(g=[]);var p=f.call(g)==="[object Array]";this.path=a.util.makePathSimpler(p?g:a.util.parsePath(g)),!!this.path&&a.Polyline.prototype._setPositionDimensions.call(this,m)},_renderPathCommands:function(g){var m,p=0,v=0,y=0,b=0,x=0,w=0,T=-this.pathOffset.x,_=-this.pathOffset.y;g.beginPath();for(var E=0,k=this.path.length;E<k;++E)switch(m=this.path[E],m[0]){case"L":y=m[1],b=m[2],g.lineTo(y+T,b+_);break;case"M":y=m[1],b=m[2],p=y,v=b,g.moveTo(y+T,b+_);break;case"C":y=m[5],b=m[6],x=m[3],w=m[4],g.bezierCurveTo(m[1]+T,m[2]+_,x+T,w+_,y+T,b+_);break;case"Q":g.quadraticCurveTo(m[1]+T,m[2]+_,m[3]+T,m[4]+_),y=m[3],b=m[4],x=m[1],w=m[2];break;case"z":case"Z":y=p,b=v,g.closePath();break}},_render:function(g){this._renderPathCommands(g),this._renderPaintInOrder(g)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(g){return c(this.callSuper("toObject",g),{path:this.path.map(function(m){return m.slice()})})},toDatalessObject:function(g){var m=this.toObject(["sourcePath"].concat(g));return m.sourcePath&&delete m.path,m},_toSVG:function(){var g=a.util.joinPath(this.path);return["<path ","COMMON_PARTS",'d="',g,'" stroke-linecap="round" ',`/>
`]},_getOffsetTransform:function(){var g=a.Object.NUM_FRACTION_DIGITS;return" translate("+d(-this.pathOffset.x,g)+", "+d(-this.pathOffset.y,g)+")"},toClipPathSVG:function(g){var m=this._getOffsetTransform();return"	"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:g,additionalTransform:m})},toSVG:function(g){var m=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:g,additionalTransform:m})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var g=[],m=[],p,v=0,y=0,b=0,x=0,w,T=0,_=this.path.length;T<_;++T){switch(p=this.path[T],p[0]){case"L":b=p[1],x=p[2],w=[];break;case"M":b=p[1],x=p[2],v=b,y=x,w=[];break;case"C":w=a.util.getBoundsOfCurve(b,x,p[1],p[2],p[3],p[4],p[5],p[6]),b=p[5],x=p[6];break;case"Q":w=a.util.getBoundsOfCurve(b,x,p[1],p[2],p[1],p[2],p[3],p[4]),b=p[3],x=p[4];break;case"z":case"Z":b=v,x=y;break}w.forEach(function(B){g.push(B.x),m.push(B.y)}),g.push(b),m.push(x)}var E=l(g)||0,k=l(m)||0,z=h(g)||0,F=h(m)||0,j=z-E,K=F-k;return{left:E,top:k,width:j,height:K}}}),a.Path.fromObject=function(g,m){if(typeof g.sourcePath=="string"){var p=g.sourcePath;a.loadSVGFromURL(p,function(v){var y=v[0];y.setOptions(g),m&&m(y)})}else a.Object._fromObject("Path",g,m,"path")},a.Path.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat(["d"]),a.Path.fromElement=function(g,m,p){var v=a.parseAttributes(g,a.Path.ATTRIBUTE_NAMES);v.fromSVG=!0,m(new a.Path(v.d,c(v,p)))}}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.util.array.min,h=a.util.array.max;a.Group||(a.Group=a.util.createClass(a.Object,a.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(c,f,d){f=f||{},this._objects=[],d&&this.callSuper("initialize",f),this._objects=c||[];for(var g=this._objects.length;g--;)this._objects[g].group=this;if(d)this._updateObjectsACoords();else{var m=f&&f.centerPoint;f.originX!==void 0&&(this.originX=f.originX),f.originY!==void 0&&(this.originY=f.originY),m||this._calcBounds(),this._updateObjectsCoords(m),delete f.centerPoint,this.callSuper("initialize",f)}this.setCoords()},_updateObjectsACoords:function(){for(var c=!0,f=this._objects.length;f--;)this._objects[f].setCoords(c)},_updateObjectsCoords:function(f){for(var f=f||this.getCenterPoint(),d=this._objects.length;d--;)this._updateObjectCoords(this._objects[d],f)},_updateObjectCoords:function(c,f){var d=c.left,g=c.top,m=!0;c.set({left:d-f.x,top:g-f.y}),c.group=this,c.setCoords(m)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(c){var f=!!this.group;return this._restoreObjectsState(),a.util.resetObjectTransform(this),c&&(f&&a.util.removeTransformFromObject(c,this.group.calcTransformMatrix()),this._objects.push(c),c.group=this,c._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,f?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(c){return this._restoreObjectsState(),a.util.resetObjectTransform(this),this.remove(c),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(c){this.dirty=!0,c.group=this,c._set("canvas",this.canvas)},_onObjectRemoved:function(c){this.dirty=!0,delete c.group},_set:function(c,f){var d=this._objects.length;if(this.useSetOnGroup)for(;d--;)this._objects[d].setOnGroup(c,f);if(c==="canvas")for(;d--;)this._objects[d]._set(c,f);a.Object.prototype._set.call(this,c,f)},toObject:function(c){var f=this.includeDefaultValues,d=this._objects.filter(function(m){return!m.excludeFromExport}).map(function(m){var p=m.includeDefaultValues;m.includeDefaultValues=f;var v=m.toObject(c);return m.includeDefaultValues=p,v}),g=a.Object.prototype.toObject.call(this,c);return g.objects=d,g},toDatalessObject:function(c){var f,d=this.sourcePath;if(d)f=d;else{var g=this.includeDefaultValues;f=this._objects.map(function(p){var v=p.includeDefaultValues;p.includeDefaultValues=g;var y=p.toDatalessObject(c);return p.includeDefaultValues=v,y})}var m=a.Object.prototype.toDatalessObject.call(this,c);return m.objects=f,m},render:function(c){this._transformDone=!0,this.callSuper("render",c),this._transformDone=!1},shouldCache:function(){var c=a.Object.prototype.shouldCache.call(this);if(c){for(var f=0,d=this._objects.length;f<d;f++)if(this._objects[f].willDrawShadow())return this.ownCaching=!1,!1}return c},willDrawShadow:function(){if(a.Object.prototype.willDrawShadow.call(this))return!0;for(var c=0,f=this._objects.length;c<f;c++)if(this._objects[c].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(c){for(var f=0,d=this._objects.length;f<d;f++)this._objects[f].render(c);this._drawClipPath(c)},isCacheDirty:function(c){if(this.callSuper("isCacheDirty",c))return!0;if(!this.statefullCache)return!1;for(var f=0,d=this._objects.length;f<d;f++)if(this._objects[f].isCacheDirty(!0)){if(this._cacheCanvas){var g=this.cacheWidth/this.zoomX,m=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-g/2,-m/2,g,m)}return!0}return!1},_restoreObjectsState:function(){var c=this.calcOwnMatrix();return this._objects.forEach(function(f){a.util.addTransformToObject(f,c),delete f.group,f.setCoords()}),this},realizeTransform:function(c,f){return a.util.addTransformToObject(c,f),c},destroy:function(){return this._objects.forEach(function(c){c.set("dirty",!0)}),this._restoreObjectsState()},toActiveSelection:function(){if(!!this.canvas){var c=this._objects,f=this.canvas;this._objects=[];var d=this.toObject();delete d.objects;var g=new a.ActiveSelection([]);return g.set(d),g.type="activeSelection",f.remove(this),c.forEach(function(m){m.group=g,m.dirty=!0,f.add(m)}),g.canvas=f,g._objects=c,f._activeObject=g,g.setCoords(),g}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){var c=!0;return this.forEachObject(function(f){f.setCoords(c)}),this},_calcBounds:function(c){for(var f=[],d=[],g,m,p,v=["tr","br","bl","tl"],y=0,b=this._objects.length,x,w=v.length;y<b;++y){for(g=this._objects[y],p=g.calcACoords(),x=0;x<w;x++)m=v[x],f.push(p[m].x),d.push(p[m].y);g.aCoords=p}this._getBounds(f,d,c)},_getBounds:function(c,f,d){var g=new a.Point(l(c),l(f)),m=new a.Point(h(c),h(f)),p=g.y||0,v=g.x||0,y=m.x-g.x||0,b=m.y-g.y||0;this.width=y,this.height=b,d||this.setPositionByOrigin({x:v,y:p},"left","top")},_toSVG:function(c){for(var f=["<g ","COMMON_PARTS",` >
`],d=0,g=this._objects.length;d<g;d++)f.push("		",this._objects[d].toSVG(c));return f.push(`</g>
`),f},getSvgStyles:function(){var c=typeof this.opacity!="undefined"&&this.opacity!==1?"opacity: "+this.opacity+";":"",f=this.visible?"":" visibility: hidden;";return[c,this.getSvgFilter(),f].join("")},toClipPathSVG:function(c){for(var f=[],d=0,g=this._objects.length;d<g;d++)f.push("	",this._objects[d].toClipPathSVG(c));return this._createBaseClipPathSVGMarkup(f,{reviver:c})}}),a.Group.fromObject=function(c,f){var d=c.objects,g=a.util.object.clone(c,!0);if(delete g.objects,typeof d=="string"){a.loadSVGFromURL(d,function(m){var p=a.util.groupSVGElements(m,c,d);p.set(g),f&&f(p)});return}a.util.enlivenObjects(d,function(m){a.util.enlivenObjects([c.clipPath],function(p){var v=a.util.object.clone(c,!0);v.clipPath=p[0],delete v.objects,f&&f(new a.Group(m,v,!0))})})})}(e),function(o){var a=o.fabric||(o.fabric={});a.ActiveSelection||(a.ActiveSelection=a.util.createClass(a.Group,{type:"activeSelection",initialize:function(l,h){h=h||{},this._objects=l||[];for(var c=this._objects.length;c--;)this._objects[c].group=this;h.originX&&(this.originX=h.originX),h.originY&&(this.originY=h.originY),this._calcBounds(),this._updateObjectsCoords(),a.Object.prototype.initialize.call(this,h),this.setCoords()},toGroup:function(){var l=this._objects.concat();this._objects=[];var h=a.Object.prototype.toObject.call(this),c=new a.Group([]);if(delete h.type,c.set(h),l.forEach(function(d){d.canvas.remove(d),d.group=c}),c._objects=l,!this.canvas)return c;var f=this.canvas;return f.add(c),f._activeObject=c,c.setCoords(),c},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(l,h,c){l.save(),l.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",l,h),c=c||{},typeof c.hasControls=="undefined"&&(c.hasControls=!1),c.forActiveSelection=!0;for(var f=0,d=this._objects.length;f<d;f++)this._objects[f]._renderControls(l,c);l.restore()}}),a.ActiveSelection.fromObject=function(l,h){a.util.enlivenObjects(l.objects,function(c){delete l.objects,h&&h(new a.ActiveSelection(c,l,!0))})})}(e),function(o){var a=t.util.object.extend;if(o.fabric||(o.fabric={}),o.fabric.Image){t.warn("fabric.Image is already defined.");return}t.Image=t.util.createClass(t.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:t.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:t.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(l,h){h||(h={}),this.filters=[],this.cacheKey="texture"+t.Object.__uid++,this.callSuper("initialize",h),this._initElement(l,h)},getElement:function(){return this._element||{}},setElement:function(l,h){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=l,this._originalElement=l,this._initConfig(h),this.filters.length!==0&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(l){var h=t.filterBackend;h&&h.evictCachesForKey&&h.evictCachesForKey(l)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(l){t.util.cleanUpJsdomNode(this[l]),this[l]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var l=this.getElement();return{width:l.naturalWidth||l.width,height:l.naturalHeight||l.height}},_stroke:function(l){if(!(!this.stroke||this.strokeWidth===0)){var h=this.width/2,c=this.height/2;l.beginPath(),l.moveTo(-h,-c),l.lineTo(h,-c),l.lineTo(h,c),l.lineTo(-h,c),l.lineTo(-h,-c),l.closePath()}},toObject:function(l){var h=[];this.filters.forEach(function(f){f&&h.push(f.toObject())});var c=a(this.callSuper("toObject",["cropX","cropY"].concat(l)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:h});return this.resizeFilter&&(c.resizeFilter=this.resizeFilter.toObject()),c},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var l=[],h=[],c,f=this._element,d=-this.width/2,g=-this.height/2,m="",p="";if(!f)return[];if(this.hasCrop()){var v=t.Object.__uid++;l.push('<clipPath id="imageCrop_'+v+`">
`,'	<rect x="'+d+'" y="'+g+'" width="'+this.width+'" height="'+this.height+`" />
`,`</clipPath>
`),m=' clip-path="url(#imageCrop_'+v+')" '}if(this.imageSmoothing||(p='" image-rendering="optimizeSpeed'),h.push("	<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',d-this.cropX,'" y="',g-this.cropY,'" width="',f.width||f.naturalWidth,'" height="',f.height||f.height,p,'"',m,`></image>
`),this.stroke||this.strokeDashArray){var y=this.fill;this.fill=null,c=["	<rect ",'x="',d,'" y="',g,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),`"/>
`],this.fill=y}return this.paintFirst!=="fill"?l=l.concat(c,h):l=l.concat(h,c),l},getSrc:function(l){var h=l?this._element:this._originalElement;return h?h.toDataURL?h.toDataURL():this.srcFromAttribute?h.getAttribute("src"):h.src:this.src||""},setSrc:function(l,h,c){return t.util.loadImage(l,function(f,d){this.setElement(f,c),this._setWidthHeight(),h&&h(this,d)},this,c&&c.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var l=this.resizeFilter,h=this.minimumScaleTrigger,c=this.getTotalObjectScaling(),f=c.scaleX,d=c.scaleY,g=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!l||f>h&&d>h){this._element=g,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=f,this._lastScaleY=d;return}t.filterBackend||(t.filterBackend=t.initFilterBackend());var m=t.util.createCanvasElement(),p=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,v=g.width,y=g.height;m.width=v,m.height=y,this._element=m,this._lastScaleX=l.scaleX=f,this._lastScaleY=l.scaleY=d,t.filterBackend.applyFilters([l],g,v,y,this._element,p),this._filterScalingX=m.width/this._originalElement.width,this._filterScalingY=m.height/this._originalElement.height},applyFilters:function(l){if(l=l||this.filters||[],l=l.filter(function(g){return g&&!g.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),l.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var h=this._originalElement,c=h.naturalWidth||h.width,f=h.naturalHeight||h.height;if(this._element===this._originalElement){var d=t.util.createCanvasElement();d.width=c,d.height=f,this._element=d,this._filteredEl=d}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,c,f),this._lastScaleX=1,this._lastScaleY=1;return t.filterBackend||(t.filterBackend=t.initFilterBackend()),t.filterBackend.applyFilters(l,this._originalElement,c,f,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(l){t.util.setImageSmoothing(l,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(l),this._renderPaintInOrder(l)},drawCacheOnCanvas:function(l){t.util.setImageSmoothing(l,this.imageSmoothing),t.Object.prototype.drawCacheOnCanvas.call(this,l)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(l){var h=this._element;if(!!h){var c=this._filterScalingX,f=this._filterScalingY,d=this.width,g=this.height,m=Math.min,p=Math.max,v=p(this.cropX,0),y=p(this.cropY,0),b=h.naturalWidth||h.width,x=h.naturalHeight||h.height,w=v*c,T=y*f,_=m(d*c,b-w),E=m(g*f,x-T),k=-d/2,z=-g/2,F=m(d,b/c-v),j=m(g,x/f-y);h&&l.drawImage(h,w,T,_,E,k,z,F,j)}},_needsResize:function(){var l=this.getTotalObjectScaling();return l.scaleX!==this._lastScaleX||l.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(l,h){this.setElement(t.util.getById(l),h),t.util.addClass(this.getElement(),t.Image.CSS_CANVAS)},_initConfig:function(l){l||(l={}),this.setOptions(l),this._setWidthHeight(l)},_initFilters:function(l,h){l&&l.length?t.util.enlivenObjects(l,function(c){h&&h(c)},"fabric.Image.filters"):h&&h()},_setWidthHeight:function(l){l||(l={});var h=this.getElement();this.width=l.width||h.naturalWidth||h.width||0,this.height=l.height||h.naturalHeight||h.height||0},parsePreserveAspectRatioAttribute:function(){var l=t.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),h=this._element.width,c=this._element.height,f=1,d=1,g=0,m=0,p=0,v=0,y,b=this.width,x=this.height,w={width:b,height:x};return l&&(l.alignX!=="none"||l.alignY!=="none")?(l.meetOrSlice==="meet"&&(f=d=t.util.findScaleToFit(this._element,w),y=(b-h*f)/2,l.alignX==="Min"&&(g=-y),l.alignX==="Max"&&(g=y),y=(x-c*d)/2,l.alignY==="Min"&&(m=-y),l.alignY==="Max"&&(m=y)),l.meetOrSlice==="slice"&&(f=d=t.util.findScaleToCover(this._element,w),y=h-b/f,l.alignX==="Mid"&&(p=y/2),l.alignX==="Max"&&(p=y),y=c-x/d,l.alignY==="Mid"&&(v=y/2),l.alignY==="Max"&&(v=y),h=b/f,c=x/d)):(f=b/h,d=x/c),{width:h,height:c,scaleX:f,scaleY:d,offsetLeft:g,offsetTop:m,cropX:p,cropY:v}}}),t.Image.CSS_CANVAS="canvas-img",t.Image.prototype.getSvgSrc=t.Image.prototype.getSrc,t.Image.fromObject=function(l,h){var c=t.util.object.clone(l);t.util.loadImage(c.src,function(f,d){if(d){h&&h(null,!0);return}t.Image.prototype._initFilters.call(c,c.filters,function(g){c.filters=g||[],t.Image.prototype._initFilters.call(c,[c.resizeFilter],function(m){c.resizeFilter=m[0],t.util.enlivenObjects([c.clipPath],function(p){c.clipPath=p[0];var v=new t.Image(f,c);h(v,!1)})})})},null,c.crossOrigin)},t.Image.fromURL=function(l,h,c){t.util.loadImage(l,function(f,d){h&&h(new t.Image(f,c),d)},null,c&&c.crossOrigin)},t.Image.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),t.Image.fromElement=function(l,h,c){var f=t.parseAttributes(l,t.Image.ATTRIBUTE_NAMES);t.Image.fromURL(f["xlink:href"],h,a(c?t.util.object.clone(c):{},f))}}(e),t.util.object.extend(t.Object.prototype,{_getAngleValueForStraighten:function(){var o=this.angle%360;return o>0?Math.round((o-1)/90)*90:Math.round(o/90)*90},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(o){o=o||{};var a=function(){},l=o.onComplete||a,h=o.onChange||a,c=this;return t.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(f){c.rotate(f),h()},onComplete:function(){c.setCoords(),l()}}),this}}),t.util.object.extend(t.StaticCanvas.prototype,{straightenObject:function(o){return o.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(o){return o.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){function o(l,h){var c="precision "+h+` float;
void main(){}`,f=l.createShader(l.FRAGMENT_SHADER);return l.shaderSource(f,c),l.compileShader(f),!!l.getShaderParameter(f,l.COMPILE_STATUS)}t.isWebglSupported=function(l){if(t.isLikelyNode)return!1;l=l||t.WebglFilterBackend.prototype.tileSize;var h=document.createElement("canvas"),c=h.getContext("webgl")||h.getContext("experimental-webgl"),f=!1;if(c){t.maxTextureSize=c.getParameter(c.MAX_TEXTURE_SIZE),f=t.maxTextureSize>=l;for(var d=["highp","mediump","lowp"],g=0;g<3;g++)if(o(c,d[g])){t.webGlPrecision=d[g];break}}return this.isSupported=f,f},t.WebglFilterBackend=a;function a(l){l&&l.tileSize&&(this.tileSize=l.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}a.prototype={tileSize:2048,resources:{},setupGLContext:function(l,h){this.dispose(),this.createWebGLCanvas(l,h),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(l,h)},chooseFastestCopyGLTo2DMethod:function(l,h){var c=typeof window.performance!="undefined",f;try{new ImageData(1,1),f=!0}catch{f=!1}var d=typeof ArrayBuffer!="undefined",g=typeof Uint8ClampedArray!="undefined";if(!!(c&&f&&d&&g)){var m=t.util.createCanvasElement(),p=new ArrayBuffer(l*h*4);if(t.forceGLPutImageData){this.imageBuffer=p,this.copyGLTo2D=u;return}var v={imageBuffer:p,destinationWidth:l,destinationHeight:h,targetCanvas:m},y,b,x;m.width=l,m.height=h,y=window.performance.now(),s.call(v,this.gl,v),b=window.performance.now()-y,y=window.performance.now(),u.call(v,this.gl,v),x=window.performance.now()-y,b>x?(this.imageBuffer=p,this.copyGLTo2D=u):this.copyGLTo2D=s}},createWebGLCanvas:function(l,h){var c=t.util.createCanvasElement();c.width=l,c.height=h;var f={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},d=c.getContext("webgl",f);d||(d=c.getContext("experimental-webgl",f)),!!d&&(d.clearColor(0,0,0,0),this.canvas=c,this.gl=d)},applyFilters:function(l,h,c,f,d,g){var m=this.gl,p;g&&(p=this.getCachedTexture(g,h));var v={originalWidth:h.width||h.originalWidth,originalHeight:h.height||h.originalHeight,sourceWidth:c,sourceHeight:f,destinationWidth:c,destinationHeight:f,context:m,sourceTexture:this.createTexture(m,c,f,!p&&h),targetTexture:this.createTexture(m,c,f),originalTexture:p||this.createTexture(m,c,f,!p&&h),passes:l.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:d},y=m.createFramebuffer();return m.bindFramebuffer(m.FRAMEBUFFER,y),l.forEach(function(b){b&&b.applyTo(v)}),i(v),this.copyGLTo2D(m,v),m.bindTexture(m.TEXTURE_2D,null),m.deleteTexture(v.sourceTexture),m.deleteTexture(v.targetTexture),m.deleteFramebuffer(y),d.getContext("2d").setTransform(1,0,0,1,0,0),v},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(l,h,c,f){var d=l.createTexture();return l.bindTexture(l.TEXTURE_2D,d),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),f?l.texImage2D(l.TEXTURE_2D,0,l.RGBA,l.RGBA,l.UNSIGNED_BYTE,f):l.texImage2D(l.TEXTURE_2D,0,l.RGBA,h,c,0,l.RGBA,l.UNSIGNED_BYTE,null),d},getCachedTexture:function(l,h){if(this.textureCache[l])return this.textureCache[l];var c=this.createTexture(this.gl,h.width,h.height,h);return this.textureCache[l]=c,c},evictCachesForKey:function(l){this.textureCache[l]&&(this.gl.deleteTexture(this.textureCache[l]),delete this.textureCache[l])},copyGLTo2D:s,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var l=this.gl,h={renderer:"",vendor:""};if(!l)return h;var c=l.getExtension("WEBGL_debug_renderer_info");if(c){var f=l.getParameter(c.UNMASKED_RENDERER_WEBGL),d=l.getParameter(c.UNMASKED_VENDOR_WEBGL);f&&(h.renderer=f.toLowerCase()),d&&(h.vendor=d.toLowerCase())}return this.gpuInfo=h,h}}}();function i(o){var a=o.targetCanvas,l=a.width,h=a.height,c=o.destinationWidth,f=o.destinationHeight;(l!==c||h!==f)&&(a.width=c,a.height=f)}function s(o,a){var l=o.canvas,h=a.targetCanvas,c=h.getContext("2d");c.translate(0,h.height),c.scale(1,-1);var f=l.height-h.height;c.drawImage(l,0,f,h.width,h.height,0,0,h.width,h.height)}function u(o,a){var l=a.targetCanvas,h=l.getContext("2d"),c=a.destinationWidth,f=a.destinationHeight,d=c*f*4,g=new Uint8Array(this.imageBuffer,0,d),m=new Uint8ClampedArray(this.imageBuffer,0,d);o.readPixels(0,0,c,f,o.RGBA,o.UNSIGNED_BYTE,g);var p=new ImageData(m,c,f);h.putImageData(p,0,0)}(function(){var o=function(){};t.Canvas2dFilterBackend=a;function a(){}a.prototype={evictCachesForKey:o,dispose:o,clearWebGLCaches:o,resources:{},applyFilters:function(l,h,c,f,d){var g=d.getContext("2d");g.drawImage(h,0,0,c,f);var m=g.getImageData(0,0,c,f),p=g.getImageData(0,0,c,f),v={sourceWidth:c,sourceHeight:f,imageData:m,originalEl:h,originalImageData:p,canvasEl:d,ctx:g,filterBackend:this};return l.forEach(function(y){y.applyTo(v)}),(v.imageData.width!==c||v.imageData.height!==f)&&(d.width=v.imageData.width,d.height=v.imageData.height),g.putImageData(v.imageData,0,0),v}}})(),t.Image=t.Image||{},t.Image.filters=t.Image.filters||{},t.Image.filters.BaseFilter=t.util.createClass({type:"BaseFilter",vertexSource:`attribute vec2 aPosition;
varying vec2 vTexCoord;
void main() {
vTexCoord = aPosition;
gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);
}`,fragmentSource:`precision highp float;
varying vec2 vTexCoord;
uniform sampler2D uTexture;
void main() {
gl_FragColor = texture2D(uTexture, vTexCoord);
}`,initialize:function(o){o&&this.setOptions(o)},setOptions:function(o){for(var a in o)this[a]=o[a]},createProgram:function(o,a,l){a=a||this.fragmentSource,l=l||this.vertexSource,t.webGlPrecision!=="highp"&&(a=a.replace(/precision highp float/g,"precision "+t.webGlPrecision+" float"));var h=o.createShader(o.VERTEX_SHADER);if(o.shaderSource(h,l),o.compileShader(h),!o.getShaderParameter(h,o.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+o.getShaderInfoLog(h));var c=o.createShader(o.FRAGMENT_SHADER);if(o.shaderSource(c,a),o.compileShader(c),!o.getShaderParameter(c,o.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+o.getShaderInfoLog(c));var f=o.createProgram();if(o.attachShader(f,h),o.attachShader(f,c),o.linkProgram(f),!o.getProgramParameter(f,o.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+o.getProgramInfoLog(f));var d=this.getAttributeLocations(o,f),g=this.getUniformLocations(o,f)||{};return g.uStepW=o.getUniformLocation(f,"uStepW"),g.uStepH=o.getUniformLocation(f,"uStepH"),{program:f,attributeLocations:d,uniformLocations:g}},getAttributeLocations:function(o,a){return{aPosition:o.getAttribLocation(a,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(o,a,l){var h=a.aPosition,c=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,c),o.enableVertexAttribArray(h),o.vertexAttribPointer(h,2,o.FLOAT,!1,0,0),o.bufferData(o.ARRAY_BUFFER,l,o.STATIC_DRAW)},_setupFrameBuffer:function(o){var a=o.context,l,h;o.passes>1?(l=o.destinationWidth,h=o.destinationHeight,(o.sourceWidth!==l||o.sourceHeight!==h)&&(a.deleteTexture(o.targetTexture),o.targetTexture=o.filterBackend.createTexture(a,l,h)),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,o.targetTexture,0)):(a.bindFramebuffer(a.FRAMEBUFFER,null),a.finish())},_swapTextures:function(o){o.passes--,o.pass++;var a=o.targetTexture;o.targetTexture=o.sourceTexture,o.sourceTexture=a},isNeutralState:function(){var o=this.mainParameter,a=t.Image.filters[this.type].prototype;if(o)if(Array.isArray(a[o])){for(var l=a[o].length;l--;)if(this[o][l]!==a[o][l])return!1;return!0}else return a[o]===this[o];else return!1},applyTo:function(o){o.webgl?(this._setupFrameBuffer(o),this.applyToWebGL(o),this._swapTextures(o)):this.applyTo2d(o)},retrieveShader:function(o){return o.programCache.hasOwnProperty(this.type)||(o.programCache[this.type]=this.createProgram(o.context)),o.programCache[this.type]},applyToWebGL:function(o){var a=o.context,l=this.retrieveShader(o);o.pass===0&&o.originalTexture?a.bindTexture(a.TEXTURE_2D,o.originalTexture):a.bindTexture(a.TEXTURE_2D,o.sourceTexture),a.useProgram(l.program),this.sendAttributeData(a,l.attributeLocations,o.aPosition),a.uniform1f(l.uniformLocations.uStepW,1/o.sourceWidth),a.uniform1f(l.uniformLocations.uStepH,1/o.sourceHeight),this.sendUniformData(a,l.uniformLocations),a.viewport(0,0,o.destinationWidth,o.destinationHeight),a.drawArrays(a.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(o,a,l){o.activeTexture(l),o.bindTexture(o.TEXTURE_2D,a),o.activeTexture(o.TEXTURE0)},unbindAdditionalTexture:function(o,a){o.activeTexture(a),o.bindTexture(o.TEXTURE_2D,null),o.activeTexture(o.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(o){this[this.mainParameter]=o},sendUniformData:function(){},createHelpLayer:function(o){if(!o.helpLayer){var a=document.createElement("canvas");a.width=o.sourceWidth,a.height=o.sourceHeight,o.helpLayer=a}},toObject:function(){var o={type:this.type},a=this.mainParameter;return a&&(o[a]=this[a]),o},toJSON:function(){return this.toObject()}}),t.Image.filters.BaseFilter.fromObject=function(o,a){var l=new t.Image.filters[o.type](o);return a&&a(l),l},function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.ColorMatrix=h(l.BaseFilter,{type:"ColorMatrix",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
varying vec2 vTexCoord;
uniform mat4 uColorMatrix;
uniform vec4 uConstants;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
color *= uColorMatrix;
color += uConstants;
gl_FragColor = color;
}`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(c){this.callSuper("initialize",c),this.matrix=this.matrix.slice(0)},applyTo2d:function(c){var f=c.imageData,d=f.data,g=d.length,m=this.matrix,p,v,y,b,x,w=this.colorsOnly;for(x=0;x<g;x+=4)p=d[x],v=d[x+1],y=d[x+2],w?(d[x]=p*m[0]+v*m[1]+y*m[2]+m[4]*255,d[x+1]=p*m[5]+v*m[6]+y*m[7]+m[9]*255,d[x+2]=p*m[10]+v*m[11]+y*m[12]+m[14]*255):(b=d[x+3],d[x]=p*m[0]+v*m[1]+y*m[2]+b*m[3]+m[4]*255,d[x+1]=p*m[5]+v*m[6]+y*m[7]+b*m[8]+m[9]*255,d[x+2]=p*m[10]+v*m[11]+y*m[12]+b*m[13]+m[14]*255,d[x+3]=p*m[15]+v*m[16]+y*m[17]+b*m[18]+m[19]*255)},getUniformLocations:function(c,f){return{uColorMatrix:c.getUniformLocation(f,"uColorMatrix"),uConstants:c.getUniformLocation(f,"uConstants")}},sendUniformData:function(c,f){var d=this.matrix,g=[d[0],d[1],d[2],d[3],d[5],d[6],d[7],d[8],d[10],d[11],d[12],d[13],d[15],d[16],d[17],d[18]],m=[d[4],d[9],d[14],d[19]];c.uniformMatrix4fv(f.uColorMatrix,!1,g),c.uniform4fv(f.uConstants,m)}}),a.Image.filters.ColorMatrix.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Brightness=h(l.BaseFilter,{type:"Brightness",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uBrightness;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
color.rgb += uBrightness;
gl_FragColor = color;
}`,brightness:0,mainParameter:"brightness",applyTo2d:function(c){if(this.brightness!==0){var f=c.imageData,d=f.data,g,m=d.length,p=Math.round(this.brightness*255);for(g=0;g<m;g+=4)d[g]=d[g]+p,d[g+1]=d[g+1]+p,d[g+2]=d[g+2]+p}},getUniformLocations:function(c,f){return{uBrightness:c.getUniformLocation(f,"uBrightness")}},sendUniformData:function(c,f){c.uniform1f(f.uBrightness,this.brightness)}}),a.Image.filters.Brightness.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.util.object.extend,h=a.Image.filters,c=a.util.createClass;h.Convolute=c(h.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[9];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 0);
for (float h = 0.0; h < 3.0; h+=1.0) {
for (float w = 0.0; w < 3.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];
}
}
gl_FragColor = color;
}`,Convolute_3_0:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[9];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 1);
for (float h = 0.0; h < 3.0; h+=1.0) {
for (float w = 0.0; w < 3.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];
}
}
float alpha = texture2D(uTexture, vTexCoord).a;
gl_FragColor = color;
gl_FragColor.a = alpha;
}`,Convolute_5_1:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[25];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 0);
for (float h = 0.0; h < 5.0; h+=1.0) {
for (float w = 0.0; w < 5.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];
}
}
gl_FragColor = color;
}`,Convolute_5_0:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[25];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 1);
for (float h = 0.0; h < 5.0; h+=1.0) {
for (float w = 0.0; w < 5.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];
}
}
float alpha = texture2D(uTexture, vTexCoord).a;
gl_FragColor = color;
gl_FragColor.a = alpha;
}`,Convolute_7_1:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[49];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 0);
for (float h = 0.0; h < 7.0; h+=1.0) {
for (float w = 0.0; w < 7.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];
}
}
gl_FragColor = color;
}`,Convolute_7_0:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[49];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 1);
for (float h = 0.0; h < 7.0; h+=1.0) {
for (float w = 0.0; w < 7.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];
}
}
float alpha = texture2D(uTexture, vTexCoord).a;
gl_FragColor = color;
gl_FragColor.a = alpha;
}`,Convolute_9_1:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[81];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 0);
for (float h = 0.0; h < 9.0; h+=1.0) {
for (float w = 0.0; w < 9.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];
}
}
gl_FragColor = color;
}`,Convolute_9_0:`precision highp float;
uniform sampler2D uTexture;
uniform float uMatrix[81];
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
vec4 color = vec4(0, 0, 0, 1);
for (float h = 0.0; h < 9.0; h+=1.0) {
for (float w = 0.0; w < 9.0; w+=1.0) {
vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];
}
}
float alpha = texture2D(uTexture, vTexCoord).a;
gl_FragColor = color;
gl_FragColor.a = alpha;
}`},retrieveShader:function(f){var d=Math.sqrt(this.matrix.length),g=this.type+"_"+d+"_"+(this.opaque?1:0),m=this.fragmentSource[g];return f.programCache.hasOwnProperty(g)||(f.programCache[g]=this.createProgram(f.context,m)),f.programCache[g]},applyTo2d:function(f){var d=f.imageData,g=d.data,m=this.matrix,p=Math.round(Math.sqrt(m.length)),v=Math.floor(p/2),y=d.width,b=d.height,x=f.ctx.createImageData(y,b),w=x.data,T=this.opaque?1:0,_,E,k,z,F,j,K,B,H,ue,ge,fe,L;for(ge=0;ge<b;ge++)for(ue=0;ue<y;ue++){for(F=(ge*y+ue)*4,_=0,E=0,k=0,z=0,L=0;L<p;L++)for(fe=0;fe<p;fe++)K=ge+L-v,j=ue+fe-v,!(K<0||K>=b||j<0||j>=y)&&(B=(K*y+j)*4,H=m[L*p+fe],_+=g[B]*H,E+=g[B+1]*H,k+=g[B+2]*H,T||(z+=g[B+3]*H));w[F]=_,w[F+1]=E,w[F+2]=k,T?w[F+3]=g[F+3]:w[F+3]=z}f.imageData=x},getUniformLocations:function(f,d){return{uMatrix:f.getUniformLocation(d,"uMatrix"),uOpaque:f.getUniformLocation(d,"uOpaque"),uHalfSize:f.getUniformLocation(d,"uHalfSize"),uSize:f.getUniformLocation(d,"uSize")}},sendUniformData:function(f,d){f.uniform1fv(d.uMatrix,this.matrix)},toObject:function(){return l(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),a.Image.filters.Convolute.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Grayscale=h(l.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float;
uniform sampler2D uTexture;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
float average = (color.r + color.b + color.g) / 3.0;
gl_FragColor = vec4(average, average, average, color.a);
}`,lightness:`precision highp float;
uniform sampler2D uTexture;
uniform int uMode;
varying vec2 vTexCoord;
void main() {
vec4 col = texture2D(uTexture, vTexCoord);
float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;
gl_FragColor = vec4(average, average, average, col.a);
}`,luminosity:`precision highp float;
uniform sampler2D uTexture;
uniform int uMode;
varying vec2 vTexCoord;
void main() {
vec4 col = texture2D(uTexture, vTexCoord);
float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;
gl_FragColor = vec4(average, average, average, col.a);
}`},mode:"average",mainParameter:"mode",applyTo2d:function(c){var f=c.imageData,d=f.data,g,m=d.length,p,v=this.mode;for(g=0;g<m;g+=4)v==="average"?p=(d[g]+d[g+1]+d[g+2])/3:v==="lightness"?p=(Math.min(d[g],d[g+1],d[g+2])+Math.max(d[g],d[g+1],d[g+2]))/2:v==="luminosity"&&(p=.21*d[g]+.72*d[g+1]+.07*d[g+2]),d[g]=p,d[g+1]=p,d[g+2]=p},retrieveShader:function(c){var f=this.type+"_"+this.mode;if(!c.programCache.hasOwnProperty(f)){var d=this.fragmentSource[this.mode];c.programCache[f]=this.createProgram(c.context,d)}return c.programCache[f]},getUniformLocations:function(c,f){return{uMode:c.getUniformLocation(f,"uMode")}},sendUniformData:function(c,f){var d=1;c.uniform1i(f.uMode,d)},isNeutralState:function(){return!1}}),a.Image.filters.Grayscale.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Invert=h(l.BaseFilter,{type:"Invert",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform int uInvert;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
if (uInvert == 1) {
gl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);
} else {
gl_FragColor = color;
}
}`,invert:!0,mainParameter:"invert",applyTo2d:function(c){var f=c.imageData,d=f.data,g,m=d.length;for(g=0;g<m;g+=4)d[g]=255-d[g],d[g+1]=255-d[g+1],d[g+2]=255-d[g+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(c,f){return{uInvert:c.getUniformLocation(f,"uInvert")}},sendUniformData:function(c,f){c.uniform1i(f.uInvert,this.invert)}}),a.Image.filters.Invert.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.util.object.extend,h=a.Image.filters,c=a.util.createClass;h.Noise=c(h.BaseFilter,{type:"Noise",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uStepH;
uniform float uNoise;
uniform float uSeed;
varying vec2 vTexCoord;
float rand(vec2 co, float seed, float vScale) {
return fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);
}
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
color.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;
gl_FragColor = color;
}`,mainParameter:"noise",noise:0,applyTo2d:function(f){if(this.noise!==0){var d=f.imageData,g=d.data,m,p=g.length,v=this.noise,y;for(m=0,p=g.length;m<p;m+=4)y=(.5-Math.random())*v,g[m]+=y,g[m+1]+=y,g[m+2]+=y}},getUniformLocations:function(f,d){return{uNoise:f.getUniformLocation(d,"uNoise"),uSeed:f.getUniformLocation(d,"uSeed")}},sendUniformData:function(f,d){f.uniform1f(d.uNoise,this.noise/255),f.uniform1f(d.uSeed,Math.random())},toObject:function(){return l(this.callSuper("toObject"),{noise:this.noise})}}),a.Image.filters.Noise.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Pixelate=h(l.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uBlocksize;
uniform float uStepW;
uniform float uStepH;
varying vec2 vTexCoord;
void main() {
float blockW = uBlocksize * uStepW;
float blockH = uBlocksize * uStepW;
int posX = int(vTexCoord.x / blockW);
int posY = int(vTexCoord.y / blockH);
float fposX = float(posX);
float fposY = float(posY);
vec2 squareCoords = vec2(fposX * blockW, fposY * blockH);
vec4 color = texture2D(uTexture, squareCoords);
gl_FragColor = color;
}`,applyTo2d:function(c){var f=c.imageData,d=f.data,g=f.height,m=f.width,p,v,y,b,x,w,T,_,E,k,z;for(v=0;v<g;v+=this.blocksize)for(y=0;y<m;y+=this.blocksize)for(p=v*4*m+y*4,b=d[p],x=d[p+1],w=d[p+2],T=d[p+3],k=Math.min(v+this.blocksize,g),z=Math.min(y+this.blocksize,m),_=v;_<k;_++)for(E=y;E<z;E++)p=_*4*m+E*4,d[p]=b,d[p+1]=x,d[p+2]=w,d[p+3]=T},isNeutralState:function(){return this.blocksize===1},getUniformLocations:function(c,f){return{uBlocksize:c.getUniformLocation(f,"uBlocksize"),uStepW:c.getUniformLocation(f,"uStepW"),uStepH:c.getUniformLocation(f,"uStepH")}},sendUniformData:function(c,f){c.uniform1f(f.uBlocksize,this.blocksize)}}),a.Image.filters.Pixelate.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.util.object.extend,h=a.Image.filters,c=a.util.createClass;h.RemoveColor=c(h.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform vec4 uLow;
uniform vec4 uHigh;
varying vec2 vTexCoord;
void main() {
gl_FragColor = texture2D(uTexture, vTexCoord);
if(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {
gl_FragColor.a = 0.0;
}
}`,distance:.02,useAlpha:!1,applyTo2d:function(f){var d=f.imageData,g=d.data,m,p=this.distance*255,v,y,b,x=new a.Color(this.color).getSource(),w=[x[0]-p,x[1]-p,x[2]-p],T=[x[0]+p,x[1]+p,x[2]+p];for(m=0;m<g.length;m+=4)v=g[m],y=g[m+1],b=g[m+2],v>w[0]&&y>w[1]&&b>w[2]&&v<T[0]&&y<T[1]&&b<T[2]&&(g[m+3]=0)},getUniformLocations:function(f,d){return{uLow:f.getUniformLocation(d,"uLow"),uHigh:f.getUniformLocation(d,"uHigh")}},sendUniformData:function(f,d){var g=new a.Color(this.color).getSource(),m=parseFloat(this.distance),p=[0+g[0]/255-m,0+g[1]/255-m,0+g[2]/255-m,1],v=[g[0]/255+m,g[1]/255+m,g[2]/255+m,1];f.uniform4fv(d.uLow,p),f.uniform4fv(d.uHigh,v)},toObject:function(){return l(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),a.Image.filters.RemoveColor.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass,c={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var f in c)l[f]=h(l.ColorMatrix,{type:f,matrix:c[f],mainParameter:!1,colorsOnly:!0}),a.Image.filters[f].fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric,l=a.Image.filters,h=a.util.createClass;l.BlendColor=h(l.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:`gl_FragColor.rgb *= uColor.rgb;
`,screen:`gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);
`,add:`gl_FragColor.rgb += uColor.rgb;
`,diff:`gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);
`,subtract:`gl_FragColor.rgb -= uColor.rgb;
`,lighten:`gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);
`,darken:`gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);
`,exclusion:`gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);
`,overlay:`if (uColor.r < 0.5) {
gl_FragColor.r *= 2.0 * uColor.r;
} else {
gl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);
}
if (uColor.g < 0.5) {
gl_FragColor.g *= 2.0 * uColor.g;
} else {
gl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);
}
if (uColor.b < 0.5) {
gl_FragColor.b *= 2.0 * uColor.b;
} else {
gl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);
}
`,tint:`gl_FragColor.rgb *= (1.0 - uColor.a);
gl_FragColor.rgb += uColor.rgb;
`},buildSource:function(c){return`precision highp float;
uniform sampler2D uTexture;
uniform vec4 uColor;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
gl_FragColor = color;
if (color.a > 0.0) {
`+this.fragmentSource[c]+`}
}`},retrieveShader:function(c){var f=this.type+"_"+this.mode,d;return c.programCache.hasOwnProperty(f)||(d=this.buildSource(this.mode),c.programCache[f]=this.createProgram(c.context,d)),c.programCache[f]},applyTo2d:function(c){var f=c.imageData,d=f.data,g=d.length,m,p,v,y,b,x,w,T=1-this.alpha;w=new a.Color(this.color).getSource(),m=w[0]*this.alpha,p=w[1]*this.alpha,v=w[2]*this.alpha;for(var _=0;_<g;_+=4)switch(y=d[_],b=d[_+1],x=d[_+2],this.mode){case"multiply":d[_]=y*m/255,d[_+1]=b*p/255,d[_+2]=x*v/255;break;case"screen":d[_]=255-(255-y)*(255-m)/255,d[_+1]=255-(255-b)*(255-p)/255,d[_+2]=255-(255-x)*(255-v)/255;break;case"add":d[_]=y+m,d[_+1]=b+p,d[_+2]=x+v;break;case"diff":case"difference":d[_]=Math.abs(y-m),d[_+1]=Math.abs(b-p),d[_+2]=Math.abs(x-v);break;case"subtract":d[_]=y-m,d[_+1]=b-p,d[_+2]=x-v;break;case"darken":d[_]=Math.min(y,m),d[_+1]=Math.min(b,p),d[_+2]=Math.min(x,v);break;case"lighten":d[_]=Math.max(y,m),d[_+1]=Math.max(b,p),d[_+2]=Math.max(x,v);break;case"overlay":d[_]=m<128?2*y*m/255:255-2*(255-y)*(255-m)/255,d[_+1]=p<128?2*b*p/255:255-2*(255-b)*(255-p)/255,d[_+2]=v<128?2*x*v/255:255-2*(255-x)*(255-v)/255;break;case"exclusion":d[_]=m+y-2*m*y/255,d[_+1]=p+b-2*p*b/255,d[_+2]=v+x-2*v*x/255;break;case"tint":d[_]=m+y*T,d[_+1]=p+b*T,d[_+2]=v+x*T}},getUniformLocations:function(c,f){return{uColor:c.getUniformLocation(f,"uColor")}},sendUniformData:function(c,f){var d=new a.Color(this.color).getSource();d[0]=this.alpha*d[0]/255,d[1]=this.alpha*d[1]/255,d[2]=this.alpha*d[2]/255,d[3]=this.alpha,c.uniform4fv(f.uColor,d)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),a.Image.filters.BlendColor.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric,l=a.Image.filters,h=a.util.createClass;l.BlendImage=h(l.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:`attribute vec2 aPosition;
varying vec2 vTexCoord;
varying vec2 vTexCoord2;
uniform mat3 uTransformMatrix;
void main() {
vTexCoord = aPosition;
vTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;
gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);
}`,fragmentSource:{multiply:`precision highp float;
uniform sampler2D uTexture;
uniform sampler2D uImage;
uniform vec4 uColor;
varying vec2 vTexCoord;
varying vec2 vTexCoord2;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
vec4 color2 = texture2D(uImage, vTexCoord2);
color.rgba *= color2.rgba;
gl_FragColor = color;
}`,mask:`precision highp float;
uniform sampler2D uTexture;
uniform sampler2D uImage;
uniform vec4 uColor;
varying vec2 vTexCoord;
varying vec2 vTexCoord2;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
vec4 color2 = texture2D(uImage, vTexCoord2);
color.a = color2.a;
gl_FragColor = color;
}`},retrieveShader:function(c){var f=this.type+"_"+this.mode,d=this.fragmentSource[this.mode];return c.programCache.hasOwnProperty(f)||(c.programCache[f]=this.createProgram(c.context,d)),c.programCache[f]},applyToWebGL:function(c){var f=c.context,d=this.createTexture(c.filterBackend,this.image);this.bindAdditionalTexture(f,d,f.TEXTURE1),this.callSuper("applyToWebGL",c),this.unbindAdditionalTexture(f,f.TEXTURE1)},createTexture:function(c,f){return c.getCachedTexture(f.cacheKey,f._element)},calculateMatrix:function(){var c=this.image,f=c._element.width,d=c._element.height;return[1/c.scaleX,0,0,0,1/c.scaleY,0,-c.left/f,-c.top/d,1]},applyTo2d:function(c){var f=c.imageData,d=c.filterBackend.resources,g=f.data,m=g.length,p=f.width,v=f.height,y,b,x,w,T,_,E,k,z,F,j=this.image,K;d.blendImage||(d.blendImage=a.util.createCanvasElement()),z=d.blendImage,F=z.getContext("2d"),z.width!==p||z.height!==v?(z.width=p,z.height=v):F.clearRect(0,0,p,v),F.setTransform(j.scaleX,0,0,j.scaleY,j.left,j.top),F.drawImage(j._element,0,0,p,v),K=F.getImageData(0,0,p,v).data;for(var B=0;B<m;B+=4)switch(T=g[B],_=g[B+1],E=g[B+2],k=g[B+3],y=K[B],b=K[B+1],x=K[B+2],w=K[B+3],this.mode){case"multiply":g[B]=T*y/255,g[B+1]=_*b/255,g[B+2]=E*x/255,g[B+3]=k*w/255;break;case"mask":g[B+3]=w;break}},getUniformLocations:function(c,f){return{uTransformMatrix:c.getUniformLocation(f,"uTransformMatrix"),uImage:c.getUniformLocation(f,"uImage")}},sendUniformData:function(c,f){var d=this.calculateMatrix();c.uniform1i(f.uImage,1),c.uniformMatrix3fv(f.uTransformMatrix,!1,d)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),a.Image.filters.BlendImage.fromObject=function(c,f){a.Image.fromObject(c.image,function(d){var g=a.util.object.clone(c);g.image=d,f(new a.Image.filters.BlendImage(g))})}}(e),function(o){var a=o.fabric||(o.fabric={}),l=Math.pow,h=Math.floor,c=Math.sqrt,f=Math.abs,d=Math.round,g=Math.sin,m=Math.ceil,p=a.Image.filters,v=a.util.createClass;p.Resize=v(p.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(y,b){return{uDelta:y.getUniformLocation(b,"uDelta"),uTaps:y.getUniformLocation(b,"uTaps")}},sendUniformData:function(y,b){y.uniform2fv(b.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),y.uniform1fv(b.uTaps,this.taps)},retrieveShader:function(y){var b=this.getFilterWindow(),x=this.type+"_"+b;if(!y.programCache.hasOwnProperty(x)){var w=this.generateShader(b);y.programCache[x]=this.createProgram(y.context,w)}return y.programCache[x]},getFilterWindow:function(){var y=this.tempScale;return Math.ceil(this.lanczosLobes/y)},getTaps:function(){for(var y=this.lanczosCreate(this.lanczosLobes),b=this.tempScale,x=this.getFilterWindow(),w=new Array(x),T=1;T<=x;T++)w[T-1]=y(T*b);return w},generateShader:function(w){for(var b=new Array(w),x=this.fragmentSourceTOP,w,T=1;T<=w;T++)b[T-1]=T+".0 * uDelta";return x+="uniform float uTaps["+w+`];
`,x+=`void main() {
`,x+=`  vec4 color = texture2D(uTexture, vTexCoord);
`,x+=`  float sum = 1.0;
`,b.forEach(function(_,E){x+="  color += texture2D(uTexture, vTexCoord + "+_+") * uTaps["+E+`];
`,x+="  color += texture2D(uTexture, vTexCoord - "+_+") * uTaps["+E+`];
`,x+="  sum += 2.0 * uTaps["+E+`];
`}),x+=`  gl_FragColor = color / sum;
`,x+="}",x},fragmentSourceTOP:`precision highp float;
uniform sampler2D uTexture;
uniform vec2 uDelta;
varying vec2 vTexCoord;
`,applyTo:function(y){y.webgl?(y.passes++,this.width=y.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=y.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),y.destinationWidth=this.dW,this._setupFrameBuffer(y),this.applyToWebGL(y),this._swapTextures(y),y.sourceWidth=y.destinationWidth,this.height=y.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),y.destinationHeight=this.dH,this._setupFrameBuffer(y),this.applyToWebGL(y),this._swapTextures(y),y.sourceHeight=y.destinationHeight):this.applyTo2d(y)},isNeutralState:function(){return this.scaleX===1&&this.scaleY===1},lanczosCreate:function(y){return function(b){if(b>=y||b<=-y)return 0;if(b<11920929e-14&&b>-11920929e-14)return 1;b*=Math.PI;var x=b/y;return g(b)/b*g(x)/x}},applyTo2d:function(y){var b=y.imageData,x=this.scaleX,w=this.scaleY;this.rcpScaleX=1/x,this.rcpScaleY=1/w;var T=b.width,_=b.height,E=d(T*x),k=d(_*w),z;this.resizeType==="sliceHack"?z=this.sliceByTwo(y,T,_,E,k):this.resizeType==="hermite"?z=this.hermiteFastResize(y,T,_,E,k):this.resizeType==="bilinear"?z=this.bilinearFiltering(y,T,_,E,k):this.resizeType==="lanczos"&&(z=this.lanczosResize(y,T,_,E,k)),y.imageData=z},sliceByTwo:function(y,b,x,w,T){var _=y.imageData,E=.5,k=!1,z=!1,F=b*E,j=x*E,K=a.filterBackend.resources,B,H,ue=0,ge=0,fe=b,L=0;for(K.sliceByTwo||(K.sliceByTwo=document.createElement("canvas")),B=K.sliceByTwo,(B.width<b*1.5||B.height<x)&&(B.width=b*1.5,B.height=x),H=B.getContext("2d"),H.clearRect(0,0,b*1.5,x),H.putImageData(_,0,0),w=h(w),T=h(T);!k||!z;)b=F,x=j,w<h(F*E)?F=h(F*E):(F=w,k=!0),T<h(j*E)?j=h(j*E):(j=T,z=!0),H.drawImage(B,ue,ge,b,x,fe,L,F,j),ue=fe,ge=L,L+=j;return H.getImageData(ue,ge,w,T)},lanczosResize:function(y,b,x,w,T){function _(M){var D,R,P,O,N,I,q,X,ne,re,ae;for(L.x=(M+.5)*j,Z.x=h(L.x),D=0;D<T;D++){for(L.y=(D+.5)*K,Z.y=h(L.y),N=0,I=0,q=0,X=0,ne=0,R=Z.x-ue;R<=Z.x+ue;R++)if(!(R<0||R>=b)){re=h(1e3*f(R-L.x)),fe[re]||(fe[re]={});for(var G=Z.y-ge;G<=Z.y+ge;G++)G<0||G>=x||(ae=h(1e3*f(G-L.y)),fe[re][ae]||(fe[re][ae]=F(c(l(re*B,2)+l(ae*H,2))/1e3)),P=fe[re][ae],P>0&&(O=(G*b+R)*4,N+=P,I+=P*E[O],q+=P*E[O+1],X+=P*E[O+2],ne+=P*E[O+3]))}O=(D*w+M)*4,z[O]=I/N,z[O+1]=q/N,z[O+2]=X/N,z[O+3]=ne/N}return++M<w?_(M):k}var E=y.imageData.data,k=y.ctx.createImageData(w,T),z=k.data,F=this.lanczosCreate(this.lanczosLobes),j=this.rcpScaleX,K=this.rcpScaleY,B=2/this.rcpScaleX,H=2/this.rcpScaleY,ue=m(j*this.lanczosLobes/2),ge=m(K*this.lanczosLobes/2),fe={},L={},Z={};return _(0)},bilinearFiltering:function(y,b,x,w,T){var _,E,k,z,F,j,K,B,H,ue,ge,fe,L=0,Z,M=this.rcpScaleX,D=this.rcpScaleY,R=4*(b-1),P=y.imageData,O=P.data,N=y.ctx.createImageData(w,T),I=N.data;for(K=0;K<T;K++)for(B=0;B<w;B++)for(F=h(M*B),j=h(D*K),H=M*B-F,ue=D*K-j,Z=4*(j*b+F),ge=0;ge<4;ge++)_=O[Z+ge],E=O[Z+4+ge],k=O[Z+R+ge],z=O[Z+R+4+ge],fe=_*(1-H)*(1-ue)+E*H*(1-ue)+k*ue*(1-H)+z*H*ue,I[L++]=fe;return N},hermiteFastResize:function(y,b,x,w,T){for(var _=this.rcpScaleX,E=this.rcpScaleY,k=m(_/2),z=m(E/2),F=y.imageData,j=F.data,K=y.ctx.createImageData(w,T),B=K.data,H=0;H<T;H++)for(var ue=0;ue<w;ue++){for(var ge=(ue+H*w)*4,fe=0,L=0,Z=0,M=0,D=0,R=0,P=0,O=(H+.5)*E,N=h(H*E);N<(H+1)*E;N++)for(var I=f(O-(N+.5))/z,q=(ue+.5)*_,X=I*I,ne=h(ue*_);ne<(ue+1)*_;ne++){var re=f(q-(ne+.5))/k,ae=c(X+re*re);ae>1&&ae<-1||(fe=2*ae*ae*ae-3*ae*ae+1,fe>0&&(re=4*(ne+N*b),P+=fe*j[re+3],Z+=fe,j[re+3]<255&&(fe=fe*j[re+3]/250),M+=fe*j[re],D+=fe*j[re+1],R+=fe*j[re+2],L+=fe))}B[ge]=M/L,B[ge+1]=D/L,B[ge+2]=R/L,B[ge+3]=P/Z}return K},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),a.Image.filters.Resize.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Contrast=h(l.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uContrast;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));
color.rgb = contrastF * (color.rgb - 0.5) + 0.5;
gl_FragColor = color;
}`,contrast:0,mainParameter:"contrast",applyTo2d:function(c){if(this.contrast!==0){var f=c.imageData,d,m,g=f.data,m=g.length,p=Math.floor(this.contrast*255),v=259*(p+255)/(255*(259-p));for(d=0;d<m;d+=4)g[d]=v*(g[d]-128)+128,g[d+1]=v*(g[d+1]-128)+128,g[d+2]=v*(g[d+2]-128)+128}},getUniformLocations:function(c,f){return{uContrast:c.getUniformLocation(f,"uContrast")}},sendUniformData:function(c,f){c.uniform1f(f.uContrast,this.contrast)}}),a.Image.filters.Contrast.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Saturation=h(l.BaseFilter,{type:"Saturation",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uSaturation;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
float rgMax = max(color.r, color.g);
float rgbMax = max(rgMax, color.b);
color.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;
color.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;
color.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;
gl_FragColor = color;
}`,saturation:0,mainParameter:"saturation",applyTo2d:function(c){if(this.saturation!==0){var f=c.imageData,d=f.data,g=d.length,m=-this.saturation,p,v;for(p=0;p<g;p+=4)v=Math.max(d[p],d[p+1],d[p+2]),d[p]+=v!==d[p]?(v-d[p])*m:0,d[p+1]+=v!==d[p+1]?(v-d[p+1])*m:0,d[p+2]+=v!==d[p+2]?(v-d[p+2])*m:0}},getUniformLocations:function(c,f){return{uSaturation:c.getUniformLocation(f,"uSaturation")}},sendUniformData:function(c,f){c.uniform1f(f.uSaturation,-this.saturation)}}),a.Image.filters.Saturation.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Vibrance=h(l.BaseFilter,{type:"Vibrance",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform float uVibrance;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
float max = max(color.r, max(color.g, color.b));
float avg = (color.r + color.g + color.b) / 3.0;
float amt = (abs(max - avg) * 2.0) * uVibrance;
color.r += max != color.r ? (max - color.r) * amt : 0.00;
color.g += max != color.g ? (max - color.g) * amt : 0.00;
color.b += max != color.b ? (max - color.b) * amt : 0.00;
gl_FragColor = color;
}`,vibrance:0,mainParameter:"vibrance",applyTo2d:function(c){if(this.vibrance!==0){var f=c.imageData,d=f.data,g=d.length,m=-this.vibrance,p,v,y,b;for(p=0;p<g;p+=4)v=Math.max(d[p],d[p+1],d[p+2]),y=(d[p]+d[p+1]+d[p+2])/3,b=Math.abs(v-y)*2/255*m,d[p]+=v!==d[p]?(v-d[p])*b:0,d[p+1]+=v!==d[p+1]?(v-d[p+1])*b:0,d[p+2]+=v!==d[p+2]?(v-d[p+2])*b:0}},getUniformLocations:function(c,f){return{uVibrance:c.getUniformLocation(f,"uVibrance")}},sendUniformData:function(c,f){c.uniform1f(f.uVibrance,-this.vibrance)}}),a.Image.filters.Vibrance.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Blur=h(l.BaseFilter,{type:"Blur",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform vec2 uDelta;
varying vec2 vTexCoord;
const float nSamples = 15.0;
vec3 v3offset = vec3(12.9898, 78.233, 151.7182);
float random(vec3 scale) {
return fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);
}
void main() {
vec4 color = vec4(0.0);
float total = 0.0;
float offset = random(v3offset);
for (float t = -nSamples; t <= nSamples; t++) {
float percent = (t + offset - 0.5) / nSamples;
float weight = 1.0 - abs(percent);
color += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;
total += weight;
}
gl_FragColor = color / total;
}`,blur:0,mainParameter:"blur",applyTo:function(c){c.webgl?(this.aspectRatio=c.sourceWidth/c.sourceHeight,c.passes++,this._setupFrameBuffer(c),this.horizontal=!0,this.applyToWebGL(c),this._swapTextures(c),this._setupFrameBuffer(c),this.horizontal=!1,this.applyToWebGL(c),this._swapTextures(c)):this.applyTo2d(c)},applyTo2d:function(c){c.imageData=this.simpleBlur(c)},simpleBlur:function(c){var f=c.filterBackend.resources,d,g,m=c.imageData.width,p=c.imageData.height;f.blurLayer1||(f.blurLayer1=a.util.createCanvasElement(),f.blurLayer2=a.util.createCanvasElement()),d=f.blurLayer1,g=f.blurLayer2,(d.width!==m||d.height!==p)&&(g.width=d.width=m,g.height=d.height=p);var v=d.getContext("2d"),y=g.getContext("2d"),b=15,x,w,T,_,E=this.blur*.06*.5;for(v.putImageData(c.imageData,0,0),y.clearRect(0,0,m,p),_=-b;_<=b;_++)x=(Math.random()-.5)/4,w=_/b,T=E*w*m+x,y.globalAlpha=1-Math.abs(w),y.drawImage(d,T,x),v.drawImage(g,0,0),y.globalAlpha=1,y.clearRect(0,0,g.width,g.height);for(_=-b;_<=b;_++)x=(Math.random()-.5)/4,w=_/b,T=E*w*p+x,y.globalAlpha=1-Math.abs(w),y.drawImage(d,x,T),v.drawImage(g,0,0),y.globalAlpha=1,y.clearRect(0,0,g.width,g.height);c.ctx.drawImage(d,0,0);var k=c.ctx.getImageData(0,0,d.width,d.height);return v.globalAlpha=1,v.clearRect(0,0,d.width,d.height),k},getUniformLocations:function(c,f){return{delta:c.getUniformLocation(f,"uDelta")}},sendUniformData:function(c,f){var d=this.chooseRightDelta();c.uniform2fv(f.delta,d)},chooseRightDelta:function(){var c=1,f=[0,0],d;return this.horizontal?this.aspectRatio>1&&(c=1/this.aspectRatio):this.aspectRatio<1&&(c=this.aspectRatio),d=c*this.blur*.12,this.horizontal?f[0]=d:f[1]=d,f}}),l.Blur.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Gamma=h(l.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float;
uniform sampler2D uTexture;
uniform vec3 uGamma;
varying vec2 vTexCoord;
void main() {
vec4 color = texture2D(uTexture, vTexCoord);
vec3 correction = (1.0 / uGamma);
color.r = pow(color.r, correction.r);
color.g = pow(color.g, correction.g);
color.b = pow(color.b, correction.b);
gl_FragColor = color;
gl_FragColor.rgb *= color.a;
}`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(c){this.gamma=[1,1,1],l.BaseFilter.prototype.initialize.call(this,c)},applyTo2d:function(c){var f=c.imageData,d=f.data,g=this.gamma,m=d.length,p=1/g[0],v=1/g[1],y=1/g[2],b;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),b=0,m=256;b<m;b++)this.rVals[b]=Math.pow(b/255,p)*255,this.gVals[b]=Math.pow(b/255,v)*255,this.bVals[b]=Math.pow(b/255,y)*255;for(b=0,m=d.length;b<m;b+=4)d[b]=this.rVals[d[b]],d[b+1]=this.gVals[d[b+1]],d[b+2]=this.bVals[d[b+2]]},getUniformLocations:function(c,f){return{uGamma:c.getUniformLocation(f,"uGamma")}},sendUniformData:function(c,f){c.uniform3fv(f.uGamma,this.gamma)}}),a.Image.filters.Gamma.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.Composed=h(l.BaseFilter,{type:"Composed",subFilters:[],initialize:function(c){this.callSuper("initialize",c),this.subFilters=this.subFilters.slice(0)},applyTo:function(c){c.passes+=this.subFilters.length-1,this.subFilters.forEach(function(f){f.applyTo(c)})},toObject:function(){return a.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(c){return c.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(c){return!c.isNeutralState()})}}),a.Image.filters.Composed.fromObject=function(c,f){var d=c.subFilters||[],g=d.map(function(p){return new a.Image.filters[p.type](p)}),m=new a.Image.filters.Composed({subFilters:g});return f&&f(m),m}}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.Image.filters,h=a.util.createClass;l.HueRotation=h(l.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var c=this.rotation*Math.PI,f=a.util.cos(c),d=a.util.sin(c),g=1/3,m=Math.sqrt(g)*d,p=1-f;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=f+p/3,this.matrix[1]=g*p-m,this.matrix[2]=g*p+m,this.matrix[5]=g*p+m,this.matrix[6]=f+g*p,this.matrix[7]=g*p-m,this.matrix[10]=g*p-m,this.matrix[11]=g*p+m,this.matrix[12]=f+g*p},isNeutralState:function(c){return this.calculateMatrix(),l.BaseFilter.prototype.isNeutralState.call(this,c)},applyTo:function(c){this.calculateMatrix(),l.BaseFilter.prototype.applyTo.call(this,c)}}),a.Image.filters.HueRotation.fromObject=a.Image.filters.BaseFilter.fromObject}(e),function(o){var a=o.fabric||(o.fabric={}),l=a.util.object.clone;if(a.Text){a.warn("fabric.Text is already defined");return}var h="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");a.Text=a.util.createClass(a.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:a.Object.prototype.stateProperties.concat(h),cacheProperties:a.Object.prototype.cacheProperties.concat(h),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(c,f){this.styles=f?f.styles||{}:{},this.text=c,this.__skipDimension=!0,this.callSuper("initialize",f),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var c=this.path;c&&(c.segmentsInfo=a.util.getPathSegmentsInfo(c.path))},getMeasuringContext:function(){return a._measuringContext||(a._measuringContext=this.canvas&&this.canvas.contextCache||a.util.createCanvasElement().getContext("2d")),a._measuringContext},_splitText:function(){var c=this._splitTextIntoLines(this.text);return this.textLines=c.lines,this._textLines=c.graphemeLines,this._unwrappedTextLines=c._unwrappedLines,this._text=c.graphemeText,c},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var c,f,d,g,m,p,v,y=0,b=this._textLines.length;y<b;y++)if(!(this.textAlign!=="justify"&&(y===b-1||this.isEndOfWrapping(y)))&&(g=0,m=this._textLines[y],f=this.getLineWidth(y),f<this.width&&(v=this.textLines[y].match(this._reSpacesAndTabs)))){d=v.length,c=(this.width-f)/d;for(var x=0,w=m.length;x<=w;x++)p=this.__charBounds[y][x],this._reSpaceAndTab.test(m[x])?(p.width+=c,p.kernedWidth+=c,p.left+=g,g+=c):p.left+=g}},isEndOfWrapping:function(c){return c===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var c=this.callSuper("_getCacheCanvasDimensions"),f=this.fontSize;return c.width+=f*c.zoomX,c.height+=f*c.zoomY,c},_render:function(c){var f=this.path;f&&!f.isNotVisible()&&f._render(c),this._setTextStyles(c),this._renderTextLinesBackground(c),this._renderTextDecoration(c,"underline"),this._renderText(c),this._renderTextDecoration(c,"overline"),this._renderTextDecoration(c,"linethrough")},_renderText:function(c){this.paintFirst==="stroke"?(this._renderTextStroke(c),this._renderTextFill(c)):(this._renderTextFill(c),this._renderTextStroke(c))},_setTextStyles:function(c,f,d){c.textBaseline="alphabetic",c.font=this._getFontDeclaration(f,d)},calcTextWidth:function(){for(var c=this.getLineWidth(0),f=1,d=this._textLines.length;f<d;f++){var g=this.getLineWidth(f);g>c&&(c=g)}return c},_renderTextLine:function(c,f,d,g,m,p){this._renderChars(c,f,d,g,m,p)},_renderTextLinesBackground:function(c){if(!(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))){for(var f,d,g=c.fillStyle,m,p,v=this._getLeftOffset(),y=this._getTopOffset(),b=0,x=0,w,T,_=this.path,E,k=0,z=this._textLines.length;k<z;k++){if(f=this.getHeightOfLine(k),!this.textBackgroundColor&&!this.styleHas("textBackgroundColor",k)){y+=f;continue}m=this._textLines[k],d=this._getLineLeftOffset(k),x=0,b=0,p=this.getValueOfPropertyAt(k,0,"textBackgroundColor");for(var F=0,j=m.length;F<j;F++)w=this.__charBounds[k][F],T=this.getValueOfPropertyAt(k,F,"textBackgroundColor"),_?(c.save(),c.translate(w.renderLeft,w.renderTop),c.rotate(w.angle),c.fillStyle=T,T&&c.fillRect(-w.width/2,-f/this.lineHeight*(1-this._fontSizeFraction),w.width,f/this.lineHeight),c.restore()):T!==p?(E=v+d+b,this.direction==="rtl"&&(E=this.width-E-x),c.fillStyle=p,p&&c.fillRect(E,y,x,f/this.lineHeight),b=w.left,x=w.width,p=T):x+=w.kernedWidth;T&&!_&&(E=v+d+b,this.direction==="rtl"&&(E=this.width-E-x),c.fillStyle=T,c.fillRect(E,y,x,f/this.lineHeight)),y+=f}c.fillStyle=g,this._removeShadow(c)}},getFontCache:function(c){var f=c.fontFamily.toLowerCase();a.charWidthsCache[f]||(a.charWidthsCache[f]={});var d=a.charWidthsCache[f],g=c.fontStyle.toLowerCase()+"_"+(c.fontWeight+"").toLowerCase();return d[g]||(d[g]={}),d[g]},_measureChar:function(c,f,d,g){var m=this.getFontCache(f),p=this._getFontDeclaration(f),v=this._getFontDeclaration(g),y=d+c,b=p===v,x,w,T,_=f.fontSize/this.CACHE_FONT_SIZE,E;if(d&&m[d]!==void 0&&(T=m[d]),m[c]!==void 0&&(E=x=m[c]),b&&m[y]!==void 0&&(w=m[y],E=w-T),x===void 0||T===void 0||w===void 0){var k=this.getMeasuringContext();this._setTextStyles(k,f,!0)}return x===void 0&&(E=x=k.measureText(c).width,m[c]=x),T===void 0&&b&&d&&(T=k.measureText(d).width,m[d]=T),b&&w===void 0&&(w=k.measureText(y).width,m[y]=w,E=w-T),{width:x*_,kernedWidth:E*_}},getHeightOfChar:function(c,f){return this.getValueOfPropertyAt(c,f,"fontSize")},measureLine:function(c){var f=this._measureLine(c);return this.charSpacing!==0&&(f.width-=this._getWidthOfCharSpacing()),f.width<0&&(f.width=0),f},_measureLine:function(c){var f=0,d,g,m=this._textLines[c],p,v,y=0,b=new Array(m.length),x=0,w,T,_=this.path,E=this.pathSide==="right";for(this.__charBounds[c]=b,d=0;d<m.length;d++)g=m[d],v=this._getGraphemeBox(g,c,d,p),b[d]=v,f+=v.kernedWidth,p=g;if(b[d]={left:v?v.left+v.width:0,width:0,kernedWidth:0,height:this.fontSize},_){switch(T=_.segmentsInfo[_.segmentsInfo.length-1].length,w=a.util.getPointOnPath(_.path,0,_.segmentsInfo),w.x+=_.pathOffset.x,w.y+=_.pathOffset.y,this.textAlign){case"left":x=E?T-f:0;break;case"center":x=(T-f)/2;break;case"right":x=E?0:T-f;break}for(x+=this.pathStartOffset*(E?-1:1),d=E?m.length-1:0;E?d>=0:d<m.length;E?d--:d++)v=b[d],x>T?x%=T:x<0&&(x+=T),this._setGraphemeOnPath(x,v,w),x+=v.kernedWidth}return{width:f,numOfSpaces:y}},_setGraphemeOnPath:function(c,f,d){var g=c+f.kernedWidth/2,m=this.path,p=a.util.getPointOnPath(m.path,g,m.segmentsInfo);f.renderLeft=p.x-d.x,f.renderTop=p.y-d.y,f.angle=p.angle+(this.pathSide==="right"?Math.PI:0)},_getGraphemeBox:function(c,f,d,g,m){var p=this.getCompleteStyleDeclaration(f,d),v=g?this.getCompleteStyleDeclaration(f,d-1):{},y=this._measureChar(c,p,g,v),b=y.kernedWidth,x=y.width,w;this.charSpacing!==0&&(w=this._getWidthOfCharSpacing(),x+=w,b+=w);var T={width:x,left:0,height:p.fontSize,kernedWidth:b,deltaY:p.deltaY};if(d>0&&!m){var _=this.__charBounds[f][d-1];T.left=_.left+_.width+y.kernedWidth-y.width}return T},getHeightOfLine:function(c){if(this.__lineHeights[c])return this.__lineHeights[c];for(var f=this._textLines[c],d=this.getHeightOfChar(c,0),g=1,m=f.length;g<m;g++)d=Math.max(this.getHeightOfChar(c,g),d);return this.__lineHeights[c]=d*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var c,f=0,d=0,g=this._textLines.length;d<g;d++)c=this.getHeightOfLine(d),f+=d===g-1?c/this.lineHeight:c;return f},_getLeftOffset:function(){return this.direction==="ltr"?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(c,f){c.save();for(var d=0,g=this._getLeftOffset(),m=this._getTopOffset(),p=0,v=this._textLines.length;p<v;p++){var y=this.getHeightOfLine(p),b=y/this.lineHeight,x=this._getLineLeftOffset(p);this._renderTextLine(f,c,this._textLines[p],g+x,m+d+b,p),d+=y}c.restore()},_renderTextFill:function(c){!this.fill&&!this.styleHas("fill")||this._renderTextCommon(c,"fillText")},_renderTextStroke:function(c){(!this.stroke||this.strokeWidth===0)&&this.isEmptyStyles()||(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(c),c.save(),this._setLineDash(c,this.strokeDashArray),c.beginPath(),this._renderTextCommon(c,"strokeText"),c.closePath(),c.restore())},_renderChars:function(c,f,d,g,m,p){var v=this.getHeightOfLine(p),y=this.textAlign.indexOf("justify")!==-1,b,x,w="",T,_=0,E,k=this.path,z=!y&&this.charSpacing===0&&this.isEmptyStyles(p)&&!k,F=this.direction==="ltr",j=this.direction==="ltr"?1:-1,K;if(f.save(),m-=v*this._fontSizeFraction/this.lineHeight,z){f.canvas.setAttribute("dir",F?"ltr":"rtl"),f.direction=F?"ltr":"rtl",f.textAlign=F?"left":"right",this._renderChar(c,f,p,0,d.join(""),g,m,v),f.restore();return}for(var B=0,H=d.length-1;B<=H;B++)E=B===H||this.charSpacing||k,w+=d[B],T=this.__charBounds[p][B],_===0?(g+=j*(T.kernedWidth-T.width),_+=T.width):_+=T.kernedWidth,y&&!E&&this._reSpaceAndTab.test(d[B])&&(E=!0),E||(b=b||this.getCompleteStyleDeclaration(p,B),x=this.getCompleteStyleDeclaration(p,B+1),E=this._hasStyleChanged(b,x)),E&&(k?(f.save(),f.translate(T.renderLeft,T.renderTop),f.rotate(T.angle),this._renderChar(c,f,p,B,w,-_/2,0,v),f.restore()):(K=g,f.canvas.setAttribute("dir",F?"ltr":"rtl"),f.direction=F?"ltr":"rtl",f.textAlign=F?"left":"right",this._renderChar(c,f,p,B,w,K,m,v)),w="",b=x,g+=j*_,_=0);f.restore()},_applyPatternGradientTransformText:function(c){var f=a.util.createCanvasElement(),d,g=this.width+this.strokeWidth,m=this.height+this.strokeWidth;return f.width=g,f.height=m,d=f.getContext("2d"),d.beginPath(),d.moveTo(0,0),d.lineTo(g,0),d.lineTo(g,m),d.lineTo(0,m),d.closePath(),d.translate(g/2,m/2),d.fillStyle=c.toLive(d),this._applyPatternGradientTransform(d,c),d.fill(),d.createPattern(f,"no-repeat")},handleFiller:function(c,f,d){var g,m;return d.toLive?d.gradientUnits==="percentage"||d.gradientTransform||d.patternTransform?(g=-this.width/2,m=-this.height/2,c.translate(g,m),c[f]=this._applyPatternGradientTransformText(d),{offsetX:g,offsetY:m}):(c[f]=d.toLive(c,this),this._applyPatternGradientTransform(c,d)):(c[f]=d,{offsetX:0,offsetY:0})},_setStrokeStyles:function(c,f){return c.lineWidth=f.strokeWidth,c.lineCap=this.strokeLineCap,c.lineDashOffset=this.strokeDashOffset,c.lineJoin=this.strokeLineJoin,c.miterLimit=this.strokeMiterLimit,this.handleFiller(c,"strokeStyle",f.stroke)},_setFillStyles:function(c,f){return this.handleFiller(c,"fillStyle",f.fill)},_renderChar:function(c,f,d,g,m,p,v){var y=this._getStyleDeclaration(d,g),b=this.getCompleteStyleDeclaration(d,g),x=c==="fillText"&&b.fill,w=c==="strokeText"&&b.stroke&&b.strokeWidth,T,_;!w&&!x||(f.save(),x&&(T=this._setFillStyles(f,b)),w&&(_=this._setStrokeStyles(f,b)),f.font=this._getFontDeclaration(b),y&&y.textBackgroundColor&&this._removeShadow(f),y&&y.deltaY&&(v+=y.deltaY),x&&f.fillText(m,p-T.offsetX,v-T.offsetY),w&&f.strokeText(m,p-_.offsetX,v-_.offsetY),f.restore())},setSuperscript:function(c,f){return this._setScript(c,f,this.superscript)},setSubscript:function(c,f){return this._setScript(c,f,this.subscript)},_setScript:function(c,f,d){var g=this.get2DCursorLocation(c,!0),m=this.getValueOfPropertyAt(g.lineIndex,g.charIndex,"fontSize"),p=this.getValueOfPropertyAt(g.lineIndex,g.charIndex,"deltaY"),v={fontSize:m*d.size,deltaY:p+m*d.baseline};return this.setSelectionStyles(v,c,f),this},_hasStyleChanged:function(c,f){return c.fill!==f.fill||c.stroke!==f.stroke||c.strokeWidth!==f.strokeWidth||c.fontSize!==f.fontSize||c.fontFamily!==f.fontFamily||c.fontWeight!==f.fontWeight||c.fontStyle!==f.fontStyle||c.deltaY!==f.deltaY},_hasStyleChangedForSvg:function(c,f){return this._hasStyleChanged(c,f)||c.overline!==f.overline||c.underline!==f.underline||c.linethrough!==f.linethrough},_getLineLeftOffset:function(c){var f=this.getLineWidth(c),d=this.width-f,g=this.textAlign,m=this.direction,v,p=0,v=this.isEndOfWrapping(c);return g==="justify"||g==="justify-center"&&!v||g==="justify-right"&&!v||g==="justify-left"&&!v?0:(g==="center"&&(p=d/2),g==="right"&&(p=d),g==="justify-center"&&(p=d/2),g==="justify-right"&&(p=d),m==="rtl"&&(p-=d),p)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var c=this._forceClearCache;return c||(c=this.hasStateChanged("_dimensionAffectingProps")),c&&(this.dirty=!0,this._forceClearCache=!1),c},getLineWidth:function(c){if(this.__lineWidths[c])return this.__lineWidths[c];var f,d=this._textLines[c],g;return d===""?f=0:(g=this.measureLine(c),f=g.width),this.__lineWidths[c]=f,f},_getWidthOfCharSpacing:function(){return this.charSpacing!==0?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(c,f,d){var g=this._getStyleDeclaration(c,f);return g&&typeof g[d]!="undefined"?g[d]:this[d]},_renderTextDecoration:function(c,f){if(!(!this[f]&&!this.styleHas(f))){for(var d,g,m,p,v,y,b,x,w=this._getLeftOffset(),T=this._getTopOffset(),_,E,k,z,F,j,K,B,H=this.path,ue=this._getWidthOfCharSpacing(),ge=this.offsets[f],fe=0,L=this._textLines.length;fe<L;fe++){if(d=this.getHeightOfLine(fe),!this[f]&&!this.styleHas(f,fe)){T+=d;continue}b=this._textLines[fe],j=d/this.lineHeight,p=this._getLineLeftOffset(fe),E=0,k=0,x=this.getValueOfPropertyAt(fe,0,f),B=this.getValueOfPropertyAt(fe,0,"fill"),_=T+j*(1-this._fontSizeFraction),g=this.getHeightOfChar(fe,0),v=this.getValueOfPropertyAt(fe,0,"deltaY");for(var Z=0,M=b.length;Z<M;Z++)if(z=this.__charBounds[fe][Z],F=this.getValueOfPropertyAt(fe,Z,f),K=this.getValueOfPropertyAt(fe,Z,"fill"),m=this.getHeightOfChar(fe,Z),y=this.getValueOfPropertyAt(fe,Z,"deltaY"),H&&F&&K)c.save(),c.fillStyle=B,c.translate(z.renderLeft,z.renderTop),c.rotate(z.angle),c.fillRect(-z.kernedWidth/2,ge*m+y,z.kernedWidth,this.fontSize/15),c.restore();else if((F!==x||K!==B||m!==g||y!==v)&&k>0){var D=w+p+E;this.direction==="rtl"&&(D=this.width-D-k),x&&B&&(c.fillStyle=B,c.fillRect(D,_+ge*g+v,k,this.fontSize/15)),E=z.left,k=z.width,x=F,B=K,g=m,v=y}else k+=z.kernedWidth;var D=w+p+E;this.direction==="rtl"&&(D=this.width-D-k),c.fillStyle=K,F&&K&&c.fillRect(D,_+ge*g+v,k-ue,this.fontSize/15),T+=d}this._removeShadow(c)}},_getFontDeclaration:function(c,f){var d=c||this,g=this.fontFamily,m=a.Text.genericFonts.indexOf(g.toLowerCase())>-1,p=g===void 0||g.indexOf("'")>-1||g.indexOf(",")>-1||g.indexOf('"')>-1||m?d.fontFamily:'"'+d.fontFamily+'"';return[a.isLikelyNode?d.fontWeight:d.fontStyle,a.isLikelyNode?d.fontStyle:d.fontWeight,f?this.CACHE_FONT_SIZE+"px":d.fontSize+"px",p].join(" ")},render:function(c){!this.visible||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",c))},_splitTextIntoLines:function(c){for(var f=c.split(this._reNewline),d=new Array(f.length),g=[`
`],m=[],p=0;p<f.length;p++)d[p]=a.util.string.graphemeSplit(f[p]),m=m.concat(d[p],g);return m.pop(),{_unwrappedLines:d,lines:f,graphemeText:m,graphemeLines:d}},toObject:function(c){var f=h.concat(c),d=this.callSuper("toObject",f);return d.styles=l(this.styles,!0),d.path&&(d.path=this.path.toObject()),d},set:function(c,f){this.callSuper("set",c,f);var d=!1,g=!1;if(typeof c=="object")for(var m in c)m==="path"&&this.setPathInfo(),d=d||this._dimensionAffectingProps.indexOf(m)!==-1,g=g||m==="path";else d=this._dimensionAffectingProps.indexOf(c)!==-1,g=c==="path";return g&&this.setPathInfo(),d&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),a.Text.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),a.Text.DEFAULT_SVG_FONT_SIZE=16,a.Text.fromElement=function(c,f,d){if(!c)return f(null);var g=a.parseAttributes(c,a.Text.ATTRIBUTE_NAMES),m=g.textAnchor||"left";if(d=a.util.object.extend(d?l(d):{},g),d.top=d.top||0,d.left=d.left||0,g.textDecoration){var p=g.textDecoration;p.indexOf("underline")!==-1&&(d.underline=!0),p.indexOf("overline")!==-1&&(d.overline=!0),p.indexOf("line-through")!==-1&&(d.linethrough=!0),delete d.textDecoration}"dx"in g&&(d.left+=g.dx),"dy"in g&&(d.top+=g.dy),"fontSize"in d||(d.fontSize=a.Text.DEFAULT_SVG_FONT_SIZE);var v="";"textContent"in c?v=c.textContent:"firstChild"in c&&c.firstChild!==null&&"data"in c.firstChild&&c.firstChild.data!==null&&(v=c.firstChild.data),v=v.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var y=d.strokeWidth;d.strokeWidth=0;var b=new a.Text(v,d),x=b.getScaledHeight()/b.height,w=(b.height+b.strokeWidth)*b.lineHeight-b.height,T=w*x,_=b.getScaledHeight()+T,E=0;m==="center"&&(E=b.getScaledWidth()/2),m==="right"&&(E=b.getScaledWidth()),b.set({left:b.left-E,top:b.top-(_-b.fontSize*(.07+b._fontSizeFraction))/b.lineHeight,strokeWidth:typeof y!="undefined"?y:1}),f(b)},a.Text.fromObject=function(c,f){var d=l(c),g=c.path;return delete d.path,a.Object._fromObject("Text",d,function(m){g?a.Object._fromObject("Path",g,function(p){m.set("path",p),f(m)},"path"):f(m)},"text")},a.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],a.util.createAccessors&&a.util.createAccessors(a.Text)}(e),function(){t.util.object.extend(t.Text.prototype,{isEmptyStyles:function(o){if(!this.styles||typeof o!="undefined"&&!this.styles[o])return!0;var a=typeof o=="undefined"?this.styles:{line:this.styles[o]};for(var l in a)for(var h in a[l])for(var c in a[l][h])return!1;return!0},styleHas:function(o,a){if(!this.styles||!o||o===""||typeof a!="undefined"&&!this.styles[a])return!1;var l=typeof a=="undefined"?this.styles:{0:this.styles[a]};for(var h in l)for(var c in l[h])if(typeof l[h][c][o]!="undefined")return!0;return!1},cleanStyle:function(o){if(!this.styles||!o||o==="")return!1;var a=this.styles,l=0,h,c,f=!0,d=0,g;for(var m in a){h=0;for(var p in a[m]){var g=a[m][p],v=g.hasOwnProperty(o);l++,v?(c?g[o]!==c&&(f=!1):c=g[o],g[o]===this[o]&&delete g[o]):f=!1,Object.keys(g).length!==0?h++:delete a[m][p]}h===0&&delete a[m]}for(var y=0;y<this._textLines.length;y++)d+=this._textLines[y].length;f&&l===d&&(this[o]=c,this.removeStyle(o))},removeStyle:function(o){if(!(!this.styles||!o||o==="")){var a=this.styles,l,h,c;for(h in a){l=a[h];for(c in l)delete l[c][o],Object.keys(l[c]).length===0&&delete l[c];Object.keys(l).length===0&&delete a[h]}}},_extendStyles:function(o,a){var l=this.get2DCursorLocation(o);this._getLineStyle(l.lineIndex)||this._setLineStyle(l.lineIndex),this._getStyleDeclaration(l.lineIndex,l.charIndex)||this._setStyleDeclaration(l.lineIndex,l.charIndex,{}),t.util.object.extend(this._getStyleDeclaration(l.lineIndex,l.charIndex),a)},get2DCursorLocation:function(o,a){typeof o=="undefined"&&(o=this.selectionStart);for(var l=a?this._unwrappedTextLines:this._textLines,h=l.length,c=0;c<h;c++){if(o<=l[c].length)return{lineIndex:c,charIndex:o};o-=l[c].length+this.missingNewlineOffset(c)}return{lineIndex:c-1,charIndex:l[c-1].length<o?l[c-1].length:o}},getSelectionStyles:function(o,a,l){typeof o=="undefined"&&(o=this.selectionStart||0),typeof a=="undefined"&&(a=this.selectionEnd||o);for(var h=[],c=o;c<a;c++)h.push(this.getStyleAtPosition(c,l));return h},getStyleAtPosition:function(o,a){var l=this.get2DCursorLocation(o),h=a?this.getCompleteStyleDeclaration(l.lineIndex,l.charIndex):this._getStyleDeclaration(l.lineIndex,l.charIndex);return h||{}},setSelectionStyles:function(o,a,l){typeof a=="undefined"&&(a=this.selectionStart||0),typeof l=="undefined"&&(l=this.selectionEnd||a);for(var h=a;h<l;h++)this._extendStyles(h,o);return this._forceClearCache=!0,this},_getStyleDeclaration:function(o,a){var l=this.styles&&this.styles[o];return l?l[a]:null},getCompleteStyleDeclaration:function(o,a){for(var l=this._getStyleDeclaration(o,a)||{},h={},c,f=0;f<this._styleProperties.length;f++)c=this._styleProperties[f],h[c]=typeof l[c]=="undefined"?this[c]:l[c];return h},_setStyleDeclaration:function(o,a,l){this.styles[o][a]=l},_deleteStyleDeclaration:function(o,a){delete this.styles[o][a]},_getLineStyle:function(o){return!!this.styles[o]},_setLineStyle:function(o){this.styles[o]={}},_deleteLineStyle:function(o){delete this.styles[o]}})}(),function(){function o(a){a.textDecoration&&(a.textDecoration.indexOf("underline")>-1&&(a.underline=!0),a.textDecoration.indexOf("line-through")>-1&&(a.linethrough=!0),a.textDecoration.indexOf("overline")>-1&&(a.overline=!0),delete a.textDecoration)}t.IText=t.util.createClass(t.Text,t.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(a,l){this.callSuper("initialize",a,l),this.initBehavior()},setSelectionStart:function(a){a=Math.max(a,0),this._updateAndFire("selectionStart",a)},setSelectionEnd:function(a){a=Math.min(a,this.text.length),this._updateAndFire("selectionEnd",a)},_updateAndFire:function(a,l){this[a]!==l&&(this._fireSelectionChanged(),this[a]=l),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(a){this.clearContextTop(),this.callSuper("render",a),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(a){this.callSuper("_render",a)},clearContextTop:function(a){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var l=this.canvas.contextTop,h=this.canvas.viewportTransform;l.save(),l.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this.transform(l),this._clearTextArea(l),a||l.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var a=this._getCursorBoundaries(),l=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(a,l):this.renderSelection(a,l),l.restore()}},_clearTextArea:function(a){var l=this.width+4,h=this.height+4;a.clearRect(-l/2,-h/2,l,h)},_getCursorBoundaries:function(a){typeof a=="undefined"&&(a=this.selectionStart);var l=this._getLeftOffset(),h=this._getTopOffset(),c=this._getCursorBoundariesOffsets(a);return{left:l,top:h,leftOffset:c.left,topOffset:c.top}},_getCursorBoundariesOffsets:function(a){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var l,h,c,f=0,d=0,g,m=this.get2DCursorLocation(a);c=m.charIndex,h=m.lineIndex;for(var p=0;p<h;p++)f+=this.getHeightOfLine(p);l=this._getLineLeftOffset(h);var v=this.__charBounds[h][c];return v&&(d=v.left),this.charSpacing!==0&&c===this._textLines[h].length&&(d-=this._getWidthOfCharSpacing()),g={top:f,left:l+(d>0?d:0)},this.direction==="rtl"&&(g.left*=-1),this.cursorOffsetCache=g,this.cursorOffsetCache},renderCursor:function(a,l){var h=this.get2DCursorLocation(),c=h.lineIndex,f=h.charIndex>0?h.charIndex-1:0,d=this.getValueOfPropertyAt(c,f,"fontSize"),g=this.scaleX*this.canvas.getZoom(),m=this.cursorWidth/g,p=a.topOffset,v=this.getValueOfPropertyAt(c,f,"deltaY");p+=(1-this._fontSizeFraction)*this.getHeightOfLine(c)/this.lineHeight-d*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(a,l),l.fillStyle=this.cursorColor||this.getValueOfPropertyAt(c,f,"fill"),l.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,l.fillRect(a.left+a.leftOffset-m/2,p+a.top+v,m,d)},renderSelection:function(a,l){for(var h=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,c=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,f=this.textAlign.indexOf("justify")!==-1,d=this.get2DCursorLocation(h),g=this.get2DCursorLocation(c),m=d.lineIndex,p=g.lineIndex,v=d.charIndex<0?0:d.charIndex,y=g.charIndex<0?0:g.charIndex,b=m;b<=p;b++){var x=this._getLineLeftOffset(b)||0,w=this.getHeightOfLine(b),T=0,_=0,E=0;if(b===m&&(_=this.__charBounds[m][v].left),b>=m&&b<p)E=f&&!this.isEndOfWrapping(b)?this.width:this.getLineWidth(b)||5;else if(b===p)if(y===0)E=this.__charBounds[p][y].left;else{var k=this._getWidthOfCharSpacing();E=this.__charBounds[p][y-1].left+this.__charBounds[p][y-1].width-k}T=w,(this.lineHeight<1||b===p&&this.lineHeight>1)&&(w/=this.lineHeight);var z=a.left+x+_,F=E-_,j=w,K=0;this.inCompositionMode?(l.fillStyle=this.compositionColor||"black",j=1,K=w):l.fillStyle=this.selectionColor,this.direction==="rtl"&&(z=this.width-z-F),l.fillRect(z,a.top+a.topOffset+K,F,j),a.topOffset+=T}},getCurrentCharFontSize:function(){var a=this._getCurrentCharIndex();return this.getValueOfPropertyAt(a.l,a.c,"fontSize")},getCurrentCharColor:function(){var a=this._getCurrentCharIndex();return this.getValueOfPropertyAt(a.l,a.c,"fill")},_getCurrentCharIndex:function(){var a=this.get2DCursorLocation(this.selectionStart,!0),l=a.charIndex>0?a.charIndex-1:0;return{l:a.lineIndex,c:l}}}),t.IText.fromObject=function(a,l){if(o(a),a.styles)for(var h in a.styles)for(var c in a.styles[h])o(a.styles[h][c]);t.Object._fromObject("IText",a,l,"text")}}(),function(){var o=t.util.object.clone;t.util.object.extend(t.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var a=this;this.on("added",function(){var l=a.canvas;l&&(l._hasITextHandlers||(l._hasITextHandlers=!0,a._initCanvasHandlers(l)),l._iTextInstances=l._iTextInstances||[],l._iTextInstances.push(a))})},initRemovedHandler:function(){var a=this;this.on("removed",function(){var l=a.canvas;l&&(l._iTextInstances=l._iTextInstances||[],t.util.removeFromArray(l._iTextInstances,a),l._iTextInstances.length===0&&(l._hasITextHandlers=!1,a._removeCanvasHandlers(l)))})},_initCanvasHandlers:function(a){a._mouseUpITextHandler=function(){a._iTextInstances&&a._iTextInstances.forEach(function(l){l.__isMousedown=!1})},a.on("mouse:up",a._mouseUpITextHandler)},_removeCanvasHandlers:function(a){a.off("mouse:up",a._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(a,l,h,c){var f;return f={isAborted:!1,abort:function(){this.isAborted=!0}},a.animate("_currentCursorOpacity",l,{duration:h,onComplete:function(){f.isAborted||a[c]()},onChange:function(){a.canvas&&a.selectionStart===a.selectionEnd&&a.renderCursorOrSelection()},abort:function(){return f.isAborted}}),f},_onTickComplete:function(){var a=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){a._currentTickCompleteState=a._animateCursor(a,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(a){var l=this,h=a?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){l._tick()},h)},abortCursorAnimation:function(){var a=this._currentTickState||this._currentTickCompleteState,l=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,a&&l&&l.clearContext(l.contextTop||l.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(a){var l=0,h=a-1;if(this._reSpace.test(this._text[h]))for(;this._reSpace.test(this._text[h]);)l++,h--;for(;/\S/.test(this._text[h])&&h>-1;)l++,h--;return a-l},findWordBoundaryRight:function(a){var l=0,h=a;if(this._reSpace.test(this._text[h]))for(;this._reSpace.test(this._text[h]);)l++,h++;for(;/\S/.test(this._text[h])&&h<this._text.length;)l++,h++;return a+l},findLineBoundaryLeft:function(a){for(var l=0,h=a-1;!/\n/.test(this._text[h])&&h>-1;)l++,h--;return a-l},findLineBoundaryRight:function(a){for(var l=0,h=a;!/\n/.test(this._text[h])&&h<this._text.length;)l++,h++;return a+l},searchWordBoundary:function(a,l){for(var h=this._text,c=this._reSpace.test(h[a])?a-1:a,f=h[c],d=t.reNonWord;!d.test(f)&&c>0&&c<h.length;)c+=l,f=h[c];return d.test(f)&&(c+=l===1?0:1),c},selectWord:function(a){a=a||this.selectionStart;var l=this.searchWordBoundary(a,-1),h=this.searchWordBoundary(a,1);this.selectionStart=l,this.selectionEnd=h,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(a){a=a||this.selectionStart;var l=this.findLineBoundaryLeft(a),h=this.findLineBoundaryRight(a);return this.selectionStart=l,this.selectionEnd=h,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(a){if(!(this.isEditing||!this.editable))return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(a),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(a){a._iTextInstances&&a._iTextInstances.forEach(function(l){l.selected=!1,l.isEditing&&l.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(a){if(!(!this.__isMousedown||!this.isEditing)){var l=this.getSelectionStartFromPointer(a.e),h=this.selectionStart,c=this.selectionEnd;(l!==this.__selectionStartOnMouseDown||h===c)&&(h===l||c===l)||(l>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=l):(this.selectionStart=l,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==h||this.selectionEnd!==c)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(a,l,h){var c=h.slice(0,a),f=t.util.string.graphemeSplit(c).length;if(a===l)return{selectionStart:f,selectionEnd:f};var d=h.slice(a,l),g=t.util.string.graphemeSplit(d).length;return{selectionStart:f,selectionEnd:f+g}},fromGraphemeToStringSelection:function(a,l,h){var c=h.slice(0,a),f=c.join("").length;if(a===l)return{selectionStart:f,selectionEnd:f};var d=h.slice(a,l),g=d.join("").length;return{selectionStart:f,selectionEnd:f+g}},_updateTextarea:function(){if(this.cursorOffsetCache={},!!this.hiddenTextarea){if(!this.inCompositionMode){var a=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=a.selectionStart,this.hiddenTextarea.selectionEnd=a.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(!!this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var a=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=a.selectionEnd,this.inCompositionMode||(this.selectionStart=a.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var a=this._calcTextareaPosition();this.hiddenTextarea.style.left=a.left,this.hiddenTextarea.style.top=a.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var a=this.inCompositionMode?this.compositionStart:this.selectionStart,l=this._getCursorBoundaries(a),h=this.get2DCursorLocation(a),c=h.lineIndex,f=h.charIndex,d=this.getValueOfPropertyAt(c,f,"fontSize")*this.lineHeight,g=l.leftOffset,m=this.calcTransformMatrix(),p={x:l.left+g,y:l.top+l.topOffset+d},v=this.canvas.getRetinaScaling(),y=this.canvas.upperCanvasEl,b=y.width/v,x=y.height/v,w=b-d,T=x-d,_=y.clientWidth/b,E=y.clientHeight/x;return p=t.util.transformPoint(p,m),p=t.util.transformPoint(p,this.canvas.viewportTransform),p.x*=_,p.y*=E,p.x<0&&(p.x=0),p.x>w&&(p.x=w),p.y<0&&(p.y=0),p.y>T&&(p.y=T),p.x+=this.canvas._offset.left,p.y+=this.canvas._offset.top,{left:p.x+"px",top:p.y+"px",fontSize:d+"px",charHeight:d}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){!this._savedProps||(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var a=this._textBeforeEdit!==this.text,l=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,l&&(l.blur&&l.blur(),l.parentNode&&l.parentNode.removeChild(l)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),a&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),a&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var a in this.styles)this._textLines[a]||delete this.styles[a]},removeStyleFromTo:function(a,l){var h=this.get2DCursorLocation(a,!0),c=this.get2DCursorLocation(l,!0),f=h.lineIndex,d=h.charIndex,g=c.lineIndex,m=c.charIndex,p,v;if(f!==g){if(this.styles[f])for(p=d;p<this._unwrappedTextLines[f].length;p++)delete this.styles[f][p];if(this.styles[g])for(p=m;p<this._unwrappedTextLines[g].length;p++)v=this.styles[g][p],v&&(this.styles[f]||(this.styles[f]={}),this.styles[f][d+p-m]=v);for(p=f+1;p<=g;p++)delete this.styles[p];this.shiftLineStyles(g,f-g)}else if(this.styles[f]){v=this.styles[f];var y=m-d,b,x;for(p=d;p<m;p++)delete v[p];for(x in this.styles[f])b=parseInt(x,10),b>=m&&(v[b-y]=v[x],delete v[x])}},shiftLineStyles:function(a,l){var h=o(this.styles);for(var c in this.styles){var f=parseInt(c,10);f>a&&(this.styles[f+l]=h[f],h[f-l]||delete this.styles[f])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(a,l,h,c){var f,d={},g=!1,m=this._unwrappedTextLines[a].length===l;h||(h=1),this.shiftLineStyles(a,h),this.styles[a]&&(f=this.styles[a][l===0?l:l-1]);for(var p in this.styles[a]){var v=parseInt(p,10);v>=l&&(g=!0,d[v-l]=this.styles[a][p],m&&l===0||delete this.styles[a][p])}var y=!1;for(g&&!m&&(this.styles[a+h]=d,y=!0),y&&h--;h>0;)c&&c[h-1]?this.styles[a+h]={0:o(c[h-1])}:f?this.styles[a+h]={0:o(f)}:delete this.styles[a+h],h--;this._forceClearCache=!0},insertCharStyleObject:function(a,l,h,c){this.styles||(this.styles={});var f=this.styles[a],d=f?o(f):{};h||(h=1);for(var g in d){var m=parseInt(g,10);m>=l&&(f[m+h]=d[m],d[m-h]||delete f[m])}if(this._forceClearCache=!0,c){for(;h--;)!Object.keys(c[h]).length||(this.styles[a]||(this.styles[a]={}),this.styles[a][l+h]=o(c[h]));return}if(!!f)for(var p=f[l?l-1:1];p&&h--;)this.styles[a][l+h]=o(p)},insertNewStyleBlock:function(a,l,h){for(var c=this.get2DCursorLocation(l,!0),f=[0],d=0,g=0;g<a.length;g++)a[g]===`
`?(d++,f[d]=0):f[d]++;f[0]>0&&(this.insertCharStyleObject(c.lineIndex,c.charIndex,f[0],h),h=h&&h.slice(f[0]+1)),d&&this.insertNewlineStyleObject(c.lineIndex,c.charIndex+f[0],d);for(var g=1;g<d;g++)f[g]>0?this.insertCharStyleObject(c.lineIndex+g,0,f[g],h):h&&(this.styles[c.lineIndex+g][0]=h[0]),h=h&&h.slice(f[g]+1);f[g]>0&&this.insertCharStyleObject(c.lineIndex+g,0,f[g],h)},setSelectionStartEndWithShift:function(a,l,h){h<=a?(l===a?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=a),this.selectionStart=h):h>a&&h<l?this._selectionDirection==="right"?this.selectionEnd=h:this.selectionStart=h:(l===a?this._selectionDirection="right":this._selectionDirection==="left"&&(this._selectionDirection="right",this.selectionStart=l),this.selectionEnd=h)},setSelectionInBoundaries:function(){var a=this.text.length;this.selectionStart>a?this.selectionStart=a:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>a?this.selectionEnd=a:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),t.util.object.extend(t.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(o){if(!!this.canvas){this.__newClickTime=+new Date;var a=o.pointer;this.isTripleClick(a)&&(this.fire("tripleclick",o),this._stopEvent(o.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=a,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(o){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===o.x&&this.__lastPointer.y===o.y},_stopEvent:function(o){o.preventDefault&&o.preventDefault(),o.stopPropagation&&o.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(o){!this.isEditing||this.selectWord(this.getSelectionStartFromPointer(o.e))},tripleClickHandler:function(o){!this.isEditing||this.selectLine(this.getSelectionStartFromPointer(o.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(o){!this.canvas||!this.editable||o.e.button&&o.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(o.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(o){!this.canvas||!this.editable||o.e.button&&o.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(o){if(this.__isMousedown=!1,!(!this.editable||this.group||o.transform&&o.transform.actionPerformed||o.e.button&&o.e.button!==1)){if(this.canvas){var a=this.canvas._activeObject;if(a&&a!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(o.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(o){var a=this.getSelectionStartFromPointer(o),l=this.selectionStart,h=this.selectionEnd;o.shiftKey?this.setSelectionStartEndWithShift(l,h,a):(this.selectionStart=a,this.selectionEnd=a),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(o){for(var a=this.getLocalPointer(o),l=0,h=0,c=0,f=0,d=0,g,m,p=0,v=this._textLines.length;p<v&&c<=a.y;p++)c+=this.getHeightOfLine(p)*this.scaleY,d=p,p>0&&(f+=this._textLines[p-1].length+this.missingNewlineOffset(p-1));g=this._getLineLeftOffset(d),h=g*this.scaleX,m=this._textLines[d],this.direction==="rtl"&&(a.x=this.width*this.scaleX-a.x+h);for(var y=0,b=m.length;y<b&&(l=h,h+=this.__charBounds[d][y].kernedWidth*this.scaleX,h<=a.x);y++)f++;return this._getNewSelectionStartFromOffset(a,l,h,f,b)},_getNewSelectionStartFromOffset:function(o,a,l,h,c){var f=o.x-a,d=l-o.x,g=d>f||d<0?0:1,m=h+g;return this.flipX&&(m=c-m),m>this._text.length&&(m=this._text.length),m}}),t.util.object.extend(t.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=t.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var o=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+o.top+"; left: "+o.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding\uFF70top: "+o.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):t.document.body.appendChild(this.hiddenTextarea),t.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),t.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),t.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),t.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(t.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(o){if(!!this.isEditing){var a=this.direction==="rtl"?this.keysMapRtl:this.keysMap;if(o.keyCode in a)this[a[o.keyCode]](o);else if(o.keyCode in this.ctrlKeysMapDown&&(o.ctrlKey||o.metaKey))this[this.ctrlKeysMapDown[o.keyCode]](o);else return;o.stopImmediatePropagation(),o.preventDefault(),o.keyCode>=33&&o.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(o){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}if(o.keyCode in this.ctrlKeysMapUp&&(o.ctrlKey||o.metaKey))this[this.ctrlKeysMapUp[o.keyCode]](o);else return;o.stopImmediatePropagation(),o.preventDefault(),this.canvas&&this.canvas.requestRenderAll()},onInput:function(o){var a=this.fromPaste;if(this.fromPaste=!1,o&&o.stopPropagation(),!!this.isEditing){var l=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,h=this._text.length,c=l.length,f,d,g=c-h,m=this.selectionStart,p=this.selectionEnd,v=m!==p,y,b,x;if(this.hiddenTextarea.value===""){this.styles={},this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll());return}var w=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),T=m>w.selectionStart;v?(f=this._text.slice(m,p),g+=p-m):c<h&&(T?f=this._text.slice(p+g,p):f=this._text.slice(m,m-g)),d=l.slice(w.selectionEnd-g,w.selectionEnd),f&&f.length&&(d.length&&(y=this.getSelectionStyles(m,m+1,!1),y=d.map(function(){return y[0]})),v?(b=m,x=p):T?(b=p-f.length,x=p):(b=p,x=p+f.length),this.removeStyleFromTo(b,x)),d.length&&(a&&d.join("")===t.copiedText&&!t.disableStyleCopyPaste&&(y=t.copiedTextStyle),this.insertNewStyleBlock(d,m,y)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(o){this.compositionStart=o.target.selectionStart,this.compositionEnd=o.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(t.copiedText=this.getSelectedText(),t.disableStyleCopyPaste?t.copiedTextStyle=null:t.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(o){return o&&o.clipboardData||t.window.clipboardData},_getWidthBeforeCursor:function(o,a){var l=this._getLineLeftOffset(o),h;return a>0&&(h=this.__charBounds[o][a-1],l+=h.left+h.width),l},getDownCursorOffset:function(o,a){var l=this._getSelectionForOffset(o,a),h=this.get2DCursorLocation(l),c=h.lineIndex;if(c===this._textLines.length-1||o.metaKey||o.keyCode===34)return this._text.length-l;var f=h.charIndex,d=this._getWidthBeforeCursor(c,f),g=this._getIndexOnLine(c+1,d),m=this._textLines[c].slice(f);return m.length+g+1+this.missingNewlineOffset(c)},_getSelectionForOffset:function(o,a){return o.shiftKey&&this.selectionStart!==this.selectionEnd&&a?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(o,a){var l=this._getSelectionForOffset(o,a),h=this.get2DCursorLocation(l),c=h.lineIndex;if(c===0||o.metaKey||o.keyCode===33)return-l;var f=h.charIndex,d=this._getWidthBeforeCursor(c,f),g=this._getIndexOnLine(c-1,d),m=this._textLines[c].slice(0,f),p=this.missingNewlineOffset(c-1);return-this._textLines[c-1].length+g-m.length+(1-p)},_getIndexOnLine:function(o,a){for(var l=this._textLines[o],h=this._getLineLeftOffset(o),c=h,f=0,d,g,m=0,p=l.length;m<p;m++)if(d=this.__charBounds[o][m].width,c+=d,c>a){g=!0;var v=c-d,y=c,b=Math.abs(v-a),x=Math.abs(y-a);f=x<b?m:m-1;break}return g||(f=l.length-1),f},moveCursorDown:function(o){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",o)},moveCursorUp:function(o){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown("Up",o)},_moveCursorUpOrDown:function(o,a){var l="get"+o+"CursorOffset",h=this[l](a,this._selectionDirection==="right");a.shiftKey?this.moveCursorWithShift(h):this.moveCursorWithoutShift(h),h!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(o){var a=this._selectionDirection==="left"?this.selectionStart+o:this.selectionEnd+o;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,a),o!==0},moveCursorWithoutShift:function(o){return o<0?(this.selectionStart+=o,this.selectionEnd=this.selectionStart):(this.selectionEnd+=o,this.selectionStart=this.selectionEnd),o!==0},moveCursorLeft:function(o){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight("Left",o)},_move:function(o,a,l){var h;if(o.altKey)h=this["findWordBoundary"+l](this[a]);else if(o.metaKey||o.keyCode===35||o.keyCode===36)h=this["findLineBoundary"+l](this[a]);else return this[a]+=l==="Left"?-1:1,!0;if(typeof h!==void 0&&this[a]!==h)return this[a]=h,!0},_moveLeft:function(o,a){return this._move(o,a,"Left")},_moveRight:function(o,a){return this._move(o,a,"Right")},moveCursorLeftWithoutShift:function(o){var a=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(a=this._moveLeft(o,"selectionStart")),this.selectionEnd=this.selectionStart,a},moveCursorLeftWithShift:function(o){if(this._selectionDirection==="right"&&this.selectionStart!==this.selectionEnd)return this._moveLeft(o,"selectionEnd");if(this.selectionStart!==0)return this._selectionDirection="left",this._moveLeft(o,"selectionStart")},moveCursorRight:function(o){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",o)},_moveCursorLeftOrRight:function(o,a){var l="moveCursor"+o+"With";this._currentCursorOpacity=1,a.shiftKey?l+="Shift":l+="outShift",this[l](a)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(o){if(this._selectionDirection==="left"&&this.selectionStart!==this.selectionEnd)return this._moveRight(o,"selectionStart");if(this.selectionEnd!==this._text.length)return this._selectionDirection="right",this._moveRight(o,"selectionEnd")},moveCursorRightWithoutShift:function(o){var a=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(a=this._moveRight(o,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,a},removeChars:function(o,a){typeof a=="undefined"&&(a=o+1),this.removeStyleFromTo(o,a),this._text.splice(o,a-o),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(o,a,l,h){typeof h=="undefined"&&(h=l),h>l&&this.removeStyleFromTo(l,h);var c=t.util.string.graphemeSplit(o);this.insertNewStyleBlock(c,l,a),this._text=[].concat(this._text.slice(0,l),c,this._text.slice(h)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var o=t.util.toFixed,a=/  +/g;t.util.object.extend(t.Text.prototype,{_toSVG:function(){var l=this._getSVGLeftTopOffsets(),h=this._getSVGTextAndBg(l.textTop,l.textLeft);return this._wrapSVGTextAndBg(h)},toSVG:function(l){return this._createBaseSVGMarkup(this._toSVG(),{reviver:l,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(l){var h=!0,c=this.getSvgTextDecoration(this);return[l.textBgRects.join(""),'		<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",c?'text-decoration="'+c+'" ':"",'style="',this.getSvgStyles(h),'"',this.addPaintOrder()," >",l.textSpans.join(""),`</text>
`]},_getSVGTextAndBg:function(l,h){var c=[],f=[],d=l,g;this._setSVGBg(f);for(var m=0,p=this._textLines.length;m<p;m++)g=this._getLineLeftOffset(m),(this.textBackgroundColor||this.styleHas("textBackgroundColor",m))&&this._setSVGTextLineBg(f,m,h+g,d),this._setSVGTextLineText(c,m,h+g,d),d+=this.getHeightOfLine(m);return{textSpans:c,textBgRects:f}},_createTextCharSpan:function(l,h,c,f){var d=l!==l.trim()||l.match(a),g=this.getSvgSpanStyles(h,d),m=g?'style="'+g+'"':"",p=h.deltaY,v="",y=t.Object.NUM_FRACTION_DIGITS;return p&&(v=' dy="'+o(p,y)+'" '),['<tspan x="',o(c,y),'" y="',o(f,y),'" ',v,m,">",t.util.string.escapeXml(l),"</tspan>"].join("")},_setSVGTextLineText:function(l,h,c,f){var d=this.getHeightOfLine(h),g=this.textAlign.indexOf("justify")!==-1,m,p,v="",y,b,x=0,w=this._textLines[h],T;f+=d*(1-this._fontSizeFraction)/this.lineHeight;for(var _=0,E=w.length-1;_<=E;_++)T=_===E||this.charSpacing,v+=w[_],y=this.__charBounds[h][_],x===0?(c+=y.kernedWidth-y.width,x+=y.width):x+=y.kernedWidth,g&&!T&&this._reSpaceAndTab.test(w[_])&&(T=!0),T||(m=m||this.getCompleteStyleDeclaration(h,_),p=this.getCompleteStyleDeclaration(h,_+1),T=this._hasStyleChangedForSvg(m,p)),T&&(b=this._getStyleDeclaration(h,_)||{},l.push(this._createTextCharSpan(v,b,c,f)),v="",m=p,c+=x,x=0)},_pushTextBgRect:function(l,h,c,f,d,g){var m=t.Object.NUM_FRACTION_DIGITS;l.push("		<rect ",this._getFillAttributes(h),' x="',o(c,m),'" y="',o(f,m),'" width="',o(d,m),'" height="',o(g,m),`"></rect>
`)},_setSVGTextLineBg:function(l,h,c,f){for(var d=this._textLines[h],g=this.getHeightOfLine(h)/this.lineHeight,m=0,p=0,v,y,b=this.getValueOfPropertyAt(h,0,"textBackgroundColor"),x=0,w=d.length;x<w;x++)v=this.__charBounds[h][x],y=this.getValueOfPropertyAt(h,x,"textBackgroundColor"),y!==b?(b&&this._pushTextBgRect(l,b,c+p,f,m,g),p=v.left,m=v.width,b=y):m+=v.kernedWidth;y&&this._pushTextBgRect(l,y,c+p,f,m,g)},_getFillAttributes:function(l){var h=l&&typeof l=="string"?new t.Color(l):"";return!h||!h.getSource()||h.getAlpha()===1?'fill="'+l+'"':'opacity="'+h.getAlpha()+'" fill="'+h.setAlpha(1).toRgb()+'"'},_getSVGLineTopOffset:function(l){for(var h=0,c=0,f=0;f<l;f++)h+=this.getHeightOfLine(f);return c=this.getHeightOfLine(f),{lineTop:h,offset:(this._fontSizeMult-this._fontSizeFraction)*c/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(l){var h=t.Object.prototype.getSvgStyles.call(this,l);return h+" white-space: pre;"}})}(),function(o){var a=o.fabric||(o.fabric={});a.Textbox=a.util.createClass(a.IText,a.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:a.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(l){for(var h=0,c=0,f=0,d={},g=0;g<l.graphemeLines.length;g++)l.graphemeText[f]===`
`&&g>0?(c=0,f++,h++):!this.splitByGrapheme&&this._reSpaceAndTab.test(l.graphemeText[f])&&g>0&&(c++,f++),d[g]={line:h,offset:c},f+=l.graphemeLines[g].length,c+=l.graphemeLines[g].length;return d},styleHas:function(l,h){if(this._styleMap&&!this.isWrapping){var c=this._styleMap[h];c&&(h=c.line)}return a.Text.prototype.styleHas.call(this,l,h)},isEmptyStyles:function(l){if(!this.styles)return!0;var h=0,c=l+1,f,d,g=!1,m=this._styleMap[l],p=this._styleMap[l+1];m&&(l=m.line,h=m.offset),p&&(c=p.line,g=c===l,f=p.offset),d=typeof l=="undefined"?this.styles:{line:this.styles[l]};for(var v in d)for(var y in d[v])if(y>=h&&(!g||y<f))for(var b in d[v][y])return!1;return!0},_getStyleDeclaration:function(l,h){if(this._styleMap&&!this.isWrapping){var c=this._styleMap[l];if(!c)return null;l=c.line,h=c.offset+h}return this.callSuper("_getStyleDeclaration",l,h)},_setStyleDeclaration:function(l,h,c){var f=this._styleMap[l];l=f.line,h=f.offset+h,this.styles[l][h]=c},_deleteStyleDeclaration:function(l,h){var c=this._styleMap[l];l=c.line,h=c.offset+h,delete this.styles[l][h]},_getLineStyle:function(l){var h=this._styleMap[l];return!!this.styles[h.line]},_setLineStyle:function(l){var h=this._styleMap[l];this.styles[h.line]={}},_wrapText:function(l,h){var c=[],f;for(this.isWrapping=!0,f=0;f<l.length;f++)c=c.concat(this._wrapLine(l[f],f,h));return this.isWrapping=!1,c},_measureWord:function(l,h,c){var f=0,d,g=!0;c=c||0;for(var m=0,p=l.length;m<p;m++){var v=this._getGraphemeBox(l[m],h,m+c,d,g);f+=v.kernedWidth,d=l[m]}return f},_wrapLine:function(l,h,c,z){var d=0,g=this.splitByGrapheme,m=[],p=[],v=g?a.util.string.graphemeSplit(l):l.split(this._wordJoiners),y="",b=0,x=g?"":" ",w=0,T=0,_=0,E=!0,k=this._getWidthOfCharSpacing(),z=z||0;v.length===0&&v.push([]),c-=z;for(var F=0;F<v.length;F++)y=g?v[F]:a.util.string.graphemeSplit(v[F]),w=this._measureWord(y,h,b),b+=y.length,d+=T+w-k,d>c&&!E?(m.push(p),p=[],d=w,E=!0):d+=k,!E&&!g&&p.push(x),p=p.concat(y),T=g?0:this._measureWord([x],h,b),b++,E=!1,w>_&&(_=w);return F&&m.push(p),_+z>this.dynamicMinWidth&&(this.dynamicMinWidth=_-k+z),m},isEndOfWrapping:function(l){return!this._styleMap[l+1]||this._styleMap[l+1].line!==this._styleMap[l].line},missingNewlineOffset:function(l){return this.splitByGrapheme?this.isEndOfWrapping(l)?1:0:1},_splitTextIntoLines:function(l){for(var h=a.Text.prototype._splitTextIntoLines.call(this,l),c=this._wrapText(h.lines,this.width),f=new Array(c.length),d=0;d<c.length;d++)f[d]=c[d].join("");return h.lines=f,h.graphemeLines=c,h},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var l={};for(var h in this._styleMap)this._textLines[h]&&(l[this._styleMap[h].line]=1);for(var h in this.styles)l[h]||delete this.styles[h]},toObject:function(l){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(l))}}),a.Textbox.fromObject=function(l,h){return a.Object._fromObject("Textbox",l,h,"text")}}(e),function(){var o=t.controlsUtils,a=o.scaleSkewCursorStyleHandler,l=o.scaleCursorStyleHandler,h=o.scalingEqually,c=o.scalingYOrSkewingX,f=o.scalingXOrSkewingY,d=o.scaleOrSkewActionName,g=t.Object.prototype.controls;if(g.ml=new t.Control({x:-.5,y:0,cursorStyleHandler:a,actionHandler:f,getActionName:d}),g.mr=new t.Control({x:.5,y:0,cursorStyleHandler:a,actionHandler:f,getActionName:d}),g.mb=new t.Control({x:0,y:.5,cursorStyleHandler:a,actionHandler:c,getActionName:d}),g.mt=new t.Control({x:0,y:-.5,cursorStyleHandler:a,actionHandler:c,getActionName:d}),g.tl=new t.Control({x:-.5,y:-.5,cursorStyleHandler:l,actionHandler:h}),g.tr=new t.Control({x:.5,y:-.5,cursorStyleHandler:l,actionHandler:h}),g.bl=new t.Control({x:-.5,y:.5,cursorStyleHandler:l,actionHandler:h}),g.br=new t.Control({x:.5,y:.5,cursorStyleHandler:l,actionHandler:h}),g.mtr=new t.Control({x:0,y:-.5,actionHandler:o.rotationWithSnapping,cursorStyleHandler:o.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),t.Textbox){var m=t.Textbox.prototype.controls={};m.mtr=g.mtr,m.tr=g.tr,m.br=g.br,m.tl=g.tl,m.bl=g.bl,m.mt=g.mt,m.mb=g.mb,m.mr=new t.Control({x:.5,y:0,actionHandler:o.changeWidth,cursorStyleHandler:a,actionName:"resizing"}),m.ml=new t.Control({x:-.5,y:0,actionHandler:o.changeWidth,cursorStyleHandler:a,actionName:"resizing"})}}()})(Me);const XC={lockScalingFlip:!0,originY:"center",originX:"center",lockMovementX:!0,lockMovementY:!0,borderColor:"transparent"};function Zv(e=36){let t="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n<e;n+=1)t+=r.charAt(Math.floor(Math.random()*r.length));return t}function A(){return pe.getState()}function V(){return A().editor.tools}function be(){return A().fabric}function Hz(e){var u;const t=new Me.fabric.Canvas(e,{width:1,height:1});t.preserveObjectStacking=!0,t.selection=!1,t.renderOnAddRemove=!1;const r=A().config.textureSize;r&&(Me.fabric.textureSize=r);const n=(u=A().config.objectDefaults)==null?void 0:u.global,i=$($({},n),XC);Object.keys(i).forEach(o=>{Me.fabric.Object.prototype[o]=i[o]}),t.on("object:added",o=>{var a,l;o.target&&!((l=(a=o.target)==null?void 0:a.data)==null?void 0:l.id)&&(o.target.data||(o.target.data={}),o.target.data.id=Zv(10))});const s=Me.fabric.Object.prototype.controls;return Object.keys(s).forEach(o=>{delete s[o]}),t}class Wz{constructor(){Te(this,"maxZoom",2);Te(this,"minZoom",1);Te(this,"step",.05);this.allowUserZoom&&this.bindMouseWheel(),pe.subscribe(t=>t.stageSize,()=>{setTimeout(()=>{this.fitToScreen()},1)})}get allowUserZoom(){var t,r,n,i;return(i=(n=(r=(t=A().config)==null?void 0:t.tools)==null?void 0:r.zoom)==null?void 0:n.allowUserZoom)!=null?i:!0}get currentZoom(){return A().zoom}zoomIn(t=this.step){this.set(this.currentZoom+t)}canZoomIn(t=this.step){return this.currentZoom+t<=this.maxZoom}canZoomOut(t=this.step){return this.currentZoom-t>=this.minZoom}zoomOut(t=this.step){this.set(this.currentZoom-t)}set(t,r=!0){if(t<this.minZoom||t>this.maxZoom)return;const n=ug.round(A().original.width*t,0),i=ug.round(A().original.height*t,0);be().setZoom(t),r&&be().setDimensions({width:n,height:i}),A().setZoom(t)}fitToScreen(){var s,u;if(!((u=(s=A().config.tools)==null?void 0:s.zoom)==null?void 0:u.fitImageToScreen))return;const{width:t,height:r}=A().stageSize,n=Math.max(r,1),i=Math.max(t,1);if(A().original.height>n||A().original.width>i){const o=Math.min(n/A().original.height,i/A().original.width);this.minZoom=Math.min(o,1)}else this.minZoom=1;this.set(this.minZoom)}bindMouseWheel(){be().on("mouse:wheel",t=>{t.e.preventDefault(),t.e.stopPropagation(),t.e.deltaY<0?this.zoomIn():this.zoomOut()})}}const co={selectable:!1,evented:!1,lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0,hasControls:!1,hasBorders:!1,hasRotatingPoint:!1,strokeWidth:0};function GC(e){return new Promise(t=>{Me.fabric.util.loadImage(e,r=>t(new Me.fabric.Image(r)),null,A().config.crossOrigin?"anonymous":void 0)})}function Qv(){return!A().config.image&&!A().config.blankCanvasSize&&(!be()||be().getObjects().length===0)}async function Lf(e){return(await fetch(e)).json()}class Yz{constructor(){Te(this,"minWidth",50);Te(this,"minHeight",50)}resize(t,r,{applyZoom:n=!1,resizeHelper:i=!0}={}){const s=A().zoom;be().setWidth(t*(n?s:1)),be().setHeight(r*(n?s:1)),A().setOriginal(t,r),i&&V().transform.resetStraightenAnchor()}async addMainImage(t,r="mainImage"){var i,s;A().toggleLoading(r);const n=await GC(t);if(!!n)return this.clear(),n.set(co),n.name=pt.MainImage,be().add(n),this.resize(n.width,n.height),n.center(),n.setCoords(),V().zoom.fitToScreen(),A().toggleLoading(!1),(s=(i=A().config).onMainImageLoaded)==null||s.call(i,n),n}openNew(t,r,n){return t=Math.max(this.minWidth,t),r=Math.max(this.minHeight,r),this.clear(),this.resize(t,r),be().backgroundColor=n,V().zoom.fitToScreen(),A().toggleLoading("newCanvas"),requestAnimationFrame(()=>{A().toggleLoading(!1)}),Promise.resolve({width:t,height:r})}getMainImage(){return be().getObjects().find(t=>t.name===pt.MainImage)}render(){be().requestRenderAll()}async loadInitialContent(){var i,s;const t=A().config.image,r=A().config.blankCanvasSize,n=A().config.state;if(t&&t.endsWith("json")){const u=await Lf(t);await V().import.loadState(u)}else t&&t.startsWith('{"canvas')?await V().import.loadState(t):t?await this.addMainImage(t):n?await V().import.loadState(n):r&&await this.openNew(r.width,r.height);return Qv()&&((s=(i=A().config.ui)==null?void 0:i.openImageDialog)==null?void 0:s.show)&&A().togglePanel("newImage",!0),new Promise(u=>{setTimeout(()=>{V().history.addInitial(),u()},10)})}clear(){be().clear(),V().frame.remove(),V().transform.resetStraightenAnchor()}}function Kz(e){return e.name===pt.Sticker&&"forEachObject"in e}const Xz=["fontSize","fontFamily","left","top","width","height","scaleX","scaleY","flipX","flipY","angle","src","strokeWidth"];function qC(e={}){be().fire("object:modified",Gz(e))}function Gz(e){return{values:e,sizeOrPositionChanged:qz(e)}}function qz(e){return Object.keys(e).some(t=>Xz.includes(t))}function e0(e=null){if(A().dirty)return;V().zoom.fitToScreen();const[t,r]=JC(be().getActiveObject());e?A().setActiveTool(e,t===e?r:null):A().setActiveTool(t,r)}function JC(e){switch(e==null?void 0:e.name){case pt.Text:return[Ge.TEXT,Wr.Text];case pt.Sticker:case pt.Image:return[Ge.STICKERS,Wr.ActiveObject];case pt.Shape:return[Ge.SHAPES,Wr.ActiveObject];default:return[null,null]}}function Jz(){A().fabric.on("selection:created",e=>{ZC(e)||t0(e.target)}),A().fabric.on("selection:updated",e=>{ZC(e)||t0(e.target)}),A().fabric.on("selection:cleared",()=>{t0()})}function ZC(e){const[t]=JC(e.target),r=t===A().activeTool;return A().dirty&&(!e.target||!r)?(e.deselected&&V().objects.select(e.deselected[0]),!0):!1}function t0(e){(e==null?void 0:e.data.id)!==A().objects.active.id&&(A().objects.setActive(e!=null?e:null),e0())}class Zz{constructor(){this.syncObjects(),Jz(),A().fabric.on("text:editing:entered",()=>{A().objects.setIsEditingText(!0)}),A().fabric.on("text:editing:exited",()=>{A().objects.setIsEditingText(!1)}),A().fabric.on("object:added",()=>{this.syncObjects()}),A().fabric.on("object:removed",()=>{this.syncObjects()})}getAll(){return be().getObjects().filter(t=>{var r;return!((r=t==null?void 0:t.data)==null?void 0:r.pixieInternal)})}get(t){return this.getAll().find(r=>r.name===t)}getById(t){return this.getAll().find(r=>r.data.id===t)}isActive(t){var n;const r=typeof t=="string"?t:t.data.id;return((n=A().objects.active)==null?void 0:n.id)===r}getActive(){return be().getActiveObject()}has(t){return this.getAll().findIndex(r=>r.name===t)>-1}select(t){const r=typeof t=="string"?this.getById(t):t;!r||(be().setActiveObject(r),be().requestRenderAll())}deselectActive(){be().discardActiveObject(),be().requestRenderAll()}setValues(t,r){if(r=r||this.getActive(),!r)return;let n=!1;Kz(r)&&t.fill!==r.fill&&r.forEachObject(i=>i.set("fill",t.fill)),Zi(r)?((t.fontFamily!==r.fontFamily||t.fontSize!==r.fontSize)&&(n=!0),r.selectionStart!==r.selectionEnd?r.setSelectionStyles(t):r.set(t)):r.set(t),n?setTimeout(()=>{be().requestRenderAll()},50):be().requestRenderAll(),A().objects.setActive(r),qC(t)}move(t,r=1,n){n=n||this.getActive(),!!n&&(t==="up"?this.setValues({top:n.top-r}):t==="down"?this.setValues({top:n.top+r}):t==="left"?this.setValues({left:n.left-r}):t==="right"&&this.setValues({left:n.left+r}),V().canvas.render())}bringToFront(t){t=t||this.getActive(),!!t&&(t.bringToFront(),V().canvas.render())}sendToBack(t){t=t||this.getActive(),!!t&&(t.sendToBack(),V().canvas.render())}flipHorizontally(t){t=t||this.getActive(),!!t&&(this.setValues({flipX:!t.flipX}),V().canvas.render())}duplicate(t){const r=t||this.getActive();!r||(this.deselectActive(),r.clone(n=>{n.set({left:r.left+40,top:r.top+40,data:Y($({},r.data),{id:Zv(10)}),name:r.name}),be().add(n),this.select(n),V().canvas.render()}))}delete(t){t=t||this.getActive(),!!t&&(this.deselectActive(),be().remove(t),be().requestRenderAll(),V().history.addHistoryItem({name:"deletedObject"}))}syncObjects(){const t=this.getAll().map(r=>{var n;return{name:r.name,selectable:(n=r.selectable)!=null?n:!1,id:r.data.id}});pe.setState({objects:Y($({},A().objects),{all:t})})}}const Qz={frame:null,fonts:[]};function Nf(e=[]){var n;e=[...Object.keys(co),"crossOrigin","name","displayName","data",...e];const t=be().toJSON(e);t.objects=t.objects.filter(i=>!i.data.pixieInternal).map(i=>(i.type==="image"&&A().config.crossOrigin&&(i.crossOrigin="anonymous"),Zi(i)&&(i.selectable=!0,i.lockMovementX=!1,i.lockMovementY=!1,i.lockUniScaling=!1),Y($({},i),{data:i.data?$({},i.data):{}})));const r=V().frame.active.config?{name:V().frame.active.config.name,sizePercent:V().frame.active.currentSizeInPercent}:null;return{canvas:t,editor:{frame:r,zoom:A().zoom,activeObjectId:((n=A().objects.active)==null?void 0:n.id)||null},canvasWidth:A().original.width,canvasHeight:A().original.height}}function QC(e){e.state||(e.state=Nf());const t=e.state||Nf();return Y($({},t),{name:e.name,id:Zv(15)})}const eE=15;class ej{constructor(){Te(this,"minWidth",250)}add(t,r={}){var s,u,o;if(t=t||((u=(s=A().config.tools)==null?void 0:s.text)==null?void 0:u.defaultText),!t)return;const n=Y($($({},(o=A().config.objectDefaults)==null?void 0:o.text),r),{name:pt.Text,padding:eE,editingBorderColor:pm.fill}),i=new Me.fabric.IText(t,n);be().add(i),this.autoPositionText(i),V().objects.select(i)}autoPositionText(t){const r=be().getWidth(),n=be().getHeight(),i=Math.min(be().getWidth(),this.minWidth);t.scaleToWidth(Math.max(r/3,i)),t.getScaledHeight()>n&&t.scaleToHeight(n-t.getScaledHeight()-20),t.viewportCenter(),be().getObjects("i-text").forEach(s=>{if(s!==t&&s.intersectsWithObject(t)){const u=s.top-t.top+s.getScaledHeight();let o=t.top+u;o>A().original.height-s.getScaledHeight()&&(o=0),t.set("top",o),t.setCoords()}})}}function tj(e){return e?/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e):!1}function Ar(e){return e?tj(e)?e:`${A().config.baseUrl?`${A().config.baseUrl}/`:""}${e}`:""}function tE(e){const t=e.map(async r=>{const n=Array.from(document.fonts.values()).find(s=>s.family===r.family);if(n)return n.loaded;const i=new FontFace(r.family,`url(${Ar(r.src)})`,r.descriptors);return document.fonts.add(i),i.load()});return Promise.all(t)}class rj{async undo(){if(this.canUndo()){const t=A().history.items[A().history.pointer-1];await this.load(t)}}async redo(){if(this.canRedo()){const t=A().history.items[A().history.pointer+1];await this.load(t)}}canUndo(){return A().history.canUndo}canRedo(){return A().history.canRedo}reload(){return this.load(A().history.items[A().history.pointer])}replaceCurrent(){const t=A().history.items[A().history.pointer],r=[...A().history.items];r[A().history.pointer]=QC({name:t.name,state:t})}addHistoryItem(t){const r=QC(t),i=[...A().history.items.slice(0,A().history.pointer+1),r];A().history.update(i.length-1,i)}load(t){return t=Y($({},t),{editor:t.editor||Qz}),new Promise(r=>{tE(nj(t.canvas.objects)).then(()=>{be().loadFromJSON(t.canvas,()=>{V().zoom.set(1),t.canvasWidth&&t.canvasHeight&&V().canvas.resize(t.canvasWidth,t.canvasHeight,{resizeHelper:!1,applyZoom:!1}),V().frame.remove(),t.editor.frame&&V().frame.add(t.editor.frame.name,t.editor.frame.sizePercent),V().objects.syncObjects(),V().objects.getAll().forEach(n=>{if(!n.data.pixieInternal&&n.originX==="left"&&n.originY==="top"){const i=n.getPointByOrigin("center","center");n.set("left",i.x),n.set("top",i.y)}n.set($({},XC)),n.type==="i-text"&&(n.padding=eE)}),V().canvas.render(),be().calcOffset(),V().zoom.fitToScreen(),A().history.updatePointerById(t.id),V().transform.resetStraightenAnchor(),r()})})})}addInitial(t){!A().history.items.find(n=>n.name==="initial")&&(t||!Qv())&&this.addHistoryItem({name:"initial",state:t})}}function nj(e){const t=[];return e.forEach(r=>{var i,s,u;if(!Zi(r))return;const n=(u=(s=(i=A().config.tools)==null?void 0:i.text)==null?void 0:s.items)==null?void 0:u.find(o=>o.family===r.fontFamily);n&&t.push(n)}),t}class ij{canMerge(){return V().objects.getAll().filter(t=>t.name!==pt.MainImage).length>0}async apply(){A().toggleLoading("merge");const t=V().export.getDataUrl();t&&await V().canvas.addMainImage(t,"merge")}}const zf=[{name:"grayscale"},{name:"blackWhite",fabricType:"blackwhite"},{name:"sharpen",uses:"Convolute",matrix:[0,-1,0,-1,5,-1,0,-1,0]},{name:"invert"},{name:"vintage"},{name:"polaroid"},{name:"kodachrome"},{name:"technicolor"},{name:"brownie"},{name:"sepia"},{name:"removeColor",fabricType:"removecolor",options:{distance:{type:"slider",current:.1,min:0,max:1,step:.01},color:{current:"#fff",type:"colorPicker"}}},{name:"brightness",options:{brightness:{type:"slider",current:.1,min:-1,max:1,step:.1}}},{name:"gamma",options:{red:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},green:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},blue:{type:"slider",current:.1,min:.2,max:2.2,step:.003921}},apply:e=>{e.gamma=[e.red,e.green,e.blue]}},{name:"noise",options:{noise:{type:"slider",current:40,min:1,max:600}}},{name:"pixelate",options:{blocksize:{type:"slider",min:1,max:40,current:6}}},{name:"blur",uses:"Convolute",matrix:[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9]},{name:"emboss",uses:"Convolute",matrix:[1,1,1,1,.7,-1,-1,-1,-1]},{name:"blendColor",fabricType:"blendcolor",options:{alpha:{type:"slider",current:.5,min:.1,max:1,step:.1},mode:{current:"add",type:"select",available:[{key:"add"},{key:"multiply"},{key:"subtract"},{key:"diff"},{key:"screen"},{key:"lighten"},{key:"darken"}]},color:{type:"colorPicker",current:"#FF4081"}}}],oj={grayscale:{id:"hanSko",defaultMessage:[{type:0,value:"grayscale"}]},blackWhite:{id:"PPBwfo",defaultMessage:[{type:0,value:"Black & White"}]},sharpen:{id:"zigryQ",defaultMessage:[{type:0,value:"Sharpen"}]},invert:{id:"LmfbOm",defaultMessage:[{type:0,value:"Invert"}]},vintage:{id:"I9oSmn",defaultMessage:[{type:0,value:"Vintage"}]},polaroid:{id:"bWw3nL",defaultMessage:[{type:0,value:"Polaroid"}]},kodachrome:{id:"ntXTEb",defaultMessage:[{type:0,value:"Kodachrome"}]},technicolor:{id:"eiirdl",defaultMessage:[{type:0,value:"Technicolor"}]},brownie:{id:"7Vuh3m",defaultMessage:[{type:0,value:"Brownie"}]},sepia:{id:"Ax70Ky",defaultMessage:[{type:0,value:"Sepia"}]},removeColor:{id:"t+ijui",defaultMessage:[{type:0,value:"Remove Color"}]},brightness:{id:"/4ssxy",defaultMessage:[{type:0,value:"Brightness"}]},gamma:{id:"BQrhdi",defaultMessage:[{type:0,value:"Gamma"}]},noise:{id:"N0/0z5",defaultMessage:[{type:0,value:"Noise"}]},pixelate:{id:"thCGjq",defaultMessage:[{type:0,value:"Pixelate"}]},blur:{id:"VXV22v",defaultMessage:[{type:0,value:"Blur"}]},emboss:{id:"+EGmqP",defaultMessage:[{type:0,value:"Emboss"}]},blendColor:{id:"3wuUmC",defaultMessage:[{type:0,value:"Blend Color"}]}},r0={distance:{id:"b1UO8a",defaultMessage:[{type:0,value:"distance"}]},color:{id:"uHla4C",defaultMessage:[{type:0,value:"color"}]},brightness:{id:"UFDwMY",defaultMessage:[{type:0,value:"brightness"}]},red:{id:"2qELFK",defaultMessage:[{type:0,value:"red"}]},green:{id:"biDOz4",defaultMessage:[{type:0,value:"green"}]},blue:{id:"QOD43s",defaultMessage:[{type:0,value:"blue"}]},noise:{id:"t2y9+Z",defaultMessage:[{type:0,value:"noise"}]},blocksize:{id:"90afbG",defaultMessage:[{type:0,value:"blocksize"}]},mode:{id:"s3GkYx",defaultMessage:[{type:0,value:"mode"}]},alpha:{id:"tyl8L5",defaultMessage:[{type:0,value:"alpha"}]}};function jf(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}class aj{constructor(){pe.subscribe(t=>t.history.pointer,()=>{this.syncState()})}apply(t){A().filter.select(t,this.hasOptions(t));const r=this.getByName(t);if(this.isApplied(r.name)){this.remove(r.name);return}const n=this.create(r);this.getImages().forEach(i=>{var s;(s=i.filters)==null||s.push(n),i.applyFilters()}),this.syncState(),V().canvas.render()}remove(t){A().filter.deselect(t);const r=this.getByName(t);this.getImages().forEach(n=>{var s;const i=this.findFilterIndex(r.name,n.filters);(s=n.filters)==null||s.splice(i,1),n.applyFilters()}),this.syncState(),V().canvas.render()}getAll(){return zf}getByName(t){return zf.find(r=>r.name===t)}isApplied(t){const r=V().canvas.getMainImage();return r?this.findFilterIndex(t,r.filters)>-1:!1}applyValue(t,r,n){const i=this.getByName(t);this.getImages().forEach(s=>{const u=(s.filters||[]).find(o=>o.type.toLowerCase()===i.name.toLowerCase());!u||(u[r]=n,i.apply&&i.apply(u,r,n),s.applyFilters())}),V().canvas.render()}addCustom(t,r,n,i){const s=Me.fabric.Image.filters;s[jf(t)]=Me.fabric.util.createClass(s.BaseFilter,r),s[jf(t)].fromObject=s.BaseFilter.fromObject,zf.push({name:t,options:n,initialConfig:i})}create(t){const r=t.initialConfig||{};let n;return t.uses?(r.matrix=t.matrix,n=new Me.fabric.Image.filters[jf(t.uses)](r)):(Object.entries(t.options||{}).forEach(([i,s])=>{r[i]=s.current}),n=new Me.fabric.Image.filters[jf(t.name)](r)),n.name=t.name,n}hasOptions(t){return!!this.getByName(t).options}findFilterIndex(t,r){if(!(r==null?void 0:r.length))return-1;const n=this.getByName(t);return r.findIndex(i=>this.configMatchesFabricFilter(n,i))}syncState(){var n;const t=[];(((n=this.getImages()[0])==null?void 0:n.filters)||[]).forEach(i=>{const s=this.getByFabricFilter(i);s&&t.push(s.name)}),pe.setState({filter:Y($({},A().filter),{applied:t})})}getByFabricFilter(t){return zf.find(r=>this.configMatchesFabricFilter(r,t))}configMatchesFabricFilter(t,r){const n=r.type.toLowerCase().replace(" ","");return n===t.fabricType||n===t.name?!0:n==="convolute"&&this.matrixAreEqual(t.matrix,r.matrix)}matrixAreEqual(t,r){if(!t||!r||t.length!==r.length)return!1;for(let n=t.length;n--;)if(t[n]!==r[n])return!1;return!0}getImages(){return V().objects.getAll().filter(t=>t.name===pt.Image||pt.MainImage)}}function sj(e){return e.width<rE(e.usePercentages)&&(e.width=rE(e.usePercentages),e.maintainAspect&&(e.height=Bf(e.width,e.usePercentages))),e.width>nE(e.usePercentages)&&(e.width=nE(e.usePercentages),e.maintainAspect&&(e.height=Bf(e.width,e.usePercentages))),e.height<iE(e.usePercentages)&&(e.height=iE(e.usePercentages),e.maintainAspect&&(e.width=n0(e.height,e.usePercentages))),e.height>oE(e.usePercentages)&&(e.height=oE(e.usePercentages),e.maintainAspect&&(e.width=n0(e.height,e.usePercentages))),e}function rE(e){var r,n;const t=((n=(r=A().config.tools)==null?void 0:r.resize)==null?void 0:n.minWidth)||50;return e?Math.ceil(t*100/A().original.width):t}function nE(e){var r,n;const t=((n=(r=A().config.tools)==null?void 0:r.resize)==null?void 0:n.maxWidth)||2400;return e?Math.ceil(t*100/A().original.width):t}function iE(e){var r,n;const t=((n=(r=A().config.tools)==null?void 0:r.resize)==null?void 0:n.minHeight)||50;return e?Math.ceil(t*100/A().original.height):t}function oE(e){var r,n;const t=((n=(r=A().config.tools)==null?void 0:r.resize)==null?void 0:n.maxHeight)||2400;return e?Math.ceil(t*100/A().original.height):t}function n0(e,t){if(t)return e;const r=A().original.height/e;return Math.floor(A().original.width/r)}function Bf(e,t){if(t)return e;const r=A().original.width/e;return Math.floor(A().original.height/r)}class lj{apply(t){const{width:r,height:n,usePercentages:i}=sj(t),s=Math.ceil(A().original.width),u=Math.ceil(A().original.height),o=Math.ceil(r),a=Math.ceil(n);let l,h;i?(l=r/100,h=n/100):(l=r/A().original.width,h=n/A().original.height),!(s===o&&u===a)&&this.resize(l,h)}resize(t,r){V().zoom.set(1,!1);const n=Math.round(A().original.height*r),i=Math.round(A().original.width*t);V().canvas.resize(i,n,{applyZoom:!1,resizeHelper:!0}),V().objects.getAll().forEach(s=>{const u=s.scaleX||1,o=s.scaleY||1,a=s.left||0,l=s.top||0,h=u*t,c=o*r,f=a*t,d=l*r;s.scaleX=h,s.scaleY=c,s.left=f,s.top=d,s.setCoords()}),V().zoom.fitToScreen(),be().requestRenderAll()}}function uj(e,t){t.innerZone!==null&&(t=t,cj(e,t),fj(e,t),dj(e,t))}function cj(e,t){t.innerZone.style.width=`${e.width}px`,t.innerZone.style.height=`${e.height}px`,t.innerZone.style.transform=`translate(${e.left}px, ${e.top}px)`}function fj(e,t){const r=A().canvasSize.width,n=A().canvasSize.height;t.maskTop.style.height=`${e.top}px`,t.maskTop.style.width=`${r}px`,t.maskLeft.style.top=`${e.top}px`,t.maskLeft.style.height=`${e.height}px`,t.maskLeft.style.width=`${e.left}px`;const i=e.left+e.width;t.maskRight.style.left=`${i}px`,t.maskRight.style.top=`${e.top}px`,t.maskRight.style.height=`${e.height}px`,t.maskRight.style.width=`${r-i}px`,t.maskBottom.style.height=`${n-(e.top+e.height)}px`,t.maskBottom.style.width=`${r}px`}function dj(e,t){const r=(e.width-2)/3;t.lineVer1.style.height=`${e.height}px`,t.lineVer1.style.transform=`translate(${r}px, 0)`,t.lineVer2.style.height=`${e.height}px`,t.lineVer2.style.transform=`translate(${r*2}px, 0)`;const n=(e.height-2)/3;t.lineHor1.style.width=`${e.width}px`,t.lineHor1.style.transform=`translate(0, ${n}px)`,t.lineHor2.style.width=`${e.width}px`,t.lineHor2.style.transform=`translate(0, ${n*2}px)`}function Vf(e,t,r){let n=t,i=r;return e&&(r*e>t?i=t/e:n=r*e),{width:Math.floor(n),height:Math.floor(i)}}function i0(e){if(!e)return null;const t=e.split(":");return parseInt(t[0],10)/parseInt(t[1],10)}function hj(e,t=null){const r={width:e.width,height:e.height,top:0,left:0,angle:0};if(t){const n=Vf(t,r.width,r.height);r.width=n.width,r.height=n.height}return r.left=(e.width-r.width)/2,r.top=(e.height-r.height)/2,r}class pj{constructor(){Te(this,"refs",null);Te(this,"zone")}apply(t){var i;const r=(i=V().frame.active.config)==null?void 0:i.name,n=V().frame.active.currentSizeInPercent;return V().frame.active.hide(),V().merge.apply().then(()=>{V().canvas.resize(Math.round(t.width),Math.round(t.height),{applyZoom:!0,resizeHelper:!0});const s=V().canvas.getMainImage();s.cropX=Math.round(t.left),s.cropY=Math.round(t.top),s.width=Math.round(t.width),s.height=Math.round(t.height),s.viewportCenter(),r&&V().frame.add(r,n),V().zoom.fitToScreen(),V().canvas.render()})}drawZone(t){var r;((r=this.refs)==null?void 0:r.current)&&(A().crop.setCropzoneRect(t),uj(t,this.refs.current))}resetCropzone(t){var s;const r=A().canvasSize,n=i0(t);if(!r)return;(s=this.zone)==null||s.setConfig({aspectRatio:n,boundaryRect:r}),A().crop.setAspectRatio(t);const i=hj(r,n);this.drawZone(i)}registerRefs(t){this.refs=t}}class gj{getShapeByName(t){var n,i;const r=(i=(n=A().config.tools)==null?void 0:n.shapes)==null?void 0:i.items;return(r==null?void 0:r.find(s=>s.name===t))||null}addBasicShape(t){var a;const r=this.getShapeByName(t);if(!r)return null;const l=((a=A().config.objectDefaults)==null?void 0:a.shape)||{},{width:n,height:i}=l,s=ze(l,["width","height"]),u=$($({},s),r.options);let o;if(r.name==="circle")o=new Me.fabric.Circle(Y($({},u),{radius:100}));else if(r.name==="ellipse")o=new Me.fabric.Ellipse(Y($({},u),{rx:100,ry:50}));else if(r.type==="Path")o=new Me.fabric.Path(u.path,$({displayName:r.name},u));else{const h=r.type;o=new Me.fabric[h](Y($({},u),{width:150,height:150}))}return this.addAndPositionShape(o,pt.Shape,{width:n,height:i}),o}addSticker(t,r){var i,s,u;const n=(u=(s=(i=A().config.tools)==null?void 0:i.stickers)==null?void 0:s.items)==null?void 0:u.find(o=>o.name===t);if(!n)return Promise.resolve();if(n.type==="svg"){const o=o0(n,r);return this.addSvgSticker(o)}return this.addRegularSticker(n,r)}addRegularSticker(t,r){return new Promise(n=>{Me.fabric.util.loadImage(o0(t,r),i=>{var l;const h=((l=A().config.objectDefaults)==null?void 0:l.sticker)||{},{width:s,height:u}=h,o=ze(h,["width","height"]),a=new Me.fabric.Image(i,o);this.addAndPositionShape(a,pt.Sticker,{width:s,height:u}),n()})})}addSvgSticker(t,r=pt.Sticker){return new Promise(n=>{Me.fabric.loadSVGFromURL(t,(i,s)=>{var h;const c=((h=A().config.objectDefaults)==null?void 0:h.sticker)||{},{width:u,height:o}=c,a=ze(c,["width","height"]),l=Me.fabric.util.groupSVGElements(i,s);l.set(a),this.addAndPositionShape(l,r,{width:u,height:o}),n()})})}addAndPositionShape(t,r,{width:n}){t.name=r,t.scaleX=1,t.scaleY=1,be().add(t);const i=n||A().original.width*A().zoom/4;t.scaleToWidth(Math.min(150,i)),t.viewportCenter(),t.setCoords(),V().canvas.render(),be().setActiveObject(t)}}function o0(e,t){return Ar(`images/stickers/${e.name}/${t}.${e.type}`)}class mj{constructor(t){Te(this,"patternCache",[]);this.activeFrame=t}fillParts(t){this.patternCache.forEach(r=>{this.fillPartWithPattern(r,t)})}fillPartWithPattern(t,r){if(!this.activeFrame.parts)return;t.canvas=new Me.fabric.StaticCanvas(null),t.canvas.add(t.img);const n=new Me.fabric.Pattern({source:t.canvas.getElement(),repeat:r==="repeat"?"repeat":"no-repeat"});this.activeFrame.parts[t.name]&&this.activeFrame.parts[t.name].set("fill",n)}scale(t){if(!this.activeFrame.config||!this.patternCache)return;const r=this.activeFrame.config.mode;t/=be().getRetinaScaling(),this.patternCache.forEach(n=>{!this.activeFrame.parts||(n.name==="top"||n.name==="bottom"?r==="stretch"?(this.scalePatternToWidth(n.img,this.activeFrame.parts.top.getScaledWidth()),this.scalePatternToHeight(n.img,t)):n.img.scaleToHeight(t):n.name==="left"||n.name==="right"?r==="stretch"?(this.scalePatternToWidth(n.img,t),this.scalePatternToHeight(n.img,this.activeFrame.parts.left.getScaledHeight())):n.img.scaleToWidth(t):r==="stretch"?(this.scalePatternToWidth(n.img,t),this.scalePatternToHeight(n.img,t)):n.img.scaleToWidth(t),n.canvas.setDimensions({width:n.img.getScaledWidth(),height:n.img.getScaledHeight()}))}),V().canvas.render()}scalePatternToWidth(t,r){if(!t.width)return;const n=t.getBoundingRect().width/t.getScaledWidth();t.set("scaleX",r/t.width/n),t.setCoords()}scalePatternToHeight(t,r){if(!t.height)return;const n=t.getBoundingRect().height/t.getScaledHeight();t.set("scaleY",r/t.height/n),t.setCoords()}load(t){const r=this.activeFrame.getPartNames().map(n=>new Promise(i=>{const s=Y($({},co),{originX:"left",originY:"top"});A().config.crossOrigin&&(s.crossOrigin="anonymous"),Me.fabric.Image.fromURL(this.getPartUrl(t,n),u=>{i({name:n,img:u})},s)}));return Promise.all(r).then(n=>{this.patternCache=n,this.fillParts(t.mode)})}getPartUrl(t,r){return Ar(`images/frames/${t.name}/${r}.png`)}}class vj{constructor(t,r){this.activeFrame=t,this.patterns=r}get defaultColor(){var t,r;return(r=(t=A().config.objectDefaults)==null?void 0:t.global)==null?void 0:r.fill}build(t,r){if(this.createParts(t),this.resize(r),this.activeFrame.config=t,t.mode==="basic"){V().canvas.render();return}this.patterns.load(t).then(()=>{this.patterns.scale(r),V().canvas.render()})}createParts(t){const r={};this.activeFrame.getPartNames().forEach(n=>{const i=t.mode==="basic"?this.defaultColor:void 0;r[n]=new Me.fabric.Rect(Y($({},co),{fill:i,originX:"left",originY:"top",name:`frame.rect.${n}`,objectCaching:!1,data:{pixieInternal:!0}})),be().add(r[n])}),this.activeFrame.parts=r}resize(t){const r=A().original.width,n=A().original.height,i=this.activeFrame,s=t;!i.parts||(i.parts.topLeft.set({width:s,height:s}),i.parts.topRight.set({left:r-i.parts.topLeft.getScaledWidth(),width:s,height:s}),i.parts.top.set({left:i.parts.topLeft.getScaledWidth()-1,width:r-i.parts.topLeft.getScaledWidth()-i.parts.topRight.getScaledWidth()+3,height:s}),i.parts.bottomLeft.set({top:n-i.parts.topLeft.getScaledHeight(),width:s,height:s}),i.parts.left.set({top:i.parts.topLeft.getScaledHeight()-1,width:s,height:n-i.parts.topLeft.getScaledHeight()-i.parts.bottomLeft.getScaledHeight()+3}),i.parts.bottomRight.set({left:r-i.parts.bottomLeft.getScaledWidth(),top:n-i.parts.topRight.getScaledWidth(),width:s,height:s}),i.parts.bottom.set({left:i.parts.top.left,top:n-i.parts.top.getScaledHeight(),width:i.parts.top.getScaledWidth(),height:s}),i.parts.right.set({left:r-i.parts.left.getScaledWidth(),top:i.parts.left.top,width:i.parts.left.width,height:i.parts.left.getScaledHeight()}))}}class yj{constructor(){Te(this,"corners",["topLeft","topRight","bottomLeft","bottomRight"]);Te(this,"sides",["top","right","bottom","left"]);Te(this,"parts",null);Te(this,"config",null);Te(this,"currentSizeInPercent",100)}getPartNames(){return[...this.corners,...this.sides]}hide(){!this.parts||(Object.values(this.parts).forEach(t=>t.set({visible:!1})),V().canvas.render())}show(){!this.parts||(Object.values(this.parts).forEach(t=>t.set({visible:!0})),V().canvas.render())}remove(){!this.parts||(this.config=null,Object.values(this.parts).forEach(t=>{be().remove(t)}),this.parts=null,V().canvas.render())}is(t){return this.config?this.config.name===t.name:!1}changeColor(t){var r;((r=this.config)==null?void 0:r.mode)!=="basic"||!this.parts||(Object.values(this.parts).forEach(n=>{n.set("fill",t)}),V().canvas.render())}getMinSize(){var t,r;return(r=(t=this.config)==null?void 0:t.size.min)!=null?r:1}getMaxSize(){var t,r;return(r=(t=this.config)==null?void 0:t.size.max)!=null?r:35}}class bj{constructor(){Te(this,"patterns");Te(this,"builder");Te(this,"active");this.active=new yj,this.patterns=new mj(this.active),this.builder=new vj(this.active,this.patterns),be().on("object:added",()=>{Object.values(this.active.parts||[]).forEach(t=>t.moveTo(98))})}add(t,r){const n=this.getByName(t);if(!n||this.active.is(n))return;this.active.remove(),this.active.currentSizeInPercent=r!=null?r:n.size.default;const i=this.calcFrameSizeInPixels(this.active.currentSizeInPercent);this.builder.build(n,i),A().frame.select(n)}resize(t){if(!this.active.parts||!this.active.config)return;t?this.active.currentSizeInPercent=t:t=this.active.currentSizeInPercent;const r=this.calcFrameSizeInPixels(t);this.builder.resize(r),this.patterns.scale(r),V().canvas.render()}changeColor(t){this.active.changeColor(t)}remove(){this.active.remove(),A().frame.deselect()}getByName(t){var n,i;const r=(i=(n=A().config.tools)==null?void 0:n.frame)==null?void 0:i.items;if(r)return r.find(s=>s.name===t)}getActiveFrameConfig(){return this.active.config}calcFrameSizeInPixels(t){const r=Math.min(A().original.width,A().original.height);return Math.ceil(t/100*r)}}const xj=e=>{const t=new Me.fabric.PatternBrush(e);return t.getPatternSrc=function(){const n=Me.fabric.document.createElement("canvas");n.width=10,n.height=10;const i=n.getContext("2d");return i.strokeStyle=this.color,i.lineWidth=5,i.beginPath(),i.moveTo(0,5),i.lineTo(10,5),i.closePath(),i.stroke(),n},t},wj=e=>{const t=new Me.fabric.PatternBrush(e);return t.getPatternSrc=function(){const n=document.createElement("canvas");n.width=10,n.height=10;const i=n.getContext("2d");return i.strokeStyle=this.color,i.lineWidth=5,i.beginPath(),i.moveTo(5,0),i.lineTo(5,10),i.closePath(),i.stroke(),n},t},Sj=e=>{const t=new Me.fabric.PatternBrush(e);return t.getPatternSrc=function(){const n=this.width/2,i=5,s=document.createElement("canvas"),u=new Me.fabric.Rect({width:n,height:n,angle:45,fill:this.color}),o=u.getBoundingRect().width;s.width=o+i,s.height=o+i,u.set({left:o/2,top:o/2});const a=s.getContext("2d");return u.render(a),s},t},_j=e=>{const t=new Me.fabric.PatternBrush(e);return t.getPatternSrc=function(){const s=document.createElement("canvas");s.width=10+2,s.height=10+2;const u=s.getContext("2d");return u.fillStyle=this.color,u.fillRect(0,0,10,10),s},t};class Tj{constructor(){Te(this,"customBrushes",{VLineBrush:xj,HLineBrush:wj,DiamondBrush:Sj,SquareBrush:_j});Te(this,"currentBrush",{type:"PencilBrush",color:(Dk=($k=A().config.objectDefaults)==null?void 0:$k.global)==null?void 0:Dk.fill,width:kS[1]});Te(this,"onPathCreated",t=>{t.path.name=pt.Drawing,t.path.set(Cj()),A().setDirty(!0)})}enable(){be().on("path:created",this.onPathCreated),be().isDrawingMode=!0,this.setBrushType(this.currentBrush.type),this.setBrushSize(this.currentBrush.width)}disable(){be().off("path:created",this.onPathCreated),be().isDrawingMode=!1}getBrushType(){return this.currentBrush.type}setBrushType(t){this.currentBrush.type=t,be().freeDrawingBrush=t in Me.fabric?new Me.fabric[t](be()):this.customBrushes[t](be()),this.applyBrushStyles()}applyBrushStyles(){Object.keys(this.currentBrush).forEach(r=>{be().freeDrawingBrush[r]=this.currentBrush[r]});const t=be().freeDrawingBrush;t.getPatternSrc&&(t.source=t.getPatternSrc.call(t))}setBrushSize(t){this.currentBrush.width=t,this.applyBrushStyles()}getBrushSize(){return this.currentBrush.width}setBrushColor(t){this.currentBrush.color=t,this.applyBrushStyles()}getBrushColor(){return this.currentBrush.color}}function Cj(){const e=$({},co);return delete e.strokeWidth,e}function aE(e){var r;return(r=/(?:\.([^.]+))?$/.exec(e))==null?void 0:r[1]}function Ej(e){const t={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",yaml:"text/yaml",yml:"text/yaml"},r=e.name?aE(e.name):null;return e.type?e.type:r&&r in t?t[r]:null}class a0{constructor(t,r){Te(this,"name");Te(this,"relativePath");Te(this,"size");Te(this,"mime");Te(this,"extension");Te(this,"native");Te(this,"lastModified");Te(this,"url",null);Te(this,"cachedData");this.name=t.name,this.size=t.size,this.mime=Ej(t),this.lastModified=t.lastModified,this.extension=aE(t.name),this.native=t,r=r||t.webkitRelativePath||null,r&&r.match(/\//g).length>1&&(this.relativePath=r)}get data(){return new Promise(t=>{this.cachedData&&t(this.cachedData);const r=new FileReader;r.addEventListener("load",()=>{this.cachedData=r.result,t(this.cachedData)}),this.extension==="json"?r.readAsText(this.native):r.readAsDataURL(this.native)})}}function Pj(e={}){var n;const t=document.querySelector("#hidden-file-upload-input");t&&t.remove();const r=document.createElement("input");return r.type="file",r.multiple=(n=e.multiple)!=null?n:!1,r.classList.add("hidden"),r.style.display="none",r.style.visibility="hidden",r.id="hidden-file-upload-input",r.accept=sE(e),e.directory&&(r.webkitdirectory=!0),document.body.appendChild(r),r}function sE({extensions:e=[],types:t=[]}){const r=[];return e&&(e=e.map(n=>n.startsWith(".")?n:`.${n}`),r.push(e.join(","))),t&&r.push(t.join(",")),r.join(",")}function Oj(e={}){return new Promise(t=>{const r=Pj(e);r.onchange=n=>{const i=n.target.files;if(!i)return t([]);const s=Array.from(i).map(u=>new a0(u));t(s),r.remove()},document.body.appendChild(r),r.click()})}let Mj={data:""},kj=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||Mj,$j=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Dj=/\/\*[^]*?\*\/|\s\s+|\n/g,yi=(e,t)=>{let r="",n="",i="";for(let s in e){let u=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+u+";":n+=s[1]=="f"?yi(u,s):s+"{"+yi(u,s[1]=="k"?"":t)+"}":typeof u=="object"?n+=yi(u,t?t.replace(/([^,])+/g,o=>s.replace(/(^:.*)|([^,])+/g,a=>/&/.test(a)?a.replace(/&/g,o):o?o+" "+a:a)):s):u!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=yi.p?yi.p(s,u):s+":"+u+";")}return r+(t&&i?t+"{"+i+"}":i)+n},Pl={},lE=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+lE(e[r]);return t}return e},Aj=(e,t,r,n,i)=>{let s=lE(e),u=Pl[s]||(Pl[s]=(o=>{let a=0,l=11;for(;a<o.length;)l=101*l+o.charCodeAt(a++)>>>0;return"go"+l})(s));if(!Pl[u]){let o=s!==e?e:(a=>{let l,h=[{}];for(;l=$j.exec(a.replace(Dj,""));)l[4]?h.shift():l[3]?h.unshift(h[0][l[3]]=h[0][l[3]]||{}):h[0][l[1]]=l[2];return h[0]})(e);Pl[u]=yi(i?{["@keyframes "+u]:o}:o,r?"":"."+u)}return((o,a,l)=>{a.data.indexOf(o)==-1&&(a.data=l?o+a.data:a.data+o)})(Pl[u],t,n),u},Ij=(e,t,r)=>e.reduce((n,i,s)=>{let u=t[s];if(u&&u.call){let o=u(r),a=o&&o.props&&o.props.className||/^go/.test(o)&&o;u=a?"."+a:o&&typeof o=="object"?o.props?"":yi(o,""):o===!1?"":o}return n+i+(u==null?"":u)},"");function uE(e){let t=this||{},r=e.call?e(t.p):e;return Aj(r.unshift?r.raw?Ij(r,[].slice.call(arguments,1),t.p):r.reduce((n,i)=>Object.assign(n,i&&i.call?i(t.p):i),{}):r,kj(t.target),t.g,t.o,t.k)}uE.bind({g:1}),uE.bind({k:1});function Rj(e,t,r,n){yi.p=t}function wt(){return wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wt.apply(this,arguments)}var Fj=function(t){return typeof t=="function"},cE=function(t,r){return Fj(t)?t(r):t},Lj=function(){var e=0;return function(){return(++e).toString()}}(),Nj=20,kt;(function(e){e[e.ADD_TOAST=0]="ADD_TOAST",e[e.UPDATE_TOAST=1]="UPDATE_TOAST",e[e.UPSERT_TOAST=2]="UPSERT_TOAST",e[e.DISMISS_TOAST=3]="DISMISS_TOAST",e[e.REMOVE_TOAST=4]="REMOVE_TOAST",e[e.START_PAUSE=5]="START_PAUSE",e[e.END_PAUSE=6]="END_PAUSE"})(kt||(kt={}));var Uf=new Map,fE=function(t){if(!Uf.has(t)){var r=setTimeout(function(){Uf.delete(t),fo({type:kt.REMOVE_TOAST,toastId:t})},1e3);Uf.set(t,r)}},zj=function(t){var r=Uf.get(t);r&&clearTimeout(r)},jj=function e(t,r){switch(r.type){case kt.ADD_TOAST:return wt({},t,{toasts:[r.toast].concat(t.toasts).slice(0,Nj)});case kt.UPDATE_TOAST:return r.toast.id&&zj(r.toast.id),wt({},t,{toasts:t.toasts.map(function(u){return u.id===r.toast.id?wt({},u,r.toast):u})});case kt.UPSERT_TOAST:var n=r.toast;return t.toasts.find(function(u){return u.id===n.id})?e(t,{type:kt.UPDATE_TOAST,toast:n}):e(t,{type:kt.ADD_TOAST,toast:n});case kt.DISMISS_TOAST:var i=r.toastId;return i?fE(i):t.toasts.forEach(function(u){fE(u.id)}),wt({},t,{toasts:t.toasts.map(function(u){return u.id===i||i===void 0?wt({},u,{visible:!1}):u})});case kt.REMOVE_TOAST:return r.toastId===void 0?wt({},t,{toasts:[]}):wt({},t,{toasts:t.toasts.filter(function(u){return u.id!==r.toastId})});case kt.START_PAUSE:return wt({},t,{pausedAt:r.time});case kt.END_PAUSE:var s=r.time-(t.pausedAt||0);return wt({},t,{pausedAt:void 0,toasts:t.toasts.map(function(u){return wt({},u,{pauseDuration:u.pauseDuration+s})})})}},Hf=[],Wf={toasts:[],pausedAt:void 0},fo=function(t){Wf=jj(Wf,t),Hf.forEach(function(r){r(Wf)})},Bj={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Vj=function(t){t===void 0&&(t={});var r=C.exports.useState(Wf),n=r[0],i=r[1];C.exports.useEffect(function(){return Hf.push(i),function(){var u=Hf.indexOf(i);u>-1&&Hf.splice(u,1)}},[n]);var s=n.toasts.map(function(u){var o,a,l;return wt({},t,t[u.type],u,{duration:u.duration||((o=t[u.type])==null?void 0:o.duration)||((a=t)==null?void 0:a.duration)||Bj[u.type],style:wt({},t.style,(l=t[u.type])==null?void 0:l.style,u.style)})});return wt({},n,{toasts:s})},Uj=function(t,r,n){return r===void 0&&(r="blank"),wt({createdAt:Date.now(),visible:!0,type:r,ariaProps:{role:"status","aria-live":"polite"},message:t,pauseDuration:0},n,{id:(n==null?void 0:n.id)||Lj()})},Ol=function(t){return function(r,n){var i=Uj(r,t,n);return fo({type:kt.UPSERT_TOAST,toast:i}),i.id}},er=function(t,r){return Ol("blank")(t,r)};er.error=Ol("error"),er.success=Ol("success"),er.loading=Ol("loading"),er.custom=Ol("custom"),er.dismiss=function(e){fo({type:kt.DISMISS_TOAST,toastId:e})},er.remove=function(e){return fo({type:kt.REMOVE_TOAST,toastId:e})},er.promise=function(e,t,r){var n=er.loading(t.loading,wt({},r,r==null?void 0:r.loading));return e.then(function(i){return er.success(cE(t.success,i),wt({id:n},r,r==null?void 0:r.success)),i}).catch(function(i){er.error(cE(t.error,i),wt({id:n},r,r==null?void 0:r.error))}),e};var Hj=function(t){var r=Vj(t),n=r.toasts,i=r.pausedAt;C.exports.useEffect(function(){if(!i){var u=Date.now(),o=n.map(function(a){if(a.duration!==1/0){var l=(a.duration||0)+a.pauseDuration-(u-a.createdAt);if(l<0){a.visible&&er.dismiss(a.id);return}return setTimeout(function(){return er.dismiss(a.id)},l)}});return function(){o.forEach(function(a){return a&&clearTimeout(a)})}}},[n,i]);var s=C.exports.useMemo(function(){return{startPause:function(){fo({type:kt.START_PAUSE,time:Date.now()})},endPause:function(){i&&fo({type:kt.END_PAUSE,time:Date.now()})},updateHeight:function(o,a){return fo({type:kt.UPDATE_TOAST,toast:{id:o,height:a}})},calculateOffset:function(o,a){var l,h=a||{},c=h.reverseOrder,f=c===void 0?!1:c,d=h.gutter,g=d===void 0?8:d,m=h.defaultPosition,p=n.filter(function(x){return(x.position||m)===(o.position||m)&&x.height}),v=p.findIndex(function(x){return x.id===o.id}),y=p.filter(function(x,w){return w<v&&x.visible}).length,b=(l=p.filter(function(x){return x.visible})).slice.apply(l,f?[y+1]:[0,y]).reduce(function(x,w){return x+(w.height||0)+g},0);return b}}},[n,i]);return{toasts:n,handlers:s}};Rj();function s0(e,{type:t}={}){return t==="error"?er.error(e):er(e)}class Wj{constructor(){Te(this,"validations",[]);Te(this,"showToast",!1)}validate(t){this.validations.length||this.initValidations();const r=this.validations.find(n=>n.fails(t));return r&&this.showToast&&r.errorMessage&&s0(r.errorMessage,{type:"error"}),{failed:!!r,errorMessage:r?r.errorMessage:null}}}class dE{constructor(){Te(this,"errorMessage")}passes(t){return!this.fails(t)}}function Yj(e){const t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return`${(t?"-":"")+e} B`;const n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));const i=r[n];return e>=10||e%1===0?`${(t?"-":"")+e.toFixed(0)} ${i}`:`${(t?"-":"")+e.toFixed(1)} ${i}`}class Kj extends dE{constructor(t){super();this.params=t,this.errorMessage={id:"+vMr4s",defaultMessage:[{type:0,value:"Maximum file size is "},{type:1,value:"number"}],values:{number:Yj(+this.params.maxSize)}}}fails(t){return this.params.maxSize<t.size}}class Xj extends dE{constructor(t){super();this.params=t,this.errorMessage={id:"4pGuOJ",defaultMessage:[{type:0,value:"Only these file types are allowed: "},{type:1,value:"extensions"}],values:{extensions:this.params.extensions.join(", ")}}}fails(t){return!this.params.extensions.some(r=>{var n;return r.toLowerCase()===((n=t.extension)==null?void 0:n.toLowerCase())})}}function Gj(e,t){if(e==null)return 0;switch(t){case"KB":return e*1024;case"MB":return e*1024**2;case"GB":return e*1024**3;case"TB":return e*1024**4;case"PB":return e*1024**5;default:return e}}class qj extends Wj{constructor(){super(...arguments);Te(this,"DEFAULT_MAX_FILE_SIZE_MB",10);Te(this,"showToast",!0)}initValidations(){this.validations.push(new Kj({maxSize:this.getMaxFileSize()}));const t=this.getAllowedExtensions();t&&t.length&&this.validations.push(new Xj({extensions:t}))}getMaxFileSize(){var t,r,n;return(n=(r=(t=A().config.tools)==null?void 0:t.import)==null?void 0:r.maxFileSize)!=null?n:Gj(this.DEFAULT_MAX_FILE_SIZE_MB,"MB")}getAllowedExtensions(){var r,n,i;return[...(i=(n=(r=A().config.tools)==null?void 0:r.import)==null?void 0:n.validImgExtensions)!=null?i:[],"json"]}}async function Jj(e,t=!0){const r=await GC(e);if(!!r)return new Promise(n=>{r.name=pt.Image,r.opacity=0;const i=A().original.width,s=A().original.height;if(t&&(r.width>=i||r.height>=s)){const u=i-.1*i,o=s-.1*s,a=1/Math.min(o/r.getScaledHeight(),u/r.getScaledWidth());r.scaleX*=1/a,r.scaleY*=1/a}A().fabric.add(r),A().fabric.setActiveObject(r),r.viewportCenter(),r.setCoords(),A().fabric.requestRenderAll(),V().zoom.fitToScreen(),r.animate("opacity","1",{duration:425,onChange:()=>{A().fabric.requestRenderAll()},onComplete:()=>{n(r)}})})}function l0(e){return V().canvas.clear(),V().frame.remove(),A().setConfig($({image:void 0,blankCanvasSize:void 0},e)),A().reset(),new Promise(t=>setTimeout(t))}var u0=(e=>(e.image="image/*",e.audio="audio/*",e.json="application/json",e.video="video/mp4,video/mpeg,video/x-m4v,video/*",e))(u0||{});class Zj{constructor(){Te(this,"validator",new qj)}async uploadAndAddImage(){const t=await this.openUploadWindow();await this.openUploadedFile(t)}async uploadAndReplaceMainImage(){const t=await this.openUploadWindow();t&&await this.openBackgroundImage(t)}async uploadAndOpenStateFile(){const t=await this.openUploadWindow(pE);t&&await this.loadState(await t.data)}async openUploadedFile(t){var n,i,s;if(!t)return;const r=await t.data;switch(t.extension){case"json":await this.loadState(r);break;case"svg":await V().shape.addSvgSticker(r,pt.Image),V().history.addHistoryItem({name:"overlayImage"});break;default:await Jj(r,(s=(i=(n=A().config.tools)==null?void 0:n.import)==null?void 0:i.fitOverlayToScreen)!=null?s:!0),V().history.addHistoryItem({name:"overlayImage"})}}async loadState(t){A().toggleLoading("state"),await l0();let r;typeof t=="string"?t.endsWith(".json")?r=await Lf(t):r=JSON.parse(t):r=t,await V().history.addInitial(r),await V().history.reload(),A().toggleLoading(!1)}async openUploadWindow(t){var n,i;t=t||hE();const r=(await Oj(t))[0];return this.fileIsValid(r)?((i=(n=A().config).onFileOpen)==null||i.call(n,r),r):null}async openBackgroundImage(t){await l0();let r;t instanceof HTMLImageElement?r=t.src:t instanceof a0?r=await t.data:r=t;const n=await V().canvas.addMainImage(r);return await V().history.addInitial(),n}fileIsValid(t){return!this.validator.validate(t).failed}}function hE(){var t,r;const e=(r=(t=A().config.tools)==null?void 0:t.import)==null?void 0:r.validImgExtensions;return e?{extensions:e}:{types:[u0.image]}}const pE={types:[".json",u0.json]};class Qj{constructor(){Te(this,"watermark",null);Te(this,"lineStyle",{stroke:"rgba(255,255,255,0.3)",strokeWidth:5,strokeLineCap:"round",strokeLineJoin:"round"})}add(t){this.createGroup(),this.addText(t),this.addLines(),be().add(this.watermark),V().canvas.render()}remove(){!this.watermark||(be().remove(this.watermark),this.watermark=null,V().canvas.render())}createGroup(){this.watermark=new Me.fabric.Group(void 0,Y($({},co),{width:A().original.width,height:A().original.height,excludeFromExport:!0,top:0,left:0,originX:"left",originY:"top"}))}addText(t){var n;const r=new Me.fabric.Text(t,{fill:"rgba(255,255,255,0.3)",strokeWidth:2,stroke:"rgba(255,255,255,0.4)",originX:"center",originY:"center",fontWeight:600,fontSize:150,fontFamily:"Courier New"});r.scaleToWidth(A().original.width/2),(n=this.watermark)==null||n.add(r)}addLines(){var h;if(!this.watermark)return;const t=(h=this.watermark)==null?void 0:h.getObjects("text")[0],r=A().original.width/2,n=A().original.height/2,i=100,s=t.width/4,u=new Me.fabric.Line(void 0,this.lineStyle),o=new Me.fabric.Line(void 0,this.lineStyle),a=new Me.fabric.Line(void 0,this.lineStyle),l=new Me.fabric.Line(void 0,this.lineStyle);this.watermark.add(u,o,a,l),u.set({x1:s,y1:-i,x2:r,y2:-n}),o.set({x1:s,y1:i,x2:r,y2:n}),a.set({x1:-s,y1:-i,x2:-r,y2:-n}),l.set({x1:-s,y1:i,x2:-r,y2:n})}}var gE={exports:{}};(function(e,t){(function(r,n){n()})(Ke,function(){function r(l,h){return typeof h=="undefined"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(l.type)?new Blob(["\uFEFF",l],{type:l.type}):l}function n(l,h,c){var f=new XMLHttpRequest;f.open("GET",l),f.responseType="blob",f.onload=function(){a(f.response,h,c)},f.onerror=function(){console.error("could not download file")},f.send()}function i(l){var h=new XMLHttpRequest;h.open("HEAD",l,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function s(l){try{l.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),l.dispatchEvent(h)}}var u=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ke=="object"&&Ke.global===Ke?Ke:void 0,o=u.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=u.saveAs||(typeof window!="object"||window!==u?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(l,h,c){var f=u.URL||u.webkitURL,d=document.createElement("a");h=h||l.name||"download",d.download=h,d.rel="noopener",typeof l=="string"?(d.href=l,d.origin===location.origin?s(d):i(d.href)?n(l,h,c):s(d,d.target="_blank")):(d.href=f.createObjectURL(l),setTimeout(function(){f.revokeObjectURL(d.href)},4e4),setTimeout(function(){s(d)},0))}:"msSaveOrOpenBlob"in navigator?function(l,h,c){if(h=h||l.name||"download",typeof l!="string")navigator.msSaveOrOpenBlob(r(l,c),h);else if(i(l))n(l,h,c);else{var f=document.createElement("a");f.href=l,f.target="_blank",setTimeout(function(){s(f)})}}:function(l,h,c,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof l=="string")return n(l,h,c);var d=l.type==="application/octet-stream",g=/constructor/i.test(u.HTMLElement)||u.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||d&&g||o)&&typeof FileReader!="undefined"){var p=new FileReader;p.onloadend=function(){var b=p.result;b=m?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=b:location=b,f=null},p.readAsDataURL(l)}else{var v=u.URL||u.webkitURL,y=v.createObjectURL(l);f?f.location=y:location.href=y,f=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});u.saveAs=a.saveAs=a,e.exports=a})})(gE);function eB(e,t,r){t=t||"",r=r||512;const n=atob(e),i=[];for(let s=0;s<n.length;s+=r){const u=n.slice(s,s+r),o=new Array(u.length);for(let l=0;l<u.length;l++)o[l]=u.charCodeAt(l);const a=new Uint8Array(o);i.push(a)}return new Blob(i,{type:t})}class tB{save(t,r,n){var o,a,l;const i=(o=A().config.tools)==null?void 0:o.export;t=t||(i==null?void 0:i.defaultName),r=this.getFormat(r),n=this.getQuality(n);const s=`${t}.${r}`;this.applyWaterMark();const u=r==="json"?this.getJsonState():this.getDataUrl(r,n);if(V().watermark.remove(),!!u)if(A().config.saveUrl)fetch(A().config.saveUrl,{method:"POST",body:JSON.stringify({data:u,filename:s,format:r})});else if(A().config.onSave)(l=(a=A().config).onSave)==null||l.call(a,u,s,r);else{const h=this.getCanvasBlob(r,u);gE.exports.saveAs(h,s)}}getDataUrl(t,r){this.prepareCanvas();try{return t==="svg"?be().toSVG():be().toDataURL({format:this.getFormat(t),quality:this.getQuality(r),multiplier:Math.max(A().original.width/be().width,A().original.height/be().height)})}catch(n){n.message.toLowerCase().includes("tainted")&&s0({id:"m45ghm",defaultMessage:[{type:0,value:"Could not export canvas with external image."}]},{type:"error"})}return null}getCanvasBlob(t,r){if(t==="json")return new Blob([r],{type:"application/json"});if(t==="svg")return new Blob([r],{type:"image/svg+xml"});const n=`image/${t}`;return r=r.replace(/data:image\/([a-z]*)?;base64,/,""),eB(r,n)}getJsonState(){return JSON.stringify(Nf())}prepareCanvas(){be().discardActiveObject()}applyWaterMark(){const t=A().config.watermarkText;t&&V().watermark.add(t)}getFormat(t){var n;const r=(n=A().config.tools)==null?void 0:n.export;return t=t||(r==null?void 0:r.defaultFormat)||"png",t==="jpg"&&(t="jpeg"),t}getQuality(t){var n;const r=(n=A().config.tools)==null?void 0:n.export;return t=t||(r==null?void 0:r.defaultQuality)||.8,t}}class rB{constructor(){Te(this,"previewRect",null)}async apply(t){this.previewRect||this.showPreview(),this.updatePreview(t),be().remove(this.previewRect),be().clipPath=this.previewRect;const r=V().export.getDataUrl();r&&V().canvas.clear(),this.hidePreview(),r&&await V().canvas.addMainImage(r),be().clipPath=void 0}getPreviewRadius(){var t;return((t=this.previewRect)==null?void 0:t.rx)||0}updatePreview(t){!this.previewRect||(this.previewRect.set({rx:t,ry:t}),V().canvas.render())}showPreview(){this.previewRect=new Me.fabric.Rect({width:A().original.width,height:A().original.height,rx:50,ry:50,objectCaching:!1,fill:"transparent",name:"round.rect",data:{pixieInternal:!0},stroke:"rgba(255,255,255,0.8)",strokeWidth:3,strokeDashArray:[4,4],selectable:!1,evented:!1}),be().add(this.previewRect),this.previewRect.moveTo(99),this.previewRect.viewportCenter(),V().canvas.render()}hidePreview(){!this.previewRect||(be().remove(this.previewRect),V().canvas.render(),this.previewRect=null)}}class nB{get straightenAnchor(){return be().getObjects().find(t=>t.name===pt.StraightenAnchor)}rotateLeft(){this.rotateFixed(-90)}rotateRight(){this.rotateFixed(90)}straighten(t){this.storeObjectsRelationToHelper(),V().objects.deselectActive();const r=(this.straightenAnchor.data.rotateAngle||0)+t,n=this.getImageScale(r,this.straightenAnchor);this.straightenAnchor.angle=r,this.straightenAnchor.scaleX=n,this.straightenAnchor.scaleY=n,this.straightenAnchor.data.straightenAngle=t,this.transformObjectsBasedOnHelper()}flip(t){const r=t==="horizontal"?"flipY":"flipX";V().objects.getAll().forEach(n=>{n[r]=!n[r]}),V().canvas.render()}rotateFixed(t){V().zoom.set(1,!1),V().objects.deselectActive();const r=this.straightenAnchor.data.rotateAngle||0;t=Math.round(t/90)*90;const n=r+(this.straightenAnchor.data.straightenAngle||0)+t;V().canvas.resize(A().original.height,A().original.width,{applyZoom:!1,resizeHelper:!1}),this.storeObjectsRelationToHelper(),this.straightenAnchor.rotate(n),this.straightenAnchor.data.rotateAngle=r+t,this.straightenAnchor.center(),this.transformObjectsBasedOnHelper(),V().frame.resize(V().frame.active.currentSizeInPercent),requestAnimationFrame(()=>{V().zoom.fitToScreen()})}getImageScale(t,r){t=Me.fabric.util.degreesToRadians(t);const n=A().original.width,i=A().original.height,s=n/2,u=i/2,o=r.width/2,a=r.height/2,l=Math.sqrt(s**2+u**2),h=Math.asin(u/l);let c=(t%(Math.PI*2)+Math.PI*4)%(Math.PI*2);c>Math.PI&&(c-=Math.PI),c>Math.PI/2&&c<=Math.PI&&(c=Math.PI/2-(c-Math.PI/2));const f=Math.PI/2-h-Math.abs(c),d=Math.abs(h-Math.abs(c)),g=Math.cos(f)*l,m=Math.cos(d)*l;return Math.max(m/o,g/a)}storeObjectsRelationToHelper(){V().objects.getAll().forEach(t=>{if(t!==this.straightenAnchor){const r=Me.fabric.util.multiplyTransformMatrices(Me.fabric.util.invertTransform(this.straightenAnchor.calcTransformMatrix()),t.calcTransformMatrix());t.data=Y($({},t.data),{relationToCanvas:r})}})}transformObjectsBasedOnHelper(){V().objects.getAll().forEach(t=>{if(t.data.relationToCanvas){const r=Me.fabric.util.multiplyTransformMatrices(this.straightenAnchor.calcTransformMatrix(),t.data.relationToCanvas),n=Me.fabric.util.qrDecompose(r);t.set({flipX:!1,flipY:!1}),t.setPositionByOrigin({x:n.translateX,y:n.translateY},"center","center"),t.set(n),t.setCoords(),t.data.relationToCanvas=null}})}resetStraightenAnchor(){const t=this.straightenAnchor;t&&be().remove(t);const r=new Me.fabric.Rect(Y($({},co),{name:pt.StraightenAnchor,visible:!1,width:A().original.width,height:A().original.height,data:{pixieInternal:!0,straightenAngle:0,rotateAngle:0}}));be().add(r),r.viewportCenter()}}function iB(e){const t=Hz(e);A().editor.fabric=t,pe.setState({fabric:t}),A().editor.tools={canvas:new Yz,objects:new Zz,zoom:new Wz,history:new rj,filter:new aj,resize:new lj,crop:new pj,merge:new ij,shape:new gj,frame:new bj,text:new ej,draw:new Tj,transform:new nB,import:new Zj,watermark:new Qj,export:new tB,corners:new rB}}function mE(e,t){const r=new ResizeObserver(n=>{const i=n[0].contentRect;t({width:i.width,height:i.height})});return r.observe(e),()=>r.unobserve(e)}function vE(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}var yE={exports:{}},bE={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,134,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,250,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,221],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:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],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,50]},xE={exports:{}},oB=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},aB=oB,sB=Array.prototype.concat,lB=Array.prototype.slice,wE=xE.exports=function(t){for(var r=[],n=0,i=t.length;n<i;n++){var s=t[n];aB(s)?r=sB.call(r,lB.call(s)):r.push(s)}return r};wE.wrap=function(e){return function(){return e(wE(arguments))}};var Ml=bE,kl=xE.exports,SE=Object.hasOwnProperty,_E={};for(var c0 in Ml)SE.call(Ml,c0)&&(_E[Ml[c0]]=c0);var Tr=yE.exports={to:{},get:{}};Tr.get=function(e){var t=e.substring(0,3).toLowerCase(),r,n;switch(t){case"hsl":r=Tr.get.hsl(e),n="hsl";break;case"hwb":r=Tr.get.hwb(e),n="hwb";break;default:r=Tr.get.rgb(e),n="rgb";break}return r?{model:n,value:r}:null},Tr.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,r=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,u=[0,0,0,1],o,a,l;if(o=e.match(r)){for(l=o[2],o=o[1],a=0;a<3;a++){var h=a*2;u[a]=parseInt(o.slice(h,h+2),16)}l&&(u[3]=parseInt(l,16)/255)}else if(o=e.match(t)){for(o=o[1],l=o[3],a=0;a<3;a++)u[a]=parseInt(o[a]+o[a],16);l&&(u[3]=parseInt(l+l,16)/255)}else if(o=e.match(n)){for(a=0;a<3;a++)u[a]=parseInt(o[a+1],0);o[4]&&(o[5]?u[3]=parseFloat(o[4])*.01:u[3]=parseFloat(o[4]))}else if(o=e.match(i)){for(a=0;a<3;a++)u[a]=Math.round(parseFloat(o[a+1])*2.55);o[4]&&(o[5]?u[3]=parseFloat(o[4])*.01:u[3]=parseFloat(o[4]))}else return(o=e.match(s))?o[1]==="transparent"?[0,0,0,0]:SE.call(Ml,o[1])?(u=Ml[o[1]],u[3]=1,u):null:null;for(a=0;a<3;a++)u[a]=bi(u[a],0,255);return u[3]=bi(u[3],0,1),u},Tr.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=e.match(t);if(r){var n=parseFloat(r[4]),i=(parseFloat(r[1])%360+360)%360,s=bi(parseFloat(r[2]),0,100),u=bi(parseFloat(r[3]),0,100),o=bi(isNaN(n)?1:n,0,1);return[i,s,u,o]}return null},Tr.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=e.match(t);if(r){var n=parseFloat(r[4]),i=(parseFloat(r[1])%360+360)%360,s=bi(parseFloat(r[2]),0,100),u=bi(parseFloat(r[3]),0,100),o=bi(isNaN(n)?1:n,0,1);return[i,s,u,o]}return null},Tr.to.hex=function(){var e=kl(arguments);return"#"+Yf(e[0])+Yf(e[1])+Yf(e[2])+(e[3]<1?Yf(Math.round(e[3]*255)):"")},Tr.to.rgb=function(){var e=kl(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Tr.to.rgb.percent=function(){var e=kl(arguments),t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},Tr.to.hsl=function(){var e=kl(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Tr.to.hwb=function(){var e=kl(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},Tr.to.keyword=function(e){return _E[e.slice(0,3)]};function bi(e,t,r){return Math.min(Math.max(t,e),r)}function Yf(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}const $l=bE,TE={};for(const e of Object.keys($l))TE[$l[e]]=e;const we={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var CE=we;for(const e of Object.keys(we)){if(!("channels"in we[e]))throw new Error("missing channels property: "+e);if(!("labels"in we[e]))throw new Error("missing channel labels property: "+e);if(we[e].labels.length!==we[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:r}=we[e];delete we[e].channels,delete we[e].labels,Object.defineProperty(we[e],"channels",{value:t}),Object.defineProperty(we[e],"labels",{value:r})}we.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),s=Math.max(t,r,n),u=s-i;let o,a;s===i?o=0:t===s?o=(r-n)/u:r===s?o=2+(n-t)/u:n===s&&(o=4+(t-r)/u),o=Math.min(o*60,360),o<0&&(o+=360);const l=(i+s)/2;return s===i?a=0:l<=.5?a=u/(s+i):a=u/(2-s-i),[o,a*100,l*100]},we.rgb.hsv=function(e){let t,r,n,i,s;const u=e[0]/255,o=e[1]/255,a=e[2]/255,l=Math.max(u,o,a),h=l-Math.min(u,o,a),c=function(f){return(l-f)/6/h+1/2};return h===0?(i=0,s=0):(s=h/l,t=c(u),r=c(o),n=c(a),u===l?i=n-r:o===l?i=1/3+t-n:a===l&&(i=2/3+r-t),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,l*100]},we.rgb.hwb=function(e){const t=e[0],r=e[1];let n=e[2];const i=we.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[i,s*100,n*100]},we.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n),s=(1-t-i)/(1-i)||0,u=(1-r-i)/(1-i)||0,o=(1-n-i)/(1-i)||0;return[s*100,u*100,o*100,i*100]};function uB(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}we.rgb.keyword=function(e){const t=TE[e];if(t)return t;let r=1/0,n;for(const i of Object.keys($l)){const s=$l[i],u=uB(e,s);u<r&&(r=u,n=i)}return n},we.keyword.rgb=function(e){return $l[e]},we.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;const i=t*.4124+r*.3576+n*.1805,s=t*.2126+r*.7152+n*.0722,u=t*.0193+r*.1192+n*.9505;return[i*100,s*100,u*100]},we.rgb.lab=function(e){const t=we.rgb.xyz(e);let r=t[0],n=t[1],i=t[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;const s=116*n-16,u=500*(r-n),o=200*(n-i);return[s,u,o]},we.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let i,s,u;if(r===0)return u=n*255,[u,u,u];n<.5?i=n*(1+r):i=n+r-n*r;const o=2*n-i,a=[0,0,0];for(let l=0;l<3;l++)s=t+1/3*-(l-1),s<0&&s++,s>1&&s--,6*s<1?u=o+(i-o)*6*s:2*s<1?u=i:3*s<2?u=o+(i-o)*(2/3-s)*6:u=o,a[l]=u*255;return a},we.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,i=r;const s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s;const u=(n+r)/2,o=n===0?2*i/(s+i):2*r/(n+r);return[t,o*100,u*100]},we.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const i=Math.floor(t)%6,s=t-Math.floor(t),u=255*n*(1-r),o=255*n*(1-r*s),a=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,a,u];case 1:return[o,n,u];case 2:return[u,n,a];case 3:return[u,o,n];case 4:return[a,u,n];case 5:return[n,u,o]}},we.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,.01);let s,u;u=(2-r)*n;const o=(2-r)*i;return s=r*i,s/=o<=1?o:2-o,s=s||0,u/=2,[t,s*100,u*100]},we.hwb.rgb=function(e){const t=e[0]/360;let r=e[1]/100,n=e[2]/100;const i=r+n;let s;i>1&&(r/=i,n/=i);const u=Math.floor(6*t),o=1-n;s=6*t-u,(u&1)!==0&&(s=1-s);const a=r+s*(o-r);let l,h,c;switch(u){default:case 6:case 0:l=o,h=a,c=r;break;case 1:l=a,h=o,c=r;break;case 2:l=r,h=o,c=a;break;case 3:l=r,h=a,c=o;break;case 4:l=a,h=r,c=o;break;case 5:l=o,h=r,c=a;break}return[l*255,h*255,c*255]},we.cmyk.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100,s=1-Math.min(1,t*(1-i)+i),u=1-Math.min(1,r*(1-i)+i),o=1-Math.min(1,n*(1-i)+i);return[s*255,u*255,o*255]},we.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let i,s,u;return i=t*3.2406+r*-1.5372+n*-.4986,s=t*-.9689+r*1.8758+n*.0415,u=t*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),u=Math.min(Math.max(0,u),1),[i*255,s*255,u*255]},we.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;const i=116*r-16,s=500*(t-r),u=200*(r-n);return[i,s,u]},we.lab.xyz=function(e){const t=e[0],r=e[1],n=e[2];let i,s,u;s=(t+16)/116,i=r/500+s,u=s-n/200;const o=s**3,a=i**3,l=u**3;return s=o>.008856?o:(s-16/116)/7.787,i=a>.008856?a:(i-16/116)/7.787,u=l>.008856?l:(u-16/116)/7.787,i*=95.047,s*=100,u*=108.883,[i,s,u]},we.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);const u=Math.sqrt(r*r+n*n);return[t,u,i]},we.lch.lab=function(e){const t=e[0],r=e[1],i=e[2]/360*2*Math.PI,s=r*Math.cos(i),u=r*Math.sin(i);return[t,s,u]},we.rgb.ansi16=function(e,t=null){const[r,n,i]=e;let s=t===null?we.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let u=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(u+=60),u},we.hsv.ansi16=function(e){return we.rgb.ansi16(we.hsv.rgb(e),e[2])},we.rgb.ansi256=function(e){const t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},we.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=(~~(e>50)+1)*.5,n=(t&1)*r*255,i=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,i,s]},we.ansi256.rgb=function(e){if(e>=232){const s=(e-232)*10+8;return[s,s,s]}e-=16;let t;const r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[r,n,i]},we.rgb.hex=function(e){const r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r},we.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(o=>o+o).join(""));const n=parseInt(r,16),i=n>>16&255,s=n>>8&255,u=n&255;return[i,s,u]},we.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),u=i-s;let o,a;return u<1?o=s/(1-u):o=0,u<=0?a=0:i===t?a=(r-n)/u%6:i===r?a=2+(n-t)/u:a=4+(t-r)/u,a/=6,a%=1,[a*360,u*100,o*100]},we.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let i=0;return n<1&&(i=(r-.5*n)/(1-n)),[e[0],n*100,i*100]},we.hsv.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=t*r;let i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],n*100,i*100]},we.hcg.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];const i=[0,0,0],s=t%1*6,u=s%1,o=1-u;let a=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=u,i[2]=0;break;case 1:i[0]=o,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=u;break;case 3:i[0]=0,i[1]=o,i[2]=1;break;case 4:i[0]=u,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=o}return a=(1-r)*n,[(r*i[0]+a)*255,(r*i[1]+a)*255,(r*i[2]+a)*255]},we.hcg.hsv=function(e){const t=e[1]/100,r=e[2]/100,n=t+r*(1-t);let i=0;return n>0&&(i=t/n),[e[0],i*100,n*100]},we.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],i*100,n*100]},we.hcg.hwb=function(e){const t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]},we.hwb.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=1-r,i=n-t;let s=0;return i<1&&(s=(n-i)/(1-i)),[e[0],i*100,s*100]},we.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},we.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},we.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},we.gray.hsl=function(e){return[0,0,e[0]]},we.gray.hsv=we.gray.hsl,we.gray.hwb=function(e){return[0,100,e[0]]},we.gray.cmyk=function(e){return[0,0,0,e[0]]},we.gray.lab=function(e){return[e[0],0,0]},we.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},we.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const Kf=CE;function cB(){const e={},t=Object.keys(Kf);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function fB(e){const t=cB(),r=[e];for(t[e].distance=0;r.length;){const n=r.pop(),i=Object.keys(Kf[n]);for(let s=i.length,u=0;u<s;u++){const o=i[u],a=t[o];a.distance===-1&&(a.distance=t[n].distance+1,a.parent=n,r.unshift(o))}}return t}function dB(e,t){return function(r){return t(e(r))}}function hB(e,t){const r=[t[e].parent,e];let n=Kf[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)r.unshift(t[i].parent),n=dB(Kf[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}var pB=function(e){const t=fB(e),r={},n=Object.keys(t);for(let i=n.length,s=0;s<i;s++){const u=n[s];t[u].parent!==null&&(r[u]=hB(u,t))}return r};const f0=CE,gB=pB,Aa={},mB=Object.keys(f0);function vB(e){const t=function(...r){const n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function yB(e){const t=function(...r){const n=r[0];if(n==null)return n;n.length>1&&(r=n);const i=e(r);if(typeof i=="object")for(let s=i.length,u=0;u<s;u++)i[u]=Math.round(i[u]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}mB.forEach(e=>{Aa[e]={},Object.defineProperty(Aa[e],"channels",{value:f0[e].channels}),Object.defineProperty(Aa[e],"labels",{value:f0[e].labels});const t=gB(e);Object.keys(t).forEach(n=>{const i=t[n];Aa[e][n]=yB(i),Aa[e][n].raw=vB(i)})});var bB=Aa;const Ia=yE.exports,Cr=bB,d0=[].slice,EE=["keyword","gray","hex"],h0={};for(const e of Object.keys(Cr))h0[d0.call(Cr[e].labels).sort().join("")]=e;const Xf={};function $t(e,t){if(!(this instanceof $t))return new $t(e,t);if(t&&t in EE&&(t=null),t&&!(t in Cr))throw new Error("Unknown model: "+t);let r,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof $t)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if(typeof e=="string"){const i=Ia.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,n=Cr[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=Cr[this.model].channels;const i=d0.call(e,0,n);this.color=p0(i,n),this.valpha=typeof e[n]=="number"?e[n]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const i=Object.keys(e);"alpha"in e&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const s=i.sort().join("");if(!(s in h0))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=h0[s];const u=Cr[this.model].labels,o=[];for(r=0;r<u.length;r++)o.push(e[u[r]]);this.color=p0(o)}if(Xf[this.model])for(n=Cr[this.model].channels,r=0;r<n;r++){const i=Xf[this.model][r];i&&(this.color[r]=i(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}$t.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in Ia.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);const r=t.valpha===1?t.color:t.color.concat(this.valpha);return Ia.to[t.model](r)},percentString(e){const t=this.rgb().round(typeof e=="number"?e:1),r=t.valpha===1?t.color:t.color.concat(this.valpha);return Ia.to.rgb.percent(r)},array(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object(){const e={},t=Cr[this.model].channels,r=Cr[this.model].labels;for(let n=0;n<t;n++)e[r[n]]=this.color[n];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new $t(this.color.map(wB(e)).concat(this.valpha),this.model)},alpha(e){return arguments.length>0?new $t(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:ct("rgb",0,St(255)),green:ct("rgb",1,St(255)),blue:ct("rgb",2,St(255)),hue:ct(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:ct("hsl",1,St(100)),lightness:ct("hsl",2,St(100)),saturationv:ct("hsv",1,St(100)),value:ct("hsv",2,St(100)),chroma:ct("hcg",1,St(100)),gray:ct("hcg",2,St(100)),white:ct("hwb",1,St(100)),wblack:ct("hwb",2,St(100)),cyan:ct("cmyk",0,St(100)),magenta:ct("cmyk",1,St(100)),yellow:ct("cmyk",2,St(100)),black:ct("cmyk",3,St(100)),x:ct("xyz",0,St(100)),y:ct("xyz",1,St(100)),z:ct("xyz",2,St(100)),l:ct("lab",0,St(100)),a:ct("lab",1),b:ct("lab",2),keyword(e){return arguments.length>0?new $t(e):Cr[this.model].keyword(this.color)},hex(e){return arguments.length>0?new $t(e):Ia.to.hex(this.rgb().round().color)},hexa(e){if(arguments.length>0)return new $t(e);const t=this.rgb().round().color;let r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),Ia.to.hex(t)+r},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[r,n]of e.entries()){const i=n/255;t[r]=i<=.03928?i/12.92:((i+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*299+e[1]*587+e[2]*114)/1e3<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return $t.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const r=e.rgb(),n=this.rgb(),i=t===void 0?.5:t,s=2*i-1,u=r.alpha()-n.alpha(),o=((s*u===-1?s:(s+u)/(1+s*u))+1)/2,a=1-o;return $t.rgb(o*r.red()+a*n.red(),o*r.green()+a*n.green(),o*r.blue()+a*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(const e of Object.keys(Cr)){if(EE.includes(e))continue;const t=Cr[e].channels;$t.prototype[e]=function(){if(this.model===e)return new $t(this);if(arguments.length>0)return new $t(arguments,e);const r=typeof arguments[t]=="number"?t:this.valpha;return new $t(SB(Cr[this.model][e].raw(this.color)).concat(r),e)},$t[e]=function(r){return typeof r=="number"&&(r=p0(d0.call(arguments),t)),new $t(r,e)}}function xB(e,t){return Number(e.toFixed(t))}function wB(e){return function(t){return xB(t,e)}}function ct(e,t,r){e=Array.isArray(e)?e:[e];for(const n of e)(Xf[n]||(Xf[n]=[]))[t]=r;return e=e[0],function(n){let i;return arguments.length>0?(r&&(n=r(n)),i=this[e](),i.color[t]=n,i):(i=this[e]().color[t],r&&(i=r(i)),i)}}function St(e){return function(t){return Math.max(0,Math.min(e,t))}}function SB(e){return Array.isArray(e)?e:[e]}function p0(e,t){for(let r=0;r<t;r++)typeof e[r]!="number"&&(e[r]=0);return e}var _B=$t;function TB(e,t){if(!t)return;const r=t.isDark?gm.find(i=>i.isDark):gm.find(i=>!i.isDark),n=Y($($({},r),t),{colors:$($({},r.colors),t.colors)});Object.entries(n.colors).forEach(([i,s])=>{e.style.setProperty(i,CB(s))}),t.isDark?e.classList.add("dark"):e.classList.remove("dark")}function CB(e){return e.endsWith("%")||e.split(" ").length===3?e:_B(e).rgb().array().slice(0,3).join(" ")}function g0(){const e=pe(t=>{var r;return(r=t.config.ui)==null?void 0:r.activeTheme});return pe(t=>{var r;return(((r=t.config.ui)==null?void 0:r.themes)||[]).find(n=>n.name===e)})}const PE=ee.createContext(null),OE="flex flex-shrink-0 items-center justify-between px-12 py-[9px] w-full h-[54px]",ME={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{type:"tween",duration:.15}};function kE(e,{padding:t,equalWidth:r}={}){switch(e){case"xs":return`text-xs h-30 ${r?"w-30":t||"px-14"}`;case"sm":return`text-sm h-36 ${r?"w-36":t||"px-18"}`;case"lg":return`text-lg h-50 ${r?"w-50":t||"px-26"}`;case"xl":return`text-xl h-60 ${r?"w-60":t||"px-32"}`;case"md":return`text-base h-42 ${r?"w-42":t||"px-22"}`;default:return""}}function m0(e){switch(e){case"xs":return"icon-xs";case"sm":return"icon-sm";case"md":return"icon-md";case"lg":return"icon-lg";case"xl":return"icon-xl";default:return""}}function An(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var Gf={};An(Gf,"FocusScope",()=>qf),An(Gf,"useFocusManager",()=>MB),An(Gf,"getFocusableTreeWalker",()=>rr),An(Gf,"createFocusManager",()=>LB);var EB={};An(EB,"focusSafely",()=>Ra);function Ra(e){if(NC()==="virtual"){let t=document.activeElement;Mv(()=>{document.activeElement===t&&document.contains(e)&&pn(e)})}else pn(e)}function PB(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;let{display:t,visibility:r}=e.style,n=t!=="none"&&r!=="hidden"&&r!=="collapse";if(n){const{getComputedStyle:i}=e.ownerDocument.defaultView;let{display:s,visibility:u}=i(e);n=s!=="none"&&u!=="hidden"&&u!=="collapse"}return n}function OB(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function $E(e,t){return e.nodeName!=="#comment"&&PB(e)&&OB(e,t)&&(!e.parentElement||$E(e.parentElement,e))}const v0=ee.createContext(null);let tr=null,Fa=new Map;function qf(e){let{children:t,contain:r,restoreFocus:n,autoFocus:i}=e,s=C.exports.useRef(),u=C.exports.useRef(),o=C.exports.useRef([]),a=C.exports.useContext(v0),l=a==null?void 0:a.scopeRef;mt(()=>{let c=s.current.nextSibling,f=[];for(;c&&c!==u.current;)f.push(c),c=c.nextSibling;o.current=f},[t,l]),mt(()=>(Fa.set(o,l),()=>{(o===tr||Jf(o,tr))&&(!l||Fa.has(l))&&(tr=l),Fa.delete(o)}),[o,l]),AB(o,r),FB(o,n,r),RB(o,i);let h=kB(o);return ee.createElement(v0.Provider,{value:{scopeRef:o,focusManager:h}},ee.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:s}),t,ee.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:u}))}function MB(){var e;return(e=C.exports.useContext(v0))===null||e===void 0?void 0:e.focusManager}function kB(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:i,wrap:s}=t,u=n||document.activeElement,o=r[0].previousElementSibling,a=rr(La(r),{tabbable:i},r);a.currentNode=Kr(u,r)?u:o;let l=a.nextNode();return!l&&s&&(a.currentNode=o,l=a.nextNode()),l&&fr(l,!0),l},focusPrevious(t={}){let r=e.current,{from:n,tabbable:i,wrap:s}=t,u=n||document.activeElement,o=r[r.length-1].nextElementSibling,a=rr(La(r),{tabbable:i},r);a.currentNode=Kr(u,r)?u:o;let l=a.previousNode();return!l&&s&&(a.currentNode=o,l=a.previousNode()),l&&fr(l,!0),l},focusFirst(t={}){let r=e.current,{tabbable:n}=t,i=rr(La(r),{tabbable:n},r);i.currentNode=r[0].previousElementSibling;let s=i.nextNode();return s&&fr(s,!0),s},focusLast(t={}){let r=e.current,{tabbable:n}=t,i=rr(La(r),{tabbable:n},r);i.currentNode=r[r.length-1].nextElementSibling;let s=i.previousNode();return s&&fr(s,!0),s}}}const y0=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],$B=y0.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";y0.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const DB=y0.join(':not([hidden]):not([tabindex="-1"]),');function La(e){return e[0].parentElement}function AB(e,t){let r=C.exports.useRef(),n=C.exports.useRef(null);mt(()=>{let i=e.current;if(!t)return;let s=a=>{if(a.key!=="Tab"||a.altKey||a.ctrlKey||a.metaKey||e!==tr)return;let l=document.activeElement,h=e.current;if(!Kr(l,h))return;let c=rr(La(h),{tabbable:!0},h);c.currentNode=l;let f=a.shiftKey?c.previousNode():c.nextNode();f||(c.currentNode=a.shiftKey?h[h.length-1].nextElementSibling:h[0].previousElementSibling,f=a.shiftKey?c.previousNode():c.nextNode()),a.preventDefault(),f&&fr(f,!0)},u=a=>{!tr||Jf(tr,e)?(tr=e,r.current=a.target):e===tr&&!DE(a.target,e)?r.current?r.current.focus():tr&&AE(tr.current):e===tr&&(r.current=a.target)},o=a=>{n.current=requestAnimationFrame(()=>{e===tr&&!DE(document.activeElement,e)&&(tr=e,r.current=a.target,r.current.focus())})};return document.addEventListener("keydown",s,!1),document.addEventListener("focusin",u,!1),i.forEach(a=>a.addEventListener("focusin",u,!1)),i.forEach(a=>a.addEventListener("focusout",o,!1)),()=>{document.removeEventListener("keydown",s,!1),document.removeEventListener("focusin",u,!1),i.forEach(a=>a.removeEventListener("focusin",u,!1)),i.forEach(a=>a.removeEventListener("focusout",o,!1))}},[e,t]),C.exports.useEffect(()=>()=>cancelAnimationFrame(n.current),[n])}function IB(e){for(let t of Fa.keys())if(Kr(e,t.current))return!0;return!1}function Kr(e,t){return t.some(r=>r.contains(e))}function DE(e,t){for(let r of Fa.keys())if((r===t||Jf(t,r))&&Kr(e,r.current))return!0;return!1}function Jf(e,t){let r=Fa.get(t);return r?r===e?!0:Jf(e,r):!1}function fr(e,t=!1){if(e!=null&&!t)try{Ra(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function AE(e){let t=e[0].previousElementSibling,r=rr(La(e),{tabbable:!0},e);r.currentNode=t,fr(r.nextNode())}function RB(e,t){const r=ee.useRef(t);C.exports.useEffect(()=>{r.current&&(tr=e,Kr(document.activeElement,tr.current)||AE(e.current)),r.current=!1},[])}function FB(e,t,r){const n=C.exports.useRef(typeof document!="undefined"?document.activeElement:null);mt(()=>{let i=n.current;if(!t)return;let s=u=>{if(u.key!=="Tab"||u.altKey||u.ctrlKey||u.metaKey)return;let o=document.activeElement;if(!Kr(o,e.current))return;let a=rr(document.body,{tabbable:!0});a.currentNode=o;let l=u.shiftKey?a.previousNode():a.nextNode();if((!document.body.contains(i)||i===document.body)&&(i=null),(!l||!Kr(l,e.current))&&i){a.currentNode=i;do l=u.shiftKey?a.previousNode():a.nextNode();while(Kr(l,e.current));u.preventDefault(),u.stopPropagation(),l?fr(l,!0):IB(i)?fr(i,!0):o.blur()}};return r||document.addEventListener("keydown",s,!0),()=>{r||document.removeEventListener("keydown",s,!0),t&&i&&Kr(document.activeElement,e.current)&&requestAnimationFrame(()=>{document.body.contains(i)&&fr(i)})}},[e,t,r])}function rr(e,t,r){let n=(t==null?void 0:t.tabbable)?DB:$B,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var u;return(t==null||(u=t.from)===null||u===void 0?void 0:u.contains(s))?NodeFilter.FILTER_REJECT:s.matches(n)&&$E(s)&&(!r||Kr(s,r))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return(t==null?void 0:t.from)&&(i.currentNode=t.from),i}function LB(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:i,wrap:s}=t,u=n||document.activeElement,o=rr(r,{tabbable:i});r.contains(u)&&(o.currentNode=u);let a=o.nextNode();return!a&&s&&(o.currentNode=r,a=o.nextNode()),a&&fr(a,!0),a},focusPrevious(t={}){let r=e.current,{from:n,tabbable:i,wrap:s}=t,u=n||document.activeElement,o=rr(r,{tabbable:i});if(r.contains(u))o.currentNode=u;else{let l=b0(o);return l&&fr(l,!0),l}let a=o.previousNode();return!a&&s&&(o.currentNode=r,a=b0(o)),a&&fr(a,!0),a},focusFirst(t={}){let r=e.current,{tabbable:n}=t,s=rr(r,{tabbable:n}).nextNode();return s&&fr(s,!0),s},focusLast(t={}){let r=e.current,{tabbable:n}=t,i=rr(r,{tabbable:n}),s=b0(i);return s&&fr(s,!0),s}}}function b0(e){let t,r;do r=e.lastChild(),r&&(t=r);while(r);return t}var NB={};An(NB,"FocusRing",()=>x0);var zB={};An(zB,"useFocusRing",()=>ho);function ho(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,i=C.exports.useRef({isFocused:!1,isFocusVisible:t||lo()}).current,[s,u]=C.exports.useState(!1),[o,a]=C.exports.useState(()=>i.isFocused&&i.isFocusVisible),l=()=>a(i.isFocused&&i.isFocusVisible),h=d=>{i.isFocused=d,u(d),l()};Wv(d=>{i.isFocusVisible=d,l()},[],{isTextInput:r});let{focusProps:c}=Cl({isDisabled:n,onFocusChange:h}),{focusWithinProps:f}=Da({isDisabled:!n,onFocusWithinChange:h});return{isFocused:s,isFocusVisible:i.isFocused&&o,focusProps:n?f:c}}function x0(e){let{children:t,focusClass:r,focusRingClass:n}=e,{isFocused:i,isFocusVisible:s,focusProps:u}=ho(e),o=ee.Children.only(t);return ee.cloneElement(o,Ce(o.props,Y($({},u),{className:Ee({[r||""]:i,[n||""]:s})})))}var IE={};An(IE,"FocusableProvider",()=>VB),An(IE,"useFocusable",()=>Na);let RE=ee.createContext(null);function jB(e){let t=C.exports.useContext(RE)||{};kf(t,e);let i=t,{ref:r}=i;return ze(i,["ref"])}function BB(e,t){let s=e,{children:r}=s,n=ze(s,["children"]),i=Y($({},n),{ref:t});return ee.createElement(RE.Provider,{value:i},r)}let VB=ee.forwardRef(BB);function Na(e,t){let{focusProps:r}=Cl(e),{keyboardProps:n}=UC(e),i=Ce(r,n),s=jB(t),u=e.isDisabled?{}:s,o=C.exports.useRef(e.autoFocus);return C.exports.useEffect(()=>{o.current&&t.current&&t.current.focus(),o.current=!1},[]),{focusableProps:Ce(Y($({},i),{tabIndex:e.excludeFromTabOrder&&!e.isDisabled?-1:void 0}),u)}}function FE(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var UB={};FE(UB,"useButton",()=>Zf);function Zf(e,t){let{elementType:r="button",isDisabled:n,onPress:i,onPressStart:s,onPressEnd:u,onPressChange:o,preventFocusOnPress:a,allowFocusWhenDisabled:l,onClick:h,href:c,target:f,rel:d,type:g="button"}=e,m;r==="button"?m={type:g,disabled:n}:m={role:"button",tabIndex:n?void 0:0,href:r==="a"&&n?void 0:c,target:r==="a"?f:void 0,type:r==="input"?g:void 0,disabled:r==="input"?n:void 0,"aria-disabled":!n||r==="input"?void 0:n,rel:r==="a"?d:void 0};let{pressProps:p,isPressed:v}=mi({onPressStart:s,onPressEnd:u,onPressChange:o,onPress:i,isDisabled:n,preventFocusOnPress:a,ref:t}),{focusableProps:y}=Na(e,t);l&&(y.tabIndex=n?-1:y.tabIndex);let b=Ce(y,p,_r(e,{labelable:!0}));return{isPressed:v,buttonProps:Ce(m,b,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],onClick:x=>{h&&(h(x),console.warn("onClick is deprecated, please use onPress"))}})}}var HB={};FE(HB,"useToggleButton",()=>WB);function WB(e,t,r){const{isSelected:n}=t,{isPressed:i,buttonProps:s}=Zf(Y($({},e),{onPress:io(t.toggle,e.onPress)}),r);return{isPressed:i,buttonProps:Ce(s,{"aria-pressed":n})}}function YB(e,t){let r=[];return e==="outline"?r=KB(t):e==="text"?r=XB(t):(e==="flat"||e==="raised")&&(r=GB(t)),[...r,e==="raised"&&"shadow-md",e&&"align-middle whitespace-nowrap inline-flex items-center transition-button duration-200","select-none appearance-none no-underline outline-none disabled:pointer-events-none disabled:cursor-default"]}function KB(e){const t="disabled:text-disabled disabled:bg-transparent disabled:border-disabled-bg";switch(e){case"primary":return["text-primary bg-transparent border border-primary/50","hover:bg-primary/hover hover:border-primary",t];case"error":return["text-error bg-transparent border border-error/50","hover:bg-error/4 hover:border-error",t];case"paper":return["text bg-paper border","hover:bg-hover",t];default:return["text-current bg-transparent border","hover:bg-hover",t]}}function XB(e){const t="disabled:text-disabled disabled:bg-transparent";switch(e){case"primary":return["text-primary bg-transparent border-transparent","hover:bg-primary/4",t];case"error":return["text-error bg-transparent border-transparent","hover:bg-error/4",t];default:return["text-current bg-transparent border-transparent","hover:bg-hover",t]}}function GB(e){const t="disabled:text-disabled disabled:bg-disabled disabled:border-transparent disabled:shadow-none";switch(e){case"primary":return["text-on-primary bg-primary border border-primary","hover:bg-primary-dark hover:border-primary-dark",t];case"error":return["text-on-error bg-error border border-error","hover:bg-error/90 hover:border-error/90",t];default:return["text-current bg border-background","hover:bg-hover",t]}}const In=ee.forwardRef((e,t)=>{const{children:r,color:n=null,variant:i,radius:s,justify:u="justify-center",className:o,href:a,style:l}=e,{isFocusVisible:h,focusProps:c}=ho(),{buttonProps:f,isPressed:d}=Zf(Y($({},e),{elementType:a?"a":"button"}),t);return S(a?"a":"button",Y($({},Ce(f,c)),{ref:t,style:l,className:Ee(d&&"translate-y-1",h&&"outline outline-offset-2",YB(i,n),s,u,o),children:r}))}),nr=ee.forwardRef((h,l)=>{var c=h,{children:e,startIcon:t,endIcon:r,size:n,className:i,equalWidth:s=!1,radius:u="rounded",variant:o="flat"}=c,a=ze(c,["children","startIcon","endIcon","size","className","equalWidth","radius","variant"]);const f=Ee("font-semibold",kE(n,{equalWidth:s}),i),d=m0(n);return ce(In,Y($({className:f,ref:l,radius:u,variant:o},a),{children:[t&&S(LE,{position:"start",icon:t,size:d}),e,r&&S(LE,{position:"end",icon:r,size:d})]}))});function LE({icon:e,position:t,size:r}){const n=Ee("m-auto",r,{"-ml-4 mr-8":t==="start","-mr-4 ml-8":t==="end"},e.props.className);return ee.cloneElement(e,{className:n})}function Qf(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var qB={};Qf(qB,"Item",()=>_t);function NE(e){return null}NE.getCollectionNode=function*(t,r){let{childItems:n,title:i,children:s}=t,u=t.title||t.children,o=t.textValue||(typeof u=="string"?u:"")||t["aria-label"]||"";!o&&!(r==null?void 0:r.suppressTextValueWarning)&&console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."),yield{type:"item",props:t,rendered:u,textValue:o,"aria-label":t["aria-label"],hasChildNodes:JB(t),*childNodes(){if(n)for(let a of n)yield{type:"item",value:a};else if(i){let a=[];ee.Children.forEach(s,l=>{a.push({type:"item",element:l})}),yield*a}}}};function JB(e){return e.hasChildItems!=null?e.hasChildItems:!!(e.childItems||e.title&&ee.Children.count(e.children)>0)}let _t=NE;var ZB={};Qf(ZB,"Section",()=>QB);function zE(e){return null}zE.getCollectionNode=function*(t){let{children:r,title:n,items:i}=t;yield{type:"section",hasChildNodes:!0,rendered:n,"aria-label":t["aria-label"],*childNodes(){if(typeof r=="function"){if(!i)throw new Error("props.children was a function but props.items is missing");for(let s of i)yield{type:"item",value:s,renderer:r}}else{let s=[];ee.Children.forEach(r,u=>{s.push({type:"item",element:u})}),yield*s}}}};let QB=zE;var eV={};Qf(eV,"useCollection",()=>ed);class tV{build(t,r){return this.context=r,jE(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:r,items:n}=t;if(typeof r=="function"){if(!n)throw new Error("props.children was a function but props.items is missing");for(let i of t.items)yield*this.getFullNode({value:i},{renderer:r})}else{let i=[];ee.Children.forEach(r,u=>{i.push(u)});let s=0;for(let u of i){let o=this.getFullNode({element:u,index:s},{});for(let a of o)s++,yield a}}}getKey(t,r,n,i){if(t.key!=null)return t.key;if(r.type==="cell"&&r.key!=null)return`${i}${r.key}`;let s=r.value;if(s!=null){var u;let o=(u=s.key)!==null&&u!==void 0?u:s.id;if(o==null)throw new Error("No key found for item");return o}return i?`${i}.${r.index}`:`$.${r.index}`}getChildState(t,r){return{renderer:r.renderer||t.renderer}}*getFullNode(t,r,n,i){let s=t.element;if(!s&&t.value&&r&&r.renderer){let a=this.cache.get(t.value);if(a&&(!a.shouldInvalidate||!a.shouldInvalidate(this.context))){a.index=t.index,a.parentKey=i?i.key:null,yield a;return}s=r.renderer(t.value)}if(ee.isValidElement(s)){let a=s.type;if(typeof a!="function"&&typeof a.getCollectionNode!="function"){let f=typeof s.type=="function"?s.type.name:s.type;throw new Error(`Unknown element <${f}> in collection.`)}let l=a.getCollectionNode(s.props,this.context),h=t.index,c=l.next();for(;!c.done&&c.value;){let f=c.value;t.index=h;let d=f.key;d||(d=f.element?null:this.getKey(s,t,r,n));let m=[...this.getFullNode(Y($({},f),{key:d,index:h,wrapper:rV(t.wrapper,f.wrapper)}),this.getChildState(r,f),n?`${n}${s.key}`:s.key,i)];for(let p of m){if(p.value=f.value||t.value,p.value&&this.cache.set(p.value,p),t.type&&p.type!==t.type)throw new Error(`Unsupported type <${w0(p.type)}> in <${w0(i.type)}>. Only <${w0(t.type)}> is supported.`);h++,yield p}c=l.next(m)}return}if(t.key==null)return;let u=this,o={type:t.type,props:t.props,key:t.key,parentKey:i?i.key:null,value:t.value,level:i?i.level+1:0,index:t.index,rendered:t.rendered,textValue:t.textValue,"aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes,childNodes:jE(function*(){if(!t.hasChildNodes)return;let a=0;for(let l of t.childNodes()){l.key!=null&&(l.key=`${o.key}${l.key}`),l.index=a;let h=u.getFullNode(l,u.getChildState(r,l),o.key,o);for(let c of h)a++,yield c}})};yield o}constructor(){this.cache=new WeakMap}}function jE(e){let t=[],r=null;return{*[Symbol.iterator](){for(let n of t)yield n;r||(r=e());for(let n of r)t.push(n),yield n}}}function rV(e,t){if(e&&t)return r=>e(t(r));if(e)return e;if(t)return t}function w0(e){return e[0].toUpperCase()+e.slice(1)}function ed(e,t,r,n=[]){let i=C.exports.useMemo(()=>new tV,[]),s=C.exports.useRef(null);return C.exports.useMemo(()=>{let u=i.build(e,r);return s.current=t(u,s.current),s.current},[i,e.children,e.items,r,...n])}var nV={};Qf(nV,"getItemCount",()=>td);const BE=new WeakMap;function td(e){let t=BE.get(e);if(t!=null)return t;t=0;for(let r of e)r.type==="section"?t+=td(r.childNodes):t++;return BE.set(e,t),t}function iV(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var oV={};iV(oV,"useOverlayTriggerState",()=>S0);function S0(e){let[t,r]=Mn(e.isOpen,e.defaultOpen||!1,e.onOpenChange);return{isOpen:t,open(){r(!0)},close(){r(!1)},toggle(){r(!t)}}}function aV(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var sV={};aV(sV,"useMenuTriggerState",()=>_0);function _0(e){let t=S0(e),[r,n]=C.exports.useState(null);return Y($({focusStrategy:r},t),{open(i=null){n(i),t.open()},toggle(i=null){n(i),t.toggle()}})}function VE(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var lV={};VE(lV,"MessageDictionary",()=>UE);class UE{getStringForLocale(t,r){let n=this.messages[r];n||(n=uV(r,this.messages,this.defaultLocale),this.messages[r]=n);let i=n[t];if(!i)throw new Error(`Could not find intl message ${t} in ${r} locale`);return i}constructor(t,r="en-US"){this.messages=$({},t),this.defaultLocale=r}}function uV(e,t,r="en-US"){if(t[e])return t[e];let n=cV(e);for(let i in t)if(i.startsWith(n+"-"))return t[i];return t[r]}function cV(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}var fV={};VE(fV,"MessageFormatter",()=>HE);class HE{format(t,r){let n=this.cache[t];if(!n){let s=this.messages.getStringForLocale(t,this.locale);if(!s)throw new Error(`Could not find intl message ${t} in ${this.locale} locale`);n=new cR(s,this.locale),this.cache[t]=n}let i;return r&&(i=Object.keys(r).reduce((s,u)=>(s[u]=r[u]==null?!1:r[u],s),{})),n.format(i)}constructor(t,r){this.locale=t,this.messages=r,this.cache={}}}function Se(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var rd={};Se(rd,"CalendarDate",()=>go),Se(rd,"Time",()=>Rl),Se(rd,"CalendarDateTime",()=>Ua),Se(rd,"ZonedDateTime",()=>wi);var Dt={};Se(Dt,"epochFromDate",()=>xi),Se(Dt,"toCalendar",()=>dr),Se(Dt,"getTimeZoneOffset",()=>Ba),Se(Dt,"possibleAbsolutes",()=>iP),Se(Dt,"toAbsolute",()=>Er),Se(Dt,"toCalendarDateTime",()=>Rn),Se(Dt,"toDate",()=>M0),Se(Dt,"fromAbsolute",()=>Ir),Se(Dt,"fromDate",()=>aP),Se(Dt,"fromDateToLocal",()=>DV),Se(Dt,"toCalendarDate",()=>sP),Se(Dt,"toDateFields",()=>AV),Se(Dt,"toTimeFields",()=>IV),Se(Dt,"toTime",()=>RV),Se(Dt,"toZoned",()=>lP),Se(Dt,"toTimeZone",()=>ad),Se(Dt,"zonedToDate",()=>uP),Se(Dt,"toLocalTimeZone",()=>FV);var Je={};Se(Je,"isSameDay",()=>WE),Se(Je,"isSameMonth",()=>hV),Se(Je,"startOfMonth",()=>po),Se(Je,"isSameYear",()=>pV),Se(Je,"startOfYear",()=>Dl),Se(Je,"isEqualDay",()=>gV),Se(Je,"isEqualMonth",()=>mV),Se(Je,"isEqualYear",()=>vV),Se(Je,"isToday",()=>yV),Se(Je,"today",()=>KE),Se(Je,"getDayOfWeek",()=>T0),Se(Je,"now",()=>YE),Se(Je,"compareDate",()=>C0),Se(Je,"compareTime",()=>E0),Se(Je,"getHoursInDay",()=>bV),Se(Je,"getLocalTimeZone",()=>za),Se(Je,"endOfMonth",()=>GE),Se(Je,"endOfYear",()=>xV),Se(Je,"getMinimumMonthInYear",()=>wV),Se(Je,"getMinimumDayInMonth",()=>SV),Se(Je,"startOfWeek",()=>qE),Se(Je,"endOfWeek",()=>_V),Se(Je,"getWeeksInMonth",()=>CV),Se(Je,"minDate",()=>EV),Se(Je,"maxDate",()=>PV),Se(Je,"isWeekend",()=>QE),Se(Je,"isWeekday",()=>MV);const dV={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AT:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function WE(e,t){return t=dr(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function hV(e,t){return t=dr(t,e.calendar),e=po(e),t=po(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function pV(e,t){return t=dr(t,e.calendar),e=Dl(e),t=Dl(t),e.era===t.era&&e.year===t.year}function gV(e,t){return e.calendar.identifier===t.calendar.identifier&&e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function mV(e,t){return e=po(e),t=po(t),e.calendar.identifier===t.calendar.identifier&&e.era===t.era&&e.year===t.year&&e.month===t.month}function vV(e,t){return e=Dl(e),t=Dl(t),e.calendar.identifier===t.calendar.identifier&&e.era===t.era&&e.year===t.year}function yV(e,t){return WE(e,KE(t))}function T0(e,t){let r=e.calendar.toJulianDay(e),n=Math.ceil(r+1-TV(t))%7;return n<0&&(n+=7),n}function YE(e){return Ir(Date.now(),e)}function KE(e){return sP(YE(e))}function C0(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function E0(e,t){return XE(e)-XE(t)}function XE(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}function bV(e,t){let r=Er(e,t),n=e.add({days:1});return(Er(n,t)-r)/36e5}let P0=null;function za(){return P0==null&&(P0=new Intl.DateTimeFormat().resolvedOptions().timeZone),P0}function po(e){return e.subtract({days:e.day-1})}function GE(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Dl(e){return po(e.subtract({months:e.month-1}))}function xV(e){return GE(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function wV(e){return e.calendar.getMinimumMonthInYear?e.calendar.getMinimumMonthInYear(e):1}function SV(e){return e.calendar.getMinimumDayInMonth?e.calendar.getMinimumDayInMonth(e):1}function qE(e,t){let r=T0(e,t);return e.subtract({days:r})}function _V(e,t){return qE(e,t).add({days:6})}const JE=new Map;function ZE(e){if(Intl.Locale){let r=JE.get(e);return r||(r=new Intl.Locale(e).maximize().region,JE.set(e,r)),r}let t=e.split("-")[1];return t==="u"?null:t}function TV(e){let t=ZE(e);return dV[t]||0}function CV(e,t){let r=e.calendar.getDaysInMonth(e);return Math.ceil((T0(po(e),t)+r)/7)}function EV(e,t){return e.compare(t)<=0?e:t}function PV(e,t){return e.compare(t)>=0?e:t}const OV={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function QE(e,t){let r=e.calendar.toJulianDay(e),n=Math.ceil(r+1)%7;n<0&&(n+=7);let i=ZE(t),[s,u]=OV[i]||[6,0];return n===s||n===u}function MV(e,t){return!QE(e,t)}function O0(e,t){return e-t*Math.floor(e/t)}const eP=1721426;function nd(e,t,r){let n=e-1,i=-2;return t<=2?i=0:id(e)&&(i=-1),eP-1+365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)+Math.floor((367*t-362)/12+i+r)}function id(e){return e%4===0&&(e%100!==0||e%400===0)}const kV={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class ja{fromJulianDay(t){let r=t,n=r-eP,i=Math.floor(n/146097),s=O0(n,146097),u=Math.floor(s/36524),o=O0(s,36524),a=Math.floor(o/1461),l=O0(o,1461),h=Math.floor(l/365),c=i*400+u*100+a*4+h+(u!==4&&h!==4?1:0),f=r-nd(c,1,1),d=2;r<nd(c,3,1)?d=0:id(c)&&(d=1);let g=Math.floor(((f+d)*12+373)/367),m=r-nd(c,g,1)+1;return new go(this,c,g,m)}toJulianDay(t){return nd(t.year,t.month,t.day)}getDaysInMonth(t){return kV[id(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return id(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}getYearsToAdd(t,r){return t.era==="BC"?-r:r}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}function xi(e){return e=dr(e,new ja),tP(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function tP(e,t,r,n,i,s,u){let o=new Date;return o.setUTCHours(n,i,s,u),o.setUTCFullYear(e,t-1,r),o.getTime()}function Ba(e,t){if(t===za())return new Date(e).getTimezoneOffset()*-6e4;let{year:r,month:n,day:i,hour:s,minute:u,second:o}=nP(e,t);return tP(r,n,i,s,u,o,0)-Math.floor(e/1e3)*1e3}const rP=new Map;function nP(e,t){let r=rP.get(t);r||(r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),rP.set(t,r));let n=r.formatToParts(new Date(e)),i={};for(let s of n)s.type!=="literal"&&(i[s.type]=s.value);return{year:i.era==="BC"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const od=864e5;function iP(e,t){let r=xi(e),n=r-Ba(r-od,t),i=r-Ba(r+od,t);return oP(e,t,n,i)}function oP(e,t,r,n){return(r===n?[r]:[r,n]).filter(s=>$V(e,t,s))}function $V(e,t,r){let n=nP(r,t);return e.year===n.year&&e.month===n.month&&e.day===n.day&&e.hour===n.hour&&e.minute===n.minute&&e.second===n.second}function Er(e,t,r="compatible"){let n=Rn(e);if(t===za()&&r==="compatible"){n=dr(n,new ja);let a=new Date;return a.setFullYear(n.year,n.month-1,n.day),a.setHours(n.hour,n.minute,n.second,n.millisecond),a.getTime()}let i=xi(n),s=Ba(i-od,t),u=Ba(i+od,t),o=oP(n,t,i-s,i-u);if(o.length===1)return o[0];if(o.length>1)switch(r){case"compatible":case"earlier":return o[0];case"later":return o[o.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(r){case"earlier":return Math.min(i-s,i-u);case"compatible":case"later":return Math.max(i-s,i-u);case"reject":throw new RangeError("No such absolute time found")}}function M0(e,t,r="compatible"){return new Date(Er(e,t,r))}function Ir(e,t){let r=Ba(e,t),n=new Date(e+r),i=n.getUTCFullYear(),s=n.getUTCMonth()+1,u=n.getUTCDate(),o=n.getUTCHours(),a=n.getUTCMinutes(),l=n.getUTCSeconds(),h=n.getUTCMilliseconds();return new wi(i,s,u,t,r,o,a,l,h)}function aP(e,t){return Ir(e.getTime(),t)}function DV(e){return aP(e,za())}function sP(e){return new go(e.calendar,e.era,e.year,e.month,e.day)}function AV(e){return{era:e.era,year:e.year,month:e.month,day:e.day}}function IV(e){return{hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond}}function Rn(e,t){let r=0,n=0,i=0,s=0;if("timeZone"in e)({hour:r,minute:n,second:i,millisecond:s}=e);else if("hour"in e&&!t)return e;return t&&({hour:r,minute:n,second:i,millisecond:s}=t),new Ua(e.calendar,e.era,e.year,e.month,e.day,r,n,i,s)}function RV(e){return new Rl(e.hour,e.minute,e.second,e.millisecond)}function dr(e,t){if(e.calendar.identifier===t.identifier)return e;let r=t.fromJulianDay(e.calendar.toJulianDay(e)),n=e.copy();return n.calendar=t,n.era=r.era,n.year=r.year,n.month=r.month,n.day=r.day,n}function lP(e,t,r){if(e instanceof wi)return e.timeZone===t?e:ad(e,t);let n=Er(e,t,r);return Ir(n,t)}function uP(e){let t=xi(e)-e.offset;return new Date(t)}function ad(e,t){let r=xi(e)-e.offset;return dr(Ir(r,t),e.calendar)}function FV(e){return ad(e,za())}const Al=36e5;function sd(e,t){let r=e.copy(),n="hour"in e?hP(e,t):0;return k0(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e),r.month+=t.months||0,$0(r),cP(r),r.day+=(t.weeks||0)*7,r.day+=t.days||0,r.day+=n,LV(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r}function k0(e,t){e.calendar.getYearsToAdd&&(t=e.calendar.getYearsToAdd(e,t)),e.year+=t}function $0(e){for(;e.month<1;)k0(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,k0(e,1)}function LV(e){for(;e.day<1;)e.month--,$0(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,$0(e)}function cP(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Va(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),cP(e)}function D0(e){let t={};for(let r in e)typeof e[r]=="number"&&(t[r]=-e[r]);return t}function fP(e,t){return sd(e,D0(t))}function A0(e,t){let r=e.copy();return t.era!=null&&(r.era=t.era),t.year!=null&&(r.year=t.year),t.month!=null&&(r.month=t.month),t.day!=null&&(r.day=t.day),Va(r),r}function Il(e,t){let r=e.copy();return t.hour!=null&&(r.hour=t.hour),t.minute!=null&&(r.minute=t.minute),t.second!=null&&(r.second=t.second),t.millisecond!=null&&(r.millisecond=t.millisecond),dP(r),r}function NV(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=ld(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=ld(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=ld(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=ld(e.hour,24),t}function dP(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function ld(e,t){let r=e%t;return r<0&&(r+=t),r}function hP(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,NV(e)}function pP(e,t){let r=e.copy();return hP(r,t),r}function zV(e,t){return pP(e,D0(t))}function I0(e,t,r,n){let i=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),u=s.indexOf(e.era);if(u<0)throw new Error("Invalid era: "+e.era);u=Fn(u,r,0,s.length-1,n==null?void 0:n.round),i.era=s[u],Va(i);break}case"year":i.calendar.getYearsToAdd&&(r=i.calendar.getYearsToAdd(i,r)),i.year=Fn(e.year,r,-1/0,9999,n==null?void 0:n.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=Fn(e.month,r,1,e.calendar.getMonthsInYear(e),n==null?void 0:n.round);break;case"day":i.day=Fn(e.day,r,1,e.calendar.getDaysInMonth(e),n==null?void 0:n.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),Va(i),i}function R0(e,t,r,n){let i=e.copy();switch(t){case"hour":{let s=e.hour,u=0,o=23;if((n==null?void 0:n.hourCycle)===12){let a=s>=12;u=a?12:0,o=a?23:11}i.hour=Fn(s,r,u,o,n==null?void 0:n.round);break}case"minute":i.minute=Fn(e.minute,r,0,59,n==null?void 0:n.round);break;case"second":i.second=Fn(e.second,r,0,59,n==null?void 0:n.round);break;case"millisecond":i.millisecond=Fn(e.millisecond,r,0,999,n==null?void 0:n.round);break;default:throw new Error("Unsupported field "+t)}return i}function Fn(e,t,r,n,i=!1){if(i){e+=Math.sign(t),e<r&&(e=n);let s=Math.abs(t);t>0?e=Math.ceil(e/s)*s:e=Math.floor(e/s)*s,e>n&&(e=r)}else e+=t,e<r?e=n-(r-e-1):e>n&&(e=r+(e-n-1));return e}function gP(e,t){let r;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.days!=null&&t.days!==0){let i=sd(Rn(e),{years:t.years,months:t.months,days:t.days});r=Er(i,e.timeZone)}else r=xi(e)-e.offset;r+=t.milliseconds||0,r+=(t.seconds||0)*1e3,r+=(t.minutes||0)*6e4,r+=(t.hours||0)*36e5;let n=Ir(r,e.timeZone);return dr(n,e.calendar)}function jV(e,t){return gP(e,D0(t))}function BV(e,t,r,n){switch(t){case"hour":{let i=0,s=23;if((n==null?void 0:n.hourCycle)===12){let g=e.hour>=12;i=g?12:0,s=g?23:11}let u=Rn(e),o=dr(Il(u,{hour:i}),new ja),a=[Er(o,e.timeZone,"earlier"),Er(o,e.timeZone,"later")].filter(g=>Ir(g,e.timeZone).day===o.day)[0],l=dr(Il(u,{hour:s}),new ja),h=[Er(l,e.timeZone,"earlier"),Er(l,e.timeZone,"later")].filter(g=>Ir(g,e.timeZone).day===l.day).pop(),c=xi(e)-e.offset,f=Math.floor(c/Al),d=c%Al;return c=Fn(f,r,Math.floor(a/Al),Math.floor(h/Al),n==null?void 0:n.round)*Al+d,dr(Ir(c,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return R0(e,t,r,n);case"era":case"year":case"month":case"day":{let i=I0(Rn(e),t,r,n),s=Er(i,e.timeZone);return dr(Ir(s,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function VV(e,t,r){let n=Rn(e),i=Il(A0(n,t),t);if(i.compare(n)===0)return e;let s=Er(i,e.timeZone,r);return dr(Ir(s,e.timeZone),e.calendar)}var mn={};Se(mn,"parseTime",()=>XV),Se(mn,"parseDate",()=>GV),Se(mn,"parseDateTime",()=>qV),Se(mn,"parseZonedDateTime",()=>JV),Se(mn,"dateTimeToString",()=>ud),Se(mn,"parseAbsolute",()=>mP),Se(mn,"parseAbsoluteToLocal",()=>ZV),Se(mn,"timeToString",()=>F0),Se(mn,"dateToString",()=>L0),Se(mn,"zonedDateTimeToString",()=>yP);const UV=/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,HV=/^(\d{4})-(\d{2})-(\d{2})$/,WV=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,YV=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::(\d{2}))?)?\[(.*?)\]$/,KV=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::(\d{2}))?)|Z)$/;function XV(e){let t=e.match(UV);if(!t)throw new Error("Invalid ISO 8601 time string: "+e);return new Rl(He(t[1],0,23),t[2]?He(t[2],0,59):0,t[3]?He(t[3],0,59):0,t[4]?He(t[4],0,1/0)*1e3:0)}function GV(e){let t=e.match(HV);if(!t)throw new Error("Invalid ISO 8601 date string: "+e);let r=new go(He(t[1],0,9999),He(t[2],1,12),1);return r.day=He(t[3],0,r.calendar.getDaysInMonth(r)),r}function qV(e){let t=e.match(WV);if(!t)throw new Error("Invalid ISO 8601 date time string: "+e);let r=new Ua(He(t[1],1,9999),He(t[2],1,12),1,t[4]?He(t[4],0,23):0,t[5]?He(t[5],0,59):0,t[6]?He(t[6],0,59):0,t[7]?He(t[7],0,1/0)*1e3:0);return r.day=He(t[3],0,r.calendar.getDaysInMonth(r)),r}function JV(e,t){let r=e.match(YV);if(!r)throw new Error("Invalid ISO 8601 date time string: "+e);let n=new wi(He(r[1],1,9999),He(r[2],1,12),1,r[10],0,r[4]?He(r[4],0,23):0,r[5]?He(r[5],0,59):0,r[6]?He(r[6],0,59):0,r[7]?He(r[7],0,1/0)*1e3:0);n.day=He(r[3],0,n.calendar.getDaysInMonth(n));let i=Rn(n),s;if(r[8]){var u;if(n.offset=He(r[8],-23,23)*36e5+He((u=r[9])!==null&&u!==void 0?u:"0",0,59)*6e4,s=xi(n)-n.offset,!iP(i,n.timeZone).includes(s))throw new Error(`Offset ${vP(n.offset)} is invalid for ${ud(n)} in ${n.timeZone}`)}else s=Er(Rn(i),n.timeZone,t);return Ir(s,n.timeZone)}function mP(e,t){let r=e.match(KV);if(!r)throw new Error("Invalid ISO 8601 date time string: "+e);let n=new wi(He(r[1],1,9999),He(r[2],1,12),1,t,0,r[4]?He(r[4],0,23):0,r[5]?He(r[5],0,59):0,r[6]?He(r[6],0,59):0,r[7]?He(r[7],0,1/0)*1e3:0);n.day=He(r[3],0,n.calendar.getDaysInMonth(n));var i;return r[8]&&(n.offset=He(r[8],-23,23)*36e5+He((i=r[9])!==null&&i!==void 0?i:"0",0,59)*6e4),ad(n,t)}function ZV(e){return mP(e,za())}function He(e,t,r){let n=Number(e);if(n<t||n>r)throw new RangeError(`Value out of range: ${t} <= ${n} <= ${r}`);return n}function F0(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function L0(e){let t=dr(e,new ja);return`${String(t.year).padStart(4,"0")}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function ud(e){return`${L0(e)}T${F0(e)}`}function vP(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let r=Math.floor(e/36e5),n=e%36e5/6e4;return`${t}${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function yP(e){return`${ud(e)}${vP(e.offset)}[${e.timeZone}]`}function N0(e){let t=typeof e[0]=="object"?e.shift():new ja,r;if(typeof e[0]=="string")r=e.shift();else{let u=t.getEras();r=u[u.length-1]}let n=e.shift(),i=e.shift(),s=e.shift();return[t,r,n,i,s]}class go{copy(){return this.era?new go(this.calendar,this.era,this.year,this.month,this.day):new go(this.calendar,this.year,this.month,this.day)}add(t){return sd(this,t)}subtract(t){return fP(this,t)}set(t){return A0(this,t)}cycle(t,r,n){return I0(this,t,r,n)}toDate(t){return M0(this,t)}toString(){return L0(this)}compare(t){return C0(this,t)}constructor(...t){QV.set(this,{writable:!0,value:void 0});let[r,n,i,s,u]=N0(t);this.calendar=r,this.era=n,this.year=i,this.month=s,this.day=u,Va(this)}}var QV=new WeakMap;class Rl{copy(){return new Rl(this.hour,this.minute,this.second,this.millisecond)}add(t){return pP(this,t)}subtract(t){return zV(this,t)}set(t){return Il(this,t)}cycle(t,r,n){return R0(this,t,r,n)}toString(){return F0(this)}compare(t){return E0(this,t)}constructor(t=0,r=0,n=0,i=0){eU.set(this,{writable:!0,value:void 0}),this.hour=t,this.minute=r,this.second=n,this.millisecond=i,dP(this)}}var eU=new WeakMap;class Ua{copy(){return this.era?new Ua(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Ua(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return sd(this,t)}subtract(t){return fP(this,t)}set(t){return A0(Il(this,t),t)}cycle(t,r,n){switch(t){case"era":case"year":case"month":case"day":return I0(this,t,r,n);default:return R0(this,t,r,n)}}toDate(t){return M0(this,t)}toString(){return ud(this)}compare(t){let r=C0(this,t);return r===0?E0(this,Rn(t)):r}constructor(...t){tU.set(this,{writable:!0,value:void 0});let[r,n,i,s,u]=N0(t);this.calendar=r,this.era=n,this.year=i,this.month=s,this.day=u,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Va(this)}}var tU=new WeakMap;class wi{copy(){return this.era?new wi(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new wi(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return gP(this,t)}subtract(t){return jV(this,t)}set(t,r){return VV(this,t,r)}cycle(t,r,n){return BV(this,t,r,n)}toDate(){return uP(this)}toString(){return yP(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-lP(t,this.timeZone).toDate().getTime()}constructor(...t){rU.set(this,{writable:!0,value:void 0});let[r,n,i,s,u]=N0(t),o=t.shift(),a=t.shift();this.calendar=r,this.era=n,this.year=i,this.month=s,this.day=u,this.timeZone=o,this.offset=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Va(this)}}var rU=new WeakMap,nU={};Se(nU,"DateFormatter",()=>bP);let z0=new Map;class bP{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,r){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,r);if(r<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} \u2013 ${this.formatter.format(r)}`}formatRangeToParts(t,r){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,r);if(r<t)throw new RangeError("End date must be >= start date");let n=this.formatter.formatToParts(t),i=this.formatter.formatToParts(r);return[...n.map(s=>Y($({},s),{source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...i.map(s=>Y($({},s),{source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return aU()&&(this.resolvedHourCycle||(this.resolvedHourCycle=sU(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t}constructor(t,r={}){this.formatter=xP(t,r),this.options=r}}const iU={true:{ja:"h11"},false:{}};function xP(e,t={}){if(typeof t.hour12=="boolean"&&oU()){t=$({},t);let i=iU[String(t.hour12)][e.split("-")[0]],s=t.hour12?"h12":"h23";t.hourCycle=i!=null?i:s,delete t.hour12}let r=e+(t?Object.entries(t).sort((i,s)=>i[0]<s[0]?-1:1).join():"");if(z0.has(r))return z0.get(r);let n=new Intl.DateTimeFormat(e,t);return z0.set(r,n),n}let j0=null;function oU(){return j0==null&&(j0=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),j0}let B0=null;function aU(){return B0==null&&(B0=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),B0}function sU(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let r=xP(e,Y($({},t),{timeZone:void 0})),n=parseInt(r.formatToParts(new Date(2020,2,3,0)).find(s=>s.type==="hour").value,10),i=parseInt(r.formatToParts(new Date(2020,2,3,23)).find(s=>s.type==="hour").value,10);if(n===0&&i===23)return"h23";if(n===24&&i===23)return"h24";if(n===0&&i===11)return"h11";if(n===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}let V0=new Map,U0=!1;try{U0=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let cd=!1;try{cd=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const wP={degree:{narrow:{default:"\xB0","ja-JP":" \u5EA6","zh-TW":"\u5EA6","sl-SI":" \xB0"}}};class H0{format(t){let r="";if(!U0&&this.options.signDisplay!=null?r=uU(this.numberFormatter,this.options.signDisplay,t):r=this.numberFormatter.format(t),this.options.style==="unit"&&!cd){var n;let{unit:i,unitDisplay:s="short",locale:u}=this.resolvedOptions(),o=(n=wP[i])===null||n===void 0?void 0:n[s];r+=o[u]||o.default}return r}formatToParts(t){return this.numberFormatter.formatToParts(t)}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!U0&&this.options.signDisplay!=null&&(t=Y($({},t),{signDisplay:this.options.signDisplay})),!cd&&this.options.style==="unit"&&(t=Y($({},t),{style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay})),t}constructor(t,r={}){this.numberFormatter=lU(t,r),this.options=r}}function lU(e,t={}){let{numberingSystem:r}=t;if(r&&e.indexOf("-u-nu-")===-1&&(e=`${e}-u-nu-${r}`),t.style==="unit"&&!cd){var n;let{unit:u,unitDisplay:o="short"}=t;if(!u)throw new Error('unit option must be provided with style: "unit"');if(!((n=wP[u])===null||n===void 0?void 0:n[o]))throw new Error(`Unsupported unit ${u} with unitDisplay = ${o}`);t=Y($({},t),{style:"decimal"})}let i=e+(t?Object.entries(t).sort((u,o)=>u[0]<o[0]?-1:1).join():"");if(V0.has(i))return V0.get(i);let s=new Intl.NumberFormat(e,t);return V0.set(i,s),s}function uU(e,t,r){if(t==="auto")return e.format(r);if(t==="never")return e.format(Math.abs(r));{let n=!1;if(t==="always"?n=r>0||Object.is(r,0):t==="exceptZero"&&(Object.is(r,-0)||Object.is(r,0)?r=Math.abs(r):n=r>0),n){let i=e.format(-r),s=e.format(r),u=i.replace(s,"").replace(/\u200e|\u061C/,"");return[...u].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(s,"!!!").replace(u,"+").replace("!!!",s)}else return e.format(r)}}const cU=new RegExp("^.*\\(.*\\).*$"),fU=["latn","arab","hanidec"];class dU{parse(t){return W0(this.locale,this.options,t).parse(t)}isValidPartialNumber(t,r,n){return W0(this.locale,this.options,t).isValidPartialNumber(t,r,n)}getNumberingSystem(t){return W0(this.locale,this.options,t).options.numberingSystem}constructor(t,r={}){this.locale=t,this.options=r}}const SP=new Map;function W0(e,t,r){let n=_P(e,t);if(!e.includes("-nu-")&&!n.isValidPartialNumber(r)){for(let i of fU)if(i!==n.options.numberingSystem){let s=_P(e+(e.includes("-u-")?"-nu-":"-u-nu-")+i,t);if(s.isValidPartialNumber(r))return s}}return n}function _P(e,t){let r=e+(t?Object.entries(t).sort((i,s)=>i[0]<s[0]?-1:1).join():""),n=SP.get(r);return n||(n=new hU(e,t),SP.set(r,n)),n}class hU{parse(t){let r=this.sanitize(t);r=fd(r,this.symbols.group,"").replace(this.symbols.decimal,".").replace(this.symbols.minusSign,"-").replace(this.symbols.numeral,this.symbols.index);let n=r?+r:NaN;if(isNaN(n))return NaN;if(this.options.currencySign==="accounting"&&cU.test(t)&&(n=-1*n),this.options.style==="percent"){n/=100;var i;n=+n.toFixed(((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)+2)}return n}sanitize(t){return t=t.replace(this.symbols.literals,""),t=t.replace("-",this.symbols.minusSign),this.options.numberingSystem==="arab"&&(t=t.replace(",",this.symbols.decimal),t=t.replace(String.fromCharCode(1548),this.symbols.decimal),t=fd(t,".",this.symbols.group)),this.options.locale==="fr-FR"&&(t=fd(t,".",String.fromCharCode(8239))),t}isValidPartialNumber(t,r=-1/0,n=1/0){return t=this.sanitize(t),t.startsWith(this.symbols.minusSign)&&r<0?t=t.slice(this.symbols.minusSign.length):this.symbols.plusSign&&t.startsWith(this.symbols.plusSign)&&n>0&&(t=t.slice(this.symbols.plusSign.length)),t.startsWith(this.symbols.group)?!1:(t=fd(t,this.symbols.group,"").replace(this.symbols.numeral,"").replace(this.symbols.decimal,""),t.length===0)}constructor(t,r={}){this.formatter=new Intl.NumberFormat(t,r),this.options=this.formatter.resolvedOptions(),this.symbols=pU(this.formatter,this.options,r)}}const TP=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]);function pU(e,t,r){var n,i,s,u;let o=e.formatToParts(-10000.111),a=e.formatToParts(10000.111),l=e.formatToParts(1);var h;let c=(h=(n=o.find(_=>_.type==="minusSign"))===null||n===void 0?void 0:n.value)!==null&&h!==void 0?h:"-",f=(i=a.find(_=>_.type==="plusSign"))===null||i===void 0?void 0:i.value;!f&&((r==null?void 0:r.signDisplay)==="exceptZero"||(r==null?void 0:r.signDisplay)==="always")&&(f="+");let d=(s=o.find(_=>_.type==="decimal"))===null||s===void 0?void 0:s.value,g=(u=o.find(_=>_.type==="group"))===null||u===void 0?void 0:u.value,m=o.filter(_=>!TP.has(_.type)).map(_=>CP(_.value)),p=l.filter(_=>!TP.has(_.type)).map(_=>CP(_.value)),v=[...new Set([...p,...m])].sort((_,E)=>E.length-_.length),y=new RegExp(`${v.join("|")}|[\\p{White_Space}]`,"gu"),b=[...new Intl.NumberFormat(t.locale,{useGrouping:!1}).format(9876543210)].reverse(),x=new Map(b.map((_,E)=>[_,E])),w=new RegExp(`[${b.join("")}]`,"g");return{minusSign:c,plusSign:f,decimal:d,group:g,literals:y,numeral:w,index:_=>String(x.get(_))}}function fd(e,t,r){return e.replaceAll?e.replaceAll(t,r):e.split(t).join(r)}function CP(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function mo(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var EP={};mo(EP,"I18nProvider",()=>vU),mo(EP,"useLocale",()=>Rr);const gU=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),mU=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function PP(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize().script;return gU.has(r)}let t=e.split("-")[0];return mU.has(t)}function OP(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:PP(e)?"rtl":"ltr"}}let Y0=OP(),Fl=new Set;function MP(){Y0=OP();for(let e of Fl)e(Y0)}function kP(){let e=Cf(),[t,r]=C.exports.useState(Y0);return C.exports.useEffect(()=>(Fl.size===0&&window.addEventListener("languagechange",MP),Fl.add(r),()=>{Fl.delete(r),Fl.size===0&&window.removeEventListener("languagechange",MP)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const $P=ee.createContext(null);function vU(e){let{locale:t,children:r}=e,n=kP(),i=t?{locale:t,direction:PP(t)?"rtl":"ltr"}:n;return ee.createElement($P.Provider,{value:i},r)}function Rr(){let e=kP();return C.exports.useContext($P)||e}var yU={};mo(yU,"useMessageFormatter",()=>Ll);const DP=new WeakMap;function bU(e){let t=DP.get(e);return t||(t=new UE(e),DP.set(e,t)),t}function Ll(e){let{locale:t}=Rr(),r=C.exports.useMemo(()=>bU(e),[e]),n=C.exports.useMemo(()=>new HE(t,r),[t,r]);return C.exports.useCallback((i,s)=>n.format(i,s),[n])}var xU={};mo(xU,"useDateFormatter",()=>wU);function wU(e){let t=C.exports.useRef(null);e&&t.current&&SU(e,t.current)&&(e=t.current),t.current=e;let{locale:r}=Rr();return C.exports.useMemo(()=>new bP(r,e),[r,e])}function SU(e,t){if(e===t)return!0;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i of r)if(t[i]!==e[i])return!1;return!0}var _U={};mo(_U,"useNumberFormatter",()=>dd);function dd(e={}){let{locale:t}=Rr();return C.exports.useMemo(()=>new H0(t,e),[t,e])}var TU={};mo(TU,"useCollator",()=>hd);let K0=new Map;function hd(e){let{locale:t}=Rr(),r=t+(e?Object.entries(e).sort((i,s)=>i[0]<s[0]?-1:1).join():"");if(K0.has(r))return K0.get(r);let n=new Intl.Collator(t,e);return K0.set(r,n),n}var CU={};mo(CU,"useFilter",()=>EU);function EU(e){let t=hd($({usage:"search"},e));return{startsWith(r,n){return n.length===0?!0:(r=r.normalize("NFC"),n=n.normalize("NFC"),t.compare(r.slice(0,n.length),n)===0)},endsWith(r,n){return n.length===0?!0:(r=r.normalize("NFC"),n=n.normalize("NFC"),t.compare(r.slice(-n.length),n)===0)},contains(r,n){if(n.length===0)return!0;r=r.normalize("NFC"),n=n.normalize("NFC");let i=0,s=n.length;for(;i+s<=r.length;i++){let u=r.slice(i,i+s);if(t.compare(n,u)===0)return!0}return!1}}}var Nl={exports:{}},Fr={exports:{}};(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Fr);var pd={exports:{}},X0={exports:{}};(function(e,t){t.__esModule=!0,t.default=n;var r=/-(.)/g;function n(i){return i.replace(r,function(s,u){return u.toUpperCase()})}e.exports=t.default})(X0,X0.exports),function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=s;var n=r(X0.exports),i=/^-ms-/;function s(u){return(0,n.default)(u.replace(i,"ms-"))}e.exports=t.default}(pd,pd.exports);var G0={exports:{}},q0={exports:{}};(function(e,t){t.__esModule=!0,t.default=n;var r=/([A-Z])/g;function n(i){return i.replace(r,"-$1").toLowerCase()}e.exports=t.default})(q0,q0.exports),function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=s;var n=r(q0.exports),i=/^ms-/;function s(u){return(0,n.default)(u).replace(i,"-ms-")}e.exports=t.default}(G0,G0.exports);var J0={exports:{}};(function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=u;var n=r(pd.exports),i=/^(top|right|bottom|left)$/,s=/^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;function u(o){if(!o)throw new TypeError("No Element passed to `getComputedStyle()`");var a=o.ownerDocument;return"defaultView"in a?a.defaultView.opener?o.ownerDocument.defaultView.getComputedStyle(o,null):window.getComputedStyle(o,null):{getPropertyValue:function(h){var c=o.style;h=(0,n.default)(h),h=="float"&&(h="styleFloat");var f=o.currentStyle[h]||null;if(f==null&&c&&c[h]&&(f=c[h]),s.test(f)&&!i.test(h)){var d=c.left,g=o.runtimeStyle,m=g&&g.left;m&&(g.left=o.currentStyle.left),c.left=h==="fontSize"?"1em":f,f=c.pixelLeft+"px",c.left=d,m&&(g.left=m)}return f}}}e.exports=t.default})(J0,J0.exports);var Z0={exports:{}};(function(e,t){t.__esModule=!0,t.default=r;function r(n,i){return"removeProperty"in n.style?n.style.removeProperty(i):n.style.removeAttribute(i)}e.exports=t.default})(Z0,Z0.exports);var Re={},gd={exports:{}};(function(e,t){t.__esModule=!0,t.default=void 0;var r=!!(typeof window!="undefined"&&window.document&&window.document.createElement);t.default=r,e.exports=t.default})(gd,gd.exports);var PU=Fr.exports;Re.__esModule=!0,Re.default=Re.animationEnd=Re.animationDelay=Re.animationTiming=Re.animationDuration=Re.animationName=Re.transitionEnd=Re.transitionDuration=Re.transitionDelay=Re.transitionTiming=Re.transitionProperty=Re.transform=void 0;var OU=PU(gd.exports),md="transform";Re.transform=md;var vn,Q0,AP;Re.animationEnd=AP,Re.transitionEnd=Q0;var ey,ty,ry,ny;Re.transitionDelay=ny,Re.transitionTiming=ry,Re.transitionDuration=ty,Re.transitionProperty=ey;var IP,RP,FP,LP;if(Re.animationDelay=LP,Re.animationTiming=FP,Re.animationDuration=RP,Re.animationName=IP,OU.default){var iy=kU();vn=iy.prefix,Re.transitionEnd=Q0=iy.transitionEnd,Re.animationEnd=AP=iy.animationEnd,Re.transform=md=vn+"-"+md,Re.transitionProperty=ey=vn+"-transition-property",Re.transitionDuration=ty=vn+"-transition-duration",Re.transitionDelay=ny=vn+"-transition-delay",Re.transitionTiming=ry=vn+"-transition-timing-function",Re.animationName=IP=vn+"-animation-name",Re.animationDuration=RP=vn+"-animation-duration",Re.animationTiming=FP=vn+"-animation-delay",Re.animationDelay=LP=vn+"-animation-timing-function"}var MU={transform:md,end:Q0,property:ey,timing:ry,delay:ny,duration:ty};Re.default=MU;function kU(){for(var e=document.createElement("div").style,t={O:function(l){return"o"+l.toLowerCase()},Moz:function(l){return l.toLowerCase()},Webkit:function(l){return"webkit"+l},ms:function(l){return"MS"+l}},r=Object.keys(t),n,i,s="",u=0;u<r.length;u++){var o=r[u];if(o+"TransitionProperty"in e){s="-"+o.toLowerCase(),n=t[o]("TransitionEnd"),i=t[o]("AnimationEnd");break}}return!n&&"transitionProperty"in e&&(n="transitionend"),!i&&"animationName"in e&&(i="animationend"),e=null,{animationEnd:i,transitionEnd:n,prefix:s}}var oy={exports:{}};(function(e,t){t.__esModule=!0,t.default=n;var r=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function n(i){return!!(i&&r.test(i))}e.exports=t.default})(oy,oy.exports),function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=l;var n=r(pd.exports),i=r(G0.exports),s=r(J0.exports),u=r(Z0.exports),o=Re,a=r(oy.exports);function l(h,c,f){var d="",g="",m=c;if(typeof c=="string"){if(f===void 0)return h.style[(0,n.default)(c)]||(0,s.default)(h).getPropertyValue((0,i.default)(c));(m={})[c]=f}Object.keys(m).forEach(function(p){var v=m[p];!v&&v!==0?(0,u.default)(h,(0,i.default)(p)):(0,a.default)(p)?g+=p+"("+v+") ":d+=(0,i.default)(p)+": "+v+";"}),g&&(d+=o.transform+": "+g+";"),h.style.cssText+=";"+d}e.exports=t.default}(Nl,Nl.exports);var NP=We(Nl.exports),vd={exports:{}},ay={exports:{}};(function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=void 0;var n=r(gd.exports),i=function(){return n.default?function(u,o){return u.contains?u.contains(o):u.compareDocumentPosition?u===o||!!(u.compareDocumentPosition(o)&16):s(u,o)}:s}();t.default=i;function s(u,o){if(o)do if(o===u)return!0;while(o=o.parentNode);return!1}e.exports=t.default})(ay,ay.exports);var zl={exports:{}};(function(e,t){t.__esModule=!0,t.default=r;function r(n){return n===n.window?n:n.nodeType===9?n.defaultView||n.parentWindow:!1}e.exports=t.default})(zl,zl.exports);var jl={exports:{}};(function(e,t){t.__esModule=!0,t.default=r;function r(n){return n&&n.ownerDocument||document}e.exports=t.default})(jl,jl.exports);var zP=We(jl.exports);(function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=u;var n=r(ay.exports),i=r(zl.exports),s=r(jl.exports);function u(o){var a=(0,s.default)(o),l=(0,i.default)(a),h=a&&a.documentElement,c={top:0,left:0,height:0,width:0};if(!!a)return(0,n.default)(h,o)&&(o.getBoundingClientRect!==void 0&&(c=o.getBoundingClientRect()),c={top:c.top+(l.pageYOffset||h.scrollTop)-(h.clientTop||0),left:c.left+(l.pageXOffset||h.scrollLeft)-(h.clientLeft||0),width:(c.width==null?o.offsetWidth:c.width)||0,height:(c.height==null?o.offsetHeight:c.height)||0}),c}e.exports=t.default})(vd,vd.exports);var yd=We(vd.exports),sy={exports:{}},jP={exports:{}};(function(e){function t(){return e.exports=t=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])}return r},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(jP);var ly={exports:{}};(function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=u;var n=r(jl.exports),i=r(Nl.exports);function s(o){return o.nodeName&&o.nodeName.toLowerCase()}function u(o){for(var a=(0,n.default)(o),l=o&&o.offsetParent;l&&s(o)!=="html"&&(0,i.default)(l,"position")==="static";)l=l.offsetParent;return l||a.documentElement}e.exports=t.default})(ly,ly.exports);var bd={exports:{}};(function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=i;var n=r(zl.exports);function i(s,u){var o=(0,n.default)(s);if(u===void 0)return o?"pageYOffset"in o?o.pageYOffset:o.document.documentElement.scrollTop:s.scrollTop;o?o.scrollTo("pageXOffset"in o?o.pageXOffset:o.document.documentElement.scrollLeft,u):s.scrollTop=u}e.exports=t.default})(bd,bd.exports);var uy=We(bd.exports),xd={exports:{}};(function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=i;var n=r(zl.exports);function i(s,u){var o=(0,n.default)(s);if(u===void 0)return o?"pageXOffset"in o?o.pageXOffset:o.document.documentElement.scrollLeft:s.scrollLeft;o?o.scrollTo(u,"pageYOffset"in o?o.pageYOffset:o.document.documentElement.scrollTop):s.scrollLeft=u}e.exports=t.default})(xd,xd.exports);var cy=We(xd.exports);(function(e,t){var r=Fr.exports;t.__esModule=!0,t.default=h;var n=r(jP.exports),i=r(vd.exports),s=r(ly.exports),u=r(bd.exports),o=r(xd.exports),a=r(Nl.exports);function l(c){return c.nodeName&&c.nodeName.toLowerCase()}function h(c,f){var d={top:0,left:0},g;return(0,a.default)(c,"position")==="fixed"?g=c.getBoundingClientRect():(f=f||(0,s.default)(c),g=(0,i.default)(c),l(f)!=="html"&&(d=(0,i.default)(f)),d.top+=parseInt((0,a.default)(f,"borderTopWidth"),10)-(0,u.default)(f)||0,d.left+=parseInt((0,a.default)(f,"borderLeftWidth"),10)-(0,o.default)(f)||0),(0,n.default)({},g,{top:g.top-d.top-(parseInt((0,a.default)(c,"marginTop"),10)||0),left:g.left-d.left-(parseInt((0,a.default)(c,"marginLeft"),10)||0)})}e.exports=t.default})(sy,sy.exports);var BP=We(sy.exports);function Xr(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function $U(e){return e&&e.__esModule?e.default:e}var DU={};Xr(DU,"useOverlayPosition",()=>BU);const VP={top:"top",bottom:"top",left:"left",right:"left"},wd={top:"bottom",bottom:"top",left:"right",right:"left"},AU={top:"left",left:"top"},fy={top:"height",left:"width"},Sd={};let Ha=typeof window!="undefined"&&window.visualViewport;function IU(e){let t=0,r=0,n=0,i=0,s={};if(e.tagName==="BODY"){var u;t=(u=Ha==null?void 0:Ha.width)!==null&&u!==void 0?u:document.documentElement.clientWidth;var o;r=(o=Ha==null?void 0:Ha.height)!==null&&o!==void 0?o:document.documentElement.clientHeight,s.top=uy(zP(e).documentElement)||uy(e),s.left=cy(zP(e).documentElement)||cy(e)}else({width:t,height:r,top:n,left:i}=yd(e)),s.top=uy(e),s.left=cy(e);return{width:t,height:r,scroll:s,top:n,left:i}}function RU(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function UP(e,t,r,n,i){let s=n.scroll[e],u=n[fy[e]],o=t-i-s,a=t+i-s+r;return o<0?-o:a>u?Math.max(u-a,-o):0}function FU(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function HP(e){if(Sd[e])return Sd[e];let[t,r]=e.split(" "),n=VP[t]||"right",i=AU[n];VP[r]||(r="center");let s=fy[n],u=fy[i];return Sd[e]={placement:t,crossPlacement:r,axis:n,crossAxis:i,size:s,crossSize:u},Sd[e]}function dy(e,t,r,n,i,s,u,o){let{placement:a,crossPlacement:l,axis:h,crossAxis:c,size:f,crossSize:d}=n,g={};g[c]=e[c],l==="center"?g[c]+=(e[d]-r[d])/2:l!==c&&(g[c]+=e[d]-r[d]),g[c]+=s;let m=e[c]+e[d]/2-r[d],p=e[c]+e[d]/2;if(g[c]=Math.min(Math.max(m,g[c]),p),a===h){const v=o?u[f]:t[f];g[wd[h]]=Math.floor(v-e[h]+i)}else g[h]=Math.floor(e[h]+e[f]+i);return g}function LU(e,t,r,n,i,s){return e.top!=null?Math.max(0,t.height+t.top+t.scroll.top-(r.top+e.top)-(i.top+i.bottom+s)):Math.max(0,n.top+r.top-(t.top+t.scroll.top)-(i.top+i.bottom+s))}function WP(e,t,r,n,i,s){let{placement:u,axis:o,size:a}=s;return u===o?Math.max(0,r[o]-e[o]-e.scroll[o]+t[o]-n[o]-n[wd[o]]-i):Math.max(0,e[a]+e[o]+e.scroll[o]-t[o]-r[o]-r[a]-n[o]-n[wd[o]]-i)}function NU(e,t,r,n,i,s,u,o,a,l,h,c,f){let d=HP(e),{size:g,crossAxis:m,crossSize:p,placement:v,crossPlacement:y}=d,b=dy(t,o,r,d,l,h,a,c),x=l,w=WP(o,a,t,i,s+l,d);if(u&&n[g]>w){let k=HP(`${wd[v]} ${y}`),z=dy(t,o,r,k,l,h,a,c);WP(o,a,t,i,s+l,k)>w&&(d=k,b=z,x=l)}let T=UP(m,b[m],r[p],o,s);b[m]+=T;let _=LU(b,o,a,t,i,s);f&&f<_&&(_=f),r.height=Math.min(r.height,_),b=dy(t,o,r,d,x,h,a,c),T=UP(m,b[m],r[p],o,s),b[m]+=T;let E={};return E[m]=t[m]-b[m]+t[p]/2,{position:b,maxHeight:_,arrowOffsetLeft:E.left,arrowOffsetTop:E.top,placement:d.placement}}function zU(e){let{placement:t,targetNode:r,overlayNode:n,scrollNode:i,padding:s,shouldFlip:u,boundaryElement:o,offset:a,crossOffset:l,maxHeight:h}=e,c=n.offsetParent||document.body,f=c.tagName==="BODY";const d=window.getComputedStyle(c).position;let g=!!d&&d!=="static",m=f?yd(r):BP(r,c);f||(m.top+=parseInt(NP(r,"marginTop"),10)||0,m.left+=parseInt(NP(r,"marginLeft"),10)||0);let p=yd(n),v=FU(n);p.width+=v.left+v.right,p.height+=v.top+v.bottom;let y=RU(i),b=IU(o),x=o.tagName==="BODY"?yd(c):BP(c,o);return NU(t,m,p,y,v,s,u,b,x,a,l,g,h)}const YP=new WeakMap;function jU(e){let{triggerRef:t,isOpen:r,onClose:n}=e;C.exports.useEffect(()=>{if(!r)return;let i=s=>{let u=s.target;if(!t.current||u instanceof Node&&!u.contains(t.current))return;let o=n||YP.get(t.current);o&&o()};return window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("scroll",i,!0)}},[r,n,t])}let Wa=typeof window!="undefined"&&window.visualViewport;function BU(e){let{direction:t}=Rr(),{targetRef:r,overlayRef:n,scrollRef:i=n,placement:s="bottom",containerPadding:u=12,shouldFlip:o=!0,boundaryElement:a=typeof document!="undefined"?document.body:null,offset:l=0,crossOffset:h=0,shouldUpdatePosition:c=!0,isOpen:f=!0,onClose:d,maxHeight:g}=e,[m,p]=C.exports.useState({position:{},arrowOffsetLeft:void 0,arrowOffsetTop:void 0,maxHeight:void 0,placement:void 0}),v=[c,s,n.current,r.current,i.current,u,o,a,l,h,f,t,g],y=C.exports.useCallback(()=>{c===!1||!f||!n.current||!r.current||!i.current||!a||p(zU({placement:UU(s,t),overlayNode:n.current,targetNode:r.current,scrollNode:i.current,padding:u,shouldFlip:o,boundaryElement:a,offset:l,crossOffset:h,maxHeight:g}))},v);mt(y,v),VU(y);let b=C.exports.useRef(!1);mt(()=>{let w,T=()=>{b.current=!0,clearTimeout(w),w=setTimeout(()=>{b.current=!1},500),y()};return Wa==null||Wa.addEventListener("resize",T),()=>{Wa==null||Wa.removeEventListener("resize",T)}},[y]);let x=C.exports.useCallback(()=>{b.current||d()},[d,b]);return jU({triggerRef:r,isOpen:f,onClose:d?x:void 0}),{overlayProps:{style:Y($({position:"absolute",zIndex:1e5},m.position),{maxHeight:m.maxHeight})},placement:m.placement,arrowProps:{style:{left:m.arrowOffsetLeft,top:m.arrowOffsetTop}},updatePosition:y}}function VU(e){mt(()=>(window.addEventListener("resize",e,!1),()=>{window.removeEventListener("resize",e,!1)}),[e])}function UU(e,t){return t==="rtl"?e.replace("start","right").replace("end","left"):e.replace("start","left").replace("end","right")}var HU={};Xr(HU,"useOverlay",()=>_d);const Ln=[];function _d(e,t){let{onClose:r,shouldCloseOnBlur:n,isOpen:i,isDismissable:s=!1,isKeyboardDismissDisabled:u=!1,shouldCloseOnInteractOutside:o}=e;C.exports.useEffect(()=>(i&&Ln.push(t),()=>{let g=Ln.indexOf(t);g>=0&&Ln.splice(g,1)}),[i,t]);let a=()=>{Ln[Ln.length-1]===t&&r&&r()},l=g=>{(!o||o(g.target))&&Ln[Ln.length-1]===t&&(g.stopPropagation(),g.preventDefault())},h=g=>{(!o||o(g.target))&&(Ln[Ln.length-1]===t&&(g.stopPropagation(),g.preventDefault()),a())},c=g=>{g.key==="Escape"&&!u&&(g.preventDefault(),a())};BC({ref:t,onInteractOutside:s?h:null,onInteractOutsideStart:l});let{focusWithinProps:f}=Da({isDisabled:!n,onBlurWithin:g=>{(!o||o(g.relatedTarget))&&r()}}),d=g=>{g.target===g.currentTarget&&g.preventDefault()};return{overlayProps:$({onKeyDown:c},f),underlayProps:{onPointerDown:d}}}var WU={};Xr(WU,"useOverlayTrigger",()=>hy);function hy(e,t,r){let{type:n}=e,{isOpen:i}=t;C.exports.useEffect(()=>{r&&r.current&&YP.set(r.current,t.close)});let s;n==="menu"?s=!0:n==="listbox"&&(s="listbox");let u=Kt();return{triggerProps:{"aria-haspopup":s,"aria-expanded":i,"aria-controls":i?u:null},overlayProps:{id:u}}}var YU={};Xr(YU,"usePreventScroll",()=>Td);const py=typeof window!="undefined"&&window.visualViewport,KP=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Td(e={}){let{isDisabled:t}=e;mt(()=>{if(!t)return Pa()?XU():KU()},[t])}function KU(){return io(Bl(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),Bl(document.documentElement,"overflow","hidden"))}function XU(){let e,t=0,r=c=>{e=$v(c.target),!(e===document.documentElement&&e===document.body)&&(t=c.changedTouches[0].pageY)},n=c=>{if(e===document.documentElement||e===document.body){c.preventDefault();return}let f=c.changedTouches[0].pageY,d=e.scrollTop,g=e.scrollHeight-e.clientHeight;(d<=0&&f>t||d>=g&&f<t)&&c.preventDefault(),t=f},i=c=>{let f=c.target;f instanceof HTMLInputElement&&!KP.has(f.type)&&(c.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},s=c=>{let f=c.target;f instanceof HTMLInputElement&&!KP.has(f.type)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",py&&(py.height<window.innerHeight?requestAnimationFrame(()=>{XP(f)}):py.addEventListener("resize",()=>XP(f),{once:!0}))}))},u=()=>{window.scrollTo(0,0)},o=window.pageXOffset,a=window.pageYOffset,l=io(Bl(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),Bl(document.documentElement,"overflow","hidden"),Bl(document.body,"marginTop",`-${a}px`));window.scrollTo(0,0);let h=io(Vl(document,"touchstart",r,{passive:!1,capture:!0}),Vl(document,"touchmove",n,{passive:!1,capture:!0}),Vl(document,"touchend",i,{passive:!1,capture:!0}),Vl(document,"focus",s,!0),Vl(window,"scroll",u));return()=>{l(),h(),window.scrollTo(o,a)}}function Bl(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function Vl(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function XP(e){let t=$v(e);if(t!==document.documentElement&&t!==document.body){let r=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top;n>r+e.clientHeight&&(t.scrollTop+=n-r)}}var Ul={};Xr(Ul,"ModalProvider",()=>GP),Xr(Ul,"useModalProvider",()=>qP),Xr(Ul,"OverlayProvider",()=>JP),Xr(Ul,"OverlayContainer",()=>ZP),Xr(Ul,"useModal",()=>Ed);const Cd=ee.createContext(null);function GP(e){let{children:t}=e,r=C.exports.useContext(Cd),[n,i]=C.exports.useState(0),s=C.exports.useMemo(()=>({parent:r,modalCount:n,addModal(){i(u=>u+1),r&&r.addModal()},removeModal(){i(u=>u-1),r&&r.removeModal()}}),[r,n]);return ee.createElement(Cd.Provider,{value:s},t)}function qP(){let e=C.exports.useContext(Cd);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:null}}}function GU(e){let{modalProviderProps:t}=qP();return ee.createElement("div",$($({"data-overlay-container":!0},e),t))}function JP(e){return ee.createElement(GP,null,ee.createElement(GU,e))}function ZP(e){let i=e,{portalContainer:t=document.body}=i,r=ze(i,["portalContainer"]);ee.useEffect(()=>{if(t.closest("[data-overlay-container]"))throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.")},[t]);let n=ee.createElement(JP,r);return fc.createPortal(n,t)}function Ed(e){let t=C.exports.useContext(Cd);if(!t)throw new Error("Modal is not contained within a provider");return C.exports.useEffect(()=>{if(!((e==null?void 0:e.isDisabled)||!t||!t.parent))return t.parent.addModal(),()=>{t&&t.parent&&t.parent.removeModal()}},[t,t.parent,e==null?void 0:e.isDisabled]),{modalProps:{"data-ismodal":!(e==null?void 0:e.isDisabled)}}}var qU={};Xr(qU,"DismissButton",()=>Ya);var QP={},e5={};e5=JSON.parse('{"dismiss":"\u062A\u062C\u0627\u0647\u0644"}');var t5={};t5=JSON.parse('{"dismiss":"\u041E\u0442\u0445\u0432\u044A\u0440\u043B\u044F\u043D\u0435"}');var r5={};r5=JSON.parse('{"dismiss":"Odstranit"}');var n5={};n5=JSON.parse('{"dismiss":"Luk"}');var i5={};i5=JSON.parse('{"dismiss":"Schlie\xDFen"}');var o5={};o5=JSON.parse('{"dismiss":"\u0391\u03C0\u03CC\u03C1\u03C1\u03B9\u03C8\u03B7"}');var a5={};a5=JSON.parse('{"dismiss":"Dismiss"}');var s5={};s5=JSON.parse('{"dismiss":"Descartar"}');var l5={};l5=JSON.parse('{"dismiss":"L\xF5peta"}');var u5={};u5=JSON.parse('{"dismiss":"Hylk\xE4\xE4"}');var c5={};c5=JSON.parse('{"dismiss":"Rejeter"}');var f5={};f5=JSON.parse('{"dismiss":"\u05D4\u05EA\u05E2\u05DC\u05DD"}');var d5={};d5=JSON.parse('{"dismiss":"Odbaci"}');var h5={};h5=JSON.parse('{"dismiss":"Elutas\xEDt\xE1s"}');var p5={};p5=JSON.parse('{"dismiss":"Ignora"}');var g5={};g5=JSON.parse('{"dismiss":"\u9589\u3058\u308B"}');var m5={};m5=JSON.parse('{"dismiss":"\uBB34\uC2DC"}');var v5={};v5=JSON.parse('{"dismiss":"Atmesti"}');var y5={};y5=JSON.parse('{"dismiss":"Ner\u0101d\u012Bt"}');var b5={};b5=JSON.parse('{"dismiss":"Lukk"}');var x5={};x5=JSON.parse('{"dismiss":"Negeren"}');var w5={};w5=JSON.parse('{"dismiss":"Zignoruj"}');var S5={};S5=JSON.parse('{"dismiss":"Descartar"}');var _5={};_5=JSON.parse('{"dismiss":"Dispensar"}');var T5={};T5=JSON.parse('{"dismiss":"Revocare"}');var C5={};C5=JSON.parse('{"dismiss":"\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C"}');var E5={};E5=JSON.parse('{"dismiss":"Zru\u0161i\u0165"}');var P5={};P5=JSON.parse('{"dismiss":"Opusti"}');var O5={};O5=JSON.parse('{"dismiss":"Odbaci"}');var M5={};M5=JSON.parse('{"dismiss":"Avvisa"}');var k5={};k5=JSON.parse('{"dismiss":"Kapat"}');var $5={};$5=JSON.parse('{"dismiss":"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438"}');var D5={};D5=JSON.parse('{"dismiss":"\u53D6\u6D88"}');var A5={};A5=JSON.parse('{"dismiss":"\u95DC\u9589"}'),QP={"ar-AE":e5,"bg-BG":t5,"cs-CZ":r5,"da-DK":n5,"de-DE":i5,"el-GR":o5,"en-US":a5,"es-ES":s5,"et-EE":l5,"fi-FI":u5,"fr-FR":c5,"he-IL":f5,"hr-HR":d5,"hu-HU":h5,"it-IT":p5,"ja-JP":g5,"ko-KR":m5,"lt-LT":v5,"lv-LV":y5,"nb-NO":b5,"nl-NL":x5,"pl-PL":w5,"pt-BR":S5,"pt-PT":_5,"ro-RO":T5,"ru-RU":C5,"sk-SK":E5,"sl-SI":P5,"sr-SP":O5,"sv-SE":M5,"tr-TR":k5,"uk-UA":$5,"zh-CN":D5,"zh-TW":A5};function Ya(e){let u=e,{onDismiss:t}=u,r=ze(u,["onDismiss"]),n=Ll($U(QP)),i=_l(r,n("dismiss")),s=()=>{t&&t()};return ee.createElement(uo,null,ee.createElement("button",Y($({},i),{tabIndex:-1,onClick:s})))}var JU={};Xr(JU,"ariaHideOutside",()=>ZU);let Hl=new WeakMap;function ZU(e,t=document.body){let r=new Set(e),n=new Set,i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode(a){return a instanceof HTMLElement&&a.dataset.liveAnnouncer==="true"&&r.add(a),r.has(a)||n.has(a.parentElement)?NodeFilter.FILTER_REJECT:a instanceof HTMLElement&&a.getAttribute("role")==="row"||e.some(l=>a.contains(l))?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}}),s=a=>{var l;let h=(l=Hl.get(a))!==null&&l!==void 0?l:0;a.getAttribute("aria-hidden")==="true"&&h===0||(h===0&&a.setAttribute("aria-hidden","true"),n.add(a),Hl.set(a,h+1))},u=i.nextNode();for(;u!=null;)s(u),u=i.nextNode();let o=new MutationObserver(a=>{for(let l of a)if(!(l.type!=="childList"||l.addedNodes.length===0)&&![...r,...n].some(h=>h.contains(l.target)))for(let h of l.addedNodes)h instanceof HTMLElement&&h.dataset.liveAnnouncer==="true"?r.add(h):h instanceof Element&&s(h)});return o.observe(t,{childList:!0,subtree:!0}),()=>{o.disconnect();for(let a of n){let l=Hl.get(a);l===1?(a.removeAttribute("aria-hidden"),Hl.delete(a)):Hl.set(a,l-1)}}}function Wl(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var QU={};Wl(QU,"useSelectableCollection",()=>my);function I5(e){return PC()?e.altKey:e.ctrlKey}function Ka(e){return ao()?e.metaKey:e.ctrlKey}var eH={};Wl(eH,"useTypeSelect",()=>gy);function gy(e){let{keyboardDelegate:t,selectionManager:r,onTypeSelect:n}=e,i=C.exports.useRef({search:"",timeout:null}).current,s=u=>{let o=tH(u.key);if(!o||u.ctrlKey||u.metaKey)return;o===" "&&i.search.trim().length>0&&(u.preventDefault(),"continuePropagation"in u||u.stopPropagation()),i.search+=o;let a=t.getKeyForSearch(i.search,r.focusedKey);a==null&&(a=t.getKeyForSearch(i.search)),a!=null&&(r.setFocusedKey(a),n&&n(a)),clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},500)};return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?s:null}}}function tH(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function my(e){let{selectionManager:t,keyboardDelegate:r,ref:n,autoFocus:i=!1,shouldFocusWrap:s=!1,disallowEmptySelection:u=!1,disallowSelectAll:o=!1,selectOnFocus:a=t.selectionBehavior==="replace",disallowTypeAhead:l=!1,shouldUseVirtualFocus:h,allowsTabNavigation:c=!1,isVirtualized:f,scrollRef:d=n}=e,{direction:g}=Rr(),m=_=>{if(_.altKey&&_.key==="Tab"&&_.preventDefault(),!n.current.contains(_.target))return;const E=(K,B)=>{K!=null&&(t.setFocusedKey(K,B),_.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(K):a&&!I5(_)&&t.replaceSelection(K))};switch(_.key){case"ArrowDown":if(r.getKeyBelow){var k,z;_.preventDefault();let K=t.focusedKey!=null?r.getKeyBelow(t.focusedKey):(k=r.getFirstKey)===null||k===void 0?void 0:k.call(r);K==null&&s&&(K=(z=r.getFirstKey)===null||z===void 0?void 0:z.call(r,t.focusedKey)),E(K)}break;case"ArrowUp":if(r.getKeyAbove){var F,j;_.preventDefault();let K=t.focusedKey!=null?r.getKeyAbove(t.focusedKey):(F=r.getLastKey)===null||F===void 0?void 0:F.call(r);K==null&&s&&(K=(j=r.getLastKey)===null||j===void 0?void 0:j.call(r,t.focusedKey)),E(K)}break;case"ArrowLeft":if(r.getKeyLeftOf){_.preventDefault();let K=r.getKeyLeftOf(t.focusedKey);E(K,g==="rtl"?"first":"last")}break;case"ArrowRight":if(r.getKeyRightOf){_.preventDefault();let K=r.getKeyRightOf(t.focusedKey);E(K,g==="rtl"?"last":"first")}break;case"Home":if(r.getFirstKey){_.preventDefault();let K=r.getFirstKey(t.focusedKey,Ka(_));t.setFocusedKey(K),Ka(_)&&_.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(K):a&&t.replaceSelection(K)}break;case"End":if(r.getLastKey){_.preventDefault();let K=r.getLastKey(t.focusedKey,Ka(_));t.setFocusedKey(K),Ka(_)&&_.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(K):a&&t.replaceSelection(K)}break;case"PageDown":if(r.getKeyPageBelow){_.preventDefault();let K=r.getKeyPageBelow(t.focusedKey);E(K)}break;case"PageUp":if(r.getKeyPageAbove){_.preventDefault();let K=r.getKeyPageAbove(t.focusedKey);E(K)}break;case"a":Ka(_)&&t.selectionMode==="multiple"&&o!==!0&&(_.preventDefault(),t.selectAll());break;case"Escape":_.preventDefault(),u||t.clearSelection();break;case"Tab":if(!c){if(_.shiftKey)n.current.focus();else{let K=rr(n.current,{tabbable:!0}),B,H;do H=K.lastChild(),H&&(B=H);while(H);B&&!B.contains(document.activeElement)&&pn(B)}break}}},p=C.exports.useRef({top:0,left:0});Fv(d,"scroll",f?null:()=>{p.current={top:d.current.scrollTop,left:d.current.scrollLeft}});let v=_=>{if(t.isFocused){_.currentTarget.contains(_.target)||t.setFocused(!1);return}if(!!_.currentTarget.contains(_.target)){if(t.setFocused(!0),t.focusedKey==null){let z=j=>{j!=null&&(t.setFocusedKey(j),a&&t.replaceSelection(j))},F=_.relatedTarget;var E,k;F&&_.currentTarget.compareDocumentPosition(F)&Node.DOCUMENT_POSITION_FOLLOWING?z((E=t.lastSelectedKey)!==null&&E!==void 0?E:r.getLastKey()):z((k=t.firstSelectedKey)!==null&&k!==void 0?k:r.getFirstKey())}else if(!f){d.current.scrollTop=p.current.top,d.current.scrollLeft=p.current.left;let z=d.current.querySelector(`[data-key="${t.focusedKey}"]`);z&&(pn(z),Lv(d.current,z))}}},y=_=>{_.currentTarget.contains(_.relatedTarget)||t.setFocused(!1)};const b=C.exports.useRef(i);C.exports.useEffect(()=>{if(b.current){let _=null;i==="first"&&(_=r.getFirstKey()),i==="last"&&(_=r.getLastKey());let E=t.selectedKeys;E.size&&(_=E.values().next().value),t.setFocused(!0),t.setFocusedKey(_),_==null&&!h&&Ra(n.current)}b.current=!1},[]),C.exports.useEffect(()=>{if(!f&&t.focusedKey&&(d==null?void 0:d.current)){let _=d.current.querySelector(`[data-key="${t.focusedKey}"]`);_&&Lv(d.current,_)}},[f,d,t.focusedKey]);let x={onKeyDown:m,onFocus:v,onBlur:y,onMouseDown(_){_.currentTarget.contains(_.target)&&_.preventDefault()}},{typeSelectProps:w}=gy({keyboardDelegate:r,selectionManager:t});l||(x=Ce(w,x));let T;return h||(T=t.focusedKey==null?0:-1),{collectionProps:Y($({},x),{tabIndex:T})}}var rH={};Wl(rH,"useSelectableItem",()=>Pd);function Pd(e){let{selectionManager:t,key:r,ref:n,shouldSelectOnPressUp:i,isVirtualized:s,shouldUseVirtualFocus:u,focus:o,isDisabled:a,onAction:l}=e,h=_=>{if(_.pointerType==="keyboard"&&I5(_))t.toggleSelection(r);else{if(t.selectionMode==="none")return;t.selectionMode==="single"?t.isSelected(r)&&!t.disallowEmptySelection?t.toggleSelection(r):t.replaceSelection(r):_&&_.shiftKey?t.extendSelection(r):t.selectionBehavior==="toggle"||_&&(Ka(_)||_.pointerType==="touch"||_.pointerType==="virtual")?t.toggleSelection(r):t.replaceSelection(r)}},c=r===t.focusedKey;C.exports.useEffect(()=>{c&&t.isFocused&&!u&&document.activeElement!==n.current&&(o?o():Ra(n.current))},[n,c,t.focusedKey,t.childFocusStrategy,t.isFocused,u]);let f={};u||(f={tabIndex:c?0:-1,onFocus(_){_.target===n.current&&t.setFocusedKey(r)}});let d=C.exports.useRef(null),g=l&&t.selectionMode==="none",m=l&&t.selectionMode!=="none"&&t.selectionBehavior==="replace",p=!a&&t.canSelectItem(r),v={};i?(v.onPressStart=_=>{d.current=_.pointerType,_.pointerType==="keyboard"&&h(_)},v.onPressUp=_=>{_.pointerType!=="keyboard"&&h(_)},v.onPress=g?()=>l():null):(v.onPressStart=_=>{d.current=_.pointerType,_.pointerType!=="touch"&&_.pointerType!=="virtual"&&h(_)},v.onPress=_=>{(_.pointerType==="touch"||_.pointerType==="virtual"||g)&&(g||m?l():h(_))}),s||(f["data-key"]=r),v.preventFocusOnPress=u;let{pressProps:y,isPressed:b}=mi(v),x=m?_=>{d.current==="mouse"&&(_.stopPropagation(),_.preventDefault(),l())}:void 0,{longPressProps:w}=Gv({isDisabled:!m,onLongPress(_){_.pointerType==="touch"&&(h(_),t.setSelectionBehavior("toggle"))}});return{itemProps:Ce(f,p||g?y:{},m?w:{},{onKeyUp:m?_=>{_.key==="Enter"&&l()}:void 0,onDoubleClick:x}),isPressed:b}}var nH={};Wl(nH,"useSelectableList",()=>yy);var iH={};Wl(iH,"ListKeyboardDelegate",()=>vy);class vy{getKeyBelow(t){for(t=this.collection.getKeyAfter(t);t!=null;){if(this.collection.getItem(t).type==="item"&&!this.disabledKeys.has(t))return t;t=this.collection.getKeyAfter(t)}}getKeyAbove(t){for(t=this.collection.getKeyBefore(t);t!=null;){if(this.collection.getItem(t).type==="item"&&!this.disabledKeys.has(t))return t;t=this.collection.getKeyBefore(t)}}getFirstKey(){let t=this.collection.getFirstKey();for(;t!=null;){if(this.collection.getItem(t).type==="item"&&!this.disabledKeys.has(t))return t;t=this.collection.getKeyAfter(t)}}getLastKey(){let t=this.collection.getLastKey();for(;t!=null;){if(this.collection.getItem(t).type==="item"&&!this.disabledKeys.has(t))return t;t=this.collection.getKeyBefore(t)}}getItem(t){return this.ref.current.querySelector(`[data-key="${t}"]`)}getKeyPageAbove(t){let r=this.ref.current,n=this.getItem(t);if(!n)return null;let i=Math.max(0,n.offsetTop+n.offsetHeight-r.offsetHeight);for(;n&&n.offsetTop>i;)t=this.getKeyAbove(t),n=this.getItem(t);return t}getKeyPageBelow(t){let r=this.ref.current,n=this.getItem(t);if(!n)return null;let i=Math.min(r.scrollHeight,n.offsetTop-n.offsetHeight+r.offsetHeight);for(;n&&n.offsetTop<i;)t=this.getKeyBelow(t),n=this.getItem(t);return t}getKeyForSearch(t,r){if(!this.collator)return null;let n=this.collection,i=r||this.getFirstKey();for(;i!=null;){let s=n.getItem(i),u=s.textValue.slice(0,t.length);if(s.textValue&&this.collator.compare(u,t)===0)return i;i=this.getKeyBelow(i)}return null}constructor(t,r,n,i){this.collection=t,this.disabledKeys=r,this.ref=n,this.collator=i}}function yy(e){let{selectionManager:t,collection:r,disabledKeys:n,ref:i,keyboardDelegate:s,autoFocus:u,shouldFocusWrap:o,isVirtualized:a,disallowEmptySelection:l,selectOnFocus:h=!1,disallowTypeAhead:c,shouldUseVirtualFocus:f,allowsTabNavigation:d}=e,g=hd({usage:"search",sensitivity:"base"}),m=C.exports.useMemo(()=>s||new vy(r,n,i,g),[s,r,n,i,g]),{collectionProps:p}=my({ref:i,selectionManager:t,keyboardDelegate:m,autoFocus:u,shouldFocusWrap:o,disallowEmptySelection:l,selectOnFocus:h,disallowTypeAhead:c,shouldUseVirtualFocus:f,allowsTabNavigation:d,isVirtualized:a,scrollRef:i});return{listProps:p}}function oH(e){return e&&e.__esModule?e.default:e}function Od(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var aH={};Od(aH,"useMenuTrigger",()=>by);var R5={},F5={};F5=JSON.parse('{"longPressMessage":"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u0627\u064B \u0623\u0648 \u0627\u0636\u063A\u0637 \u0639\u0644\u0649 Alt + \u0627\u0644\u0633\u0647\u0645 \u0644\u0623\u0633\u0641\u0644 \u0644\u0641\u062A\u062D \u0627\u0644\u0642\u0627\u0626\u0645\u0629"}');var L5={};L5=JSON.parse('{"longPressMessage":"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E \u0438\u043B\u0438 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 Alt+ \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043D\u0430\u0434\u043E\u043B\u0443, \u0437\u0430 \u0434\u0430 \u043E\u0442\u0432\u043E\u0440\u0438\u0442\u0435 \u043C\u0435\u043D\u044E\u0442\u043E"}');var N5={};N5=JSON.parse('{"longPressMessage":"Dlouh\xFDm stiskem nebo stisknut\xEDm kl\xE1ves Alt + \u0161ipka dol\u016F otev\u0159ete nab\xEDdku"}');var z5={};z5=JSON.parse('{"longPressMessage":"Langt tryk eller tryk p\xE5 Alt + pil ned for at \xE5bne menuen"}');var j5={};j5=JSON.parse('{"longPressMessage":"Dr\xFCcken Sie lange oder dr\xFCcken Sie Alt + Nach-unten, um das Men\xFC zu \xF6ffnen"}');var B5={};B5=JSON.parse('{"longPressMessage":"\u03A0\u03B9\u03AD\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03AE \u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 Alt + \u03BA\u03AC\u03C4\u03C9 \u03B2\u03AD\u03BB\u03BF\u03C2 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B1\u03BD\u03BF\u03AF\u03BE\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BC\u03B5\u03BD\u03BF\u03CD"}');var V5={};V5=JSON.parse('{"longPressMessage":"Long press or press Alt + ArrowDown to open menu"}');var U5={};U5=JSON.parse('{"longPressMessage":"Mantenga pulsado o pulse Alt + flecha abajo para abrir el men\xFA"}');var H5={};H5=JSON.parse('{"longPressMessage":"Men\xFC\xFC avamiseks vajutage pikalt v\xF5i vajutage klahve Alt + allanool"}');var W5={};W5=JSON.parse('{"longPressMessage":"Avaa valikko painamalla pohjassa tai n\xE4pp\xE4inyhdistelm\xE4ll\xE4 Alt + Alanuoli"}');var Y5={};Y5=JSON.parse('{"longPressMessage":"Appuyez de mani\xE8re prolong\xE9e ou appuyez sur Alt\xA0+\xA0Fl\xE8che vers le bas pour ouvrir le menu."}');var K5={};K5=JSON.parse('{"longPressMessage":"\u05DC\u05D7\u05E5 \u05DC\u05D7\u05D9\u05E6\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05D0\u05D5 \u05D4\u05E7\u05E9 Alt + ArrowDown \u05DB\u05D3\u05D9 \u05DC\u05E4\u05EA\u05D5\u05D7 \u05D0\u05EA \u05D4\u05EA\u05E4\u05E8\u05D9\u05D8"}');var X5={};X5=JSON.parse('{"longPressMessage":"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"}');var G5={};G5=JSON.parse('{"longPressMessage":"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele ny\xEDl gombot a men\xFC megnyit\xE1s\xE1hoz"}');var q5={};q5=JSON.parse('{"longPressMessage":"Premere a lungo o premere Alt + Freccia gi\xF9 per aprire il menu"}');var J5={};J5=JSON.parse('{"longPressMessage":"\u9577\u62BC\u3057\u307E\u305F\u306F Alt+\u4E0B\u77E2\u5370\u30AD\u30FC\u3067\u30E1\u30CB\u30E5\u30FC\u3092\u958B\u304F"}');var Z5={};Z5=JSON.parse('{"longPressMessage":"\uAE38\uAC8C \uB204\uB974\uAC70\uB098 Alt + \uC544\uB798\uCABD \uD654\uC0B4\uD45C\uB97C \uB20C\uB7EC \uBA54\uB274 \uC5F4\uAE30"}');var Q5={};Q5=JSON.parse('{"longPressMessage":"Nor\u0117dami atidaryti meniu, nuspaud\u0119 palaikykite arba paspauskite \u201EAlt + ArrowDown\u201C."}');var eO={};eO=JSON.parse('{"longPressMessage":"Lai atv\u0113rtu izv\u0113lni, turiet nospiestu vai nospiediet tausti\u0146u kombin\u0101ciju Alt + lejupv\u0113rst\u0101 bulti\u0146a"}');var tO={};tO=JSON.parse('{"longPressMessage":"Langt trykk eller trykk Alt + PilNed for \xE5 \xE5pne menyen"}');var rO={};rO=JSON.parse('{"longPressMessage":"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"}');var nO={};nO=JSON.parse('{"longPressMessage":"Naci\u015Bnij i przytrzymaj lub naci\u015Bnij klawisze Alt + Strza\u0142ka w d\xF3\u0142, aby otworzy\u0107 menu"}');var iO={};iO=JSON.parse('{"longPressMessage":"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"}');var oO={};oO=JSON.parse('{"longPressMessage":"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"}');var aO={};aO=JSON.parse('{"longPressMessage":"Ap\u0103sa\u021Bi lung sau ap\u0103sa\u021Bi pe Alt + s\u0103geat\u0103 \xEEn jos pentru a deschide meniul"}');var sO={};sO=JSON.parse('{"longPressMessage":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0438\u043B\u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 Alt + \u0421\u0442\u0440\u0435\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E"}');var lO={};lO=JSON.parse('{"longPressMessage":"Ponuku otvor\xEDte dlh\xFDm stla\u010Den\xEDm alebo stla\u010Den\xEDm kl\xE1vesu Alt + kl\xE1vesu so \u0161\xEDpkou nadol"}');var uO={};uO=JSON.parse('{"longPressMessage":"Za odprtje menija pritisnite in dr\u017Eite gumb ali pritisnite Alt+pu\u0161\u010Dica navzdol"}');var cO={};cO=JSON.parse('{"longPressMessage":"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"}');var fO={};fO=JSON.parse('{"longPressMessage":"H\xE5ll nedtryckt eller tryck p\xE5 Alt + pil ned\xE5t f\xF6r att \xF6ppna menyn"}');var dO={};dO=JSON.parse('{"longPressMessage":"Men\xFCy\xFC a\xE7mak i\xE7in uzun bas\u0131n veya Alt + A\u015Fa\u011F\u0131 Ok tu\u015Funa bas\u0131n"}');var hO={};hO=JSON.parse('{"longPressMessage":"\u0414\u043E\u0432\u0433\u043E \u0430\u0431\u043E \u0437\u0432\u0438\u0447\u0430\u0439\u043D\u043E \u043D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u043A\u043E\u043C\u0431\u0456\u043D\u0430\u0446\u0456\u044E \u043A\u043B\u0430\u0432\u0456\u0448 Alt \u0456 \u0441\u0442\u0440\u0456\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0449\u043E\u0431 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u043C\u0435\u043D\u044E"}');var pO={};pO=JSON.parse('{"longPressMessage":"\u957F\u6309\u6216\u6309 Alt + \u5411\u4E0B\u65B9\u5411\u952E\u4EE5\u6253\u5F00\u83DC\u5355"}');var gO={};gO=JSON.parse('{"longPressMessage":"\u9577\u6309\u6216\u6309 Alt+\u5411\u4E0B\u9375\u4EE5\u958B\u555F\u529F\u80FD\u8868"}'),R5={"ar-AE":F5,"bg-BG":L5,"cs-CZ":N5,"da-DK":z5,"de-DE":j5,"el-GR":B5,"en-US":V5,"es-ES":U5,"et-EE":H5,"fi-FI":W5,"fr-FR":Y5,"he-IL":K5,"hr-HR":X5,"hu-HU":G5,"it-IT":q5,"ja-JP":J5,"ko-KR":Z5,"lt-LT":Q5,"lv-LV":eO,"nb-NO":tO,"nl-NL":rO,"pl-PL":nO,"pt-BR":iO,"pt-PT":oO,"ro-RO":aO,"ru-RU":sO,"sk-SK":lO,"sl-SI":uO,"sr-SP":cO,"sv-SE":fO,"tr-TR":dO,"uk-UA":hO,"zh-CN":pO,"zh-TW":gO};function by(e,t,r){let{type:n="menu",isDisabled:i,trigger:s="press"}=e,u=Kt(),{triggerProps:o,overlayProps:a}=hy({type:n},t,r),l=d=>{if(!i&&!(s==="longPress"&&!d.altKey)&&r&&r.current)switch(d.key){case"Enter":case" ":if(s==="longPress")return;case"ArrowDown":"continuePropagation"in d||d.stopPropagation(),d.preventDefault(),t.toggle("first");break;case"ArrowUp":"continuePropagation"in d||d.stopPropagation(),d.preventDefault(),t.toggle("last");break}},h=Ll(oH(R5)),{longPressProps:c}=Gv({accessibilityDescription:h("longPressMessage"),onLongPressStart(){t.close()},onLongPress(){t.open("first")}});return o=Ce(o,s==="press"?{onPressStart(d){d.pointerType!=="touch"&&d.pointerType!=="keyboard"&&!i&&t.toggle(d.pointerType==="virtual"?"first":null)},onPress(d){d.pointerType==="touch"&&!i&&t.toggle()}}:c),{menuTriggerProps:Y($({},o),{id:u,onKeyDown:l}),menuProps:Y($({},a),{"aria-labelledby":u})}}var sH={};Od(sH,"useMenu",()=>mO);function mO(e,t,r){let o=e,{shouldFocusWrap:n=!0}=o,i=ze(o,["shouldFocusWrap"]);!e["aria-label"]&&!e["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let s=_r(e,{labelable:!0}),{listProps:u}=yy(Y($({},i),{ref:r,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,shouldFocusWrap:n}));return{menuProps:Ce(s,$({role:"menu"},u))}}var lH={};Od(lH,"useMenuItem",()=>vO);function vO(e,t,r){let{isSelected:n,isDisabled:i,key:s,onClose:u,closeOnSelect:o,isVirtualized:a,onAction:l}=e,h="menuitem";t.selectionManager.selectionMode==="single"?h="menuitemradio":t.selectionManager.selectionMode==="multiple"&&(h="menuitemcheckbox");let c=kn(),f=kn(),d=kn(),g={"aria-disabled":i,role:h,"aria-label":e["aria-label"],"aria-labelledby":c,"aria-describedby":[f,d].filter(Boolean).join(" ")||void 0};t.selectionManager.selectionMode!=="none"&&(g["aria-checked"]=n),a&&(g["aria-posinset"]=t.collection.getItem(s).index,g["aria-setsize"]=td(t.collection));let m=w=>{if(!w.repeat)switch(w.key){case" ":!i&&t.selectionManager.selectionMode==="none"&&o!==!1&&u&&u();break;case"Enter":!i&&o!==!1&&u&&u();break}},p=w=>{w.pointerType==="keyboard"&&l&&l(s)},v=w=>{w.pointerType!=="keyboard"&&(l&&l(s),u&&(o!=null?o:t.selectionManager.selectionMode!=="multiple")&&u())},{itemProps:y}=Pd({selectionManager:t.selectionManager,key:s,ref:r,shouldSelectOnPressUp:!0}),{pressProps:b}=mi({onPressStart:p,onPressUp:v,isDisabled:i}),{hoverProps:x}=vi({isDisabled:i,onHoverStart(){lo()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(s))}});return{menuItemProps:$($({},g),Ce(y,b,x,{onKeyDown:m})),labelProps:{id:c},descriptionProps:{id:f},keyboardShortcutProps:{id:d}}}var uH={};Od(uH,"useMenuSection",()=>cH);function cH(e){let{heading:t,"aria-label":r}=e,n=Kt();return{itemProps:{role:"presentation"},headingProps:t?{id:n,"aria-hidden":!0}:{},groupProps:{role:"group","aria-label":r,"aria-labelledby":t?n:void 0}}}const fH=700;function yO(){return Cf()||typeof window=="undefined"?!1:window.screen.width<=fH}const xy="bg-paper shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none rounded overflow-hidden",wy={initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{type:"tween",duration:.125}};function Sy(e){var a;const o=e,{children:t,className:r,type:n}=o,i=ze(o,["children","className","type"]),s=C.exports.useContext(PE);let u;return n==="modal"?u="z-modal":n==="popover"?u="z-popover":u="z-tray",S(ZP,Y($({className:Ee("isolate absolute top-0 left-0",n!=="popover"&&"w-full h-full",u,r),portalContainer:(a=s==null?void 0:s.portalContainer)==null?void 0:a.current},i),{children:t}))}const _y=ee.forwardRef((e,t)=>{const f=e,{children:r,onClose:n,isOpen:i,shouldCloseOnBlur:s,hideArrow:u,isKeyboardDismissDisabled:o,isNonModal:a,isDismissable:l=!0,preventScroll:h=!0}=f,c=ze(f,["children","onClose","isOpen","shouldCloseOnBlur","hideArrow","isKeyboardDismissDisabled","isNonModal","isDismissable","preventScroll"]);return Td({isDisabled:!h}),S(Sy,{type:"popover",children:S(dH,Y($({},c),{ref:t,shouldCloseOnBlur:s,isKeyboardDismissDisabled:o,hideArrow:u,isNonModal:a,isDismissable:l,isOpen:i,onClose:n,children:r}))})}),dH=ee.forwardRef((e,t)=>{const g=e,{children:r,isOpen:n,onClose:i,hideArrow:s,shouldCloseOnBlur:u,isKeyboardDismissDisabled:o,isNonModal:a,isDismissable:l}=g,h=ze(g,["children","isOpen","onClose","hideArrow","shouldCloseOnBlur","isKeyboardDismissDisabled","isNonModal","isDismissable"]),c=kv(t),{overlayProps:f}=_d(Y($({},e),{isDismissable:l&&n}),c),{modalProps:d}=Ed({isDisabled:a});return ce(Yt.div,Y($($({ref:c},wy),Ce(h,f,d)),{className:xy,role:"presentation",children:[r,s?null:S(hH,{popoverPlacement:"bottom"})]}))});function hH({popoverPlacement:e}){const t=Ee("absolute fill-background",e==="top"&&"-translate-x-1/2 left-1/2",e==="bottom"&&"-translate-x-1/2 left-1/2 rotate-180",e==="left"&&"-translate-y-1/2 top-1/2 rotate-90",e==="right"&&"-translate-y-1/2 top-1/2 -rotate-90");return S("svg",{className:t,width:"16",height:"8",viewBox:"0 0 30 10",preserveAspectRatio:"none",children:S("polygon",{points:"0,0 30,0 15,10"})})}const Ty=ee.createContext(null);function pH(){return C.exports.useContext(Ty)}function Cy({disableInitialTransition:e,position:t}){return S(Yt.div,{className:`w-full h-full bg-black/30 ${t||"absolute"} top-0 left-0 z-10`,"aria-hidden":!0,initial:{opacity:e?1:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}})}function Ey(e){const h=e,{children:t,isOpen:r,onClose:n,isFixedHeight:i,isNonModal:s}=h,u=ze(h,["children","isOpen","onClose","isFixedHeight","isNonModal"]),o=C.exports.useRef(null),{overlayProps:a,underlayProps:l}=_d(Y($({},e),{isDismissable:!0}),o);return ce(Sy,Y($({type:"tray"},u),{children:[S(Cy,$({},l)),S(gH,{onClose:n,ref:o,overlayProps:a,isFixedHeight:i,isNonModal:s,children:t})]}))}const gH=C.exports.forwardRef((e,t)=>{const m=e,{children:r,isOpen:n,isFixedHeight:i,isNonModal:s,overlayProps:u}=m,o=ze(m,["children","isOpen","isFixedHeight","isNonModal","overlayProps"]);Td();const{modalProps:a}=Ed({isDisabled:s}),l=_C(),[h,c]=C.exports.useState(l.height),f=C.exports.useRef();C.exports.useEffect(()=>{clearTimeout(f.current),l.height<h&&l.height<window.innerHeight?f.current=setTimeout(()=>{c(l.height)},500):c(l.height)},[h,l.height]);const d={maxHeight:`${l.height-64}px`},g=Ce(o,u,{style:d});return S(Yt.div,{initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},transition:{type:"tween",duration:.2},className:"absolute bottom-0 left-0 w-full z-20",children:S("div",Y($($({},g),a),{className:"max-w-375 w-full pb-safe-area mx-auto bg-paper rounded shadow-lg",ref:t,children:r}))})});function Yl(e){return e.split("-")[0]}function Py(e){return e.split("-")[1]}function Md(e){return["top","bottom"].includes(Yl(e))?"x":"y"}function bO(e){return e==="y"?"height":"width"}function xO(e,t,r){let{reference:n,floating:i}=e;const s=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,o=Md(t),a=bO(o),l=n[a]/2-i[a]/2,h=o==="x";let c;switch(Yl(t)){case"top":c={x:s,y:n.y-i.height};break;case"bottom":c={x:s,y:n.y+n.height};break;case"right":c={x:n.x+n.width,y:u};break;case"left":c={x:n.x-i.width,y:u};break;default:c={x:n.x,y:n.y}}switch(Py(t)){case"start":c[o]-=l*(r&&h?-1:1);break;case"end":c[o]+=l*(r&&h?-1:1)}return c}const mH=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:u}=r,o=await(u.isRTL==null?void 0:u.isRTL(t));let a=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:h}=xO(a,n,o),c=n,f={};for(let d=0;d<s.length;d++){const{name:g,fn:m}=s[d],{x:p,y:v,data:y,reset:b}=await m({x:l,y:h,initialPlacement:n,placement:c,strategy:i,middlewareData:f,rects:a,platform:u,elements:{reference:e,floating:t}});l=p!=null?p:l,h=v!=null?v:h,f=Y($({},f),{[g]:$($({},f[g]),y)}),b&&(typeof b=="object"&&(b.placement&&(c=b.placement),b.rects&&(a=b.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:i}):b.rects),{x:l,y:h}=xO(a,c,o)),d=-1)}return{x:l,y:h,placement:c,strategy:i,middlewareData:f}};function vH(e){return typeof e!="number"?function(t){return $({top:0,right:0,bottom:0,left:0},t)}(e):{top:e,right:e,bottom:e,left:e}}function kd(e){return Y($({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}async function wO(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:s,rects:u,elements:o,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:c="floating",altBoundary:f=!1,padding:d=0}=t,g=vH(d),m=o[f?c==="floating"?"reference":"floating":c],p=kd(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(m)))==null||r?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:h})),v=kd(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:c==="floating"?Y($({},u.floating),{x:n,y:i}):u.reference,offsetParent:await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),strategy:a}):u[c]);return{top:p.top-v.top+g.top,bottom:v.bottom-p.bottom+g.bottom,left:p.left-v.left+g.left,right:v.right-p.right+g.right}}const yH=Math.min,bH=Math.max;function SO(e,t,r){return bH(e,yH(t,r))}const xH={left:"right",right:"left",bottom:"top",top:"bottom"};function $d(e){return e.replace(/left|right|bottom|top/g,t=>xH[t])}function wH(e,t,r){r===void 0&&(r=!1);const n=Py(e),i=Md(e),s=bO(i);let u=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(u=$d(u)),{main:u,cross:$d(u)}}const SH={start:"end",end:"start"};function _O(e){return e.replace(/start|end/g,t=>SH[t])}["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const _H=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,middlewareData:i,rects:s,initialPlacement:u,platform:o,elements:a}=t,E=e,{mainAxis:l=!0,crossAxis:h=!0,fallbackPlacements:c,fallbackStrategy:f="bestFit",flipAlignment:d=!0}=E,g=ze(E,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"]),m=Yl(n),p=c||(m===u||!d?[$d(u)]:function(k){const z=$d(k);return[_O(k),z,_O(z)]}(u)),v=[u,...p],y=await wO(t,g),b=[];let x=((r=i.flip)==null?void 0:r.overflows)||[];if(l&&b.push(y[m]),h){const{main:k,cross:z}=wH(n,s,await(o.isRTL==null?void 0:o.isRTL(a.floating)));b.push(y[k],y[z])}if(x=[...x,{placement:n,overflows:b}],!b.every(k=>k<=0)){var w,T;const k=((w=(T=i.flip)==null?void 0:T.index)!=null?w:0)+1,z=v[k];if(z)return{data:{index:k,overflows:x},reset:{placement:z}};let F="bottom";switch(f){case"bestFit":{var _;const j=(_=x.slice().sort((K,B)=>K.overflows.filter(H=>H>0).reduce((H,ue)=>H+ue,0)-B.overflows.filter(H=>H>0).reduce((H,ue)=>H+ue,0))[0])==null?void 0:_.placement;j&&(F=j);break}case"initialPlacement":F=u}if(n!==F)return{reset:{placement:F}}}return{}}}},TH=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n,placement:i,rects:s,platform:u,elements:o}=t,a=function(l,h,c,f){f===void 0&&(f=!1);const d=Yl(l),g=Py(l),m=Md(l)==="x",p=["left","top"].includes(d)?-1:1,v=f&&m?-1:1,y=typeof c=="function"?c(Y($({},h),{placement:l})):c,b=typeof y=="number";let{mainAxis:x,crossAxis:w,alignmentAxis:T}=b?{mainAxis:y,crossAxis:0,alignmentAxis:null}:$({mainAxis:0,crossAxis:0,alignmentAxis:null},y);return g&&typeof T=="number"&&(w=g==="end"?-1*T:T),m?{x:w*v,y:x*p}:{x:x*p,y:w*v}}(i,s,e,await(u.isRTL==null?void 0:u.isRTL(o.floating)));return{x:r+a.x,y:n+a.y,data:a}}}};function CH(e){return e==="x"?"y":"x"}const EH=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,p=e,{mainAxis:s=!0,crossAxis:u=!1,limiter:o={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}}}=p,a=ze(p,["mainAxis","crossAxis","limiter"]),l={x:r,y:n},h=await wO(t,a),c=Md(Yl(i)),f=CH(c);let d=l[c],g=l[f];if(s){const v=c==="y"?"bottom":"right";d=SO(d+h[c==="y"?"top":"left"],d,d-h[v])}if(u){const v=f==="y"?"bottom":"right";g=SO(g+h[f==="y"?"top":"left"],g,g-h[v])}const m=o.fn(Y($({},t),{[c]:d,[f]:g}));return Y($({},m),{data:{x:m.x-r,y:m.y-n}})}}};function Oy(e){return(e==null?void 0:e.toString())==="[object Window]"}function Si(e){if(e==null)return window;if(!Oy(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Kl(e){return Si(e).getComputedStyle(e)}function Nn(e){return Oy(e)?"":e?(e.nodeName||"").toLowerCase():""}function yn(e){return e instanceof Si(e).HTMLElement}function Dd(e){return e instanceof Si(e).Element}function My(e){return e instanceof Si(e).ShadowRoot||e instanceof ShadowRoot}function Ad(e){const{overflow:t,overflowX:r,overflowY:n}=Kl(e);return/auto|scroll|overlay|hidden/.test(t+n+r)}function PH(e){return["table","td","th"].includes(Nn(e))}function TO(e){const t=navigator.userAgent.toLowerCase().includes("firefox"),r=Kl(e);return r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].includes(r.willChange)||t&&r.willChange==="filter"||t&&!!r.filter&&r.filter!=="none"}const CO=Math.min,Xl=Math.max,Id=Math.round;function vo(e,t){t===void 0&&(t=!1);const r=e.getBoundingClientRect();let n=1,i=1;return t&&yn(e)&&(n=e.offsetWidth>0&&Id(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Id(r.height)/e.offsetHeight||1),{width:r.width/n,height:r.height/i,top:r.top/i,right:r.right/n,bottom:r.bottom/i,left:r.left/n,x:r.left/n,y:r.top/i}}function _i(e){return(t=e,(t instanceof Si(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function Rd(e){return Oy(e)?{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}:{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function EO(e){return vo(_i(e)).left+Rd(e).scrollLeft}function OH(e,t,r){const n=yn(t),i=_i(t),s=vo(e,n&&function(a){const l=vo(a);return Id(l.width)!==a.offsetWidth||Id(l.height)!==a.offsetHeight}(t));let u={scrollLeft:0,scrollTop:0};const o={x:0,y:0};if(n||!n&&r!=="fixed")if((Nn(t)!=="body"||Ad(i))&&(u=Rd(t)),yn(t)){const a=vo(t,!0);o.x=a.x+t.clientLeft,o.y=a.y+t.clientTop}else i&&(o.x=EO(i));return{x:s.left+u.scrollLeft-o.x,y:s.top+u.scrollTop-o.y,width:s.width,height:s.height}}function ky(e){return Nn(e)==="html"?e:e.assignedSlot||e.parentNode||(My(e)?e.host:null)||_i(e)}function PO(e){return yn(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function $y(e){const t=Si(e);let r=PO(e);for(;r&&PH(r)&&getComputedStyle(r).position==="static";)r=PO(r);return r&&(Nn(r)==="html"||Nn(r)==="body"&&getComputedStyle(r).position==="static"&&!TO(r))?t:r||function(n){let i=ky(n);for(My(i)&&(i=i.host);yn(i)&&!["html","body"].includes(Nn(i));){if(TO(i))return i;i=i.parentNode}return null}(e)||t}function OO(e){if(yn(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=vo(e);return{width:t.width,height:t.height}}function MO(e){const t=ky(e);return["html","body","#document"].includes(Nn(t))?e.ownerDocument.body:yn(t)&&Ad(t)?t:MO(t)}function kO(e,t){var r;t===void 0&&(t=[]);const n=MO(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),s=Si(n),u=i?[s].concat(s.visualViewport||[],Ad(n)?n:[]):n,o=t.concat(u);return i?o:o.concat(kO(ky(u)))}function $O(e,t){return t==="viewport"?kd(function(r){const n=Si(r),i=_i(r),s=n.visualViewport;let u=i.clientWidth,o=i.clientHeight,a=0,l=0;return s&&(u=s.width,o=s.height,Math.abs(n.innerWidth/s.scale-s.width)<.01&&(a=s.offsetLeft,l=s.offsetTop)),{width:u,height:o,x:a,y:l}}(e)):Dd(t)?function(r){const n=vo(r),i=n.top+r.clientTop,s=n.left+r.clientLeft;return{top:i,left:s,x:s,y:i,right:s+r.clientWidth,bottom:i+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t):kd(function(r){var n;const i=_i(r),s=Rd(r),u=(n=r.ownerDocument)==null?void 0:n.body,o=Xl(i.scrollWidth,i.clientWidth,u?u.scrollWidth:0,u?u.clientWidth:0),a=Xl(i.scrollHeight,i.clientHeight,u?u.scrollHeight:0,u?u.clientHeight:0);let l=-s.scrollLeft+EO(r);const h=-s.scrollTop;return Kl(u||i).direction==="rtl"&&(l+=Xl(i.clientWidth,u?u.clientWidth:0)-o),{width:o,height:a,x:l,y:h}}(_i(e)))}function MH(e){const t=kO(e),r=["absolute","fixed"].includes(Kl(e).position)&&yn(e)?$y(e):e;return Dd(r)?t.filter(n=>Dd(n)&&function(i,s){const u=s.getRootNode==null?void 0:s.getRootNode();if(i.contains(s))return!0;if(u&&My(u)){let o=s;do{if(o&&i===o)return!0;o=o.parentNode||o.host}while(o)}return!1}(n,r)&&Nn(n)!=="body"):[]}const kH={getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n}=e;const i=[...r==="clippingAncestors"?MH(t):[].concat(r),n],s=i[0],u=i.reduce((o,a)=>{const l=$O(t,a);return o.top=Xl(l.top,o.top),o.right=CO(l.right,o.right),o.bottom=CO(l.bottom,o.bottom),o.left=Xl(l.left,o.left),o},$O(t,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const i=yn(r),s=_i(r);if(r===s)return t;let u={scrollLeft:0,scrollTop:0};const o={x:0,y:0};if((i||!i&&n!=="fixed")&&((Nn(r)!=="body"||Ad(s))&&(u=Rd(r)),yn(r))){const a=vo(r,!0);o.x=a.x+r.clientLeft,o.y=a.y+r.clientTop}return Y($({},t),{x:t.x-u.scrollLeft+o.x,y:t.y-u.scrollTop+o.y})},isElement:Dd,getDimensions:OO,getOffsetParent:$y,getDocumentElement:_i,getElementRects:e=>{let{reference:t,floating:r,strategy:n}=e;return{reference:OH(t,$y(r),n),floating:Y($({},OO(r)),{x:0,y:0})}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Kl(e).direction==="rtl"},$H=(e,t,r)=>mH(e,t,$({platform:kH},r));var DO=typeof document!="undefined"?C.exports.useLayoutEffect:C.exports.useEffect;function Dy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Dy(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&e.$$typeof)&&!Dy(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function DH(e){let{middleware:t,placement:r="bottom",strategy:n="absolute"}=e===void 0?{}:e;const i=C.exports.useRef(null),s=C.exports.useRef(null),[u,o]=C.exports.useState({x:null,y:null,strategy:n,placement:r,middlewareData:{}}),[a,l]=C.exports.useState(t);Dy(a==null?void 0:a.map(m=>{let{options:p}=m;return p}),t==null?void 0:t.map(m=>{let{options:p}=m;return p}))||l(t);const h=C.exports.useRef(!0);DO(()=>(h.current=!0,()=>{h.current=!1}),[]);const c=C.exports.useCallback(()=>{!i.current||!s.current||$H(i.current,s.current,{middleware:a,placement:r,strategy:n}).then(m=>{h.current&&o(m)})},[a,r,n]);DO(c,[c]);const f=C.exports.useCallback(m=>{i.current=m,c()},[c]),d=C.exports.useCallback(m=>{s.current=m,c()},[c]),g=C.exports.useMemo(()=>({reference:i,floating:s}),[]);return C.exports.useMemo(()=>Y($({},u),{update:c,refs:g,reference:f,floating:d}),[u,c,g,f,d])}function Ay({shouldFlip:e=!0,offset:t=5,containerPadding:r=16}){const{x:n,y:i,reference:s,floating:u,strategy:o,refs:a}=DH({placement:"bottom",middleware:[TH(t),_H({padding:r,crossAxis:e,mainAxis:e}),EH({padding:r})]});return{triggerRef:s,triggerObjRef:a.reference,overlayRef:u,overlayObjRef:a.floating,objRefs:a,positionStyle:{position:o,top:i!=null?i:"",left:n!=null?n:""}}}function AH(e){const{children:t,closeOnSelect:r,shouldFlip:n=!0}=e,[i,s]=ee.Children.toArray(t),u=_0(e),{triggerRef:o,overlayRef:a,positionStyle:l,triggerObjRef:h}=Ay({shouldFlip:n}),{menuTriggerProps:c,menuProps:f}=by({},u,h),d=yO(),g=Y($({},f),{onClose:u.close,closeOnSelect:r,autoFocus:u.focusStrategy||!0}),m=ce(qf,{restoreFocus:!0,contain:d,children:[S(Ya,{onDismiss:u.close}),s,S(Ya,{onDismiss:u.close})]});let p;return d?p=S(Ey,{isOpen:u.isOpen,onClose:u.close,children:m}):p=S(_y,{isOpen:u.isOpen,style:l,ref:a,hideArrow:!0,onClose:u.close,shouldCloseOnBlur:!0,children:m}),ce(xr,{children:[i&&ee.cloneElement(i,Y($({},c),{ref:o,isPressed:u.isOpen})),S(fn,{children:u.isOpen&&S(Ty.Provider,{value:g,children:p})})]})}function AO(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var IH={};AO(IH,"useMultipleSelectionState",()=>Iy);class bn extends Set{constructor(t,r,n){super(t);t instanceof bn?(this.anchorKey=r||t.anchorKey,this.currentKey=n||t.currentKey):(this.anchorKey=r,this.currentKey=n)}}function RH(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}function Iy(e){let{selectionMode:t="none",disallowEmptySelection:r,allowDuplicateSelectionEvents:n}=e,i=C.exports.useRef(!1),[,s]=C.exports.useState(!1),u=C.exports.useRef(null),o=C.exports.useRef(null),[,a]=C.exports.useState(null),l=C.exports.useMemo(()=>IO(e.selectedKeys),[e.selectedKeys]),h=C.exports.useMemo(()=>IO(e.defaultSelectedKeys,new bn),[e.defaultSelectedKeys]),[c,f]=Mn(l,h,e.onSelectionChange),d=C.exports.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[g,m]=C.exports.useState(e.selectionBehavior||"toggle");return e.selectionBehavior==="replace"&&g==="toggle"&&typeof c=="object"&&c.size===0&&m("replace"),{selectionMode:t,disallowEmptySelection:r,selectionBehavior:g,setSelectionBehavior:m,get isFocused(){return i.current},setFocused(p){i.current=p,s(p)},get focusedKey(){return u.current},get childFocusStrategy(){return o.current},setFocusedKey(p,v="first"){u.current=p,o.current=v,a(p)},selectedKeys:c,setSelectedKeys(p){(n||!RH(p,c))&&f(p)},disabledKeys:d}}function IO(e,t){return e?e==="all"?"all":new bn(e):t}var FH={};AO(FH,"SelectionManager",()=>Ry);class Ry{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}get isFocused(){return this.state.isFocused}setFocused(t){this.state.setFocused(t)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(t,r){this.state.setFocusedKey(t,r)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(t){return this.state.selectionMode==="none"?!1:(t=this.getKey(t),this.state.selectedKeys==="all"?!this.state.disabledKeys.has(t):this.state.selectedKeys.has(t))}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let t=this.getSelectAllKeys(),r=this.state.selectedKeys;return this._isSelectAll=t.every(n=>r.has(n)),this._isSelectAll}get firstSelectedKey(){let t=null;for(let r of this.state.selectedKeys){let n=this.collection.getItem(r);(!t||(n==null?void 0:n.index)<t.index)&&(t=n)}return t==null?void 0:t.key}get lastSelectedKey(){let t=null;for(let r of this.state.selectedKeys){let n=this.collection.getItem(r);(!t||(n==null?void 0:n.index)>t.index)&&(t=n)}return t==null?void 0:t.key}extendSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(t);return}t=this.getKey(t);let r;if(this.state.selectedKeys==="all")r=new bn([t],t,t);else{let n=this.state.selectedKeys,i=n.anchorKey||t;r=new bn(n,i,t);for(let s of this.getKeyRange(i,n.currentKey||t))r.delete(s);for(let s of this.getKeyRange(t,i))this.state.disabledKeys.has(s)||r.add(s)}this.state.setSelectedKeys(r)}getKeyRange(t,r){let n=this.collection.getItem(t),i=this.collection.getItem(r);return n&&i?n.index<=i.index?this.getKeyRangeInternal(t,r):this.getKeyRangeInternal(r,t):[]}getKeyRangeInternal(t,r){let n=[],i=t;for(;i;){let s=this.collection.getItem(i);if((s&&s.type==="item"||s.type==="cell"&&this.allowsCellSelection)&&n.push(i),i===r)return n;i=this.collection.getKeyAfter(i)}return[]}getKey(t){let r=this.collection.getItem(t);if(!r||r.type==="cell"&&this.allowsCellSelection)return t;for(;r.type!=="item"&&r.parentKey!=null;)r=this.collection.getItem(r.parentKey);return!r||r.type!=="item"?null:r.key}toggleSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}if(t=this.getKey(t),t==null)return;let r=new bn(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(t)?r.delete(t):(r.add(t),r.anchorKey=t,r.currentKey=t),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){this.selectionMode!=="none"&&(t=this.getKey(t),t!=null&&this.state.setSelectedKeys(new bn([t],t,t)))}setSelectedKeys(t){if(this.selectionMode==="none")return;let r=new bn;for(let n of t)if(n=this.getKey(n),n!=null&&(r.add(n),this.selectionMode==="single"))break;this.state.setSelectedKeys(r)}getSelectAllKeys(){let t=[],r=n=>{for(;n;){if(!this.state.disabledKeys.has(n)){let i=this.collection.getItem(n);i.type==="item"&&t.push(n),i.hasChildNodes&&(this.allowsCellSelection||i.type!=="item")&&r([...i.childNodes][0].key)}n=this.collection.getKeyAfter(n)}};return r(this.collection.getFirstKey()),t}selectAll(){this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new bn)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(t,r){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(t)&&!this.disallowEmptySelection?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior==="toggle"||r&&(r.pointerType==="touch"||r.pointerType==="virtual")?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys)return!0;let r=this.selectedKeys;if(t.size!==r.size)return!1;for(let n of t)if(!r.has(n))return!1;for(let n of r)if(!t.has(n))return!1;return!0}canSelectItem(t){if(this.state.selectionMode==="none"||this.state.disabledKeys.has(t))return!1;let r=this.collection.getItem(t);return!(!r||r.type==="cell"&&!this.allowsCellSelection)}constructor(t,r,n){this.collection=t,this.state=r;var i;this.allowsCellSelection=(i=n==null?void 0:n.allowsCellSelection)!==null&&i!==void 0?i:!1,this._isSelectAll=null}}function LH(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var NH={};LH(NH,"useTreeState",()=>RO);var zH=Symbol.iterator;class jH{*[zH](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let r=this.keyMap.get(t);return r?r.prevKey:null}getKeyAfter(t){let r=this.keyMap.get(t);return r?r.nextKey:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const r=[...this.getKeys()];return this.getItem(r[t])}constructor(t,{expandedKeys:r}={}){this.keyMap=new Map,this.iterable=t,r=r||new Set;let n=u=>{if(this.keyMap.set(u.key,u),u.childNodes&&(u.type==="section"||r.has(u.key)))for(let o of u.childNodes)n(o)};for(let u of t)n(u);let i,s=0;for(let[u,o]of this.keyMap)i?(i.nextKey=u,o.prevKey=i.key):(this.firstKey=u,o.prevKey=void 0),o.type==="item"&&(o.index=s++),i=o,i.nextKey=void 0;this.lastKey=i==null?void 0:i.key}}function RO(e){let[t,r]=Mn(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,e.onExpandedChange),n=Iy(e),i=C.exports.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),s=ed(e,o=>new jH(o,{expandedKeys:t}),null,[t]);return C.exports.useEffect(()=>{n.focusedKey!=null&&!s.getItem(n.focusedKey)&&n.setFocusedKey(null)},[s,n.focusedKey]),{collection:s,expandedKeys:t,disabledKeys:i,toggleKey:o=>{r(BH(t,o))},selectionManager:new Ry(s,n)}}function BH(e,t){let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r}function FO(e){return Ee("p-4 overflow-y-auto text-base sm:text-sm outline-none max-h-inherit",e)}function LO({isFocused:e,isSelected:t,isDisabled:r,isHovered:n}){let i="";return r?i="text-disabled pointer-events-none":t?n||e?i="bg-primary/focus":i="bg-primary/selected":e?i="bg-focus":n&&(i="bg-hover"),Ee("px-16 py-8 text-sm truncate select-none outline-none rounded cursor-pointer flex items-center gap-16",i)}const VH="icon-md text-muted";function UH(e){const{item:t,state:r,onAction:n}=e,{onClose:i,closeOnSelect:s}=pH();let u,o,a;const{rendered:l,key:h}=t;Array.isArray(l)?[u=null,a,o=null]=l:a=l;const c=r.selectionManager.isSelected(h),f=r.disabledKeys.has(h),d=C.exports.useRef(null),{menuItemProps:g,labelProps:m,descriptionProps:p,keyboardShortcutProps:v}=vO({isSelected:c,isDisabled:f,"aria-label":t["aria-label"],key:h,onClose:i,closeOnSelect:s,onAction:n},r,d),{hoverProps:y,isHovered:b}=vi({isDisabled:f}),{focusProps:x,isFocusVisible:w}=ho(),T=LO({isFocused:w,isSelected:c,isDisabled:f,isHovered:b});return ce("li",Y($({className:T},Ce(g,y,x)),{ref:d,children:[u&&ee.cloneElement(u,{className:VH}),S("div",Y($({},m),{children:a})),o]}))}function HH(e){const t=FO(),r=C.exports.useContext(Ty),n=C.exports.useRef(null),i=$({},Ce(r,e)),s=RO(i),{menuProps:u}=mO(i,s,n);return S("ul",Y($({ref:n,className:t},u),{children:[...s.collection].map(o=>{let a=S(UH,{item:o,state:s,onAction:i.onAction},o.key);return o.wrapper&&(a=o.wrapper(a)),a})}))}function WH({item:e,button:t}){const r=e.menuItems;return ce(AH,{children:[t,S(HH,{onAction:n=>{const i=r.find(s=>s.label===n);i==null||i.action()},items:r,children:n=>S(_t,{children:n.label},n.label)})]})}const qe=C.exports.forwardRef((l,a)=>{var h=l,{children:e,size:t,variant:r="text",radius:n="rounded-full",className:i,padding:s,equalWidth:u=!0}=h,o=ze(h,["children","size","variant","radius","className","padding","equalWidth"]);const c=Ee(kE(t,{padding:s,equalWidth:u}),i),f=Ee(e.props.className,m0(t));return S(In,Y($({},o),{ref:a,radius:n,variant:r,className:c,children:ee.cloneElement(e,{className:f})}))});function YH({icon:e,className:t}){let r;return ee.isValidElement(e)?r=ee.cloneElement(e,{className:"svg-iconEl"}):typeof e=="string"?r=S("img",{className:"w-font h-font",src:e,alt:""}):Array.isArray(e)?r=ee.createElement(eF(e)):r=ee.createElement(e),S("span",{className:Ee(t,"leading-none"),children:r})}const Fy=ee.memo(YH);function KH({item:e}){const t=e.label?S(GH,{item:e}):S(XH,{item:e});return e.menuItems?S(WH,{item:e,button:t}):ee.cloneElement(t,{onPress:()=>{var r;(r=e.action)==null||r.call(e,A().editor)}})}const XH=C.exports.forwardRef((n,r)=>{var i=n,{item:e}=i,t=ze(i,["item"]);return S(qe,Y($({ref:r,radius:"rounded-full",size:"sm"},t),{children:S(Fy,{icon:e.icon})}))}),GH=C.exports.forwardRef((n,r)=>{var i=n,{item:e}=i,t=ze(i,["item"]);return S(nr,Y($({ref:r,radius:"rounded-full",size:"xs",color:"primary",startIcon:S(Fy,{icon:e.icon})},t),{children:S(qH,{item:e})}))});function qH({item:e}){return e.label?typeof e.label=="string"?S(xr,{children:e.label}):S(De,$({},e.label)):null}function Fd({children:e,color:t,variant:r,radius:n,size:i,className:s,value:u,onChange:o,multiple:a}){const l=f=>u===void 0?!1:a?u.includes(f):f===u,h=f=>{const d=[...u],g=u.indexOf(f);return g>-1?d.splice(g,1):d.push(f),d},c=ee.Children.map(e,(f,d)=>{if(ee.isValidElement(f)){const g=l(f.props.value),m=g?"primary":t;return ee.cloneElement(f,Y($({color:g?"primary":t,variant:r,size:i,radius:null},f.props),{onPress:p=>{f.props.onPress&&f.props.onPress(p),!!o&&(a?o==null||o(h(f.props.value)):o==null||o(f.props.value))},className:Ee(f.props.className,g?"z-20":"z-10",JH(d,e,n,m))}))}});return S("div",{className:Ee(n,"inline-flex isolate",s),children:c})}function JH(e,t,r,n){return e===0?Ee(r,"rounded-tr-none rounded-br-none",!n&&"border-r-transparent disabled:border-r-transparent"):e===t.length-1?Ee(r,"rounded-tl-none rounded-bl-none -ml-1"):Ee("rounded-none -ml-1",!n&&"border-r-transparent disabled:border-r-transparent")}const ZH=Pe(S("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"}),"UndoOutlined"),QH=Pe(S("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"}),"RedoOutlined");function eW(){const e=pe(r=>r.history.canUndo),t=pe(r=>r.history.canRedo);return ce(Fd,{variant:"outline",children:[S(qe,{equalWidth:!1,size:"xs",padding:"pl-12 pr-10",radius:"rounded-full",isDisabled:!e,onPress:()=>{V().history.undo()},children:S(ZH,{})}),S(qe,{equalWidth:!1,padding:"pl-10 pr-12",size:"xs",radius:"rounded-full",isDisabled:!t,onPress:()=>{V().history.redo()},children:S(QH,{})})]})}const tW=Pe(S("path",{d:"M19 13H5v-2h14v2z"}),"RemoveOutlined"),rW=Pe(S("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"AddOutlined");function nW(){var r,n,i;const e=pe(s=>s.zoom)||1;return((r=pe(s=>{var u,o;return(o=(u=s.config.tools)==null?void 0:u.zoom)==null?void 0:o.allowUserZoom}))!=null?r:!0)?ce("div",{className:"flex items-center select-none",children:[S(qe,{size:"sm",isDisabled:!((n=V().zoom)==null?void 0:n.canZoomOut()),onPress:()=>{V().zoom.zoomOut(V().zoom.step)},children:S(tW,{})}),ce("div",{className:"w-[4ch] text-sm text-center",children:[Math.round(e*100),"%"]}),S(qe,{size:"sm",isDisabled:!((i=V().zoom)==null?void 0:i.canZoomIn()),onPress:()=>{V().zoom.zoomIn(V().zoom.step)},children:S(rW,{})})]}):null}function Ly({item:e}){switch(e.type){case"undoWidget":return S(eW,{});case"zoomWidget":return S(nW,{});case"button":return S(KH,{item:e});case"image":return S("img",{className:"h-30 object-cover",src:Ar(e.src),alt:""});default:return null}}const Ti=Pe(S("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}),"CloseOutlined");function Ld(){var n;let e=pe(i=>{var s;return((s=i.config.ui)==null?void 0:s.mode)===hm.OVERLAY});const{width:t}=pe(i=>i.stageSize),r=t<=700;return r&&((n=A().config.ui)==null?void 0:n.forceOverlayModeOnMobile)&&(e=!0),{isModal:e,isMobile:r}}function iW(){var a;const{isModal:e,isMobile:t}=Ld(),r=(a=pe(l=>{var h;return(h=l.config.ui)==null?void 0:h.allowEditorClose}))!=null?a:!0,n=pe(l=>{var h,c;return(c=(h=l.config.ui)==null?void 0:h.menubar)==null?void 0:c.items})||[],i=[],s=[],u=[];n.filter(l=>!t&&!l.mobileOnly||t&&!l.desktopOnly).forEach(l=>{l.align==="left"?i.push(l):l.align==="right"?u.push(l):s.push(l)});const o=e&&t&&r&&S(qe,{size:"sm",className:"ml-10",onPress:()=>{A().editor.close()},children:S(Ti,{})});return ce(Yt.div,Y($({className:OE},ME),{children:[S("div",{className:"mr-auto",children:i.map((l,h)=>S(Ly,{item:l},h))}),S("div",{className:"flex items-center gap-10",children:s.map((l,h)=>S(Ly,{item:l},h))}),S("div",{className:"ml-auto flex items-center gap-8",children:u.map((l,h)=>S(Ly,{item:l},h))}),o]}))}class Ny{constructor(){Te(this,"callbackName","onResize");Te(this,"resizeDir",null)}matches(t){const r=t.target;return r.dataset.position?(this.resizeDir=r.dataset.position,!0):!1}execute(t,r){return r?this.resizeUsingRect(t,r):this.resizeUsingEvent(t)}onPointerUp(){this.resizeDir=null}resizeUsingEvent(t){const r=$({},t.currentRect),n=$({},t.currentRect),i=t.aspectRatio;return this.resizeDir==="top-right"?(n.width=Math.floor(n.width+t.deltaX),i?n.height=Math.floor(n.width/i):n.height=Math.floor(n.height-t.deltaY),n.top=Math.floor(n.top+(r.height-n.height))):this.resizeDir==="bottom-right"?(n.width=Math.floor(n.width+t.deltaX),i?n.height=Math.floor(n.width/i):n.height=Math.floor(n.height+t.deltaY)):this.resizeDir==="top-left"?(n.width=Math.floor(n.width-t.deltaX),i?n.height=Math.floor(n.width/i):n.height=Math.floor(n.height-t.deltaY),n.left=Math.floor(n.left+(r.width-n.width)),n.top=Math.floor(n.top+(r.height-n.height))):this.resizeDir==="bottom-left"&&(n.width=Math.floor(n.width-t.deltaX),i?n.height=Math.floor(n.width/i):n.height=Math.floor(n.height+t.deltaY),n.left=Math.floor(n.left+(r.width-n.width))),n}resizeUsingRect(t,r){const n=$($({},t.currentRect),r);if(t.aspectRatio){const i=Vf(t.aspectRatio,n.width,n.height);n.width=i.width,n.height=i.height}return n}}function oW(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var aW={};oW(aW,"useNumberFieldState",()=>NO);function NO(e){let{minValue:t,maxValue:r,step:n,formatOptions:i,value:s,defaultValue:u,onChange:o,locale:a,isDisabled:l,isReadOnly:h}=e,[c,f]=Mn(s,isNaN(u)?NaN:u,o),[d,g]=C.exports.useState(()=>isNaN(c)?"":new H0(a,i).format(c)),m=C.exports.useMemo(()=>new dU(a,i),[a,i]),p=C.exports.useMemo(()=>m.getNumberingSystem(d),[m,d]),v=C.exports.useMemo(()=>new H0(a,Y($({},i),{numberingSystem:p})),[a,i,p]),y=C.exports.useMemo(()=>v.resolvedOptions(),[v]),b=C.exports.useCallback(ue=>isNaN(ue)?"":v.format(ue),[v]),x=isNaN(n)?1:n;y.style==="percent"&&isNaN(n)&&(x=.01),C.exports.useEffect(()=>{g(b(c))},[c,a,i]);let w=C.exports.useMemo(()=>m.parse(d),[m,d]),T=C.exports.useRef(0);T.current=w;let _=()=>{if(!d.length){f(NaN),g(s===void 0?"":b(c));return}if(isNaN(T.current)){g(b(c));return}let ue;isNaN(n)?ue=Ca(T.current,t,r):ue=hn(T.current,t,r,n),ue=m.parse(b(ue)),f(ue),g(b(s===void 0?ue:c))},E=(ue,ge)=>{let fe=T.current;if(isNaN(fe)){let L=isNaN(ge)?0:ge;return hn(L,t,r,x)}else{let L=hn(fe,t,r,x);return ue==="+"&&L>fe||ue==="-"&&L<fe?L:hn(zy(ue,fe,x),t,r,x)}},k=()=>{let ue=E("+",t);ue===c&&g(b(ue)),f(ue)},z=()=>{let ue=E("-",r);ue===c&&g(b(ue)),f(ue)},F=()=>{r!=null&&f(hn(r,t,r,x))},j=()=>{t!=null&&f(t)},K=C.exports.useMemo(()=>!l&&!h&&(isNaN(w)||isNaN(r)||hn(w,t,r,x)>w||zy("+",w,x)<=r),[l,h,t,r,x,w]),B=C.exports.useMemo(()=>!l&&!h&&(isNaN(w)||isNaN(t)||hn(w,t,r,x)<w||zy("-",w,x)>=t),[l,h,t,r,x,w]);return{validate:ue=>m.isValidPartialNumber(ue,t,r),increment:k,incrementToMax:F,decrement:z,decrementToMin:j,canIncrement:K,canDecrement:B,minValue:t,maxValue:r,numberValue:w,setInputValue:g,inputValue:d,commit:_}}function zy(e,t,r){let n=e==="+"?t+r:t-r;if(t%1!==0||r%1!==0){const i=t.toString().split("."),s=r.toString().split("."),u=i[1]&&i[1].length||0,o=s[1]&&s[1].length||0,a=Math.pow(10,Math.max(u,o));t=Math.round(t*a),r=Math.round(r*a),n=e==="+"?t+r:t-r,n/=a}return n}function zO(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var sW={};zO(sW,"useField",()=>Nd);var lW={};zO(lW,"useLabel",()=>yo);function yo(e){let{id:t,label:r,"aria-labelledby":n,"aria-label":i,labelElementType:s="label"}=e;t=Kt(t);let u=Kt(),o={};r?(n=n?`${n} ${u}`:u,o={id:u,htmlFor:s==="label"?t:void 0}):!n&&!i&&console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility");let a=_l({id:t,"aria-label":i,"aria-labelledby":n});return{labelProps:o,fieldProps:a}}function Nd(e){let{description:t,errorMessage:r,validationState:n}=e,{labelProps:i,fieldProps:s}=yo(e),u=kn([Boolean(t),Boolean(r),n]),o=kn([Boolean(t),Boolean(r),n]);return s=Ce(s,{"aria-describedby":[u,o,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:i,fieldProps:s,descriptionProps:{id:u},errorMessageProps:{id:o}}}function jO(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var uW={};jO(uW,"useTextField",()=>jy);function jy(e,t){let{inputElementType:r="input",isDisabled:n=!1,isRequired:i=!1,isReadOnly:s=!1,validationState:u,type:o="text",onChange:a=()=>{}}=e,{focusableProps:l}=Na(e,t),{labelProps:h,fieldProps:c,descriptionProps:f,errorMessageProps:d}=Nd(e),g=_r(e,{labelable:!0});const m={type:o,pattern:e.pattern};return{labelProps:h,inputProps:Ce(g,r==="input"&&m,$($({disabled:n,readOnly:s,"aria-required":i||void 0,"aria-invalid":u==="invalid"||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],value:e.value,defaultValue:e.value?void 0:e.defaultValue,onChange:p=>a(p.target.value),autoComplete:e.autoComplete,maxLength:e.maxLength,minLength:e.minLength,name:e.name,placeholder:e.placeholder,inputMode:e.inputMode,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput},l),c)),descriptionProps:f,errorMessageProps:d}}var cW={};jO(cW,"useFormattedTextField",()=>VO);function BO(){return typeof window!="undefined"&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"}function VO(e,t,r){let n=C.exports.useRef(t);n.current=t,C.exports.useEffect(()=>{if(!BO())return;let h=r.current,c=f=>{let d=n.current,g;switch(f.inputType){case"historyUndo":case"historyRedo":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":g=h.value.slice(0,h.selectionStart)+h.value.slice(h.selectionEnd);break;case"deleteContentForward":g=h.selectionEnd===h.selectionStart?h.value.slice(0,h.selectionStart)+h.value.slice(h.selectionEnd+1):h.value.slice(0,h.selectionStart)+h.value.slice(h.selectionEnd);break;case"deleteContentBackward":g=h.selectionEnd===h.selectionStart?h.value.slice(0,h.selectionStart-1)+h.value.slice(h.selectionStart):h.value.slice(0,h.selectionStart)+h.value.slice(h.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":g=h.value.slice(h.selectionStart);break;default:f.data!=null&&(g=h.value.slice(0,h.selectionStart)+f.data+h.value.slice(h.selectionEnd));break}(g==null||!d.validate(g))&&f.preventDefault()};return h.addEventListener("beforeinput",c,!1),()=>{h.removeEventListener("beforeinput",c,!1)}},[r,n]);let i=BO()?null:h=>{let c=h.target.value.slice(0,h.target.selectionStart)+h.data+h.target.value.slice(h.target.selectionEnd);t.validate(c)||h.preventDefault()},{labelProps:s,inputProps:u,descriptionProps:o,errorMessageProps:a}=jy(e,r),l=C.exports.useRef(null);return{inputProps:Ce(u,{onBeforeInput:i,onCompositionStart(){let{value:h,selectionStart:c,selectionEnd:f}=r.current;l.current={value:h,selectionStart:c,selectionEnd:f}},onCompositionEnd(){if(!t.validate(r.current.value)){let{value:h,selectionStart:c,selectionEnd:f}=l.current;r.current.value=h,r.current.setSelectionRange(c,f),t.setInputValue(h)}}}),labelProps:s,descriptionProps:o,errorMessageProps:a}}function By(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var Vy={};By(Vy,"announce",()=>HO),By(Vy,"clearAnnouncer",()=>dW),By(Vy,"destroyAnnouncer",()=>hW);const UO=7e3;let Gl=ee.createRef(),bo=null,fW=0;function HO(e,t="assertive",r=UO){WO(n=>n.announce(e,t,r))}function dW(e){WO(t=>t.clear(e))}function hW(){Gl.current&&(fc.unmountComponentAtNode(bo),document.body.removeChild(bo),bo=null)}function WO(e){Gl.current?e(Gl.current):(bo=document.createElement("div"),bo.dataset.liveAnnouncer="true",document.body.prepend(bo),fc.render(ee.createElement(pW,{ref:Gl}),bo,()=>e(Gl.current)))}const pW=ee.forwardRef((e,t)=>{let[r,n]=C.exports.useState([]),[i,s]=C.exports.useState([]),u=a=>{(!a||a==="assertive")&&n([]),(!a||a==="polite")&&s([])},o=(a,l="assertive",h=UO)=>{let c=fW++;l==="assertive"?n(f=>[...f,{id:c,text:a}]):s(f=>[...f,{id:c,text:a}]),a!==""&&setTimeout(()=>{l==="assertive"?n(f=>f.filter(d=>d.id!==c)):s(f=>f.filter(d=>d.id!==c))},h)};return C.exports.useImperativeHandle(t,()=>({announce:o,clear:u})),ee.createElement(C.exports.Fragment,null,ee.createElement(YO,{"aria-live":"assertive"},r.map(a=>ee.createElement("div",{key:a.id},a.text))),ee.createElement(YO,{"aria-live":"polite"},i.map(a=>ee.createElement("div",{key:a.id},a.text))))});function YO({children:e,"aria-live":t}){return ee.createElement(uo,{role:"log","aria-live":t,"aria-relevant":"additions"},e)}function gW(e){return e&&e.__esModule?e.default:e}function mW(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var vW={};mW(vW,"useSpinButton",()=>O3);var KO={},XO={};XO=JSON.parse('{"Empty":"\u0641\u0627\u0631\u063A"}');var GO={};GO=JSON.parse('{"Empty":"\u0418\u0437\u043F\u0440\u0430\u0437\u043D\u0438"}');var qO={};qO=JSON.parse('{"Empty":"Pr\xE1zdn\xE9"}');var JO={};JO=JSON.parse('{"Empty":"Tom"}');var ZO={};ZO=JSON.parse('{"Empty":"Leer"}');var QO={};QO=JSON.parse('{"Empty":"\u0386\u03B4\u03B5\u03B9\u03BF"}');var e3={};e3=JSON.parse('{"Empty":"Empty"}');var t3={};t3=JSON.parse('{"Empty":"Vac\xEDo"}');var r3={};r3=JSON.parse('{"Empty":"T\xFChjenda"}');var n3={};n3=JSON.parse('{"Empty":"Tyhj\xE4"}');var i3={};i3=JSON.parse('{"Empty":"Vide"}');var o3={};o3=JSON.parse('{"Empty":"\u05E8\u05D9\u05E7"}');var a3={};a3=JSON.parse('{"Empty":"Prazno"}');var s3={};s3=JSON.parse('{"Empty":"\xDCres"}');var l3={};l3=JSON.parse('{"Empty":"Vuoto"}');var u3={};u3=JSON.parse('{"Empty":"\u7A7A"}');var c3={};c3=JSON.parse('{"Empty":"\uBE44\uC5B4 \uC788\uC74C"}');var f3={};f3=JSON.parse('{"Empty":"Tu\u0161\u010Dias"}');var d3={};d3=JSON.parse('{"Empty":"Tuk\u0161s"}');var h3={};h3=JSON.parse('{"Empty":"Tom"}');var p3={};p3=JSON.parse('{"Empty":"Leeg"}');var g3={};g3=JSON.parse('{"Empty":"Pusty"}');var m3={};m3=JSON.parse('{"Empty":"Vazio"}');var v3={};v3=JSON.parse('{"Empty":"Vazio"}');var y3={};y3=JSON.parse('{"Empty":"Gol"}');var b3={};b3=JSON.parse('{"Empty":"\u041D\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043E"}');var x3={};x3=JSON.parse('{"Empty":"Pr\xE1zdne"}');var w3={};w3=JSON.parse('{"Empty":"Prazen"}');var S3={};S3=JSON.parse('{"Empty":"Prazno"}');var _3={};_3=JSON.parse('{"Empty":"Tomt"}');var T3={};T3=JSON.parse('{"Empty":"Bo\u015F"}');var C3={};C3=JSON.parse('{"Empty":"\u041F\u0443\u0441\u0442\u043E"}');var E3={};E3=JSON.parse('{"Empty":"\u7A7A"}');var P3={};P3=JSON.parse('{"Empty":"\u7A7A\u767D"}'),KO={"ar-AE":XO,"bg-BG":GO,"cs-CZ":qO,"da-DK":JO,"de-DE":ZO,"el-GR":QO,"en-US":e3,"es-ES":t3,"et-EE":r3,"fi-FI":n3,"fr-FR":i3,"he-IL":o3,"hr-HR":a3,"hu-HU":s3,"it-IT":l3,"ja-JP":u3,"ko-KR":c3,"lt-LT":f3,"lv-LV":d3,"nb-NO":h3,"nl-NL":p3,"pl-PL":g3,"pt-BR":m3,"pt-PT":v3,"ro-RO":y3,"ru-RU":b3,"sk-SK":x3,"sl-SI":w3,"sr-SP":S3,"sv-SE":_3,"tr-TR":T3,"uk-UA":C3,"zh-CN":E3,"zh-TW":P3};function O3(e){const t=C.exports.useRef();let{value:r,textValue:n,minValue:i,maxValue:s,isDisabled:u,isReadOnly:o,isRequired:a,onIncrement:l,onIncrementPage:h,onDecrement:c,onDecrementPage:f,onDecrementToMin:d,onIncrementToMax:g}=e;const m=Ll(gW(KO)),p=C.exports.useRef(e);p.current=e;const v=()=>clearTimeout(t.current);C.exports.useEffect(()=>()=>v(),[]);let y=F=>{if(!(F.ctrlKey||F.metaKey||F.shiftKey||F.altKey||o))switch(F.key){case"PageUp":if(h){F.preventDefault(),h();break}case"ArrowUp":case"Up":l&&(F.preventDefault(),l());break;case"PageDown":if(f){F.preventDefault(),f();break}case"ArrowDown":case"Down":c&&(F.preventDefault(),c());break;case"Home":d&&(F.preventDefault(),d());break;case"End":g&&(F.preventDefault(),g());break}},b=C.exports.useRef(!1),x=()=>{b.current=!0},w=()=>{b.current=!1};n=n===""?m("Empty"):(n||`${r}`).replace("-","\u2212"),C.exports.useEffect(()=>{b.current&&HO(n,"assertive")},[n]);const T=C.exports.useCallback(F=>{v(),p.current.onIncrement(),t.current=window.setTimeout(()=>{(isNaN(s)||isNaN(r)||r<s)&&T(60)},F)},[l,s,r]),_=C.exports.useCallback(F=>{v(),p.current.onDecrement(),t.current=window.setTimeout(()=>{(isNaN(i)||isNaN(r)||r>i)&&_(60)},F)},[c,i,r]);let E=F=>{F.preventDefault()},{addGlobalListener:k,removeAllGlobalListeners:z}=oo();return{spinButtonProps:{role:"spinbutton","aria-valuenow":isNaN(r)?null:r,"aria-valuetext":n,"aria-valuemin":i,"aria-valuemax":s,"aria-disabled":u||null,"aria-readonly":o||null,"aria-required":a||null,onKeyDown:y,onFocus:x,onBlur:w},incrementButtonProps:{onPressStart:()=>{T(400),k(window,"contextmenu",E)},onPressEnd:()=>{v(),z()},onFocus:x,onBlur:w},decrementButtonProps:{onPressStart:()=>{_(400),k(window,"contextmenu",E)},onPressEnd:()=>{v(),z()},onFocus:x,onBlur:w}}}function yW(e){return e&&e.__esModule?e.default:e}function bW(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var xW={};bW(xW,"useNumberField",()=>cM);var M3={},k3={};k3=JSON.parse('{"decrease":"\u062E\u0641\u0636 {fieldLabel}","increase":"\u0632\u064A\u0627\u062F\u0629 {fieldLabel}","numberField":"\u062D\u0642\u0644 \u0631\u0642\u0645\u064A"}');var $3={};$3=JSON.parse('{"decrease":"\u041D\u0430\u043C\u0430\u043B\u044F\u0432\u0430\u043D\u0435 {fieldLabel}","increase":"\u0423\u0441\u0438\u043B\u0432\u0430\u043D\u0435 {fieldLabel}","numberField":"\u041D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043F\u043E\u043B\u0435\u0442\u043E"}');var D3={};D3=JSON.parse('{"decrease":"Sn\xED\u017Eit {fieldLabel}","increase":"Zv\xFD\u0161it {fieldLabel}","numberField":"\u010C\xEDseln\xE9 pole"}');var A3={};A3=JSON.parse('{"decrease":"Reducer {fieldLabel}","increase":"\xD8g {fieldLabel}","numberField":"Talfelt"}');var I3={};I3=JSON.parse('{"decrease":"{fieldLabel} verringern","increase":"{fieldLabel} erh\xF6hen","numberField":"Nummernfeld"}');var R3={};R3=JSON.parse('{"decrease":"\u039C\u03B5\u03AF\u03C9\u03C3\u03B7 {fieldLabel}","increase":"\u0391\u03CD\u03BE\u03B7\u03C3\u03B7 {fieldLabel}","numberField":"\u03A0\u03B5\u03B4\u03AF\u03BF \u03B1\u03C1\u03B9\u03B8\u03BC\u03BF\u03CD"}');var F3={};F3=JSON.parse('{"decrease":"Decrease {fieldLabel}","increase":"Increase {fieldLabel}","numberField":"Number field"}');var L3={};L3=JSON.parse('{"decrease":"Reducir {fieldLabel}","increase":"Aumentar {fieldLabel}","numberField":"Campo de n\xFAmero"}');var N3={};N3=JSON.parse('{"decrease":"V\xE4henda {fieldLabel}","increase":"Suurenda {fieldLabel}","numberField":"Numbri v\xE4li"}');var z3={};z3=JSON.parse('{"decrease":"V\xE4henn\xE4 {fieldLabel}","increase":"Lis\xE4\xE4 {fieldLabel}","numberField":"Numerokentt\xE4"}');var j3={};j3=JSON.parse('{"decrease":"Diminuer {fieldLabel}","increase":"Augmenter {fieldLabel}","numberField":"Champ de nombre"}');var B3={};B3=JSON.parse('{"decrease":"\u05D4\u05E7\u05D8\u05DF {fieldLabel}","increase":"\u05D4\u05D2\u05D3\u05DC {fieldLabel}","numberField":"\u05E9\u05D3\u05D4 \u05DE\u05E1\u05E4\u05E8"}');var V3={};V3=JSON.parse('{"decrease":"Smanji {fieldLabel}","increase":"Pove\u0107aj {fieldLabel}","numberField":"Polje broja"}');var U3={};U3=JSON.parse('{"decrease":"{fieldLabel} cs\xF6kkent\xE9se","increase":"{fieldLabel} n\xF6vel\xE9se","numberField":"Sz\xE1mmez\u0151"}');var H3={};H3=JSON.parse('{"decrease":"Riduci {fieldLabel}","increase":"Aumenta {fieldLabel}","numberField":"Campo numero"}');var W3={};W3=JSON.parse('{"decrease":"{fieldLabel}\u3092\u7E2E\u5C0F","increase":"{fieldLabel}\u3092\u62E1\u5927","numberField":"\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9"}');var Y3={};Y3=JSON.parse('{"decrease":"{fieldLabel} \uAC10\uC18C","increase":"{fieldLabel} \uC99D\uAC00","numberField":"\uBC88\uD638 \uD544\uB4DC"}');var K3={};K3=JSON.parse('{"decrease":"Suma\u017Einti {fieldLabel}","increase":"Padidinti {fieldLabel}","numberField":"Numerio laukas"}');var X3={};X3=JSON.parse('{"decrease":"Samazin\u0101\u0161ana {fieldLabel}","increase":"Palielin\u0101\u0161ana {fieldLabel}","numberField":"Skait\u013Cu lauks"}');var G3={};G3=JSON.parse('{"decrease":"Reduser {fieldLabel}","increase":"\xD8k {fieldLabel}","numberField":"Tallfelt"}');var q3={};q3=JSON.parse('{"decrease":"{fieldLabel} verlagen","increase":"{fieldLabel} verhogen","numberField":"Getalveld"}');var J3={};J3=JSON.parse('{"decrease":"Zmniejsz {fieldLabel}","increase":"Zwi\u0119ksz {fieldLabel}","numberField":"Pole numeru"}');var Z3={};Z3=JSON.parse('{"decrease":"Diminuir {fieldLabel}","increase":"Aumentar {fieldLabel}","numberField":"Campo de n\xFAmero"}');var Q3={};Q3=JSON.parse('{"decrease":"Diminuir {fieldLabel}","increase":"Aumentar {fieldLabel}","numberField":"Campo num\xE9rico"}');var eM={};eM=JSON.parse('{"decrease":"Sc\u0103dere {fieldLabel}","increase":"Cre\u0219tere {fieldLabel}","numberField":"C\xE2mp numeric"}');var tM={};tM=JSON.parse('{"decrease":"\u0423\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u0435 {fieldLabel}","increase":"\u0423\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u0435 {fieldLabel}","numberField":"\u0427\u0438\u0441\u043B\u043E\u0432\u043E\u0435 \u043F\u043E\u043B\u0435"}');var rM={};rM=JSON.parse('{"decrease":"Zn\xED\u017Ei\u0165 {fieldLabel}","increase":"Zv\xFD\u0161i\u0165 {fieldLabel}","numberField":"\u010C\xEDseln\xE9 pole"}');var nM={};nM=JSON.parse('{"decrease":"Upadati {fieldLabel}","increase":"Pove\u010Dajte {fieldLabel}","numberField":"\u0160tevil\u010Dno polje"}');var iM={};iM=JSON.parse('{"decrease":"Decrease {fieldLabel}","increase":"Increase {fieldLabel}","numberField":"Number field"}');var oM={};oM=JSON.parse('{"decrease":"Minska {fieldLabel}","increase":"\xD6ka {fieldLabel}","numberField":"Nummerf\xE4lt"}');var aM={};aM=JSON.parse('{"decrease":"{fieldLabel} azalt","increase":"{fieldLabel} artt\u0131r","numberField":"Say\u0131 alan\u0131"}');var sM={};sM=JSON.parse('{"decrease":"\u0417\u043C\u0435\u043D\u0448\u0438\u0442\u0438 {fieldLabel}","increase":"\u0417\u0431\u0456\u043B\u044C\u0448\u0438\u0442\u0438 {fieldLabel}","numberField":"\u041F\u043E\u043B\u0435 \u043D\u043E\u043C\u0435\u0440\u0430"}');var lM={};lM=JSON.parse('{"decrease":"\u964D\u4F4E {fieldLabel}","increase":"\u63D0\u9AD8 {fieldLabel}","numberField":"\u6570\u5B57\u5B57\u6BB5"}');var uM={};uM=JSON.parse('{"decrease":"\u7E2E\u5C0F {fieldLabel}","increase":"\u653E\u5927 {fieldLabel}","numberField":"\u6578\u5B57\u6B04\u4F4D"}'),M3={"ar-AE":k3,"bg-BG":$3,"cs-CZ":D3,"da-DK":A3,"de-DE":I3,"el-GR":R3,"en-US":F3,"es-ES":L3,"et-EE":N3,"fi-FI":z3,"fr-FR":j3,"he-IL":B3,"hr-HR":V3,"hu-HU":U3,"it-IT":H3,"ja-JP":W3,"ko-KR":Y3,"lt-LT":K3,"lv-LV":X3,"nb-NO":G3,"nl-NL":q3,"pl-PL":J3,"pt-BR":Z3,"pt-PT":Q3,"ro-RO":eM,"ru-RU":tM,"sk-SK":rM,"sl-SI":nM,"sr-SP":iM,"sv-SE":oM,"tr-TR":aM,"uk-UA":sM,"zh-CN":lM,"zh-TW":uM};function cM(e,t,r){let{id:n,decrementAriaLabel:i,incrementAriaLabel:s,isDisabled:u,isReadOnly:o,isRequired:a,minValue:l,maxValue:h,autoFocus:c,validationState:f,label:d,formatOptions:g,onBlur:m,onFocus:p,onFocusChange:v,onKeyDown:y,onKeyUp:b,description:x,errorMessage:w}=e,{increment:T,incrementToMax:_,decrement:E,decrementToMin:k,numberValue:z,commit:F}=t;const j=Ll(yW(M3));let K=Kt(n),{focusProps:B}=Cl({onBlur:()=>{F()}}),{spinButtonProps:H,incrementButtonProps:ue,decrementButtonProps:ge}=O3({isDisabled:u,isReadOnly:o,isRequired:a,maxValue:h,minValue:l,onIncrement:T,onIncrementToMax:_,onDecrement:E,onDecrementToMin:k,value:z,textValue:t.inputValue}),[fe,L]=C.exports.useState(!1),{focusWithinProps:Z}=Da({isDisabled:u,onFocusWithinChange:L}),M=C.exports.useCallback(U=>{Math.abs(U.deltaY)<=Math.abs(U.deltaX)||(U.deltaY>0?T():U.deltaY<0&&E())},[E,T]);HC({onScroll:M,isDisabled:u||o||!fe},r);let R=dd(g),O=C.exports.useMemo(()=>R.resolvedOptions(),[R]).maximumFractionDigits>0,N=isNaN(t.minValue)||t.minValue<0,I="numeric";Rv()?N?I="text":O&&(I="decimal"):kC()&&(N?I="numeric":O&&(I="decimal"));let q=U=>{t.setInputValue(U)},X=_r(e),{labelProps:ne,inputProps:re,descriptionProps:ae,errorMessageProps:G}=VO(Y($({},X),{label:d,autoFocus:c,isDisabled:u,isReadOnly:o,isRequired:a,validationState:f,value:t.inputValue,autoComplete:"off","aria-label":e["aria-label"]||null,"aria-labelledby":e["aria-labelledby"]||null,id:K,type:"text",inputMode:I,onChange:q,onBlur:m,onFocus:p,onFocusChange:v,onKeyDown:y,onKeyUp:b,description:x,errorMessage:w}),t,r),W=Ce(H,re,B,{role:null,"aria-roledescription":Pa()?null:j("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"}),J=U=>{document.activeElement!==r.current&&(U.pointerType==="mouse"?r.current.focus():U.target.focus())},te=e["aria-label"]||(typeof e.label=="string"?e.label:""),Q;te||(Q=e.label!=null?ne.id:e["aria-labelledby"]);let le=Kt(),ie=Kt(),ye=Ce(ue,{"aria-label":s||j("increase",{fieldLabel:te}).trim(),id:Q&&!s?le:null,"aria-labelledby":Q&&!s?`${le} ${Q}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:J}),he=Ce(ge,{"aria-label":i||j("decrease",{fieldLabel:te}).trim(),id:Q&&!i?ie:null,"aria-labelledby":Q&&!i?`${ie} ${Q}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:J});return{groupProps:$({role:"group","aria-disabled":u,"aria-invalid":f==="invalid"?"true":void 0},Z),labelProps:ne,inputProps:W,incrementButtonProps:ye,decrementButtonProps:he,errorMessageProps:G,descriptionProps:ae}}function xo(e){const{size:t="md",startAdornment:r,endAdornment:n,className:i,inline:s}=$({},e),u=SW(t);return{label:Ee("block capitalize text-left",u.font,s?"mr-16":"mb-4"),input:Ee("text-left relative focus:ring focus:ring-primary/focus focus:border-primary/60 block w-full bg-transparent border rounded focus:outline-none shadow-sm appearance-none transition-shadow",u.font,u.height,r?"pl-36":"pl-12",n?"pr-36":"pr-12"),adornment:m0(t),wrapper:Ee(i,u.font,{"flex items-center":s}),size:u}}const wW="text-base";function SW(e){switch(e){case"xs":return{font:"text-xs",height:"h-30"};case"sm":return{font:"text-sm",height:"h-36"};case"lg":return{font:"text-lg",height:"h-50"};case"xl":return{font:"text-xl",height:"h-60"};default:return{font:wW,height:"h-42"}}}const _W=Pe(S("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z"}),"KeyboardArrowUpOutlined"),zd=Pe(S("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDownOutlined");function wo(e){const{label:t}=e,{locale:r}=Rr(),n=xo(e),i=NO(Y($({},e),{locale:r})),s=C.exports.useRef(null),{labelProps:u,groupProps:o,inputProps:a,incrementButtonProps:l,decrementButtonProps:h}=cM(e,i,s);return ce("div",{className:n.wrapper,children:[t&&S("label",Y($({className:n.label},u),{children:t})),ce("div",Y($({className:"relative"},o),{children:[S("input",Y($({className:n.input},a),{ref:s})),ce("div",{className:"absolute top-0 right-0 h-full flex flex-col items-center justify-center",children:[S(fM,Y($({className:"border-b"},l),{children:S(_W,{})})),S(fM,Y($({},h),{children:S(zd,{})}))]})]}))]})}function fM(n){var i=n,{children:e,className:t}=i,r=ze(i,["children","className"]);const s=Ee(t,"flex flex-auto items-center border-l px-2 disabled:text-disabled");return S(qe,Y($({variant:null,radius:"rounded-none",className:s},r),{children:e}))}function TW(){const e=pe(u=>{var o;return(o=u.crop.zoneRect)==null?void 0:o.width})||1,t=pe(u=>{var o;return(o=u.crop.zoneRect)==null?void 0:o.height})||1,[r,n]=C.exports.useState({width:e,height:t});C.exports.useEffect(()=>{const u=Math.round(e/A().zoom),o=Math.round(t/A().zoom);n({width:u,height:o})},[e,t]);const i=(u,o)=>{const a=Y($({},r),{[o]:u});n(a),s(a)},s=u=>{const o=u||r;CW(o.width,o.height)};return ce("form",{className:"flex items-center gap-12",onSubmit:u=>{u.preventDefault(),s()},children:[S(wo,{size:"xs","aria-label":"Crop width",endAdornment:S("div",{className:"text-muted font-bold text-xs",children:S(De,{id:"zRkzP5",defaultMessage:[{type:0,value:"W"}]})}),minValue:1,className:"w-80",value:r.width,formatOptions:{useGrouping:!1},onChange:u=>{i(u,"width")}}),S(wo,{size:"xs","aria-label":"Crop height",endAdornment:S("div",{className:"text-muted font-bold text-xs",children:S(De,{id:"wFvZzh",defaultMessage:[{type:0,value:"H"}]})}),minValue:1,className:"w-80",value:r.height,formatOptions:{useGrouping:!1},onChange:u=>{i(u,"height")}}),S("button",{type:"submit",className:"hidden",children:S(De,{id:"4dL9o7",defaultMessage:[{type:0,value:"Resize"}]})})]})}function CW(e,t){const r=V().crop.zone;if(!A().crop.zoneRect||!r)return;const n=Y($({},A().crop.zoneRect),{width:Math.round(Math.min(A().original.width,e)*A().zoom),height:Math.round(Math.min(A().original.height,t)*A().zoom)}),i=r.config.actions.find(s=>s instanceof Ny);(i&&n.width!==r.currentRect.width||n.height!==r.currentRect.height)&&r.executeAction(i,{},n)}const dM=Pe(S("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"}),"CheckOutlined");function EW(){const e=pe(t=>t.activeTool);return ce(Yt.div,Y($({className:OE},ME),{children:[S(PW,{}),OW(e),S(MW,{})]}))}function PW(){const{isMobile:e}=Ld(),t=pe(r=>r.dirty);return e?S(qe,{size:"sm",onPress:()=>{A().cancelChanges()},children:S(Ti,{})}):S(nr,{variant:"outline",size:"xs",startIcon:S(Ti,{}),radius:"rounded-full",onPress:()=>{A().cancelChanges()},children:t?S(De,{id:"47FYwb",defaultMessage:[{type:0,value:"Cancel"}]}):S(De,{id:"rbrahO",defaultMessage:[{type:0,value:"Close"}]})})}function OW(e){var r,n,i;const t=S("div",{className:"capitalize text-sm",children:e});switch(e){case Ge.CROP:return((i=(n=(r=A().config.tools)==null?void 0:r.crop)==null?void 0:n.allowCustomRatio)!=null?i:!0)?S(TW,{}):t;default:return t}}function MW(){const{isMobile:e}=Ld(),t=pe(r=>r.dirty);return e?S(qe,{size:"sm",isDisabled:!t,onPress:()=>{A().applyChanges()},children:S(dM,{})}):S(nr,{variant:"flat",color:"primary",size:"xs",isDisabled:!t,startIcon:S(dM,{}),radius:"rounded-full",onPress:()=>{A().applyChanges()},children:S(De,{id:"EWw/tK",defaultMessage:[{type:0,value:"Apply"}]})})}function hM(){const e=pe(t=>t.activeTool);return S(fn,{initial:!1,children:e?S(EW,{},"activeToolbar"):S(iW,{},"mainToolbar")})}const kW={newCanvas:{id:"34ELdR",defaultMessage:[{type:0,value:"Loading Canvas"}]},mainImage:{id:"ymTE9v",defaultMessage:[{type:0,value:"Loading Image"}]},state:{id:"AmIZUR",defaultMessage:[{type:0,value:"Loading State"}]},merge:{id:"zP9AYY",defaultMessage:[{type:0,value:"Processing Image"}]}};function $W(){const[e,t]=C.exports.useState(!1);return C.exports.useEffect(()=>{pe.subscribe(r=>r.loading,r=>{r&&t(r)})},[]),S(fn,{children:e&&S(Yt.div,{initial:{y:"60%",opacity:0},animate:{y:0,opacity:1},exit:{y:"-60%",opacity:0},transition:{type:"tween",duration:.3},onAnimationComplete:()=>{setTimeout(()=>{t(!1)},400)},className:"absolute z-loading-indicator inset-0 m-auto p-6 w-144 h-32 text-center text-sm bg-paper rounded-full shadow-lg",children:S(De,$({},kW[e]))})})}function DW(e,t,r){return Math.max(t,Math.min(e,r))}const At={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function pM(e,t,r){return t===0||Math.abs(t)===1/0?Math.pow(e,r*5):e*t*r/(t+r*e)}function gM(e,t,r,n=.15){return n===0?DW(e,t,r):e<t?-pM(t-e,r-t,n)+t:e>r?+pM(e-r,r-t,n)+r:e}function AW(e,[t,r],[n,i]){const[[s,u],[o,a]]=e;return[gM(t,s,u,n),gM(r,o,a,i)]}function Xt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mM(Object(r),!0).forEach(function(n){Xt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const vM={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function yM(e){return e?e[0].toUpperCase()+e.slice(1):""}function IW(e,t="",r=!1){const n=vM[e],i=n&&n[t]||t;return"on"+yM(e)+yM(i)+(r?"Capture":"")}const RW=["gotpointercapture","lostpointercapture"];function FW(e){let t=e.substring(2).toLowerCase();const r=!!~t.indexOf("passive");r&&(t=t.replace("passive",""));const n=RW.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(n);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:r}}function LW(e,t=""){const r=vM[e],n=r&&r[t]||t;return e+n}function Uy(e){return"touches"in e}function NW(e){return Array.from(e.touches).filter(t=>{var r,n;return t.target===e.currentTarget||((r=e.currentTarget)===null||r===void 0||(n=r.contains)===null||n===void 0?void 0:n.call(r,t.target))})}function zW(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function bM(e){return Uy(e)?zW(e)[0]:e}function Hy(e,t){const r=t.clientX-e.clientX,n=t.clientY-e.clientY,i=(t.clientX+e.clientX)/2,s=(t.clientY+e.clientY)/2,u=Math.hypot(r,n);return{angle:-(Math.atan2(r,n)*180)/Math.PI,distance:u,origin:[i,s]}}function jW(e){return NW(e).map(t=>t.identifier)}function xM(e,t){const[r,n]=Array.from(e.touches).filter(i=>t.includes(i.identifier));return Hy(r,n)}function Wy(e){const t=bM(e);return Uy(e)?t.identifier:t.pointerId}function wM(e){const t=bM(e);return[t.clientX,t.clientY]}const SM=40,_M=800;function BW(e){let{deltaX:t,deltaY:r,deltaMode:n}=e;return n===1?(t*=SM,r*=SM):n===2&&(t*=_M,r*=_M),[t,r]}function VW(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:r,altKey:n,metaKey:i,ctrlKey:s}=e;Object.assign(t,{shiftKey:r,altKey:n,metaKey:i,ctrlKey:s})}return t}function jd(e,...t){return typeof e=="function"?e(...t):e}function UW(){}function HW(...e){return e.length===0?UW:e.length===1?e[0]:function(){let t;for(const r of e)t=r.apply(this,arguments)||t;return t}}function TM(e,t){return Object.assign({},t,e||{})}const WW=32;class CM{constructor(t,r,n){this.ctrl=t,this.args=r,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:r,ingKey:n,args:i}=this;r[n]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=i,t.axis=void 0,t.memo=void 0,t.elapsedTime=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const r=this.state,n=this.config;r._active||(this.reset(),this.computeInitial(),r._active=!0,r.target=t.target,r.currentTarget=t.currentTarget,r.lastOffset=n.from?jd(n.from,r):r.offset,r.offset=r.lastOffset),r.startTime=r.timeStamp=t.timeStamp}computeValues(t){const r=this.state;r._values=t,r.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:r,config:n,shared:i}=this;r.args=this.args;let s=0;if(t&&(r.event=t,n.preventDefault&&t.cancelable&&r.event.preventDefault(),r.type=t.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,VW(t)),i.down=i.pressed=i.buttons%2===1||i.touches>0,s=t.timeStamp-r.timeStamp,r.timeStamp=t.timeStamp,r.elapsedTime=r.timeStamp-r.startTime),r._active){const x=r._delta.map(Math.abs);At.addTo(r._distance,x)}const[u,o]=r._movement,[a,l]=n.threshold,{_step:h,values:c}=r;if(n.hasCustomTransform?(h[0]===!1&&(h[0]=Math.abs(u)>=a&&c[0]),h[1]===!1&&(h[1]=Math.abs(o)>=l&&c[1])):(h[0]===!1&&(h[0]=Math.abs(u)>=a&&Math.sign(u)*a),h[1]===!1&&(h[1]=Math.abs(o)>=l&&Math.sign(o)*l)),r.intentional=h[0]!==!1||h[1]!==!1,!r.intentional)return;const f=[0,0];if(n.hasCustomTransform){const[x,w]=c;f[0]=h[0]!==!1?x-h[0]:0,f[1]=h[1]!==!1?w-h[1]:0}else f[0]=h[0]!==!1?u-h[0]:0,f[1]=h[1]!==!1?o-h[1]:0;if(this.intent&&this.intent(f),(r._active&&!r._blocked||r.active)&&(r.first=r._active&&!r.active,r.last=!r._active&&r.active,r.active=i[this.ingKey]=r._active,t)){r.first&&("bounds"in n&&(r._bounds=jd(n.bounds,r)),this.setup&&this.setup()),r.movement=f;const x=r.offset;if(this.computeOffset(),!r.last||s>WW){r.delta=At.sub(r.offset,x);const w=r.delta.map(Math.abs);At.addTo(r.distance,w),r.direction=r.delta.map(Math.sign),r._direction=r._delta.map(Math.sign),!r.first&&s>0&&(r.velocity=[w[0]/s,w[1]/s])}}const[d,g]=r.offset,[[m,p],[v,y]]=r._bounds;r.overflow=[d<m?-1:d>p?1:0,g<v?-1:g>y?1:0],r._movementBound[0]=r.overflow[0]?r._movementBound[0]===!1?r._movement[0]:r._movementBound[0]:!1,r._movementBound[1]=r.overflow[1]?r._movementBound[1]===!1?r._movement[1]:r._movementBound[1]:!1;const b=r._active?n.rubberband||[0,0]:[0,0];r.offset=AW(r._bounds,r.offset,b),this.computeMovement()}emit(){const t=this.state,r=this.shared,n=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!n.triggerAllEvents)return;const i=this.handler(Tt(Tt(Tt({},r),t),{},{[this.aliasKey]:t.values}));i!==void 0&&(t.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function YW([e,t]){const r=Math.abs(e)-Math.abs(t);if(r>0)return"x";if(r<0)return"y"}function KW(e,t){switch(t){case"x":e[1]=0;break;case"y":e[0]=0;break}}class XW extends CM{constructor(...t){super(...t);Xt(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=At.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=At.sub(this.state.offset,this.state.lastOffset)}intent(t){this.state.axis=this.state.axis||YW(t),this.state._blocked=(this.config.lockDirection||!!this.config.axis)&&!this.state.axis||!!this.config.axis&&this.config.axis!==this.state.axis,!this.state._blocked&&(this.config.axis||this.config.lockDirection)&&KW(t,this.state.axis)}}const GW=e=>e,EM=.15,PM={enabled(e=!0){return e},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[EM,EM];case!1:return[0,0];default:return At.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return At.toVector(e)},transform(e,t,r){const n=e||r.shared.transform;return this.hasCustomTransform=!!n,n||GW},threshold(e){return At.toVector(e,0)}},ql=Tt(Tt({},PM),{},{axis(e,t,{axis:r}){if(this.lockDirection=r==="lock",!this.lockDirection)return r},bounds(e={}){if(typeof e=="function")return s=>ql.bounds(e(s));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:r=1/0,top:n=-1/0,bottom:i=1/0}=e;return[[t,r],[n,i]]}}),Bd=10,OM={ArrowRight:(e=1)=>[Bd*e,0],ArrowLeft:(e=1)=>[-Bd*e,0],ArrowUp:(e=1)=>[0,-Bd*e],ArrowDown:(e=1)=>[0,Bd*e]};class qW extends XW{constructor(...t){super(...t);Xt(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const r=t._bounds.getBoundingClientRect(),n=t.currentTarget.getBoundingClientRect(),i={left:r.left-n.left+t.offset[0],right:r.right-n.right+t.offset[0],top:r.top-n.top+t.offset[1],bottom:r.bottom-n.bottom+t.offset[1]};t._bounds=ql.bounds(i)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const r=this.config,n=this.state;t.buttons!=null&&(Array.isArray(r.pointerButtons)?!r.pointerButtons.includes(t.buttons):r.pointerButtons!==-1&&r.pointerButtons!==t.buttons)||(this.ctrl.setEventIds(t),r.pointerCapture&&t.target.setPointerCapture(t.pointerId),!n._pointerActive&&(this.start(t),this.setupPointer(t),n._pointerId=Wy(t),n._pointerActive=!0,this.computeValues(wM(t)),this.computeInitial(),r.preventScroll?this.setupScrollPrevention(t):r.delay>0?this.setupDelayTrigger(t):this.startPointerDrag(t)))}startPointerDrag(t){const r=this.state;r._active=!0,r._preventScroll=!0,r._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const r=this.state,n=this.config;if(!r._pointerActive||r.type===t.type&&t.timeStamp===r.timeStamp)return;const i=Wy(t);if(r._pointerId&&i!==r._pointerId)return;const s=wM(t);if(document.pointerLockElement===t.target?r._delta=[t.movementX,t.movementY]:(r._delta=At.sub(s,r._values),this.computeValues(s)),At.addTo(r._movement,r._delta),this.compute(t),r._delayed){this.timeoutStore.remove("dragDelay"),r.active=!1,this.startPointerDrag(t);return}if(n.preventScroll&&!r._preventScroll)if(r.axis)if(r.axis===n.preventScrollAxis||n.preventScrollAxis==="xy"){r._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const r=this.state,n=this.config;if(!r._pointerActive)return;const i=Wy(t);if(r._pointerId&&i!==r._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[s,u]=r._distance;if(r.tap=s<=n.tapsThreshold&&u<=n.tapsThreshold,r.tap&&n.filterTaps)r._force=!0;else{const[o,a]=r.direction,[l,h]=r.velocity,[c,f]=r.movement,[d,g]=n.swipe.velocity,[m,p]=n.swipe.distance,v=n.swipe.duration;r.elapsedTime<v&&(Math.abs(l)>d&&Math.abs(c)>m&&(r.swipe[0]=o),Math.abs(h)>g&&Math.abs(f)>p&&(r.swipe[1]=a))}this.emit()}pointerClick(t){this.state.tap||(t.preventDefault(),t.stopPropagation())}setupPointer(t){const r=this.config;let n=r.device;r.pointerLock&&t.currentTarget.requestPointerLock(),r.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){JW(t),this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1}),this.eventStore.add(this.sharedConfig.window,"touch","end",this.clean.bind(this),{passive:!1}),this.eventStore.add(this.sharedConfig.window,"touch","cancel",this.clean.bind(this),{passive:!1}),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScroll,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",this.startPointerDrag.bind(this),this.config.delay,t)}keyDown(t){const r=OM[t.key];if(r){const n=this.state,i=t.shiftKey?10:t.altKey?.1:1;n._delta=r(i),this.start(t),n._keyboardActive=!0,At.addTo(n._movement,n._delta),this.compute(t),this.emit()}}keyUp(t){t.key in OM&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const r=this.config.device;t(r,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(r,"change",this.pointerMove.bind(this)),t(r,"end",this.pointerUp.bind(this)),t(r,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this)),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function JW(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const Jl=typeof window!="undefined"&&window.document&&window.document.createElement;function ZW(){return Jl&&"ontouchstart"in window}function MM(){return ZW()||Jl&&window.navigator.maxTouchPoints>1}function QW(){return Jl&&"onpointerdown"in window}function eY(){return Jl&&"exitPointerLock"in window.document}function tY(){try{return"constructor"in GestureEvent}catch{return!1}}const Lr={isBrowser:Jl,gesture:tY(),touch:MM(),touchscreen:MM(),pointer:QW(),pointerLock:eY()},rY=250,nY=180,iY=.5,oY=50,aY=250,sY=Tt(Tt({},ql),{},{pointerLock(e,t,{pointer:{lock:r=!1,touch:n=!1}={}}){return this.useTouch=n&&Lr.touch,r&&Lr.pointerLock},device(e,t){return this.useTouch?"touch":this.pointerLock?"mouse":Lr.pointer?"pointer":Lr.touch?"touch":"mouse"},preventScroll(e=!1,t,{preventScrollAxis:r="y"}){return r&&(this.preventScrollAxis=r),Lr.touchscreen?typeof e=="number"?e:e?rY:!1:!1},pointerCapture(e,t,{pointer:{capture:r=!0,buttons:n=1}={}}){return this.pointerButtons=n,!this.pointerLock&&this.device==="pointer"&&r},threshold(e,t,{filterTaps:r=!1,tapsThreshold:n=3,axis:i=void 0}){const s=At.toVector(e,r?n:i?1:0);return this.filterTaps=r,this.tapsThreshold=n,s},swipe({velocity:e=iY,distance:t=oY,duration:r=aY}={}){return{velocity:this.transform(At.toVector(e)),distance:this.transform(At.toVector(t)),duration:r}},delay(e=0){switch(e){case!0:return nY;case!1:return 0;default:return e}}}),lY=30,uY=36;class cY extends CM{constructor(...t){super(...t);Xt(this,"ingKey","pinching"),Xt(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const t=this.state;t._touchIds=[],t.canceled=!1,t.cancel=this.cancel.bind(this),t.turns=0}computeOffset(){const{type:t,movement:r,lastOffset:n}=this.state;t==="wheel"?this.state.offset=At.add(r,n):this.state.offset=[(1+r[0])*n[0],r[1]+n[1]]}computeMovement(){const{offset:t,lastOffset:r}=this.state;this.state.movement=[t[0]/r[0],t[1]-r[1]]}intent(t){const r=this.state;if(!r.axis){const n=Math.abs(t[0])*lY-Math.abs(t[1]);n<0?r.axis="angle":n>0&&(r.axis="scale")}this.config.lockDirection&&(r.axis==="scale"?t[1]=0:r.axis==="angle"&&(t[0]=0))}cancel(){const t=this.state;t.canceled||setTimeout(()=>{t.canceled=!0,t._active=!1,this.compute(),this.emit()},0)}touchStart(t){this.ctrl.setEventIds(t);const r=this.state,n=this.ctrl.touchIds;if(r._active&&r._touchIds.every(s=>n.has(s))||n.size<2)return;this.start(t),r._touchIds=Array.from(n).slice(0,2);const i=xM(t,r._touchIds);this.pinchStart(t,i)}pointerStart(t){if(t.buttons!=null&&t.buttons%2!==1)return;this.ctrl.setEventIds(t),t.target.setPointerCapture(t.pointerId);const r=this.state,n=r._pointerEvents,i=this.ctrl.pointerIds;if(r._active&&Array.from(n.keys()).every(u=>i.has(u))||(n.size<2&&n.set(t.pointerId,t),r._pointerEvents.size<2))return;this.start(t);const s=Hy(...Array.from(n.values()));this.pinchStart(t,s)}pinchStart(t,r){const n=this.state;n.origin=r.origin,this.computeValues([r.distance,r.angle]),this.computeInitial(),this.compute(t),this.emit()}touchMove(t){if(!this.state._active)return;const r=xM(t,this.state._touchIds);this.pinchMove(t,r)}pointerMove(t){const r=this.state._pointerEvents;if(r.has(t.pointerId)&&r.set(t.pointerId,t),!this.state._active)return;const n=Hy(...Array.from(r.values()));this.pinchMove(t,n)}pinchMove(t,r){const n=this.state,i=n._values[1],s=r.angle-i;let u=0;Math.abs(s)>270&&(u+=Math.sign(s)),this.computeValues([r.distance,r.angle-360*u]),n.origin=r.origin,n.turns=u,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(t),this.emit()}touchEnd(t){this.ctrl.setEventIds(t),!!this.state._active&&this.state._touchIds.some(r=>!this.ctrl.touchIds.has(r))&&(this.state._active=!1,this.compute(t),this.emit())}pointerEnd(t){const r=this.state;this.ctrl.setEventIds(t);try{t.target.releasePointerCapture(t.pointerId)}catch{}r._pointerEvents.has(t.pointerId)&&r._pointerEvents.delete(t.pointerId),!!r._active&&r._pointerEvents.size<2&&(r._active=!1,this.compute(t),this.emit())}gestureStart(t){t.cancelable&&t.preventDefault();const r=this.state;r._active||(this.start(t),this.computeValues([t.scale,t.rotation]),r.origin=[t.clientX,t.clientY],this.compute(t),this.emit())}gestureMove(t){if(t.cancelable&&t.preventDefault(),!this.state._active)return;const r=this.state;this.computeValues([t.scale,t.rotation]),r.origin=[t.clientX,t.clientY];const n=r._movement;r._movement=[t.scale-1,t.rotation],r._delta=At.sub(r._movement,n),this.compute(t),this.emit()}gestureEnd(t){!this.state._active||(this.state._active=!1,this.compute(t),this.emit())}wheel(t){!t.ctrlKey||(this.state._active?this.wheelChange(t):this.wheelStart(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(t){this.start(t),this.wheelChange(t)}wheelChange(t){"uv"in t||t.cancelable&&t.preventDefault();const n=this.state;n._delta=[-BW(t)[1]/uY*n.offset[0],0],At.addTo(n._movement,n._delta),this.state.origin=[t.clientX,t.clientY],this.compute(t),this.emit()}wheelEnd(){!this.state._active||(this.state._active=!1,this.compute(),this.emit())}bind(t){const r=this.config.device;r?(t(r,"start",this[r+"Start"].bind(this)),t(r,"change",this[r+"Move"].bind(this)),t(r,"end",this[r+"End"].bind(this)),t(r,"cancel",this[r+"End"].bind(this))):t("wheel","",this.wheel.bind(this),{passive:!1})}}const fY=Tt(Tt({},PM),{},{useTouch(e,t,{pointer:{touch:r=!1}={}}){return r&&Lr.touch},device(e,t,r){if(r.shared.target&&!Lr.touch&&Lr.gesture)return"gesture";if(this.useTouch)return"touch";if(Lr.touchscreen){if(Lr.pointer)return"pointer";if(Lr.touch)return"touch"}},bounds(e,t,{scaleBounds:r={},angleBounds:n={}}){const i=u=>{const o=TM(jd(r,u),{min:-1/0,max:1/0});return[o.min,o.max]},s=u=>{const o=TM(jd(n,u),{min:-1/0,max:1/0});return[o.min,o.max]};return typeof r!="function"&&typeof n!="function"?[i(),s()]:u=>[i(u),s(u)]},threshold(e,t,r){return this.lockDirection=r.axis==="lock",At.toVector(e,this.lockDirection?[.1,3]:0)}});Tt(Tt({},ql),{},{mouseOnly:(e=!0)=>e}),Tt(Tt({},ql),{},{mouseOnly:(e=!0)=>e});const Yy=new Map,Ky=new Map;function dY(e){Yy.set(e.key,e.engine),Ky.set(e.key,e.resolver)}const hY={key:"drag",engine:qW,resolver:sY},pY={key:"pinch",engine:cY,resolver:fY};function gY(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function mY(e,t){if(e==null)return{};var r=gY(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}const vY={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Lr.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},yY=["target","eventOptions","window","enabled","transform"];function Vd(e={},t){const r={};for(const[n,i]of Object.entries(t))switch(typeof i){case"function":r[n]=i.call(r,e[n],n,e);break;case"object":r[n]=Vd(e[n],i);break;case"boolean":i&&(r[n]=e[n]);break}return r}function bY(e,t){const r=e,{target:n,eventOptions:i,window:s,enabled:u,transform:o}=r,a=mY(r,yY),l={shared:Vd({target:n,eventOptions:i,window:s,enabled:u,transform:o},vY)};if(t){const h=Ky.get(t);l[t]=Vd(Tt({shared:l.shared},a),h)}else for(const h in a){const c=Ky.get(h);c&&(l[h]=Vd(Tt({shared:l.shared},a[h]),c))}return l}class kM{constructor(t){Xt(this,"_listeners",[]),this._ctrl=t}add(t,r,n,i,s){const u=LW(r,n),o=Tt(Tt({},this._ctrl.config.shared.eventOptions),s);t.addEventListener(u,i,o),this._listeners.push(()=>t.removeEventListener(u,i,o))}clean(){this._listeners.forEach(t=>t()),this._listeners=[]}}class xY{constructor(){Xt(this,"_timeouts",new Map)}add(t,r,n=140,...i){this.remove(t),this._timeouts.set(t,window.setTimeout(r,n,...i))}remove(t){const r=this._timeouts.get(t);r&&window.clearTimeout(r)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class wY{constructor(t){Xt(this,"gestures",new Set),Xt(this,"_targetEventStore",new kM(this)),Xt(this,"gestureEventStores",{}),Xt(this,"gestureTimeoutStores",{}),Xt(this,"handlers",{}),Xt(this,"config",{}),Xt(this,"pointerIds",new Set),Xt(this,"touchIds",new Set),Xt(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),SY(this,t)}setEventIds(t){Uy(t)?this.touchIds=new Set(jW(t)):"pointerId"in t&&(t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId))}applyHandlers(t,r){this.handlers=t,this.nativeHandlers=r}applyConfig(t,r){this.config=bY(t,r)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const r=this.config.shared,n=r.eventOptions,i={};let s;if(r.target&&(s=r.target(),!s))return;const u=_Y(i,n,!!s);if(r.enabled){for(const o of this.gestures)if(this.config[o].enabled){const a=Yy.get(o);new a(this,t,o).bind(u)}for(const o in this.nativeHandlers)u(o,"",a=>this.nativeHandlers[o](Tt(Tt({},this.state.shared),{},{event:a,args:t})),void 0,!0)}for(const o in i)i[o]=HW(...i[o]);if(!s)return i;for(const o in i){const{device:a,capture:l,passive:h}=FW(o);this._targetEventStore.add(s,a,"",i[o],{capture:l,passive:h})}}}function Xa(e,t){e.gestures.add(t),e.gestureEventStores[t]=new kM(e),e.gestureTimeoutStores[t]=new xY}function SY(e,t){t.drag&&Xa(e,"drag"),t.wheel&&Xa(e,"wheel"),t.scroll&&Xa(e,"scroll"),t.move&&Xa(e,"move"),t.pinch&&Xa(e,"pinch"),t.hover&&Xa(e,"hover")}const _Y=(e,t,r)=>(n,i,s,u={},o=!1)=>{var a,l;const h=(a=u.capture)!==null&&a!==void 0?a:t.capture,c=(l=u.passive)!==null&&l!==void 0?l:t.passive;let f=o?n:IW(n,i,h);r&&c&&(f+="Passive"),e[f]=e[f]||[],e[f].push(s)},TY=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function CY(e){const t={},r={},n=new Set;for(let i in e)TY.test(i)?(n.add(RegExp.lastMatch),r[i]=e[i]):t[i]=e[i];return[r,t,n]}function Ga(e,t,r,n,i,s){if(!e.has(r)||!Yy.has(n))return;const u=r+"Start",o=r+"End",a=l=>{let h;return l.first&&u in t&&t[u](l),r in t&&(h=t[r](l)),l.last&&o in t&&t[o](l),h};i[n]=a,s[n]=s[n]||{}}function EY(e,t){const[r,n,i]=CY(e),s={};return Ga(i,r,"onDrag","drag",s,t),Ga(i,r,"onWheel","wheel",s,t),Ga(i,r,"onScroll","scroll",s,t),Ga(i,r,"onPinch","pinch",s,t),Ga(i,r,"onMove","move",s,t),Ga(i,r,"onHover","hover",s,t),{handlers:s,config:t,nativeHandlers:n}}function PY(e,t={},r,n){const i=ee.useMemo(()=>new wY(e),[]);if(i.applyHandlers(e,n),i.applyConfig(t,r),ee.useEffect(i.effect.bind(i)),ee.useEffect(()=>i.clean.bind(i),[]),t.target===void 0)return i.bind.bind(i)}function OY(e){return e.forEach(dY),function(r,n={}){const{handlers:i,nativeHandlers:s,config:u}=EY(r,n);return PY(i,u,void 0,s)}}function Ci({position:e,inset:t=!1}){const r=MY(e,t);return S("div",{"data-position":e,className:`border-white absolute w-20 h-20 ${r}`})}function MY(e,t){const r=t?"left-0":"-left-5",n=t?"top-0":"-top-5",i=t?"bottom-0":"-bottom-5",s=t?"right-0":"-right-5";switch(e){case"top-left":return`${r} ${n} border-l-4 border-t-4 cursor-nwse-resize`;case"top-right":return`${s} ${n} border-r-4 border-t-4 cursor-nesw-resize`;case"bottom-right":return`${s} ${i} border-r-4 border-b-4 cursor-se-resize`;case"bottom-left":return`${r} ${i} border-l-4 border-b-4 cursor-sw-resize`;default:return""}}var Zl=(e=>(e.top="maskTop",e.right="maskRight",e.bottom="maskBottom",e.left="maskLeft",e))(Zl||{});function Ud({position:e,refs:t}){const r=kY(e);return S("div",{className:`cropzone-transition bg-black/50 bottom absolute ${r}`,ref:n=>t.current[e]=n})}function kY(e){switch(e){case"maskTop":return"left-0 top-0";case"maskBottom":return"bottom-0 left-0";default:return""}}function Hd({name:e,refs:t}){const r=Ee("cropzone-transition pointer-events-none absolute left-0 top-0 bg-white/50",e.startsWith("lineHor")?"h-px":"w-px");return S("div",{className:r,ref:n=>{t.current[e]=n}})}class $M{constructor(t,r){Te(this,"doubleTapTimer",null);Te(this,"boundOnPointerDown");Te(this,"boundOnPointerUp");Te(this,"currentRect",{width:0,height:0,left:0,top:0,angle:0});Te(this,"currentAction");Te(this,"initialAspectRatio",0);Te(this,"lastPosition",{pageX:0,pageY:0});this.el=t,this.config=r,this.boundOnPointerDown=this.onPointerDown.bind(this),this.boundOnPointerUp=this.onPointerUp.bind(this),t.addEventListener("pointerdown",this.boundOnPointerDown),t.addEventListener("pointerup",this.boundOnPointerUp)}get aspectRatio(){return this.config.maintainInitialAspectRatio?this.initialAspectRatio:this.config.aspectRatio?this.config.aspectRatio:null}setConfig(t){this.config=$($({},this.config),t)}destroy(){this.el.removeEventListener("pointerdown",this.boundOnPointerDown),this.el.removeEventListener("pointerup",this.boundOnPointerUp)}onPointerDown(t){var r,n,i,s;t.stopPropagation(),t.preventDefault(),this.lastPosition={pageX:t.pageX,pageY:t.pageY},this.el.style.touchAction="none",this.el.style.userSelect="none",this.syncCurrentRectWithEl(this.el),this.currentAction=this.config.actions.find(u=>u.matches(t)),this.currentAction&&(this.currentRect=$($({},this.currentRect),(n=(r=this.currentAction).onPointerDown)==null?void 0:n.call(r,t))),(s=(i=this.config.listeners).onPointerDown)==null||s.call(i,{rect:this.currentRect}),this.el.onpointermove=this.onPointerMove.bind(this),this.el.setPointerCapture(t.pointerId)}onPointerMove(t){t.stopPropagation(),t.preventDefault(),this.currentAction&&this.executeAction(this.currentAction,t),this.lastPosition={pageX:t.pageX,pageY:t.pageY}}executeAction(t,r,n){const i=$({},this.currentRect);this.currentRect=t.execute({deltaX:r.pageX-this.lastPosition.pageX,deltaY:r.pageY-this.lastPosition.pageY,pageX:r.pageX,pageY:r.pageY,aspectRatio:this.aspectRatio,currentRect:this.currentRect},n),this.config.modifiers&&(this.currentRect=this.config.modifiers.reduce((o,a)=>a({currentRect:this.currentRect,prevRect:i},this.config),this.currentRect));const s=this.config.listeners[t.callbackName],u={rect:$({},this.currentRect),prevRect:i};s==null||s(u)}syncCurrentRectWithEl(t){var s;const r=(s=t.style.transform.match(/translate\((.+?)\)/))==null?void 0:s[1],[n="0",i="0"]=(r||"").split(",");this.currentRect={width:t.offsetWidth,height:t.offsetHeight,left:parseInt(n,10),top:parseInt(i,10),angle:0},this.initialAspectRatio=this.currentRect.width/this.currentRect.height}onPointerUp(t){var n,i;t.stopPropagation(),t.preventDefault();const r=t.currentTarget;this.currentAction=null,r.onpointermove=null,r.releasePointerCapture(t.pointerId),this.config.actions.forEach(s=>{var u;return(u=s.onPointerUp)==null?void 0:u.call(s,t)}),(i=(n=this.config.listeners).onPointerUp)==null||i.call(n,{rect:this.currentRect}),this.handleDoubleTap(t)}handleDoubleTap(t){var r,n;this.doubleTapTimer?(clearTimeout(this.doubleTapTimer),this.doubleTapTimer=null,(n=(r=this.config.listeners).onDoubleTap)==null||n.call(r,t)):this.doubleTapTimer=setTimeout(()=>{this.doubleTapTimer=null},300)}}class Xy{constructor(){Te(this,"callbackName","onMove");Te(this,"lockMovement",!1)}matches(t){return!!t.target&&!!t.currentTarget&&t.target===t.currentTarget}execute(t){if(this.lockMovement)return t.currentRect;const r=t.currentRect;return r.left+=t.deltaX,r.top+=t.deltaY,r}}function $Y({currentRect:e,prevRect:t},{boundaryRect:r,minWidth:n,minHeight:i,aspectRatio:s}){let u=$({},e);const o=$({},t);if(r&&(u.left<0&&(u=o),u.top<0&&(u=o),u.left+u.width>r.width&&(u=o),u.top+u.height>r.height&&(u=o)),n||i){let a;s?a=Vf(s,n,i):a={width:n,height:i},a.width&&u.width<a.width&&(u.left=o.left,u.width=a.width),a.height&&u.height<a.height&&(u.top=o.top,u.height=a.height)}return u}function DY(){const e=C.exports.useRef({}),[t,r]=C.exports.useState(!0),n=pe(o=>o.canvasSize),i=pe(o=>{var a,l;return(l=(a=o.config.tools)==null?void 0:a.crop)==null?void 0:l.cropzone}),s=pe(o=>{var a,l;return(l=(a=o.config.tools)==null?void 0:a.crop)==null?void 0:l.defaultRatio})||null;C.exports.useEffect(()=>(V().crop&&(V().crop.zone=new $M(e.current.innerZone,{actions:[new Xy,new Ny],modifiers:[$Y],listeners:{onPointerDown:()=>{r(!0)},onMove:o=>{V().crop.drawZone(o.rect)},onResize:o=>{V().crop.drawZone(o.rect)},onPointerUp:()=>{r(!1)}},minHeight:50,minWidth:50,boundaryRect:n,aspectRatio:i0(s)})),()=>{var o;(o=V().crop.zone)==null||o.destroy()}),[]),C.exports.useLayoutEffect(()=>{V().crop.registerRefs(e),V().crop.resetCropzone(s)},[s,n]);const u=Ee("cropzone absolute z-cropzone isolate left-0 top-0 w-full h-full overflow-hidden",{moving:t});return ce("div",{className:u,onPointerDown:o=>{o.stopPropagation(),o.preventDefault()},children:[ce("div",{className:"cropzone-transition border-white/50 absolute z-10 left-0 top-0 border",ref:o=>{e.current.innerZone=o},children:[!(i==null?void 0:i.hideTopLeft)&&S(Ci,{position:"top-left",inset:!0}),!(i==null?void 0:i.hideTopRight)&&S(Ci,{position:"top-right",inset:!0}),!(i==null?void 0:i.hideBottomLeft)&&S(Ci,{position:"bottom-left",inset:!0}),!(i==null?void 0:i.hideBottomRight)&&S(Ci,{position:"bottom-right",inset:!0}),S(Hd,{name:"lineVer1",refs:e}),S(Hd,{name:"lineVer2",refs:e}),S(Hd,{name:"lineHor1",refs:e}),S(Hd,{name:"lineHor2",refs:e})]}),S(Ud,{refs:e,position:Zl.top}),S(Ud,{refs:e,position:Zl.left}),S(Ud,{refs:e,position:Zl.right}),S(Ud,{refs:e,position:Zl.bottom})]})}const DM="rotation-handle";class AY{constructor(){Te(this,"callbackName","onRotate");Te(this,"centerX",0);Te(this,"centerY",0);Te(this,"startAngle",0)}matches(t){return t.target.classList.contains(DM)}onPointerDown(t){var u;const r=t.currentTarget,n=r.getBoundingClientRect();this.centerX=n.left+n.width/2,this.centerY=n.top+n.height/2;const i=(u=r.style.transform.match(/rotate\((.+?)\)/))==null?void 0:u[1],[s="0"]=i?i.split(","):[];return this.startAngle=parseFloat(s),this.startAngle=this.getDragAngle(t),{angle:this.startAngle}}onPointerUp(){this.centerX=0,this.centerY=0,this.startAngle=0}execute(t){const r=$({},t.currentRect);return r.angle=this.getDragAngle(t),r.left+=t.deltaX,r.top+=t.deltaY,r}getDragAngle(t){const r={x:this.centerX||0,y:this.centerY||0};return Math.atan2(r.y-t.pageY,r.x-t.pageX)-(this.startAngle||0)}}const IY=Pe(S("path",{d:"M 7 2 C 6.448 2 6 2.448 6 3 C 6 3.552 6.448 4 7 4 L 20 4 L 20 17 C 20 17.552 20.448 18 21 18 C 21.552 18 22 17.552 22 17 L 22 4 C 22 2.895 21.105 2 20 2 L 7 2 z M 4 6 C 2.895 6 2 6.895 2 8 L 2 20 C 2 21.105 2.895 22 4 22 L 16 22 C 17.105 22 18 21.105 18 20 L 18 8 C 18 6.895 17.105 6 16 6 L 4 6 z M 10 10 C 10.552 10 11 10.448 11 11 L 11 13 L 13 13 C 13.552 13 14 13.448 14 14 C 14 14.552 13.552 15 13 15 L 11 15 L 11 17 C 11 17.552 10.552 18 10 18 C 9.448 18 9 17.552 9 17 L 9 15 L 7 15 C 6.448 15 6 14.552 6 14 C 6 13.448 6.448 13 7 13 L 9 13 L 9 11 C 9 10.448 9.448 10 10 10 z"})),RY=Pe(S("path",{d:"M 11 3 L 2 21 L 11 21 L 11 3 z M 13 3 L 13 21 L 22 21 L 13 3 z M 9 11.472656 L 9 19 L 5.2363281 19 L 9 11.472656 z"})),FY=Pe(S("path",{d:"M 16.476562 2.4511719 C 16.392047 2.4657656 16.308531 2.5061719 16.238281 2.5761719 L 14.130859 4.6835938 C 13.956859 4.8575938 13.956859 5.1394531 14.130859 5.3144531 L 16.238281 7.4238281 C 16.519281 7.7048281 17 7.5054219 17 7.1074219 L 17 6 L 20 6 L 20 9 A 1.0001 1.0001 0 1 0 22 9 L 22 6 C 22 4.9069372 21.093063 4 20 4 L 17 4 L 17 2.8925781 C 17 2.5940781 16.730109 2.4073906 16.476562 2.4511719 z M 4 5 C 2.9069372 5 2 5.9069372 2 7 L 2 14 C 2 15.093063 2.9069372 16 4 16 L 7 16 L 7 19 C 7 20.105 7.895 21 9 21 L 16 21 C 17.105 21 18 20.105 18 19 L 18 12 C 18 10.895 17.105 10 16 10 L 13 10 L 13 7 C 13 5.9069372 12.093063 5 11 5 L 4 5 z M 4 7 L 11 7 L 11 14 L 4 14 L 4 7 z"})),LY=Pe(S("path",{d:"M 10 2 L 9 3 L 3 3 L 3 5 L 21 5 L 21 3 L 15 3 L 14 2 L 10 2 z M 4.3652344 7 L 5.8925781 20.263672 C 6.0245781 21.253672 6.877 22 7.875 22 L 16.123047 22 C 17.121047 22 17.974422 21.254859 18.107422 20.255859 L 19.634766 7 L 4.3652344 7 z"})),NY={width:120,height:30},zY=[{name:"Duplicate",icon:IY,onPress:()=>{V().objects.duplicate()}},{name:"Flip",icon:RY,onPress:()=>{V().objects.flipHorizontally()}},{name:"Bring to front",icon:FY,onPress:()=>{V().objects.bringToFront()}},{name:"Delete",icon:LY,onPress:()=>{V().objects.delete()}}],jY=ee.forwardRef((e,t)=>{const n=pe(i=>i.objects.active.isMoving)?"opacity-0":"opacity-100";return S("div",{ref:t,className:`${n} absolute z-obj-box left-0 top-0 flex items-center text-white bg-controls rounded shadow transition-opacity overflow-hidden`,children:zY.map(i=>{const s=i.icon;return S(qe,{className:"w-30 h-30 hover:bg-white/hover",radius:"rounded-none",onPress:i.onPress,children:S(s,{className:"icon-sm"})},i.name)})})});function BY(e,t){if(!t)return;const r=e.angle||0,n=r>168&&r<188?-30:-15,i=A().canvasSize,s=A().stageSize,u=NY,o=i.top-s.top,a=i.left-s.left,l=s.width-(a+i.width),h=s.height-(o+i.height),c=-o,f=-(i.left-s.left),d=i.width-u.width+l,g=i.height-u.height+h,m=e.getBoundingRect();let p=m.top-u.height+n,v=m.left+m.width/2-u.width/2;p=Math.min(g,Math.max(c,p)),v=Math.min(d,Math.max(f,v)),t.style.transform=`translate(${v}px, ${p}px) rotate(0deg)`}function VY(e){const t=V().objects.getActive();if(!t)return;const r=Me.fabric.util.radiansToDegrees(e.rect.angle);r!==t.angle&&V().objects.setValues({angle:r})}function UY(e){const t=e.rect.width/2,r=e.rect.height/2;V().objects.setValues({left:(e.rect.left+t)/A().zoom,top:(e.rect.top+r)/A().zoom})}function HY(e){var n,i;const t=V().objects.getActive();if(!t)return;const r={};if(Zi(t)){const s=e.rect.width-((i=(n=e.prevRect)==null?void 0:n.width)!=null?i:0);(s>0||t.getScaledHeight()>=20&&t.getScaledWidth()>=20)&&(r.fontSize=(t.fontSize||1)+s)}else t.width&&(r.scaleX=e.rect.width/A().zoom/t.width),t.height&&(r.scaleY=e.rect.height/A().zoom/t.height);V().objects.setValues(r)}function AM(e,t){var c,f,d;const r=V().objects.getActive();if(!r||!e.current)return;const n=e.current,i=Me.fabric.util.degreesToRadians((c=r.angle)!=null?c:0);let s=Math.round(r.getScaledWidth()*A().zoom),u=Math.round(r.getScaledHeight()*A().zoom),o=Math.round(((f=r.left)!=null?f:0)*A().zoom),a=Math.round(((d=r.top)!=null?d:0)*A().zoom);const l=r.originX==="center"?s/2:0,h=r.originY==="center"?u/2:0;r.padding&&(s+=r.padding*2,u+=r.padding*2,o-=r.padding,a-=r.padding),n.style.width=`${s}px`,n.style.height=`${u}px`,n.style.transform=`translate(${o-l}px, ${a-h}px) rotate(${i}rad)`,V().canvas.render(),BY(r,t.current)}function WY(){var t;const e=V().objects.getActive();Zi(e)&&(e.enterEditing(),(t=e.hiddenTextarea)==null||t.focus())}function YY(){return S("div",{className:"absolute -bottom-20 left-1/2 w-2 h-20 bg-white cursor-default -translate-x-1/2",children:S("div",{className:`${DM} w-18 h-18 absolute -bottom-10 -left-8 bg-white rounded-full cursor-move`})})}function KY(){const e=C.exports.useRef(null),t=C.exports.useRef(null),r=C.exports.useRef(null),n=pe(l=>l.config.objectControls),i=pe(l=>l.objects.active.id),s=pe(l=>l.objects.isEditingText),u=pe(l=>l.zoom),o=GY();return C.exports.useEffect(()=>{if(!!be())return A().editor.on("object:modified",l=>{l.sizeOrPositionChanged&&AM(e,r)}),t.current=new $M(e.current,{minWidth:50,minHeight:50,maintainInitialAspectRatio:!0,actions:[new Xy,new Ny,new AY],listeners:{onPointerUp:()=>{A().objects.setActiveIsMoving(!1)},onDoubleTap:()=>{WY()},onRotate:l=>{A().objects.setActiveIsMoving(!0),VY(l)},onMove:l=>{A().objects.setActiveIsMoving(!0),UY(l)},onResize:l=>{A().objects.setActiveIsMoving(!0),HY(l)}}}),()=>{t.current.destroy()}},[]),C.exports.useEffect(()=>{XY(t.current,o)},[n]),C.exports.useEffect(()=>{AM(e,r)},[i,u,s]),ce("div",{className:i&&!s?"block":"hidden",children:[ce("div",{ref:e,className:"absolute z-obj-box border-2 border-white shadow-md cursor-move",children:[!o.hideTopLeft&&S(Ci,{position:"top-left"}),!o.hideTopRight&&S(Ci,{position:"top-right"}),!o.hideBottomLeft&&S(Ci,{position:"bottom-left"}),!o.hideBottomRight&&S(Ci,{position:"bottom-right"}),!o.hideRotatingPoint&&S(YY,{})]}),S(jY,{ref:r})]})}function XY(e,t){const r=e.config.actions.find(n=>n instanceof Xy);r.lockMovement=!!t.lockMovement,e.setConfig({maintainInitialAspectRatio:!t.unlockAspectRatio})}function GY(){const e=V().objects.getActive();if(!e||!e.name)return{};const t=A().config.objectControls||{},r=e.name;return $($({},t.global),t[r])}function qY(){const e=pe(r=>r.activeTool===Ge.CROP),t=pe(r=>r.objects.active.id);return ce("div",{children:[e&&S(DY,{}),t&&S(KY,{})]})}const JY=OY([hY,pY]),ZY=ee.forwardRef((e,t)=>{const[r,n]=C.exports.useState(!1);C.exports.useEffect(()=>pe.subscribe(s=>s.loading,s=>{n(!s)}),[]);const i={visible:{opacity:1,transition:{duration:.35,delay:.5}},hidden:{opacity:0,transition:{duration:0}}};return S(QY,{children:ce(Yt.div,{initial:{opacity:0},variants:i,animate:r?"visible":"hidden",className:"relative m-auto",style:{backgroundImage:`url(${Ar("images/empty-canvas-bg.png")})`},children:[S(qY,{}),S("canvas",{ref:t})]})})});function QY({children:e}){const t=C.exports.useRef(null),r=JY({onPinch:n=>{if(!V().zoom.allowUserZoom||!IM(n))return n.cancel();n.direction[0]===1?V().zoom.zoomIn(.01):V().zoom.zoomOut(.01),n.event.stopPropagation(),n.event.preventDefault()},onDrag:n=>{if(n.pinching||!IM(n))return n.cancel();t.current.scrollLeft-=n.delta[0],t.current.scrollTop-=n.delta[1]}});return S("div",Y($({ref:t,className:"flex items-center justify-center w-full h-full overflow-hidden touch-none"},r()),{children:e}))}function IM(e){return!(be().findTarget(e.event,!1)||be().isDrawingMode)}function Gy({actionBtn:e,children:t,className:r}){return ce("div",{className:Ee(r,"flex gap-16 items-center h-full"),children:[e&&S("div",{className:"flex-shrink-0",children:e}),S("div",{className:"w-full flex-auto",children:t}),e&&S("div",{className:"w-96"})]})}function Wd(){return(Wd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function RM(e,t){if(e==null)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)t.indexOf(r=s[n])>=0||(i[r]=e[r]);return i}function qy(e){var t=C.exports.useRef(e),r=C.exports.useRef(function(n){t.current&&t.current(n)});return t.current=e,r.current}var Ql=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e<t?t:e},eu=function(e){return"touches"in e},Jy=function(e){return e&&e.ownerDocument.defaultView||self},FM=function(e,t,r){var n=e.getBoundingClientRect(),i=eu(t)?function(s,u){for(var o=0;o<s.length;o++)if(s[o].identifier===u)return s[o];return s[0]}(t.touches,r):t;return{left:Ql((i.pageX-(n.left+Jy(e).pageXOffset))/n.width),top:Ql((i.pageY-(n.top+Jy(e).pageYOffset))/n.height)}},LM=function(e){!eu(e)&&e.preventDefault()},NM=ee.memo(function(e){var t=e.onMove,r=e.onKey,n=RM(e,["onMove","onKey"]),i=C.exports.useRef(null),s=qy(t),u=qy(r),o=C.exports.useRef(null),a=C.exports.useRef(!1),l=C.exports.useMemo(function(){var d=function(p){LM(p),(eu(p)?p.touches.length>0:p.buttons>0)&&i.current?s(FM(i.current,p,o.current)):m(!1)},g=function(){return m(!1)};function m(p){var v=a.current,y=Jy(i.current),b=p?y.addEventListener:y.removeEventListener;b(v?"touchmove":"mousemove",d),b(v?"touchend":"mouseup",g)}return[function(p){var v=p.nativeEvent,y=i.current;if(y&&(LM(v),!function(x,w){return w&&!eu(x)}(v,a.current)&&y)){if(eu(v)){a.current=!0;var b=v.changedTouches||[];b.length&&(o.current=b[0].identifier)}y.focus(),s(FM(y,v,o.current)),m(!0)}},function(p){var v=p.which||p.keyCode;v<37||v>40||(p.preventDefault(),u({left:v===39?.05:v===37?-.05:0,top:v===40?.05:v===38?-.05:0}))},m]},[u,s]),h=l[0],c=l[1],f=l[2];return C.exports.useEffect(function(){return f},[f]),ee.createElement("div",Wd({},n,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:i,onKeyDown:c,tabIndex:0,role:"slider"}))}),Zy=function(e){return e.filter(Boolean).join(" ")},zM=function(e){var t=e.color,r=e.left,n=e.top,i=n===void 0?.5:n,s=Zy(["react-colorful__pointer",e.className]);return ee.createElement("div",{className:s,style:{top:100*i+"%",left:100*r+"%"}},ee.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},hr=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},Qy=function(e){return e[0]==="#"&&(e=e.substr(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}:{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}},eK=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:hr(e.h),s:hr(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:hr(i/2),a:hr(n,2)}},eb=function(e){var t=eK(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},tK=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var s=Math.floor(t),u=n*(1-r),o=n*(1-(t-s)*r),a=n*(1-(1-t+s)*r),l=s%6;return{r:hr(255*[n,o,u,u,a,n][l]),g:hr(255*[a,n,n,o,u,u][l]),b:hr(255*[u,u,a,n,n,o][l]),a:hr(i,2)}},tb=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},rK=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,s=Math.max(t,r,n),u=s-Math.min(t,r,n),o=u?s===t?(r-n)/u:s===r?2+(n-t)/u:4+(t-r)/u:0;return{h:hr(60*(o<0?o+6:o)),s:hr(s?u/s*100:0),v:hr(s/255*100),a:i}},nK=ee.memo(function(e){var t=e.hue,r=e.onChange,n=Zy(["react-colorful__hue",e.className]);return ee.createElement("div",{className:n},ee.createElement(NM,{onMove:function(i){r({h:360*i.left})},onKey:function(i){r({h:Ql(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuetext":hr(t)},ee.createElement(zM,{className:"react-colorful__hue-pointer",left:t/360,color:eb({h:t,s:100,v:100,a:1})})))}),iK=ee.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:eb({h:t.h,s:100,v:100,a:1})};return ee.createElement("div",{className:"react-colorful__saturation",style:n},ee.createElement(NM,{onMove:function(i){r({s:100*i.left,v:100-100*i.top})},onKey:function(i){r({s:Ql(t.s+100*i.left,0,100),v:Ql(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+hr(t.s)+"%, Brightness "+hr(t.v)+"%"},ee.createElement(zM,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:eb(t)})))}),jM=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0};function oK(e,t,r){var n=qy(r),i=C.exports.useState(function(){return e.toHsva(t)}),s=i[0],u=i[1],o=C.exports.useRef({color:t,hsva:s});C.exports.useEffect(function(){if(!e.equal(t,o.current.color)){var l=e.toHsva(t);o.current={hsva:l,color:t},u(l)}},[t,e]),C.exports.useEffect(function(){var l;jM(s,o.current.hsva)||e.equal(l=e.fromHsva(s),o.current.color)||(o.current={hsva:s,color:l},n(l))},[s,e,n]);var a=C.exports.useCallback(function(l){u(function(h){return Object.assign({},h,l)})},[]);return[s,a]}var aK=typeof window!="undefined"?C.exports.useLayoutEffect:C.exports.useEffect,sK=function(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:void 0},BM=new Map,lK=function(e){aK(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!BM.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,BM.set(t,r);var n=sK();n&&r.setAttribute("nonce",n),t.head.appendChild(r)}},[])},uK=function(e){var t=e.className,r=e.colorModel,n=e.color,i=n===void 0?r.defaultColor:n,s=e.onChange,u=RM(e,["className","colorModel","color","onChange"]),o=C.exports.useRef(null);lK(o);var a=oK(r,i,s),l=a[0],h=a[1],c=Zy(["react-colorful",t]);return ee.createElement("div",Wd({},u,{ref:o,className:c}),ee.createElement(iK,{hsva:l,onChange:h}),ee.createElement(nK,{hue:l.h,onChange:h,className:"react-colorful__last-control"}))},cK={defaultColor:"000",toHsva:function(e){return rK(Qy(e))},fromHsva:function(e){return r=(t=tK(e)).g,n=t.b,"#"+tb(t.r)+tb(r)+tb(n);var t,r,n},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||jM(Qy(e),Qy(t))}},fK=function(e){return ee.createElement(uK,Wd({},e,{colorModel:cK}))};function dK({onChange:e,selectedColor:t,colors:r}){const n=r.map(i=>{const s=t===i;return S(In,{onPress:()=>{e==null||e(i)},className:Ee("relative block flex-shrink-0 w-26 h-26 border rounded",s&&"shadow-md"),style:{backgroundColor:i},children:s&&S("span",{className:"absolute inset-0 m-auto rounded-full w-8 h-8 bg-white"})},i)});return S("div",{className:"flex gap-6 p-12",children:n})}function hK({onChange:e,selectedColor:t,colorPresets:r}){return ce("div",{className:"bg-paper rounded shadow-md",children:[S(fK,{className:"!w-auto",onChange:e}),r&&S(dK,{colors:r,onChange:e,selectedColor:t})]})}const Yd=ee.createContext(null);function VM({state:e,triggerProps:t,type:r,isDismissable:n,overlay:i,overlayProps:s={},trigger:u,disableInitialTransition:o}){const a=$({type:r,onClose:e.close,isDismissable:n,disableInitialTransition:o},s);return ce(xr,{children:[u&&ee.cloneElement(u,Ce({onPress:()=>e.toggle(),key:u.key||u.props.id},t)),S(fn,{children:e.isOpen&&S(Yd.Provider,{value:a,children:i})})]})}function pK(u){var o=u,{state:e,targetRef:t,trigger:r,hideArrow:n,children:i}=o,s=ze(o,["state","targetRef","trigger","hideArrow","children"]);const{triggerRef:a,overlayRef:l,positionStyle:h,triggerObjRef:c}=Ay(s),{triggerProps:f,overlayProps:d}=hy({type:"dialog"},e,c),g=S(_y,{style:h,isOpen:e.isOpen,ref:l,onClose:e.close,hideArrow:n,children:i});return S(VM,{type:"popover",state:e,triggerProps:Y($({},f),{ref:a}),overlayProps:d,overlay:g,trigger:r})}function gK(e){const c=e,{children:t,onClose:r,type:n,isOpen:i,isDismissable:s}=c,u=ze(c,["children","onClose","type","isOpen","isDismissable"]),o=C.exports.useRef(null),{disableInitialTransition:a}=C.exports.useContext(Yd),{overlayProps:l,underlayProps:h}=_d(e,o);return ce(Sy,Y($({type:"modal"},u),{className:"absolute inset-0 flex items-center justify-center",children:[S(Cy,$({disableInitialTransition:a},h),"modal-underlay"),S(mK,{onClose:r,isOpen:i,type:n,ref:o,overlayProps:l,children:t},"modal-wrapper")]}))}const mK=C.exports.forwardRef((e,t)=>{const h=e,{children:r,isOpen:n,type:i,overlayProps:s}=h,u=ze(h,["children","isOpen","type","overlayProps"]),{disableInitialTransition:o}=C.exports.useContext(Yd);Td();const{modalProps:a}=Ed(),l={opacity:1,scale:1};return S(Yt.div,{className:"z-20",initial:o?l:{opacity:0,scale:.7},animate:l,exit:{opacity:0,scale:1},children:S("div",Y($({},Ce(u,s,a)),{ref:t,children:r}))})});function vK({state:e,trigger:t,children:r,type:n,isDismissable:i,disableInitialTransition:s}){const u=C.exports.useRef(null);return S(VM,{type:n,state:e,disableInitialTransition:s,triggerProps:{ref:u},isDismissable:i,overlay:(()=>{switch(n){case"tray":return S(Ey,{isOpen:e.isOpen,onClose:e.close,children:r});default:return S(gK,{isOpen:e.isOpen,isDismissable:i,onClose:e.close,type:n,children:r})}})(),trigger:t})}function yK(e){const t=typeof window!="undefined"&&typeof window.matchMedia=="function",[r,n]=C.exports.useState(()=>t?window.matchMedia(e).matches:!1);return C.exports.useEffect(()=>{if(!t)return;const s=window.matchMedia(e),u=o=>{n(o.matches)};return s.addEventListener("change",u),()=>{s.removeEventListener("change",u)}},[t,e]),Cf()?!1:r}function UM(){return yK("(max-width: 700px)")}function Kd(e){let{type:t="modal",isDismissable:r=!0,mobileType:n=t==="popover"?"modal":t}=e;const{children:i,hideArrow:s,targetRef:u,disableInitialTransition:o,onClose:a}=e;UM()&&(t!=="modal"&&n==="modal"&&(r=!0),t=n);const h=S0(Y($({},e),{onOpenChange:d=>{!d&&a&&a()}})),{trigger:c,content:f}=bK(i,h);return t==="popover"?S(pK,{state:h,targetRef:u,trigger:c,hideArrow:s,children:f}):S(vK,{state:h,trigger:c,type:t,isDismissable:r,disableInitialTransition:o,children:f})}function bK(e,t){if(Array.isArray(e)){const[r,n]=e;return{trigger:typeof r=="function"?r(t):r,content:typeof n=="function"?n(t):n}}return{content:e}}function xK(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var wK={};xK(wK,"useDialog",()=>HM);function HM(e,t){let{role:r="dialog"}=e,n=kn();return n=e["aria-label"]?void 0:n,C.exports.useEffect(()=>{if(t.current&&!t.current.contains(document.activeElement)){Ra(t.current);let i=setTimeout(()=>{document.activeElement===t.current&&(t.current.blur(),Ra(t.current))},500);return()=>{clearTimeout(i)}}},[t]),{dialogProps:Y($({},_r(e,{labelable:!0})),{role:r,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||n}),titleProps:{id:n}}}function WM({children:e,className:t,titleProps:r}){return S("h3",Y($({},r),{className:t,children:e}))}function Xd(e){const f=C.exports.useContext(Yd),{type:t="modal"}=f,r=ze(f,["type"]),n=C.exports.useRef(null),{dialogProps:i,titleProps:s}=HM(Ce(r,e),n),{children:u,className:o}=e;let a=null;(t==="popover"||t==="tray")&&(a=S(Ya,{onDismiss:r.onClose}));let l=!1;const h=ee.Children.map(u,d=>ee.isValidElement(d)&&d.type===WM?(l=!0,ee.cloneElement(d,Y($({},d.props),{titleProps:s}))):d),c=Ee("bg-paper rounded shadow-lg max-h-inherit max-w-full focus:outline-none",o);return S(qf,{contain:!0,restoreFocus:!0,children:ce("section",Y($({},i),{className:c,ref:n,children:[r.isDismissable&&l&&S(qe,{"aria-label":"Dismiss",onPress:r.onClose,children:S(Ti,{})}),h,a]}))})}function So(e){const{label:t,className:r,value:n,onChange:i,size:s}=e,u=pe(d=>{var g,m;return(m=(g=d.config.ui)==null?void 0:g.colorPresets)==null?void 0:m.items})||[],o=xo({size:s}),[a,l]=C.exports.useState(n),{labelProps:h,fieldProps:c}=Nd($({labelElementType:"span"},e)),f=d=>{l(d),i==null||i(d)};return ce("div",{className:r,children:[t&&S("span",Y($({className:o.label},h),{children:t})),ce(Kd,{type:"popover",hideArrow:!0,children:[d=>ce(In,Y($({className:Ee(o.input,"inline-flex items-center")},c),{children:[S("span",{className:"block flex-shrink-0 mr-5 border rounded h-2/4 aspect-square",style:{backgroundColor:a}}),S(SK,{isActive:d.isOpen,className:o.adornment})]})),S(Xd,{children:S(hK,{onChange:f,selectedColor:a,colorPresets:u})})]})]})}function SK({isActive:e,className:t}){return S(zd,{className:`transition-transform ml-auto flex-shrink-0 ${e?"rotate-180":"rotate-0"} ${t}`})}function _K(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var TK={};_K(TK,"useSliderState",()=>rb);const CK=0,EK=100,PK=1;function rb(e){const{isDisabled:t,minValue:r=CK,maxValue:n=EK,numberFormatter:i,step:s=PK}=e;var u;const[o,a]=Mn(e.value,(u=e.defaultValue)!==null&&u!==void 0?u:[r],e.onChange),[l,h]=C.exports.useState(new Array(o.length).fill(!1)),c=C.exports.useRef(new Array(o.length).fill(!0)),[f,d]=C.exports.useState(void 0),g=C.exports.useRef(null);g.current=o;const m=C.exports.useRef(null);m.current=l;function p(F){return(F-r)/(n-r)}function v(F){return F===0?r:o[F-1]}function y(F){return F===o.length-1?n:o[F+1]}function b(F){return c.current[F]}function x(F,j){c.current[F]=j}function w(F,j){if(t||!b(F))return;const K=v(F),B=y(F);j=hn(j,K,B,s),g.current=YM(g.current,F,j),a(g.current)}function T(F,j){if(t||!b(F))return;const K=m.current[F];m.current=YM(m.current,F,j),h(m.current),e.onChangeEnd&&K&&!m.current.some(Boolean)&&e.onChangeEnd(g.current)}function _(F){return i.format(F)}function E(F,j){w(F,z(j))}function k(F){return Math.round((F-r)/s)*s+r}function z(F){const j=F*(n-r)+r;return Ca(k(j),r,n)}return{values:o,getThumbValue:F=>o[F],setThumbValue:w,setThumbPercent:E,isThumbDragging:F=>l[F],setThumbDragging:T,focusedThumb:f,setFocusedThumb:d,getThumbPercent:F=>p(o[F]),getValuePercent:p,getThumbValueLabel:F=>_(o[F]),getFormattedValue:_,getThumbMinValue:v,getThumbMaxValue:y,getPercentValue:z,isThumbEditable:b,setThumbEditable:x,step:s}}function YM(e,t,r){return e[t]===r?e:[...e.slice(0,t),r,...e.slice(t+1)]}function KM(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var OK={};KM(OK,"useSlider",()=>ob);const nb=new WeakMap;function ib(e,t){let r=nb.get(e);if(!r)throw new Error("Unknown slider state");return`${r}-${t}`}function ob(e,t,r){let{labelProps:n,fieldProps:i}=yo(e),s=e.orientation==="vertical";var u;nb.set(t,(u=n.id)!==null&&u!==void 0?u:i.id);let{direction:o}=Rr(),{addGlobalListener:a,removeGlobalListener:l}=oo();const h=C.exports.useRef(null),c=C.exports.useRef(null);c.current=t;const f=o==="rtl",d=C.exports.useRef(null),{moveProps:g}=Xv({onMoveStart(){d.current=null},onMove({deltaX:y,deltaY:b}){let x=s?r.current.offsetHeight:r.current.offsetWidth;d.current==null&&(d.current=c.current.getThumbPercent(h.current)*x);let w=s?b:y;if((s||f)&&(w=-w),d.current+=w,h.current!=null&&r.current){const T=Ca(d.current/x,0,1);c.current.setThumbPercent(h.current,T)}},onMoveEnd(){h.current!=null&&(c.current.setThumbDragging(h.current,!1),h.current=null)}});let m=C.exports.useRef(void 0),p=(y,b,x,w)=>{if(r.current&&!e.isDisabled&&t.values.every((T,_)=>!t.isThumbDragging(_))){let T=s?r.current.offsetHeight:r.current.offsetWidth;const _=r.current.getBoundingClientRect()[s?"top":"left"];let z=((s?w:x)-_)/T;(o==="rtl"||s)&&(z=1-z);let F=t.getPercentValue(z),j,K=t.values.findIndex(B=>F-B<0);if(K===0)j=K;else if(K===-1)j=t.values.length-1;else{let B=t.values[K-1],H=t.values[K];Math.abs(B-F)<Math.abs(H-F)?j=K-1:j=K}j>=0&&t.isThumbEditable(j)?(y.preventDefault(),h.current=j,t.setFocusedThumb(j),m.current=b,t.setThumbDragging(h.current,!0),t.setThumbValue(j,F),a(window,"mouseup",v,!1),a(window,"touchend",v,!1),a(window,"pointerup",v,!1)):h.current=null}},v=y=>{var b,x;((x=y.pointerId)!==null&&x!==void 0?x:(b=y.changedTouches)===null||b===void 0?void 0:b[0].identifier)===m.current&&(h.current!=null&&(t.setThumbDragging(h.current,!1),h.current=null),l(window,"mouseup",v,!1),l(window,"touchend",v,!1),l(window,"pointerup",v,!1))};return n.htmlFor&&(delete n.htmlFor,n.onClick=()=>{var y;(y=document.getElementById(ib(t,0)))===null||y===void 0||y.focus(),Hv("keyboard")}),{labelProps:n,groupProps:$({role:"group"},i),trackProps:Ce({onMouseDown(y){y.button!==0||y.altKey||y.ctrlKey||y.metaKey||p(y,void 0,y.clientX,y.clientY)},onPointerDown(y){y.pointerType==="mouse"&&(y.button!==0||y.altKey||y.ctrlKey||y.metaKey)||p(y,y.pointerId,y.clientX,y.clientY)},onTouchStart(y){p(y,y.changedTouches[0].identifier,y.changedTouches[0].clientX,y.changedTouches[0].clientY)}},g),outputProps:{htmlFor:t.values.map((y,b)=>ib(t,b)).join(" "),"aria-live":"off"}}}var MK={};KM(MK,"useSliderThumb",()=>XM);function XM(e,t){let{index:r,isRequired:n,isDisabled:i,validationState:s,trackRef:u,inputRef:o}=e,a=e.orientation==="vertical",{direction:l}=Rr(),{addGlobalListener:h,removeGlobalListener:c}=oo(),f=nb.get(t);var d;const{labelProps:g,fieldProps:m}=yo(Y($({},e),{id:ib(t,r),"aria-labelledby":`${f} ${(d=e["aria-labelledby"])!==null&&d!==void 0?d:""}`.trim()})),p=t.values[r],v=C.exports.useCallback(()=>{o.current&&pn(o.current)},[o]),y=t.focusedThumb===r;C.exports.useEffect(()=>{y&&v()},[y,v]);const b=C.exports.useRef(null);b.current=t;let x=l==="rtl",w=C.exports.useRef(null),{moveProps:T}=Xv({onMoveStart(){w.current=null,t.setThumbDragging(r,!0)},onMove({deltaX:F,deltaY:j,pointerType:K}){let B=a?u.current.offsetHeight:u.current.offsetWidth;if(w.current==null&&(w.current=b.current.getThumbPercent(r)*B),K==="keyboard"){let H=((x?-F:F)+-j)*b.current.step;w.current+=H*B,b.current.setThumbValue(r,b.current.getThumbValue(r)+H)}else{let H=a?j:F;(a||x)&&(H=-H),w.current+=H,b.current.setThumbPercent(r,Ca(w.current/B,0,1))}},onMoveEnd(){t.setThumbDragging(r,!1)}});t.setThumbEditable(r,!i);const{focusableProps:_}=Na(Ce(e,{onFocus:()=>t.setFocusedThumb(r),onBlur:()=>t.setFocusedThumb(void 0)}),o);let E=C.exports.useRef(void 0),k=F=>{v(),E.current=F,t.setThumbDragging(r,!0),h(window,"mouseup",z,!1),h(window,"touchend",z,!1),h(window,"pointerup",z,!1)},z=F=>{var j,K;((K=F.pointerId)!==null&&K!==void 0?K:(j=F.changedTouches)===null||j===void 0?void 0:j[0].identifier)===E.current&&(v(),t.setThumbDragging(r,!1),c(window,"mouseup",z,!1),c(window,"touchend",z,!1),c(window,"pointerup",z,!1))};return{inputProps:Ce(_,m,{type:"range",tabIndex:i?void 0:0,min:t.getThumbMinValue(r),max:t.getThumbMaxValue(r),step:t.step,value:p,disabled:i,"aria-orientation":e.orientation,"aria-valuetext":t.getThumbValueLabel(r),"aria-required":n||void 0,"aria-invalid":s==="invalid"||void 0,"aria-errormessage":e["aria-errormessage"],onChange:F=>{t.setThumbValue(r,parseFloat(F.target.value))}}),thumbProps:i?{}:Ce(T,{onMouseDown:F=>{F.button!==0||F.altKey||F.ctrlKey||F.metaKey||k()},onPointerDown:F=>{F.button!==0||F.altKey||F.ctrlKey||F.metaKey||k(F.pointerId)},onTouchStart:F=>{k(F.changedTouches[0].identifier)}}),labelProps:g}}function _o(e){const E=e,{size:t="md",onChange:r,onChangeEnd:n,value:i,defaultValue:s,formatOptions:u,inline:o,label:a,getValueLabel:l,showValueLabel:h=!!a,className:c,isDisabled:f}=E,d=ze(E,["size","onChange","onChangeEnd","value","defaultValue","formatOptions","inline","label","getValueLabel","showValueLabel","className","isDisabled"]),g=dd(u),m=xo({size:t}),p=C.exports.useRef(null),v=Y($({},d),{isDisabled:f,label:a,numberFormatter:g,value:i!=null?[i]:void 0,defaultValue:s!=null?[s]:void 0,onChange:k=>r==null?void 0:r(k[0]),onChangeEnd:k=>n==null?void 0:n(k[0])}),y=rb(v),{groupProps:b,trackProps:x,labelProps:w,outputProps:T}=ob(v,y,p),_=Ee("w-full flex-shrink-0 touch-none",c,{"flex items-center":o});return ce("div",Y($({},b),{className:_,children:[ce("div",{className:"flex",children:[a&&S("label",Y($({className:m.label},w),{children:a})),h&&S("output",Y($({},T),{className:Ee(m.label,"ml-auto"),children:l?l(y.values[0]):y.getThumbValueLabel(0)}))]}),ce("div",Y($({},x),{ref:p,className:"h-30 relative",children:[S("div",{className:`absolute inset-0 m-auto h-4 rounded ${f?"bg-disabled":"bg-primary-light"}`}),S("div",{className:`absolute inset-0 my-auto h-4 rounded ${f?"bg-disabled-fg":"bg-primary"}`,style:{width:`${y.getThumbPercent(0)*100}%`}}),S(kK,{index:0,state:y,trackRef:p,isDisabled:f})]}))]}))}function kK(e){const{state:t,trackRef:r,index:n,isDisabled:i}=e,s=C.exports.useRef(null),{thumbProps:u,inputProps:o}=XM({index:n,trackRef:r,inputRef:s},t),a=t.isThumbDragging(n),{focusProps:l,isFocusVisible:h}=ho(),{hoverProps:c,isHovered:f}=vi(Y($({},e),{isDisabled:i})),d=Ee("rounded-full w-20 h-20 top-1/2 -translate-y-1/2 -translate-x-1/2 absolute inset-0 transition-colors duration-200",{"outline outline-offset-2":h&&!i,"shadow-md":!i},$K({isDisabled:i,isHovered:f,isDragging:a}));return S("div",Y($({},Ce(u,c)),{className:d,style:{left:`${Math.max(t.getThumbPercent(n)*100,0)}%`},children:S(uo,{children:S("input",$({ref:s},Ce(o,l)))})}))}function $K({isDisabled:e,isHovered:t,isDragging:r}){return e?"bg-slider-disabled cursor-default":r?"bg-primary-dark ring ring-primary-light ring-inset":t?"bg-primary-dark":"bg-primary"}function ab(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var DK={};ab(DK,"useListState",()=>GM);var AK={};ab(AK,"ListCollection",()=>Gd);var IK=Symbol.iterator;class Gd{*[IK](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let r=this.keyMap.get(t);return r?r.prevKey:null}getKeyAfter(t){let r=this.keyMap.get(t);return r?r.nextKey:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const r=[...this.getKeys()];return this.getItem(r[t])}constructor(t){this.keyMap=new Map,this.iterable=t;let r=s=>{if(this.keyMap.set(s.key,s),s.childNodes&&s.type==="section")for(let u of s.childNodes)r(u)};for(let s of t)r(s);let n,i=0;for(let[s,u]of this.keyMap)n?(n.nextKey=s,u.prevKey=n.key):(this.firstKey=s,u.prevKey=void 0),u.type==="item"&&(u.index=i++),n=u,n.nextKey=void 0;this.lastKey=n==null?void 0:n.key}}function GM(e){let{filter:t}=e,r=Iy(e),n=C.exports.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),i=o=>t?new Gd(t(o)):new Gd(o),s=C.exports.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),u=ed(e,i,s,[t]);return C.exports.useEffect(()=>{r.focusedKey!=null&&!u.getItem(r.focusedKey)&&r.setFocusedKey(null)},[u,r.focusedKey]),{collection:u,disabledKeys:n,selectionManager:new Ry(u,r)}}var RK={};ab(RK,"useSingleSelectListState",()=>sb);function sb(e){var t;let[r,n]=Mn(e.selectedKey,(t=e.defaultSelectedKey)!==null&&t!==void 0?t:null,e.onSelectionChange),i=C.exports.useMemo(()=>r!=null?[r]:[],[r]),{collection:s,disabledKeys:u,selectionManager:o}=GM(Y($({},e),{selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:l=>{let h=l.values().next().value;h===r&&e.onSelectionChange&&e.onSelectionChange(h),n(h)}})),a=r!=null?s.getItem(r):null;return{collection:s,disabledKeys:u,selectionManager:o,selectedKey:r,setSelectedKey:n,selectedItem:a}}function FK(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var LK={};FK(LK,"useSelectState",()=>qM);function qM(e){let t=_0(e),r=sb(Y($({},e),{onSelectionChange:s=>{e.onSelectionChange!=null&&e.onSelectionChange(s),t.close()}})),[n,i]=C.exports.useState(!1);return Y($($({},r),t),{open(){r.collection.size!==0&&t.open()},toggle(s){r.collection.size!==0&&t.toggle(s)},isFocused:n,setFocused:i})}function lb(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var NK={};lb(NK,"useSelect",()=>JM);function JM(e,t,r){let{keyboardDelegate:n,isDisabled:i}=e,s=hd({usage:"search",sensitivity:"base"}),u=C.exports.useMemo(()=>n||new vy(t.collection,t.disabledKeys,null,s),[n,t.collection,t.disabledKeys,s]),{menuTriggerProps:o,menuProps:a}=by({isDisabled:i,type:"listbox"},t,r),l=y=>{switch(y.key){case"ArrowLeft":{y.preventDefault();let b=t.selectedKey!=null?u.getKeyAbove(t.selectedKey):u.getFirstKey();b&&t.setSelectedKey(b);break}case"ArrowRight":{y.preventDefault();let b=t.selectedKey!=null?u.getKeyBelow(t.selectedKey):u.getFirstKey();b&&t.setSelectedKey(b);break}}},{typeSelectProps:h}=gy({keyboardDelegate:u,selectionManager:t.selectionManager,onTypeSelect(y){t.setSelectedKey(y)}}),{labelProps:c,fieldProps:f,descriptionProps:d,errorMessageProps:g}=Nd(Y($({},e),{labelElementType:"span"}));h.onKeyDown=h.onKeyDownCapture,delete h.onKeyDownCapture;let m=_r(e,{labelable:!0}),p=Ce(h,o,f),v=Kt();return{labelProps:Y($({},c),{onClick:()=>{e.isDisabled||(r.current.focus(),Hv("keyboard"))}}),triggerProps:Ce(m,Y($({},p),{onKeyDown:io(p.onKeyDown,l,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[p["aria-labelledby"],p["aria-label"]&&!p["aria-labelledby"]?p.id:null,v].filter(Boolean).join(" "),onFocus(y){t.isFocused||(e.onFocus&&e.onFocus(y),t.setFocused(!0))},onBlur(y){t.isOpen||(e.onBlur&&e.onBlur(y),t.setFocused(!1))}})),valueProps:{id:v},menuProps:Y($({},a),{autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,onBlur:y=>{y.currentTarget.contains(y.relatedTarget)||(e.onBlur&&e.onBlur(y),t.setFocused(!1))},"aria-labelledby":[f["aria-labelledby"],p["aria-label"]&&!f["aria-labelledby"]?p.id:null].filter(Boolean).join(" ")}),descriptionProps:d,errorMessageProps:g}}var ZM={};lb(ZM,"useHiddenSelect",()=>QM),lb(ZM,"HiddenSelect",()=>ek);function QM(e,t,r){let{autoComplete:n,name:i,isDisabled:s}=e,u=zC(),{visuallyHiddenProps:o}=qv();var a;return{containerProps:Y($({},o),{"aria-hidden":!0}),inputProps:{type:"text",tabIndex:u==null||t.isFocused||t.isOpen?-1:0,style:{fontSize:16},onFocus:()=>r.current.focus(),disabled:s},selectProps:{tabIndex:-1,autoComplete:n,disabled:s,name:i,size:t.collection.size,value:(a=t.selectedKey)!==null&&a!==void 0?a:"",onChange:l=>t.setSelectedKey(l.target.value)}}}function ek(e){let{state:t,triggerRef:r,label:n,name:i,isDisabled:s}=e,{containerProps:u,inputProps:o,selectProps:a}=QM(e,t,r);return t.collection.size<=300?ee.createElement("div",u,ee.createElement("input",o),ee.createElement("label",null,n,ee.createElement("select",a,ee.createElement("option",null),[...t.collection.getKeys()].map(l=>{let h=t.collection.getItem(l);if(h.type==="item")return ee.createElement("option",{key:h.key,value:h.key},h.textValue)})))):i?ee.createElement("input",{type:"hidden",autoComplete:a.autoComplete,name:i,disabled:s,value:t.selectedKey}):null}function ub({children:e,direction:t}){const r=t==="start"?"left-12":"right-12";return e?S("div",{className:`absolute h-full flex items-center ${r} top-0`,children:e}):null}function tu(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var zK={};tu(zK,"useListBox",()=>nk);var tk={};tu(tk,"listData",()=>qd),tu(tk,"getItemId",()=>rk);const qd=new WeakMap;function jK(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function rk(e,t){let r=qd.get(e);if(!r)throw new Error("Unknown list");return`${r.id}-option-${jK(t)}`}function nk(e,t,r){let n=_r(e,{labelable:!0}),{listProps:i}=yy(Y($({},e),{ref:r,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys})),{focusWithinProps:s}=Da({onFocusWithin:e.onFocus,onBlurWithin:e.onBlur,onFocusWithinChange:e.onFocusChange}),u=Kt(e.id);qd.set(t,{id:u,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized});let{labelProps:o,fieldProps:a}=yo(Y($({},e),{id:u,labelElementType:"span"}));return{labelProps:o,listBoxProps:Ce(n,s,t.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},$({role:"listbox"},Ce(a,i)))}}var BK={};tu(BK,"useOption",()=>ik);function ik(e,t,r){let{key:n}=e,i=qd.get(t);var s;let u=(s=e.isDisabled)!==null&&s!==void 0?s:t.disabledKeys.has(n);var o;let a=(o=e.isSelected)!==null&&o!==void 0?o:t.selectionManager.isSelected(n),l=t.selectionManager.focusedKey===n;var h;let c=(h=e.shouldSelectOnPressUp)!==null&&h!==void 0?h:i.shouldSelectOnPressUp;var f;let d=(f=e.shouldFocusOnHover)!==null&&f!==void 0?f:i.shouldFocusOnHover;var g;let m=(g=e.shouldUseVirtualFocus)!==null&&g!==void 0?g:i.shouldUseVirtualFocus;var p;let v=(p=e.isVirtualized)!==null&&p!==void 0?p:i.isVirtualized,y=kn(),b=kn(),x={role:"option","aria-disabled":u,"aria-selected":t.selectionManager.selectionMode!=="none"?a:void 0};ao()&&OC()||(x["aria-label"]=e["aria-label"],x["aria-labelledby"]=y,x["aria-describedby"]=b),v&&(x["aria-posinset"]=t.collection.getItem(n).index+1,x["aria-setsize"]=td(t.collection));let{itemProps:w,isPressed:T}=Pd({selectionManager:t.selectionManager,key:n,ref:r,shouldSelectOnPressUp:c,isVirtualized:v,shouldUseVirtualFocus:m,isDisabled:u}),{hoverProps:_}=vi({isDisabled:u||!d,onHoverStart(){lo()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(n))}});return{optionProps:Y($($({},x),Ce(w,_)),{id:rk(t,n)}),labelProps:{id:y},descriptionProps:{id:b},isFocused:l,isSelected:a,isDisabled:u,isPressed:T}}var VK={};tu(VK,"useListBoxSection",()=>UK);function UK(e){let{heading:t,"aria-label":r}=e,n=Kt();return{itemProps:{role:"presentation"},headingProps:t?{id:n,"aria-hidden":!0}:{},groupProps:{role:"group","aria-label":r,"aria-labelledby":t?n:void 0}}}function HK(e){const{item:t,state:r}=e,n=C.exports.useRef(null),{optionProps:i,isDisabled:s,isSelected:u,isFocused:o}=ik({"aria-label":t["aria-label"],key:t.key},r,n),{hoverProps:a,isHovered:l}=vi(Y($({},e),{isDisabled:s})),h=lo(),c=LO({isFocused:o&&h,isSelected:u,isDisabled:s,isHovered:l});return S("li",Y($({className:c},Ce(i,a)),{ref:n,children:t.rendered}))}const WK=C.exports.forwardRef((i,n)=>{var s=i,{className:e,style:t}=s,r=ze(s,["className","style"]);const u=kv(n),{state:o}=r,{listBoxProps:a}=nk(r,o,u),l=FO(e);return S("ul",Y($({className:l,style:t},a),{ref:u,children:[...o.collection].map(h=>S(HK,{item:h,state:o},h.key))}))});function cb(e){var j;const{label:t,name:r,value:n,onChange:i,isDisabled:s,autoComplete:u,shouldFlip:o}=$({},e),a=xo(Y($({},e),{endAdornment:!0})),l=qM(Y($({},e),{onSelectionChange:i,selectedKey:n})),h=C.exports.useRef(null),{triggerRef:c,overlayRef:f,positionStyle:d,triggerObjRef:g}=Ay({shouldFlip:o}),{labelProps:m,triggerProps:p,valueProps:v,menuProps:y,descriptionProps:b,errorMessageProps:x}=JM(e,l,g),w=yO(),{buttonProps:T}=Zf(p,g),_=ce(qf,{restoreFocus:!0,contain:w,children:[S(Ya,{onDismiss:()=>l.close()}),S(WK,Y($({},y),{ref:h,state:l,disallowEmptySelection:!0,autoFocus:l.focusStrategy||!0,shouldSelectOnPressUp:!0})),S(Ya,{onDismiss:()=>l.close()})]}),[E,k]=C.exports.useState(null),z=C.exports.useCallback(()=>{if(!w&&g.current){const K=g.current.offsetWidth;k(K)}},[k,w,g]);SC({ref:g,onResize:z}),mt(z,[l.selectedKey,z]);let F;return w?F=S(Ey,{isOpen:l.isOpen,onClose:l.close,children:_}):F=S(_y,{isOpen:l.isOpen,ref:f,hideArrow:!0,onClose:l.close,shouldCloseOnBlur:!0,style:Y($({},d),{width:`${E}px`}),children:_}),ce("div",{className:a.wrapper,children:[S("div",Y($({},m),{className:a.label,children:t})),S(ek,{state:l,autoComplete:u,isDisabled:s,triggerRef:g,label:t,name:r}),ce("button",Y($({type:"button",className:a.input,disabled:s},T),{ref:c,children:[S("span",Y($({},v),{children:(j=l.selectedItem)==null?void 0:j.rendered})),S(ub,{direction:"end",children:S(zd,{className:"text-muted"})})]})),S(fn,{children:l.isOpen&&F})]})}function YK(){const e=pe(u=>u.filter.selected);if(!e)return null;const t=V().filter.getByName(e).options,r=(u,o)=>{var a;(a=V().filter)==null||a.applyValue(e,u,o),A().setDirty(!0)},n=V().canvas.getMainImage().filters,i=V().filter.findFilterIndex(e,n),s=n==null?void 0:n[i];if(t){const u=Object.entries(t).map(([o,a])=>{let l;const h=s?s[o]:a.current;return a.type==="slider"?l=S(_o,{label:S(De,$({},r0[o])),minValue:a.min,maxValue:a.max,step:a.step,defaultValue:h,formatOptions:{style:"percent"},size:"sm",onChange:c=>{r(o,c)}}):a.type==="colorPicker"?l=S(So,{label:S(De,$({},r0[o])),size:"sm",className:"w-full",defaultValue:h,onChange:c=>{r(o,c)}}):a.type==="select"&&(l=S(cb,{size:"sm",label:S(De,$({},r0[o])),defaultValue:h,onChange:c=>{r(o,c)},items:a.available,children:c=>S(_t,{textValue:c.key,children:S("span",{className:"capitalize",children:c.key})})})),S("div",{className:"pb-10",children:l},o)});return S(Gy,{children:S("div",{className:"max-w-240 pt-10 mx-auto",children:u})})}return null}function KK(){const e=pe(r=>r.frame.active),t=(e==null?void 0:e.mode)==="basic";return S(Gy,{className:"pb-18 pt-6",children:ce("div",{className:"max-w-288 m-auto",children:[t&&S("div",{className:"mb-16",children:S(So,{size:"sm",label:S(De,{id:"uMhpKe",defaultMessage:[{type:0,value:"Color"}]}),value:V().frame.builder.defaultColor,onChange:r=>{V().frame.active.changeColor(r)}})}),S(_o,{size:"sm",label:S(De,{id:"agOXPD",defaultMessage:[{type:0,value:"Size"}]}),step:1,minValue:V().frame.active.getMinSize(),maxValue:V().frame.active.getMaxSize(),defaultValue:V().frame.active.currentSizeInPercent,getValueLabel:r=>`${r}%`,onChange:r=>{V().frame.resize(r)}})]})})}function fb(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var XK={};fb(XK,"useTab",()=>ak);const ok=new WeakMap;function Jd(e,t,r){return typeof t=="string"&&(t=t.replace(/\s+/g,"")),`${ok.get(e)}-${r}-${t}`}function ak(e,t,r){let{key:n,isDisabled:i}=e,{selectionManager:s,selectedKey:u}=t,o=n===u,a=i||t.disabledKeys.has(n),{itemProps:l}=Pd({selectionManager:s,key:n,ref:r,isDisabled:a}),h=Jd(t,n,"tab"),c=Jd(t,n,"tabpanel"),{tabIndex:f}=l;return{tabProps:Y($({},l),{id:h,"aria-selected":o,"aria-disabled":a||void 0,"aria-controls":o?c:void 0,tabIndex:a?void 0:f,role:"tab"})}}var GK={};fb(GK,"useTabPanel",()=>sk);function sk(e,t,r){let[n,i]=C.exports.useState(0);mt(()=>{if(r==null?void 0:r.current){let o=()=>{let l=rr(r.current,{tabbable:!0});i(l.nextNode()?void 0:0)};o();let a=new MutationObserver(o);return a.observe(r.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{a.disconnect()}}},[r]);const s=Jd(t,t==null?void 0:t.selectedKey,"tabpanel"),u=_l(Y($({},e),{id:s,"aria-labelledby":Jd(t,t==null?void 0:t.selectedKey,"tab")}));return{tabPanelProps:Ce(u,{tabIndex:n,role:"tabpanel","aria-describedby":e["aria-describedby"],"aria-details":e["aria-details"]})}}var qK={};fb(qK,"useTabList",()=>lk);class JK{getKeyLeftOf(t){return this.flipDirection?this.getNextKey(t):this.orientation==="horizontal"?this.getPreviousKey(t):null}getKeyRightOf(t){return this.flipDirection?this.getPreviousKey(t):this.orientation==="horizontal"?this.getNextKey(t):null}getKeyAbove(t){return this.orientation==="vertical"?this.getPreviousKey(t):null}getKeyBelow(t){return this.orientation==="vertical"?this.getNextKey(t):null}getFirstKey(){let t=this.collection.getFirstKey();return this.disabledKeys.has(t)&&(t=this.getNextKey(t)),t}getLastKey(){let t=this.collection.getLastKey();return this.disabledKeys.has(t)&&(t=this.getPreviousKey(t)),t}getNextKey(t){do t=this.collection.getKeyAfter(t),t==null&&(t=this.collection.getFirstKey());while(this.disabledKeys.has(t));return t}getPreviousKey(t){do t=this.collection.getKeyBefore(t),t==null&&(t=this.collection.getLastKey());while(this.disabledKeys.has(t));return t}constructor(t,r,n,i=new Set){this.collection=t,this.flipDirection=r==="rtl"&&n==="horizontal",this.orientation=n,this.disabledKeys=i}}function lk(e,t,r){let{orientation:n="horizontal",keyboardActivation:i="automatic"}=e,{collection:s,selectionManager:u,disabledKeys:o}=t,{direction:a}=Rr(),l=C.exports.useMemo(()=>new JK(s,a,n,o),[s,o,n,a]),{collectionProps:h}=my({ref:r,selectionManager:u,keyboardDelegate:l,selectOnFocus:i==="automatic",disallowEmptySelection:!0,scrollRef:r}),c=Kt();ok.set(t,c);let f=_l(Y($({},e),{id:c}));return{tabListProps:Y($({},Ce(h,f)),{role:"tablist","aria-orientation":n,tabIndex:void 0})}}const ru=ee.createContext(null);function ZK(e){const t=C.exports.useContext(ru),{item:r,state:n,className:i}=e,{key:s,rendered:u}=r,o=n.disabledKeys.has(s),a=n.selectedKey===s,l=C.exports.useRef(null),{tabProps:h}=ak({key:s},n,l),{hoverProps:c,isHovered:f}=vi(Y($({},e),{isDisabled:o})),d=t.tabProps.size,g=Ee("tracking-wide overflow-hidden capitalize flex-shrink-0 flex items-center outline-none transition-colors",QK({isDisabled:o,isHovered:f,isSelected:a}),i,{"px-16 h-48":!d||d==="md","px-12 h-32":d==="sm","cursor-pointer":!o});return S(x0,{focusRingClass:"ring-2 ring-inset ring-primary-light rounded",children:S("div",Y($({className:g},Ce(h,c)),{ref:l,children:u}))})}function QK({isDisabled:e,isHovered:t,isSelected:r}){return e?"text-disabled cursor-default":r?"text-primary":t?"text-main":"text-muted"}function eX(e){const{selectedTab:t,selectedKey:r}=e,[n,i]=C.exports.useState({width:void 0,transform:void 0});return mt(()=>{t&&i({width:`${t.offsetWidth}px`,transform:`translateX(${t.offsetLeft}px)`})},[i,t,r]),S("div",{className:"absolute bottom-0 left-0 h-2 bg-primary transition-all",role:"presentation",style:n})}function tX(e){const t=C.exports.useContext(ru),{refs:r,tabState:n,tabProps:i}=t,{selectedTab:s,tabListState:u}=n,{tablistRef:o}=r,{tabListProps:a}=lk($($({},i),e),u,o);return ce("div",Y($({className:"flex relative max-w-full overflow-auto hide-scrollbar"},a),{ref:o,children:[[...u.collection].map((l,h)=>S(ZK,{className:Ee(h===0&&"ml-auto",h===u.collection.size-1&&"mr-auto"),item:l,state:u},l.key)),S(eX,{selectedTab:s})]}))}function rX(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var nX={};rX(nX,"useTabListState",()=>uk);function uk(e){let t=sb(Y($({},e),{suppressTextValueWarning:!0}));return C.exports.useEffect(()=>{let r=t.selectedKey;(t.selectionManager.isEmpty||!t.collection.getItem(r))&&(r=t.collection.getFirstKey(),t.selectionManager.replaceSelection(r)),t.selectionManager.focusedKey==null&&t.selectionManager.setFocusedKey(r)},[t.selectionManager,t.selectedKey,t.collection]),t}function iX(e){const h=e,{size:t="md",children:r,className:n}=h,i=ze(h,["size","children","className"]),s=C.exports.useRef(null),u=C.exports.useRef(null),[o,a]=C.exports.useState(null),l=uk(Y($({},e),{children:r[0].props.children}));return C.exports.useEffect(()=>{if(u.current){const c=u.current.querySelector(`[data-key="${l==null?void 0:l.selectedKey}"]`);c!=null&&a(c)}},[r,l==null?void 0:l.selectedKey,u]),S(ru.Provider,{value:{tabProps:Y($({},e),{size:t}),tabState:{tabListState:l,selectedTab:o},refs:{tablistRef:u}},children:S("div",Y($({className:Ee(n,"max-w-full overflow-hidden")},_r(i)),{ref:s,children:r}))})}const oX=Pe(S("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"}),"FormatUnderlinedOutlined"),aX=Pe(S("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"}),"FormatStrikethroughOutlined"),sX=Pe(S("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"}),"FormatItalicOutlined"),lX=Pe(S("path",{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"}),"FormatAlignRightOutlined"),uX=Pe(S("path",{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"}),"FormatAlignLeftOutlined"),cX=Pe(S("path",{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"}),"FormatAlignCenterOutlined");function fX(){return ce("div",{className:"flex gap-20 justify-center",children:[S(dX,{}),S(hX,{}),S(pX,{})]})}function dX(){var r;const e=(r=pe(n=>n.objects.active.editableProps.fontSize))!=null?r:40,{formatMessage:t}=Gi();return S(wo,{size:"xs","aria-label":t({id:"SqP3AR",defaultMessage:[{type:0,value:"Font Size"}]}),minValue:1,maxValue:300,className:"w-64 flex-shrink-0",value:e,onChange:n=>{V().objects.setValues({fontSize:n}),A().setDirty(!0)}})}function hX(){const e=pe(s=>s.objects.active.editableProps.fontStyle),t=pe(s=>s.objects.active.editableProps.underline),r=pe(s=>s.objects.active.editableProps.linethrough),[n,i]=C.exports.useState([e,t&&"underline",r&&"linethrough"]);return ce(Fd,{size:"xs",variant:"outline",radius:"rounded",value:n,multiple:!0,onChange:s=>{i(s),V().objects.setValues({underline:s.includes("underline"),linethrough:s.includes("linethrough"),fontStyle:s.includes("italic")?"italic":""}),A().setDirty(!0)},children:[S(qe,{value:"underline",children:S(oX,{})}),S(qe,{value:"linethrough",children:S(aX,{})}),S(qe,{value:"italic",children:S(sX,{})})]})}function pX(){const e=pe(t=>t.objects.active.editableProps.textAlign);return ce(Fd,{size:"xs",variant:"outline",radius:"rounded",value:e,onChange:t=>{V().objects.setValues({textAlign:t}),A().setDirty(!0)},children:[S(qe,{value:"left",children:S(uX,{})}),S(qe,{value:"center",children:S(cX,{})}),S(qe,{value:"right",children:S(lX,{})})]})}function gX(e){const{tabState:t,tabProps:r}=C.exports.useContext(ru),{tabListState:n}=t,i=o=>new Gd(o),s=ed($({items:r.items},e),i,{suppressTextValueWarning:!0}),u=n?s.getItem(n.selectedKey):null;return C.exports.createElement(mX,Y($({},e),{key:n==null?void 0:n.selectedKey}),u&&u.props.children)}function mX(e){const{children:t,className:r}=e,{tabState:n}=C.exports.useContext(ru),i=C.exports.useRef(null),{tabPanelProps:s}=sk(e,n.tabListState,i);return S(x0,{focusRingClass:"outline-primary-light",children:S("div",Y($({className:r},s),{ref:i,children:t}))})}const ck=[{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{color:"#ffe47b",offset:0},{color:"rgb(111,154,211)",offset:1}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{color:"#ff4040",offset:0},{color:"#e6399b",offset:1}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#200772"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#FF4F4F"},{offset:1,color:"rgb(255, 239, 64)"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:20,y2:20},colorStops:[{offset:0,color:"#ffe47b"},{offset:.5,color:"rgb(111,154,211)"},{offset:1,color:"rgb(166,111,213)"}]},{type:"radial",coords:{r1:50,r2:80,x1:45,y1:45,x2:52,y2:50},colorStops:[{offset:0,color:"rgb(155, 237, 0)"},{offset:1,color:"rgba(0, 164, 128,0.4)"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"#9ecb2d"},{offset:.5,color:"#72aa00"},{offset:1,color:"#bfd255"}]},{type:"radial",coords:{r1:100,r2:50,x1:30,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#aebcbf"},{offset:1,color:"#0a0809"}]},{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{offset:0,color:"#ffffff"},{offset:1,color:"#f6f6f6"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#fefcea"},{offset:1,color:"#f1da36"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#ff1a00"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#b7deed"},{offset:1,color:"#21b4e2"}]},{type:"linear",coords:{x1:-80,y1:100,x2:80,y2:-100},colorStops:[{offset:0,color:"#ffe47b"},{offset:1,color:"rgb(111,154,211)"}]}],vX=Pe(S("path",{d:"M19.51 3.08 3.08 19.51c.09.34.27.65.51.9.25.24.56.42.9.51L20.93 4.49c-.19-.69-.73-1.23-1.42-1.41zM11.88 3 3 11.88v2.83L14.71 3h-2.83zM5 3c-1.1 0-2 .9-2 2v2l4-4H5zm14 18c.55 0 1.05-.22 1.41-.59.37-.36.59-.86.59-1.41v-2l-4 4h2zm-9.71 0h2.83L21 12.12V9.29L9.29 21z"}),"TextureOutlined"),yX=Pe(S("path",{d:"M11 9h2v2h-2V9zm-2 2h2v2H9v-2zm4 0h2v2h-2v-2zm2-2h2v2h-2V9zM7 9h2v2H7V9zm12-6H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 18H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm2-7h-2v2h2v2h-2v-2h-2v2h-2v-2h-2v2H9v-2H7v2H5v-2h2v-2H5V5h14v6z"}),"GradientOutlined"),bX=Pe(S("path",{d:"M18 20H4V6h9V4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2v9zm-7.79-3.17-1.96-2.36L5.5 18h11l-3.54-4.71zM20 4V1h-2v3h-3c.01.01 0 2 0 2h3v2.99c.01.01 2 0 2 0V6h3V4h-3z"}),"AddPhotoAlternateOutlined");function fk({property:e}){const{formatMessage:t}=Gi(),r=pe(n=>n.objects.active.editableProps[e]);return ce(xr,{children:[S(So,{size:"xs","aria-label":t({id:"uMhpKe",defaultMessage:[{type:0,value:"Color"}]}),value:typeof r=="string"?r:pm.fill,onChange:n=>{V().objects.setValues({[e]:n}),A().setDirty(!0)}}),S(dk,{type:"gradient",property:e}),S(dk,{type:"texture",property:e})]})}function dk({type:e,property:t}){const r=e==="texture"?S(vX,{}):S(yX,{});return S(xr,{children:ce(Kd,{type:"popover",children:[S(nr,{id:`${e}-panel-trigger`,variant:"outline",size:"xs",startIcon:r,endIcon:S(zd,{}),children:S("span",{className:"capitalize",children:e==="gradient"?S(De,{id:"y/FCma",defaultMessage:[{type:0,value:"Gradient"}]}):S(De,{id:"ktqcD5",defaultMessage:[{type:0,value:"Texture"}]})})}),n=>S(Xd,{children:S("div",{className:"grid gap-8 grid-cols-5-min-content p-10 bg-paper rounded shadow-md",children:S(xX,{property:t,closeOverlay:n.close,type:e})})})]})})}function xX({closeOverlay:e,type:t,property:r}){const n=Array.from(Array(t==="gradient"?ck.length:28).keys()),i="w-56 h-56 bg border shadow-sm hover:scale-110",s=n.map(u=>{const o=Ar(`images/${t}s/${u}.png`);return S(In,{radius:"rounded",className:i,style:{backgroundImage:`url(${o})`},"aria-label":`Select ${t} #${u}`,onPress:async()=>{e();const a=t==="gradient"?new Me.fabric.Gradient(ck[u]):await hk(o);V().objects.setValues({[r]:a}),A().setDirty(!0)}},u)});return t==="texture"&&s.unshift(S(wX,{property:r,closeOverlay:e,className:i},"upload-btn")),S(xr,{children:s})}function wX({className:e,closeOverlay:t,property:r}){return S(In,{radius:"rounded",className:e,"aria-label":"Upload an image",onPress:async()=>{const n=await V().import.openUploadWindow();if(t(),n){const i=await hk(await n.data);V().objects.setValues({[r]:i})}},children:S(bX,{className:"icon-md"})})}function hk(e){return new Promise(t=>{Me.fabric.util.loadImage(e,r=>{const n=new Me.fabric.Pattern({source:r,repeat:"repeat"});t(n)})})}function SX(){const e=pe(t=>t.objects.active.editableProps.opacity);return S(_o,{className:"max-w-240","aria-label":"Opacity",value:e,minValue:.1,step:.1,maxValue:1,onChange:t=>{V().objects.setValues({opacity:t}),A().setDirty(!0)}})}function _X(){const{formatMessage:e}=Gi(),t=pe(n=>n.objects.active.editableProps.stroke),r=pe(n=>n.objects.active.editableProps.strokeWidth);return ce(xr,{children:[S(So,{size:"xs",value:t,"aria-label":e({id:"k1rbG0",defaultMessage:[{type:0,value:"Outline Color"}]}),onChange:n=>{V().objects.setValues({stroke:n}),A().setDirty(!0)}}),S(_o,{"aria-label":"Outline Width",className:"max-w-240",value:r,onChange:n=>{V().objects.setValues({strokeWidth:n}),A().setDirty(!0)}})]})}const TX=Pe(S("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}),"ImageOutlined");function CX(){return S("div",{children:S(nr,{type:"button",variant:"outline",size:"xs",startIcon:S(TX,{}),radius:"rounded-full",onPress:async()=>{const e=await V().import.openUploadWindow();if(e){const t=V().objects.getActive();if(t&&"setSrc"in t){const r=await e.data;t.setSrc(r,()=>{qC({src:r}),V().canvas.render()})}}},children:S(De,{id:"cYfRr+",defaultMessage:[{type:0,value:"Replace Image"}]})})})}const pk={color:"rgba(0, 0, 0, 0.6)",blur:3,offsetX:-1,offsetY:0};function EX(){const{formatMessage:e}=Gi(),t=pe(r=>r.objects.active.editableProps.shadow)||pk;return ce(xr,{children:[S(So,{value:t.color,size:"xs","aria-label":e({id:"cPxU+s",defaultMessage:[{type:0,value:"Shadow Color"}]}),onChange:r=>{V().objects.setValues({shadow:gk({color:r})}),A().setDirty(!0)}}),S(_o,{"aria-label":"Shadow Blur",className:"max-w-240",defaultValue:t.blur,onChange:r=>{V().objects.setValues({shadow:gk({blur:r})}),A().setDirty(!0)}})]})}function gk(e){var r;const t=(r=V().objects.getActive())==null?void 0:r.shadow;return t?(Object.entries(e).forEach(([n,i])=>{t[n]=i}),t):new Me.fabric.Shadow($($({},pk),e))}function mk(){const e=pe(t=>t.objects.active);return ce(iX,{size:"sm",className:"pb-18 pt-6",children:[ce(tX,{children:[e.isText&&S(_t,{children:S(De,{id:"A3jj9z",defaultMessage:[{type:0,value:"Font"}]})},"font"),!e.isImage&&S(_t,{children:S(De,{id:"uMhpKe",defaultMessage:[{type:0,value:"Color"}]})},"fill"),!e.isImage&&S(_t,{children:S(De,{id:"XQZA8e",defaultMessage:[{type:0,value:"Background"}]})},"bgColor"),e.isImage&&S(_t,{children:S(De,{id:"+0zv6g",defaultMessage:[{type:0,value:"Image"}]})},"image"),S(_t,{children:S(De,{id:"PHutSR",defaultMessage:[{type:0,value:"Opacity"}]})},"opacity"),S(_t,{children:S(De,{id:"aEhjYg",defaultMessage:[{type:0,value:"Outline"}]})},"outline"),S(_t,{children:S(De,{id:"u4jNiO",defaultMessage:[{type:0,value:"Shadow"}]})},"shadow")]}),ce(gX,{className:"flex items-center justify-center gap-10 pt-16 h-50 w-full",children:[S(_t,{children:S(fX,{})},"font"),S(_t,{children:S(fk,{property:"fill"})},"fill"),S(_t,{children:S(fk,{property:"backgroundColor"})},"bgColor"),S(_t,{children:S(CX,{})},"image"),S(_t,{children:S(SX,{})},"opacity"),S(_t,{children:S(_X,{})},"outline"),S(_t,{children:S(EX,{})},"shadow")]})]})}function PX(){const t=!UM()&&S(nr,{size:"sm",color:"primary",variant:"outline",onPress:()=>{V().text.add(),A().setDirty(!0)},children:S(De,{id:"kWzXGg",defaultMessage:[{type:0,value:"New Text"}]})});return S(Gy,{actionBtn:t,children:S(mk,{})})}function OX(){const e=pe(n=>n.activeToolOverlay),t=pe(n=>n.objects.active.id),r=MX(e,t);return S("div",{className:"relative z-tool-overlay text-sm",children:S(fn,{children:r&&S(Yt.div,{initial:{y:0,opacity:0},animate:{y:"-100%",opacity:1},exit:{y:0,opacity:0},transition:{type:"tween",duration:.15},className:"absolute inset-x-0 gap-16 px-5vw bg bg-opacity-95 border-t",children:r},"tool-controls-overlay")})})}function MX(e,t){switch(e){case Wr.Filter:return S(YK,{});case Wr.Frame:return S(KK,{});case Wr.Text:return t&&S(PX,{});case Wr.ActiveObject:return t&&S(mk,{});default:return null}}const db=Pe(S("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function kX({filter:e}){const t=pe(u=>u.filter.applied.includes(e)),r=V().filter.hasOptions(e),n=Ee("block flex-shrink-0 rounded",{"text-primary border-primary":t}),i=oj[e],s=ce(xr,{children:[ce("div",{className:"relative",children:[S($X,{filter:e}),t&&S(DX,{filter:e,hasOptions:r})]}),S("div",{className:"mt-4 text-center text-xs capitalize",children:i?S(De,$({},i)):e})]});return t&&r?S("div",{className:n,children:s}):S(In,{className:n,onPress:()=>{t?V().filter.remove(e):V().filter.apply(e)},children:s})}function $X({filter:e}){const t=pe(n=>n.filter.selected===e),r=Ee("m-auto w-96 h-56 border rounded object-cover",{shadow:t});return S("img",{src:Ar(`images/filter/${e}.jpg`),className:r,alt:""})}function DX({filter:e,hasOptions:t}){return ce("div",{className:"flex items-center justify-center bg-background/70 absolute inset-0 border-2 border-primary rounded",children:[t?S(qe,{color:"primary",size:"md",onPress:()=>{V().filter.remove(e)},children:S(db,{})}):S(db,{className:"svg-icon icon-md"}),t&&S(AX,{filter:e,hasOptions:t})]})}function AX({filter:e,hasOptions:t}){return S(qe,{color:"primary",size:"md",onPress:()=>{A().activeToolOverlay===Wr.Filter&&A().filter.selected===e?A().setActiveTool(A().activeTool,null):A().filter.select(e,t)},children:S(RS,{})})}const To=C.exports.forwardRef(({children:e,className:t,gap:r},n)=>{const i=ee.Children.map(e,(s,u)=>ee.isValidElement(s)?ee.cloneElement(s,{isFirst:u===0,isLast:ee.Children.count(e)===u+1}):s);return S("div",{ref:n,className:`tiny-scrollbar pb-4 overflow-x-auto relative flex items-center ${r||"gap-10"} ${t}`,children:i})});function zn({isFirst:e,isLast:t,children:r,className:n}){const i=Ee(n,"flex-shrink-0",{"ml-auto":e,"mr-auto":t});return S("div",{className:i,children:r})}function IX(){const e=pe(r=>{var n,i;return(i=(n=r.config.tools)==null?void 0:n.filter)==null?void 0:i.items})||[];C.exports.useEffect(()=>{V().filter.syncState()},[]);const t=e.map(r=>S(zn,{children:S(kX,{filter:r})},r));return S(To,{children:t})}function RX(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var FX={};RX(FX,"useToggleState",()=>hb);function hb(e={}){let{isReadOnly:t}=e,[r,n]=Mn(e.isSelected,e.defaultSelected||!1,e.onChange);function i(u){t||n(u)}function s(){t||n(!r)}return{isSelected:r,setSelected:i,toggle:s}}function LX(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var NX={};LX(NX,"useToggle",()=>vk);function vk(e,t,r){let{isDisabled:n=!1,isRequired:i,isReadOnly:s,value:u,name:o,children:a,"aria-label":l,"aria-labelledby":h,validationState:c="valid"}=e,f=b=>{b.stopPropagation(),t.setSelected(b.target.checked)},d=a!=null,g=l!=null||h!=null;!d&&!g&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let{pressProps:m}=mi({isDisabled:n}),{focusableProps:p}=Na(e,r),v=Ce(m,p),y=_r(e,{labelable:!0});return{inputProps:Ce(y,$({"aria-invalid":c==="invalid"||void 0,"aria-errormessage":e["aria-errormessage"],"aria-controls":e["aria-controls"],"aria-readonly":s||void 0,"aria-required":i||void 0,onChange:f,disabled:n,value:u,name:o,type:"checkbox"},v))}}function pb(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var zX={};pb(zX,"useCheckbox",()=>gb);function gb(e,t,r){let{inputProps:n}=vk(e,t,r),{isSelected:i}=t,{isIndeterminate:s}=e;return C.exports.useEffect(()=>{r.current&&(r.current.indeterminate=s)}),{inputProps:Y($({},n),{checked:i,"aria-checked":s?"mixed":i})}}var jX={};pb(jX,"useCheckboxGroup",()=>BX);const yk=new WeakMap;function BX(e,t){let{isDisabled:r,name:n}=e,{labelProps:i,fieldProps:s}=yo(Y($({},e),{labelElementType:"span"})),u=_r(e,{labelable:!0});return yk.set(t,n),{groupProps:Ce(u,$({role:"group","aria-disabled":r||void 0},s)),labelProps:i}}var VX={};pb(VX,"useCheckboxGroupItem",()=>bk);function bk(e,t,r){const n=hb({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),onChange(s){s?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(s)}});let{inputProps:i}=gb(Y($({},e),{isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||yk.get(t)}),n,r);return{inputProps:i}}const UX=Pe(S("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlankOutlined"),HX=Pe(S("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),WX=ee.createContext(null);function YX(e){const{children:t,className:r,icon:n,checkedIcon:i,isDisabled:s,value:u}=e,o=xo(Y($({},e),{label:t})),a=n||UX,l=i||HX,h=C.exports.useRef(null),{isFocusVisible:c,focusProps:f}=ho(),d=C.exports.useContext(WX),{inputProps:g}=d?bk(Y($({},e),{value:u}),d,h):gb(e,hb(e),h),m=Ee("flex items-center rounded",r,{"outline outline-offset-2":c}),p=s&&"text-disabled";return ce("label",{className:m,children:[S(uo,{children:S("input",Y($($({},g),f),{ref:h}))}),g.checked?S(l,{className:Ee(p||"text-primary",o.adornment)}):S(a,{className:Ee(p||"text-muted",o.adornment)}),t&&S("div",{className:Ee("block capitalize ml-6",o.size.font),children:t})]})}const KX=Pe(S("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOutlined"),XX=Pe(S("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOpenOutlined");function GX(){const{formatMessage:e}=Gi(),{minWidth:t=50,minHeight:r=50,maxHeight:n=2400,maxWidth:i=2400}=pe(c=>{var f;return(f=c.config.tools)==null?void 0:f.resize})||{},s=pe(c=>c.original),u=pe(c=>c.resize.formValue);C.exports.useEffect(()=>{A().resize.setFormValue($({},s))},[s]),C.exports.useEffect(()=>{A().setDirty(!0)},[]);const o=c=>{const f=Y($({},u),{width:c});u.maintainAspect&&(f.height=Bf(c,u.usePercentages)),A().resize.setFormValue(f)},a=c=>{const f=Y($({},u),{height:c});c&&u.maintainAspect&&(f.width=n0(c,u.usePercentages)),A().resize.setFormValue(f)},l=c=>{const f=Y($({},u),{maintainAspect:c});c&&(f.height=Bf(f.width,f.usePercentages)),A().resize.setFormValue(f)};return ce("form",{className:"flex items-center justify-center gap-16 w-full",onSubmit:c=>{c.preventDefault(),A().applyChanges()},children:[S(wo,{minValue:t,maxValue:i,size:"sm",className:"max-w-112",label:"Width",value:u.width,onChange:o,formatOptions:{useGrouping:!1}}),S("div",{className:"mt-24",children:S(YX,{size:"md",isSelected:u.maintainAspect,onChange:l,"aria-label":e({id:"qfw+KX",defaultMessage:[{type:0,value:"Maintain aspect ratio"}]}),checkedIcon:KX,icon:XX})}),S(wo,{minValue:r,maxValue:n,size:"sm",className:"max-w-112",label:"Height",value:u.height,onChange:a,formatOptions:{useGrouping:!1}}),S("button",{type:"submit",className:"hidden",children:S(De,{id:"4dL9o7",defaultMessage:[{type:0,value:"Resize"}]})})]})}function qX(){var i;const e=pe(s=>{var u,o;return(o=(u=s.config.tools)==null?void 0:u.crop)==null?void 0:o.presets})||[],t=pe(s=>s.crop.selectedAspectRatio),r=(i=pe(s=>{var u,o;return(o=(u=s.config.tools)==null?void 0:u.crop)==null?void 0:o.allowCustomRatio}))!=null?i:!0,n=e.filter(s=>s.ratio||!s.ratio&&r).map(s=>S(zn,{children:ce(In,{onPress:()=>V().crop.resetCropzone(s.ratio),className:"flex flex-col items-center justify-between cursor-pointer h-56",children:[S(JX,{preset:s,selectedRatio:t}),S(ZX,{preset:s,selectedRatio:t})]})},s.ratio||s.name));return S(To,{gap:"gap-18",children:n})}function JX({preset:e,selectedRatio:t}){let r=40,n=30;if(e.ratio){const s=i0(e.ratio);({width:r,height:n}=Vf(s,r,n))}const i=Ee("border-2",{"border-dotted":e.ratio===null,"border-primary":t===e.ratio});return S("div",{style:{width:`${r}px`,height:`${n}px`},className:i})}function ZX({preset:e,selectedRatio:t}){const r=Ee("mt-4 text-center text-xs",{"text-primary":t===e.ratio});return S("div",{className:r,children:e.name||e.ratio})}const xk=Pe(S("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}),"FlipOutlined");function QX(){return ce("div",{children:[S(qe,{size:"sm",onPress:()=>{V().transform.flip("vertical"),A().setDirty(!0)},children:S(xk,{})}),S(qe,{size:"sm",onPress:()=>{V().transform.flip("horizontal"),A().setDirty(!0)},children:S(xk,{className:"rotate-90"})})]})}const eG=Pe(S("path",{d:"M7.11 8.53 5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z"}),"RotateLeftOutlined"),tG=Pe(S("path",{d:"M15.55 5.55 11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42 1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"}),"RotateRightOutlined");function rG(){return ce("div",{children:[S(qe,{size:"sm",onPress:()=>{V().transform.rotateLeft(),A().setDirty(!0)},children:S(eG,{})}),S(qe,{size:"sm",onPress:()=>{V().transform.rotateRight(),A().setDirty(!0)},children:S(tG,{})})]})}function nG(){return ce("div",{className:"flex items-center justify-center gap-16",children:[S(QX,{}),S(iG,{}),S(rG,{})]})}function iG(){const e=dd(),t=C.exports.useRef(null),r=C.exports.useRef(null),n={minValue:-45,maxValue:45,step:1,label:"Straighten",numberFormatter:e,defaultValue:[A().crop.straightenAngle],onChange:a=>{const l=a[0];V().transform.straighten(l),A().crop.setTransformAngle(l),A().setDirty(!0),r.current.style.transform=`translateX(${l}px)`}},i=rb(n),{groupProps:s,trackProps:u,outputProps:o}=ob(n,i,t);return S("div",Y($({},s),{className:"flex-auto flex-shrink-0 max-w-320 touch-none isolate",children:ce("div",Y($({},u),{ref:t,className:"h-36 relative",children:[ce("output",Y($({},o),{className:"absolute left-1/2 top-1/2 w-40 text-center bg -translate-x-1/2 -translate-y-1/2 z-10",children:[i.getThumbValueLabel(0),"\xB0"]})),S(oG,{ref:r})]}))}))}const oG=ee.forwardRef((e,t)=>{const r=[...Array(80).keys()],n=r.map(i=>S("circle",{cx:2+i*10,cy:"20",r:i%5?.75:2},i));return S("div",{className:"relative h-full cursor-pointer overflow-hidden",children:S("svg",{ref:t,style:{width:r.length*10},className:"absolute -left-80 h-full fill-current",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:n})})});function aG(){return C.exports.useEffect(()=>(A().setDirty(!0),V().frame.active.hide(),()=>{V().frame.active.show()}),[]),ce("div",{className:"pb-16",children:[S("div",{className:"mb-10",children:S(nG,{})}),S(qX,{})]})}const sG=Pe(S("path",{d:"M 16 6 C 12.484375 6 9.273438 7.070313 6.90625 8.84375 C 4.539063 10.617188 3 13.15625 3 16 C 3 18.84375 4.539063 21.382813 6.90625 23.15625 C 9.273438 24.929688 12.484375 26 16 26 C 19.515625 26 22.726563 24.929688 25.09375 23.15625 C 27.460938 21.382813 29 18.84375 29 16 C 29 13.15625 27.460938 10.617188 25.09375 8.84375 C 22.726563 7.070313 19.515625 6 16 6 Z M 16 8 C 19.109375 8 21.898438 8.957031 23.875 10.4375 C 25.851563 11.917969 27 13.875 27 16 C 27 18.125 25.851563 20.082031 23.875 21.5625 C 21.898438 23.042969 19.109375 24 16 24 C 12.890625 24 10.101563 23.042969 8.125 21.5625 C 6.148438 20.082031 5 18.125 5 16 C 5 13.875 6.148438 11.917969 8.125 10.4375 C 10.101563 8.957031 12.890625 8 16 8 Z "})),lG=Pe(S("path",{d:"M 16 4 C 9.382813 4 4 9.382813 4 16 C 4 22.617188 9.382813 28 16 28 C 22.617188 28 28 22.617188 28 16 C 28 9.382813 22.617188 4 16 4 Z M 16 6 C 21.535156 6 26 10.464844 26 16 C 26 21.535156 21.535156 26 16 26 C 10.464844 26 6 21.535156 6 16 C 6 10.464844 10.464844 6 16 6 Z "})),uG=Pe(S("path",{d:"M 3 6 L 3 26 L 29 26 L 29 6 Z M 5 8 L 27 8 L 27 24 L 5 24 Z "})),cG=Pe(S("path",{d:"M 16 4.90625 L 15.125 6.40625 L 4.71875 24.5 L 3.875 26 L 28.125 26 L 27.28125 24.5 L 16.875 6.40625 Z M 16 8.9375 L 24.65625 24 L 7.34375 24 Z "}));function fG(){const t=(pe(r=>{var n,i;return(i=(n=r.config.tools)==null?void 0:n.shapes)==null?void 0:i.items})||[]).map(r=>S(zn,{children:S(qe,{variant:"outline",radius:"rounded-2xl",size:"xl",onPress:()=>{V().shape.addBasicShape(r.name),A().setDirty(!0)},children:S(dG,{shape:r})})},r.name));return S(To,{children:t})}function dG({shape:e}){var t;return e.type==="Path"?S("svg",{className:"m-auto w-36 h-36",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -100 512 700",children:S("path",{className:"fill-transparent stroke-current",d:(t=e.options)==null?void 0:t.path,strokeWidth:25})}):ee.cloneElement(hG[e.name],{className:"w-30 h-30"})}const hG={circle:S(lG,{viewBox:"0 0 32 32"}),square:S(uG,{viewBox:"0 0 32 32"}),triangle:S(cG,{viewBox:"0 0 32 32"}),ellipse:S(sG,{viewBox:"0 0 32 32"})};function Co(){return Co=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Co.apply(this,arguments)}function pG(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var gG=["bottom","height","left","right","top","width"],mG=function(t,r){return t===void 0&&(t={}),r===void 0&&(r={}),gG.some(function(n){return t[n]!==r[n]})},Ei=new Map,wk,vG=function e(){var t=[];Ei.forEach(function(r,n){var i=n.getBoundingClientRect();mG(i,r.rect)&&(r.rect=i,t.push(r))}),t.forEach(function(r){r.callbacks.forEach(function(n){return n(r.rect)})}),wk=window.requestAnimationFrame(e)};function yG(e,t){return{observe:function(){var n=Ei.size===0;Ei.has(e)?Ei.get(e).callbacks.push(t):Ei.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),n&&vG()},unobserve:function(){var n=Ei.get(e);if(n){var i=n.callbacks.indexOf(t);i>=0&&n.callbacks.splice(i,1),n.callbacks.length||Ei.delete(e),Ei.size||cancelAnimationFrame(wk)}}}}var Zd=typeof window!="undefined"?ee.useLayoutEffect:ee.useEffect;function bG(e,t){t===void 0&&(t={width:0,height:0});var r=ee.useState(e.current),n=r[0],i=r[1],s=ee.useReducer(xG,t),u=s[0],o=s[1],a=ee.useRef(!1);return Zd(function(){e.current!==n&&i(e.current)}),Zd(function(){if(n&&!a.current){a.current=!0;var l=n.getBoundingClientRect();o({rect:l})}},[n]),ee.useEffect(function(){if(!!n){var l=yG(n,function(h){o({rect:h})});return l.observe(),function(){l.unobserve()}}},[n]),u}function xG(e,t){var r=t.rect;return e.height!==r.height||e.width!==r.width?r:e}var wG=function(){return 50},SG=function(t){return t},_G=function(t,r){var n=r?"offsetWidth":"offsetHeight";return t[n]},TG=function(t){for(var r=Math.max(t.start-t.overscan,0),n=Math.min(t.end+t.overscan,t.size-1),i=[],s=r;s<=n;s++)i.push(s);return i};function CG(e){var t,r=e.size,n=r===void 0?0:r,i=e.estimateSize,s=i===void 0?wG:i,u=e.overscan,o=u===void 0?1:u,a=e.paddingStart,l=a===void 0?0:a,h=e.paddingEnd,c=h===void 0?0:h,f=e.parentRef,d=e.horizontal,g=e.scrollToFn,m=e.useObserver,p=e.initialRect,v=e.onScrollElement,y=e.scrollOffsetFn,b=e.keyExtractor,x=b===void 0?SG:b,w=e.measureSize,T=w===void 0?_G:w,_=e.rangeExtractor,E=_===void 0?TG:_,k=d?"width":"height",z=d?"scrollLeft":"scrollTop",F=ee.useRef({scrollOffset:0,measurements:[]}),j=ee.useState(0),K=j[0],B=j[1];F.current.scrollOffset=K;var H=m||bG,ue=H(f,p),ge=ue[k];F.current.outerSize=ge;var fe=ee.useCallback(function(ie){f.current&&(f.current[z]=ie)},[f,z]),L=g||fe;g=ee.useCallback(function(ie){L(ie,fe)},[fe,L]);var Z=ee.useState({}),M=Z[0],D=Z[1],R=ee.useCallback(function(){return D({})},[]),P=ee.useRef([]),O=ee.useMemo(function(){var ie=P.current.length>0?Math.min.apply(Math,P.current):0;P.current=[];for(var ye=F.current.measurements.slice(0,ie),he=ie;he<n;he++){var U=x(he),se=M[U],me=ye[he-1]?ye[he-1].end:l,_e=typeof se=="number"?se:s(he),Ie=me+_e;ye[he]={index:he,start:me,size:_e,end:Ie,key:U}}return ye},[s,M,l,n,x]),N=(((t=O[n-1])==null?void 0:t.end)||l)+c;F.current.measurements=O,F.current.totalSize=N;var I=v?v.current:f.current,q=ee.useRef(y);q.current=y,Zd(function(){if(!I){B(0);return}var ie=function(he){var U=q.current?q.current(he):I[z];B(U)};return ie(),I.addEventListener("scroll",ie,{capture:!1,passive:!0}),function(){I.removeEventListener("scroll",ie)}},[I,z]);var X=PG(F.current),ne=X.start,re=X.end,ae=ee.useMemo(function(){return E({start:ne,end:re,overscan:o,size:O.length})},[ne,re,o,O.length,E]),G=ee.useRef(T);G.current=T;var W=ee.useMemo(function(){for(var ie=[],ye=function(me,_e){var Ie=ae[me],Ue=O[Ie],Ne=Co(Co({},Ue),{},{measureRef:function(ft){if(ft){var ir=G.current(ft,d);if(ir!==Ne.size){var pr=F.current.scrollOffset;Ne.start<pr&&fe(pr+(ir-Ne.size)),P.current.push(Ie),D(function(Gr){var Gt;return Co(Co({},Gr),{},(Gt={},Gt[Ne.key]=ir,Gt))})}}}});ie.push(Ne)},he=0,U=ae.length;he<U;he++)ye(he);return ie},[ae,fe,d,O]),J=ee.useRef(!1);Zd(function(){J.current&&D({}),J.current=!0},[s]);var te=ee.useCallback(function(ie,ye){var he=ye===void 0?{}:ye,U=he.align,se=U===void 0?"start":U,me=F.current,_e=me.scrollOffset,Ie=me.outerSize;se==="auto"&&(ie<=_e?se="start":ie>=_e+Ie?se="end":se="start"),se==="start"?g(ie):se==="end"?g(ie-Ie):se==="center"&&g(ie-Ie/2)},[g]),Q=ee.useCallback(function(ie,ye){var he=ye===void 0?{}:ye,U=he.align,se=U===void 0?"auto":U,me=pG(he,["align"]),_e=F.current,Ie=_e.measurements,Ue=_e.scrollOffset,Ne=_e.outerSize,Ae=Ie[Math.max(0,Math.min(ie,n-1))];if(!!Ae){if(se==="auto")if(Ae.end>=Ue+Ne)se="end";else if(Ae.start<=Ue)se="start";else return;var ft=se==="center"?Ae.start+Ae.size/2:se==="end"?Ae.end:Ae.start;te(ft,Co({align:se},me))}},[te,n]),le=ee.useCallback(function(){for(var ie=arguments.length,ye=new Array(ie),he=0;he<ie;he++)ye[he]=arguments[he];Q.apply(void 0,ye),requestAnimationFrame(function(){Q.apply(void 0,ye)})},[Q]);return{virtualItems:W,totalSize:N,scrollToOffset:te,scrollToIndex:le,measure:R}}var EG=function(t,r,n,i){for(;t<=r;){var s=(t+r)/2|0,u=n(s);if(u<i)t=s+1;else if(u>i)r=s-1;else return s}return t>0?t-1:0};function PG(e){for(var t=e.measurements,r=e.outerSize,n=e.scrollOffset,i=t.length-1,s=function(l){return t[l].start},u=EG(0,i,s,n),o=u;o<i&&t[o].end<n+r;)o++;return{start:u,end:o}}function OG({category:e}){const t=g0(),r=e.name,n=e.list?e.list:Array.from(Array(e.items).keys()),i=C.exports.useRef(null),s=CG({horizontal:!0,size:n.length,parentRef:i,estimateSize:C.exports.useCallback(()=>52,[]),overscan:5});return C.exports.useEffect(()=>{s.scrollToIndex(0)},[r]),S(xr,{children:S("div",{ref:i,className:"tiny-scrollbar overflow-x-auto overflow-y-hidden",style:{height:"52px"},children:S("div",{className:"h-full relative mx-auto",style:{width:`${s.totalSize}px`},children:s.virtualItems.map(u=>{const o=`${n[u.index]}`;return S("div",{className:"absolute top-0 left-0 h-full",style:{width:`${u.size}px`,transform:`translateX(${u.start}px)`},children:S(nr,{variant:"outline",radius:"rounded-xl",size:"md",equalWidth:!0,onPress:async()=>{await V().shape.addSticker(e.name,o),A().setDirty(!0)},children:S("img",{className:Ee("m-auto m-auto w-28 h-28",e.invertPreview&&(t==null?void 0:t.isDark)&&"invert"),src:o0(e,o),alt:o})})},u.index)})})})})}function MG(){const e=pe(i=>{var s,u;return(u=(s=i.config.tools)==null?void 0:s.stickers)==null?void 0:u.items})||[],[t,r]=C.exports.useState(e[0]),n=e.map(i=>{const s=t===i,u=KR[i.name];return S(nr,{size:"xs",color:s?"primary":null,value:i,children:S("span",{className:"capitalize",children:u?S(De,$({},u)):i.name})},i.name)});return ce("div",{className:"h-92",children:[S(Fd,{value:t,onChange:i=>r(i),className:"mb-10 w-full justify-center",variant:"outline",radius:"rounded-full",children:n}),t&&S(OG,{category:t})]})}function kG(){const e=pe(n=>{var i,s;return(s=(i=n.config.tools)==null?void 0:i.frame)==null?void 0:s.items})||[],t=pe(n=>n.frame.active);C.exports.useEffect(()=>{A().frame.active&&A().frame.showOptionsPanel()},[]);const r=e.map(n=>{const i=Ar(`images/frames/${n.name}/thumbnail.png`),s=(t==null?void 0:t.name)===n.name;return S(zn,{children:ce("button",{type:"button",className:`border-2 overflow-hidden relative rounded border cursor-pointer ${s?"border-primary":""}`,onClick:()=>{A().setDirty(!0),s?V().frame.remove():V().frame.add(n.name)},children:[s&&S($G,{}),S("img",{draggable:"false",className:"w-64 h-64",src:i,alt:n.name})]})},n.name)});return S(To,{children:r})}function $G(){return S("span",{className:"bg-background/70 absolute inset-0 text-primary",children:S(db,{className:"svg-icon icon-md absolute inset-0 block m-auto"})})}function DG(){const e=pe(r=>{var n,i;return(i=(n=r.config.tools)==null?void 0:n.text)==null?void 0:i.items});C.exports.useEffect(()=>{e&&tE(e)},[e]),C.exports.useEffect(()=>{A().objects.active.isText||(V().text.add(),A().setDirty(!0))},[]);const t=(e||[]).map(r=>S(zn,{children:S(AG,{fontConfig:r})},r.family));return S(To,{className:"pt-6",children:t})}function AG({fontConfig:e}){var n;const t=pe(i=>i.objects.active.editableProps.fontFamily),r=Ee("block px-6 w-110 h-68 text-sm bg border rounded-2xl",{"border-primary":t===e.family,"text-primary":t===e.family});return S("button",{type:"button",className:r,style:{fontFamily:e.family,fontWeight:((n=e.descriptors)==null?void 0:n.weight)||"normal"},onClick:async()=>{A().setDirty(!0),V().objects.setValues({fontFamily:e.family})},children:e.family})}function IG(){return C.exports.useEffect(()=>(V().draw.enable(),()=>{V().draw.disable()}),[]),ce(To,{gap:"gap-16",className:"justify-center",children:[S(zn,{children:S(So,{size:"sm",label:S(De,{id:"i/W1yW",defaultMessage:[{type:0,value:"Brush Color"}]}),value:V().draw.currentBrush.color,onChange:e=>{V().draw.setBrushColor(e)}})}),S(zn,{children:S(FG,{})}),S(zn,{children:S(RG,{})})]})}function RG(){const e=pe(i=>{var s,u;return(u=(s=i.config.tools)==null?void 0:s.draw)==null?void 0:u.brushSizes})||[],[t,r]=C.exports.useState(V().draw.currentBrush.width),n=e.map(i=>({key:i,value:i}));return S(cb,{items:n,value:t,onChange:i=>{r(i),V().draw.setBrushSize(i)},size:"sm",label:"Brush Size",children:i=>S(_t,{textValue:`${i.key}`,children:ce("div",{className:"flex items-center",children:[S("div",{className:"flex-shrink-0 mr-8 border-[3px] rounded-full",style:{width:`${i.key}px`,height:`${i.key}px`}}),i.key]})})})}function FG(){const e=pe(i=>{var s,u;return(u=(s=i.config.tools)==null?void 0:s.draw)==null?void 0:u.brushTypes})||[],t=g0(),[r,n]=C.exports.useState(V().draw.currentBrush.type);return S(cb,{value:r,onChange:i=>{n(i),V().draw.setBrushType(i)},size:"sm",label:"Brush Type",children:e.map(i=>S(_t,{textValue:i,children:ce("div",{className:"flex items-center",children:[S("img",{className:"flex-shrink-0 mr-8 w-24 h-24",src:LG(i,t==null?void 0:t.isDark),alt:""}),i]})},i))})}function LG(e,t=!1){const r=e.replace("Brush","").toLowerCase();return Ar(`images/brushes/${t?"white":"black"}/${r}.png`)}function NG(){const e=Gi(),t=pe(r=>r.corners.radius);return C.exports.useEffect(()=>(A().setDirty(!0),V().corners.showPreview(),()=>V().corners.hidePreview()),[]),S("div",{className:"max-w-320 mx-auto",children:S(_o,{minValue:1,maxValue:300,label:e.formatMessage({id:"nDRMt4",defaultMessage:[{type:0,value:"Radius"}]}),getValueLabel:r=>`${r}px`,onChange:r=>{V().corners.updatePreview(r),A().corners.setRadius(r)},value:t})})}const Sk={initial:{y:"130%",opacity:0},animate:{y:0,opacity:1},exit:{y:"130%",opacity:0,left:"16px",position:"absolute",overflowY:"hidden"},transition:{type:"tween",duration:.15}};function zG({activeTool:e}){const t=jG(e);return S(Yt.div,Y($({className:"relative h-full w-full text-sm bg select-none overflow-hidden"},Sk),{children:t}))}function jG(e){switch(e){case Ge.FILTER:return S(IX,{});case Ge.RESIZE:return S(GX,{});case Ge.CROP:return S(aG,{});case Ge.DRAW:return S(IG,{});case Ge.TEXT:return S(DG,{});case Ge.SHAPES:return S(fG,{});case Ge.STICKERS:return S(MG,{});case Ge.FRAME:return S(kG,{});case Ge.CORNERS:return S(NG,{});default:return null}}function _k(){const e=pe(t=>t.activeTool);return S("nav",{className:"z-navbar min-h-86 flex-shrink-0 px-16 relative overflow-hidden",children:S(fn,{initial:!1,children:e?S(zG,{activeTool:e},"tool-controls"):S(BG,{},"nav-items")})})}function BG(){const e=pe(t=>{var r,n;return(n=(r=t.config.ui)==null?void 0:r.nav)==null?void 0:n.items})||[];return S(Yt.div,Y($({className:"w-full h-full"},Sk),{children:S(To,{children:e.map(t=>S(zn,{children:S(VG,{item:t})},t.name))})}))}function VG({item:e}){const t=()=>{typeof e.action=="string"?e0(e.action):typeof e.action=="function"&&e.action(A().editor)},r=pF[e.name];return ce(In,{variant:"outline",color:"paper",className:"flex-col flex-shrink-0 w-68 h-68",radius:"rounded-2xl",onPress:t,children:[S("div",{className:"mb-1",children:S(Fy,{className:"icon-md",icon:e.icon})}),S("div",{className:"mt-6 text-xs capitalize",children:r?S(De,$({},r)):e.name})]})}function UG(){const e=pe(r=>r.history.items),t=pe(r=>r.history.pointer);return ce(Yt.div,Y($({},wy),{className:`absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] ${xy}`,children:[ce("div",{className:"p-8 mb-4 bg-alt dark:bg-paper font-medium text-sm border-b flex items-center",children:[S(De,{id:"djJp6c",defaultMessage:[{type:0,value:"History"}]}),S(qe,{className:"ml-auto flex-shrink-0",onPress:()=>{A().togglePanel("history",!1)},children:S(Ti,{})})]}),S("div",{className:"p-8",children:e.map(r=>{const n=r.id===e[t].id,i=fi[r.name],s=i.icon&&ee.createElement(i.icon,{className:"icon-sm"});return S(nr,{onPress:()=>{n||V().history.load(r)},variant:"outline",color:n?"primary":null,size:"sm",className:Ee("w-full mb-8",n&&"pointer-events-none"),justify:"justify-start",startIcon:s,children:S(De,$({},i.name))},r.id)})})]}))}function Tk({children:e,className:t}){return S("div",{className:t,children:e})}function HG(){const e=pe(t=>t.openPanels.newImage);return S(Kd,{isOpen:e,disableInitialTransition:!0,type:"modal",isDismissable:!1,children:S(WG,{})})}function WG(){const[e,t]=C.exports.useState("default");return ce(Xd,{className:"p-20 text-center max-w-max",children:[S(WM,{className:"pb-20",children:S(De,{id:"xdfcf6",defaultMessage:[{type:0,value:"Open a photo or design to get started"}]})}),S(Tk,{children:e==="default"?S(YG,{setActivePanel:t}):S(XG,{setActivePanel:t})})]})}function YG({setActivePanel:e}){return ce(xr,{children:[S(nr,{className:"mr-20",size:"sm",variant:"raised",color:"primary",onPress:()=>{V().import.uploadAndReplaceMainImage()},children:S(De,{id:"7M1lRT",defaultMessage:[{type:0,value:"Open Photo"}]})}),S(nr,{variant:"outline",size:"sm",color:"primary",onPress:()=>{e("newCanvas")},children:S(De,{id:"CVm3PB",defaultMessage:[{type:0,value:"Create New"}]})}),S(KG,{})]})}function KG(){const e=pe(t=>{var r,n;return(n=(r=t.config.ui)==null?void 0:r.openImageDialog)==null?void 0:n.sampleImages});return(e==null?void 0:e.length)?ce(xr,{children:[ce("div",{className:"relative py-20",children:[S("hr",{className:"absolute h-1 border-none bg-divider w-full top inset-0 m-auto"}),S("span",{className:"text-sm bg-paper px-6 relative",children:S(De,{id:"LaQ6Iq",defaultMessage:[{type:0,value:"or use sample"}]})})]}),S("ul",{className:"flex items-center gap-16",children:e.map(t=>S("li",{className:"shrink-0",children:S("button",{type:"button",onClick:async()=>{typeof t.action=="function"?t.action():t.url.endsWith(".json")?(await Lf(Ar(t.url)),A().togglePanel("newImage",!1)):(await V().import.openBackgroundImage(Ar(t.url)),A().togglePanel("newImage",!1))},children:S("img",{className:"w-80 h-80 rounded overflow-hidden transition-shadow hover:shadow-md",src:Ar(t.thumbnail),alt:""})})},t.url||t.thumbnail))})]}):null}function XG({setActivePanel:e}){const[t,r]=C.exports.useState({width:800,height:600,bgColor:"transparent"});return ce("form",{onSubmit:n=>{n.preventDefault();const{width:i,height:s,bgColor:u}=t;i&&s&&(A().setConfig({blankCanvasSize:{width:i,height:s}}),V().canvas.openNew(i,s,u),A().togglePanel("newImage",!1),V().history.addInitial())},children:[S(wo,{label:S(De,{id:"5IP7AP",defaultMessage:[{type:0,value:"Width"}]}),value:t.width,minValue:1,isRequired:!0,className:"mb-16",onChange:n=>{r(Y($({},t),{width:n}))}}),S(wo,{label:S(De,{id:"teLZyZ",defaultMessage:[{type:0,value:"Height"}]}),value:t.height,minValue:1,isRequired:!0,className:"mb-16",onChange:n=>{r(Y($({},t),{height:n}))}}),S(So,{onChange:n=>{r(Y($({},t),{bgColor:n}))},className:"mb-16",value:t.bgColor,label:S(De,{id:"CMansq",defaultMessage:[{type:0,value:"Background color"}]})}),ce("div",{className:"text-right",children:[S(nr,{size:"sm",variant:"text",className:"mr-10",onPress:()=>{e("default")},children:S(De,{id:"47FYwb",defaultMessage:[{type:0,value:"Cancel"}]})}),S(nr,{size:"sm",type:"submit",variant:"raised",color:"primary",children:S(De,{id:"VzzYJk",defaultMessage:[{type:0,value:"Create"}]})})]})]})}const GG=C.exports.forwardRef((e,t)=>{const r=xo(e),n=C.exports.useRef(null),{labelProps:i,inputProps:s,descriptionProps:u,errorMessageProps:o}=jy(e,n),{label:a,startAdornment:l,endAdornment:h}=e;return ce("div",{className:r.wrapper,ref:t,children:[a&&S("label",Y($({className:r.label},i),{children:a})),ce("div",{className:"relative",children:[S(ub,{direction:"start",children:l}),S("input",$({className:r.input},s)),S(ub,{direction:"end",children:h})]})]})});function qG(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var JG={};qG(JG,"useRadioGroupState",()=>Ck);let ZG=Math.round(Math.random()*1e10),QG=0;function Ck(e){let t=C.exports.useMemo(()=>e.name||`radio-group-${ZG}-${++QG}`,[e.name]),[r,n]=Mn(e.value,e.defaultValue,e.onChange),[i,s]=C.exports.useState(null);return{name:t,selectedValue:r,setSelectedValue:o=>{!e.isReadOnly&&!e.isDisabled&&n(o)},lastFocusedValue:i,setLastFocusedValue:s,isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1}}function Ek(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var eq={};Ek(eq,"useRadio",()=>Ok);const Pk=new WeakMap;function Ok(e,t,r){let{value:n,children:i,"aria-label":s,"aria-labelledby":u}=e;const o=e.isDisabled||t.isDisabled;let a=i!=null,l=s!=null||u!=null;!a&&!l&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let h=t.selectedValue===n,c=v=>{v.stopPropagation(),t.setSelectedValue(n)},{pressProps:f}=mi({isDisabled:o}),{focusableProps:d}=Na(Ce(e,{onFocus:()=>t.setLastFocusedValue(n)}),r),g=Ce(f,d),m=_r(e,{labelable:!0}),p=t.lastFocusedValue===n||t.lastFocusedValue==null?0:-1;return o&&(p=void 0),{inputProps:Ce(m,Y($({},g),{type:"radio",name:Pk.get(t),tabIndex:p,disabled:o,checked:h,value:n,onChange:c}))}}var tq={};Ek(tq,"useRadioGroup",()=>Mk);function Mk(e,t){let{name:r,validationState:n,isReadOnly:i,isRequired:s,isDisabled:u,orientation:o="vertical"}=e,{direction:a}=Rr(),{labelProps:l,fieldProps:h}=yo(Y($({},e),{labelElementType:"span"})),c=_r(e,{labelable:!0}),{focusWithinProps:f}=Da({onBlurWithin(){t.selectedValue||t.setLastFocusedValue(null)}}),d=m=>{let p;switch(m.key){case"ArrowRight":a==="rtl"&&o!=="vertical"?p="prev":p="next";break;case"ArrowLeft":a==="rtl"&&o!=="vertical"?p="next":p="prev";break;case"ArrowDown":p="next";break;case"ArrowUp":p="prev";break;default:return}m.preventDefault();let v=rr(m.currentTarget,{from:m.target}),y;p==="next"?(y=v.nextNode(),y||(v.currentNode=m.currentTarget,y=v.firstChild())):(y=v.previousNode(),y||(v.currentNode=m.currentTarget,y=v.lastChild())),y&&(y.focus(),t.setSelectedValue(y.value))},g=Kt(r);return Pk.set(t,g),{radioGroupProps:Ce(c,$($({role:"radiogroup",onKeyDown:d,"aria-invalid":n==="invalid"||void 0,"aria-errormessage":e["aria-errormessage"],"aria-readonly":i||void 0,"aria-required":s||void 0,"aria-disabled":u||void 0,"aria-orientation":o},h),f)),labelProps:l}}const kk=ee.createContext(null);function rq(){return C.exports.useContext(kk)}const nq=C.exports.forwardRef((e,t)=>{const r=xo(e),{label:n,children:i,size:s,className:u,orientation:o="horizontal"}=e,a=Ck(e),{radioGroupProps:l,labelProps:h}=Mk(e,a);return ce("div",Y($({className:Ee("text-left",u)},l),{ref:t,children:[n&&S("span",Y($({className:r.label},h),{children:n})),S("div",{className:Ee("flex",o==="vertical"?"flex-col gap-10":"flex-row gap-16"),children:S(kk.Provider,{value:{state:a,size:s},children:i})})]}))});function mb(e){const{isDisabled:t,children:r,autoFocus:n,value:i}=e,{hoverProps:s,isHovered:u}=vi({isDisabled:t}),{isFocusVisible:o,focusProps:a}=ho(e),l=C.exports.useRef(null),h=rq(),{state:c,size:f}=h,d=c.selectedValue===i,{inputProps:g}=Ok(Y($($({},e),h),{isDisabled:t}),c,l);return ce("label",Y($({className:Ee("inline-flex gap-8 cursor-pointer select-none items-center whitespace-nowrap align-middle",t&&"text-disabled pointer-events-none")},s),{children:[S(uo,{children:S("input",Y($({},Ce(g,a)),{ref:l}))}),ce("span",{className:Ee("block relative shrink-0",iq(f),o&&"outline outline-offset-2 rounded-full"),children:[S("span",{className:Ee("absolute left-0 top-o w-full h-full block transition-colors duration-200 border-2 rounded-full",oq(d,u,t))}),S(fn,{children:d&&S(Yt.span,{className:Ee("rounded-full w-full h-full block left-0 top-o absolute",u?"bg-primary-dark":"bg-primary"),initial:{scale:.01},animate:{scale:.5},exit:{scale:.01},transition:{type:"tween",duration:.2}},"radio-inner")})]}),r&&S("span",{children:r})]}))}function iq(e){switch(e){case"xs":return"h-12 w-12";case"sm":return"h-16 w-16";case"lg":return"h-24 w-24";case"xl":return"h-36 w-36";default:return"h-20 w-20"}}function oq(e,t,r){return r?"border-disabled-fg":e?t?"border-primary-dark":"border-primary":t?"border-text-main":"border-text-muted "}function aq(){const e=pe(t=>t.openPanels.export);return S(Kd,{isOpen:e,onClose:()=>{A().togglePanel("export",!1)},type:"modal",children:S(sq,{})})}function sq(){const[e,t]=C.exports.useState(()=>{var r,n,i,s,u,o;return{filename:((n=(r=A().config.tools)==null?void 0:r.export)==null?void 0:n.defaultName)||"image",format:((s=(i=A().config.tools)==null?void 0:i.export)==null?void 0:s.defaultFormat)||"jpeg",quality:((o=(u=A().config.tools)==null?void 0:u.export)==null?void 0:o.defaultQuality)||.8}});return S(Xd,{className:"p-20 text-center max-w-max",children:S(Tk,{children:ce("form",{onSubmit:r=>{r.preventDefault(),V().export.save(e.filename,e.format,e.quality),A().togglePanel("export",!1)},children:[S(GG,{isRequired:!0,size:"sm",label:S(De,{id:"/XPfp1",defaultMessage:[{type:0,value:"Save As"}]}),value:e.filename,onChange:r=>{t(Y($({},e),{filename:r}))}}),ce(nq,{size:"sm",className:"my-20","aria-label":"Image format",value:e.format,onChange:r=>{t(Y($({},e),{format:r}))},children:[S(mb,{value:"jpeg",children:"JPEG"}),S(mb,{value:"png",children:"PNG"}),S(mb,{value:"json",children:"JSON"})]}),S(_o,{size:"sm",minValue:.1,step:.1,maxValue:1,value:e.quality,onChange:r=>{t(Y($({},e),{quality:r}))},formatOptions:{style:"percent"},label:S(De,{id:"y+7ihJ",defaultMessage:[{type:0,value:"Quality"}]})}),S(nr,{variant:"raised",color:"primary",type:"submit",className:"mt-20 w-full",size:"sm",children:S(De,{id:"jvo0vs",defaultMessage:[{type:0,value:"Save"}]})})]})})})}function lq(){const e=pe(r=>r.objects.all),t=pe(r=>r.objects.active.id);return ce(Yt.div,Y($({},wy),{className:`absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] ${xy}`,children:[ce("div",{className:"p-8 mb-4 bg-alt dark:bg-paper font-medium text-sm border-b flex items-center",children:[S(De,{id:"sWVioT",defaultMessage:[{type:0,value:"Objects"}]}),S(qe,{className:"ml-auto flex-shrink-0",onPress:()=>{A().togglePanel("objects",!1)},children:S(Ti,{})})]}),S("div",{className:"p-8",children:e.map(r=>{const n=r.id===t,i=r.name,s=zF[i],u=s.icon&&ee.createElement(s.icon,{className:"icon-sm"});return S(nr,{onPress:()=>{n||!r.selectable||V().objects.select(r.id)},variant:"outline",color:n?"primary":null,size:"sm",className:Ee("w-full mb-8",(n||!r.selectable)&&"pointer-events-none"),justify:"justify-start",startIcon:u,children:S(De,$({},s.name))},r.id)})})]}))}function uq(){const e=pe(r=>r.openPanels.history),t=pe(r=>r.openPanels.objects);return ce("div",{className:"z-modal",children:[ce(fn,{children:[e&&S(UG,{},"historyPanel"),t&&S(lq,{},"objListPanel")]}),S(HG,{}),S(aq,{})]})}const cq=Pe(S("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutlineOutlined");function fq(){const{toasts:e,handlers:t}=Hj({position:"bottom-center"}),{startPause:r,endPause:n}=t;return S("div",{className:"absolute bottom-10 left-0 right-0 z-toast m-auto px-10",onMouseEnter:r,onMouseLeave:n,children:S(fn,{initial:!1,children:e.filter(i=>i.visible).map(i=>ce(Yt.div,Y($({initial:{opacity:0,y:50,scale:.3},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.5,transition:{duration:.2}},className:"relative my-8 mx-auto h-[46px] flex items-center shadow-lg text-base w-min whitespace-nowrap bg-error text-on-error rounded-lg p-10"},i.ariaProps),{children:[i.type==="error"&&S(cq,{className:"svg-icon mr-12 icon-md"}),typeof i.message=="string"?i.message:S(De,$({},i.message)),S(qe,{onPress:()=>{er.dismiss(i.id)},size:"sm",className:"ml-12",children:S(Ti,{})})]}),i.id))})})}var Eo=(e=>(e.ENTER="Enter",e.SPACE="Space",e.ESCAPE="Escape",e.DELETE="Delete",e.ARROW_UP="ArrowUp",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_LEFT="ArrowLeft",e.PAGE_UP="PageUp",e.PAGE_DOWN="PageDown",e.HOME="Home",e.END="End",e.BACKSPACE="Backspace",e.TAB="Tab",e.S="s",e.N="n",e.A="a",e.T="t",e.B="b",e.C="c",e.O="o",e.P="p",e.R="r",e.F="f",e.Y="y",e.Z="z",e))(Eo||{});function dq(e){return ao()?e.metaKey:e.ctrlKey}function hq(e){switch(e.key){case Eo.Z:dq(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?V().history.redo():V().history.undo());break;case Eo.ARROW_UP:e.preventDefault(),e.stopPropagation(),V().objects.move("up");break;case Eo.ARROW_RIGHT:e.preventDefault(),e.stopPropagation(),V().objects.move("right");break;case Eo.ARROW_DOWN:e.preventDefault(),e.stopPropagation(),V().objects.move("down");break;case Eo.ARROW_LEFT:e.preventDefault(),e.stopPropagation(),V().objects.move("left");break;case Eo.DELETE:e.preventDefault(),e.stopPropagation(),V().objects.delete();break}}function pq(){var x,w,T,_;const e=pe(E=>E.config.activeLanguage)||"en",t=pe(E=>E.config.languages),r=(x=pe(E=>{var k;return(k=E.config.ui)==null?void 0:k.visible}))!=null?x:!0,n=(w=pe(E=>{var k,z;return(z=(k=E.config.ui)==null?void 0:k.nav)==null?void 0:z.position}))!=null?w:"bottom",i=(T=pe(E=>{var k,z;return(z=(k=E.config.ui)==null?void 0:k.menubar)==null?void 0:z.position}))!=null?T:"top",s=(_=pe(E=>{var k;return(k=E.config.ui)==null?void 0:k.allowEditorClose}))!=null?_:!0,u=(t==null?void 0:t[e])||{},o=g0(),a=C.exports.useRef(null),l=C.exports.useRef(null),{isModal:h,isMobile:c}=Ld(),f=C.exports.useCallback(E=>{var z,F,j;if(A().activeTool||A().dirty||!E.length)return;const k=new a0(E[0]);((j=(F=(z=A().config.tools)==null?void 0:z.import)==null?void 0:F.openDroppedImageAsBackground)!=null?j:!1)?V().import.openBackgroundImage(k):V().import.openUploadedFile(k)},[]),{getRootProps:d,getInputProps:g,rootRef:m}=pC({onDrop:f,accept:sE($($({},hE()),pE))});C.exports.useEffect(()=>{var z,F;if(A().fabric)return;iB(l.current),((z=A().config.ui)==null?void 0:z.defaultTool)&&A().setActiveTool((F=A().config.ui)==null?void 0:F.defaultTool,null),V().canvas.loadInitialContent().then(()=>{var j,K;(K=(j=A().config).onLoad)==null||K.call(j,A().editor)});const E=mE(m.current,()=>{A().setStageSize(vE(m.current))}),k=mE(l.current,()=>{A().setCanvasSize(vE(l.current))});return()=>{E(),k()}},[m]),mt(()=>{TB(a.current,o)},[o]);const p={visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},v=Ee("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!h,"fixed inset-0 w-full h-full z-20":h,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":h&&!c});return ce(B7,{features:V7,strict:!0,children:[h&&r&&!c&&s&&S(qe,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onPress:()=>{A().editor.close()},children:S(Ti,{})}),h&&r&&S(Cy,{position:"fixed",disableInitialTransition:!0}),S(Yt.div,{ref:a,initial:!1,variants:p,animate:r?"visible":"hidden",className:v,children:S(PE.Provider,{value:{boundary:a,portalContainer:a,shouldFlip:!1,placement:n==="bottom"?"top":"bottom",maxHeight:"400px"},children:ce(UR,{locale:e,defaultLocale:"en",messages:u,children:[i==="top"&&S(hM,{}),n==="top"&&S(_k,{}),ce("main",Y($({className:"relative flex-auto my-20 overflow-hidden outline-none"},d({onKeyDownCapture:hq})),{children:[S(uo,{children:S("input",$({},g))}),S($W,{}),S(ZY,{ref:l})]})),S(OX,{}),n==="bottom"&&S(_k,{}),i==="bottom"&&S(hM,{}),S(uq,{}),S(fq,{})]})})})]})}var gq='/*! tailwindcss v3.0.23 | MIT License | https://tailwindcss.com*/.pi *,.pi :after,.pi :before{border:0 solid rgb(var(--be-foreground-base)/var(--be-divider-opacity));box-sizing:border-box}.pi :after,.pi :before{--tw-content:""}.pi hr{border-top-width:1px;color:inherit;height:0}.pi abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6{font-size:inherit;font-weight:inherit}.pi a{color:inherit;text-decoration:inherit}.pi b,.pi strong{font-weight:bolder}.pi code,.pi kbd,.pi pre,.pi samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.pi small{font-size:80%}.pi sub,.pi sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.pi sub{bottom:-.25em}.pi sup{top:-.5em}.pi table{border-collapse:collapse;border-color:inherit;text-indent:0}.pi button,.pi input,.pi optgroup,.pi select,.pi textarea{color:inherit;font-family:inherit;font-size:100%;line-height:inherit;margin:0;padding:0}.pi button,.pi select{text-transform:none}.pi [type=button],.pi [type=reset],.pi [type=submit],.pi button{-webkit-appearance:button;background-color:transparent;background-image:none}.pi :-moz-focusring{outline:auto}.pi :-moz-ui-invalid{box-shadow:none}.pi progress{vertical-align:baseline}.pi ::-webkit-inner-spin-button,.pi ::-webkit-outer-spin-button{height:auto}.pi [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.pi ::-webkit-search-decoration{-webkit-appearance:none}.pi ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.pi summary{display:list-item}.pi blockquote,.pi dd,.pi dl,.pi figure,.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6,.pi hr,.pi p,.pi pre{margin:0}.pi fieldset{margin:0;padding:0}.pi legend{padding:0}.pi menu,.pi ol,.pi ul{list-style:none;margin:0;padding:0}.pi textarea{resize:vertical}.pi input::-moz-placeholder,.pi textarea::-moz-placeholder{color:#9ca3af;opacity:1}.pi input:-ms-input-placeholder,.pi textarea:-ms-input-placeholder{color:#9ca3af;opacity:1}.pi input::placeholder,.pi textarea::placeholder{color:#9ca3af;opacity:1}.pi [role=button],.pi button{cursor:pointer}.pi :disabled{cursor:default}.pi audio,.pi canvas,.pi embed,.pi iframe,.pi img,.pi object,.pi svg,.pi video{display:block;vertical-align:middle}.pi img,.pi video{height:auto;max-width:100%}.pi [hidden]{display:none}.pi *,.pi :after,.pi :before{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi .container{width:100%}.pi .\\!container{width:100%!important}@media (min-width:640px){.pi .container{max-width:640px}.pi .\\!container{max-width:640px!important}}@media (min-width:768px){.pi .container{max-width:768px}.pi .\\!container{max-width:768px!important}}@media (min-width:1024px){.pi .container{max-width:1024px}.pi .\\!container{max-width:1024px!important}}@media (min-width:1280px){.pi .container{max-width:1280px}.pi .\\!container{max-width:1280px!important}}@media (min-width:1536px){.pi .container{max-width:1536px}.pi .\\!container{max-width:1536px!important}}.pi .pointer-events-none{pointer-events:none}.pi .visible{visibility:visible}.pi .static{position:static}.pi .fixed{position:fixed}.pi .absolute{position:absolute}.pi .relative{position:relative}.pi .inset-0{bottom:0;top:0}.pi .inset-0,.pi .inset-x-0{left:0;right:0}.pi .right-2{right:2px}.pi .top-2{top:2px}.pi .left-0{left:0}.pi .-left-5{left:-5px}.pi .top-0{top:0}.pi .-top-5{top:-5px}.pi .bottom-0{bottom:0}.pi .-bottom-5{bottom:-5px}.pi .right-0{right:0}.pi .-right-5{right:-5px}.pi .bottom-20{bottom:20px}.pi .right-20{right:20px}.pi .bottom-10{bottom:10px}.pi .-bottom-20{bottom:-20px}.pi .left-1\\/2{left:50%}.pi .-bottom-10{bottom:-10px}.pi .-left-8{left:-8px}.pi .top-1\\/2{top:50%}.pi .-left-80{left:-80px}.pi .left-12{left:12px}.pi .right-12{right:12px}.pi .isolate{isolation:isolate}.pi .z-20{z-index:20}.pi .z-modal{z-index:120}.pi .z-obj-box{z-index:20}.pi .z-navbar{z-index:40}.pi .z-tool-overlay{z-index:30}.pi .z-loading-indicator{z-index:50}.pi .z-10{z-index:10}.pi .z-popover{z-index:140}.pi .z-tray{z-index:130}.pi .z-toast{z-index:150}.pi .z-cropzone{z-index:10}.pi .m-auto{margin:auto}.pi .my-20{margin-bottom:20px;margin-top:20px}.pi .mx-auto{margin-left:auto;margin-right:auto}.pi .my-8{margin-bottom:8px;margin-top:8px}.pi .my-auto{margin-bottom:auto;margin-top:auto}.pi .mr-5{margin-right:5px}.pi .ml-auto{margin-left:auto}.pi .mr-20{margin-right:20px}.pi .mb-16{margin-bottom:16px}.pi .mr-10{margin-right:10px}.pi .mb-4{margin-bottom:4px}.pi .mb-8{margin-bottom:8px}.pi .mt-20{margin-top:20px}.pi .mb-1{margin-bottom:1px}.pi .mt-6{margin-top:6px}.pi .mr-auto{margin-right:auto}.pi .ml-10{margin-left:10px}.pi .-ml-1{margin-left:-1px}.pi .-ml-4{margin-left:-4px}.pi .mr-8{margin-right:8px}.pi .-mr-4{margin-right:-4px}.pi .ml-8{margin-left:8px}.pi .mt-26{margin-top:26px}.pi .mr-12{margin-right:12px}.pi .ml-12{margin-left:12px}.pi .mt-4{margin-top:4px}.pi .mt-24{margin-top:24px}.pi .ml-6{margin-left:6px}.pi .mr-16{margin-right:16px}.pi .mb-10{margin-bottom:10px}.pi .block{display:block}.pi .inline-block{display:inline-block}.pi .inline{display:inline}.pi .flex{display:flex}.pi .inline-flex{display:inline-flex}.pi .grid{display:grid}.pi .contents{display:contents}.pi .hidden{display:none}.pi .aspect-square{aspect-ratio:1/1}.pi .h-2\\/4{height:50%}.pi .h-full{height:100%}.pi .h-font{height:1em}.pi .h-1{height:1px}.pi .h-80{height:80px}.pi .h-24{height:24px}.pi .h-20{height:20px}.pi .h-30{height:30px}.pi .h-84{height:84px}.pi .h-68{height:68px}.pi .h-32{height:32px}.pi .h-\\[54px\\]{height:54px}.pi .h-36{height:36px}.pi .h-50{height:50px}.pi .h-60{height:60px}.pi .h-42{height:42px}.pi .h-26{height:26px}.pi .h-8{height:8px}.pi .h-48{height:48px}.pi .h-5{height:5px}.pi .h-3{height:3px}.pi .h-64{height:64px}.pi .h-2{height:2px}.pi .h-\\[46px\\]{height:46px}.pi .h-56{height:56px}.pi .h-18{height:18px}.pi .h-12{height:12px}.pi .h-16{height:16px}.pi .h-4{height:4px}.pi .h-px{height:1px}.pi .h-28{height:28px}.pi .h-92{height:92px}.pi .max-h-\\[calc\\(100vh-90px\\)\\]{max-height:calc(100vh - 90px)}.pi .max-h-\\[calc\\(100\\%-40px\\)\\]{max-height:calc(100% - 40px)}.pi .max-h-inherit{max-height:inherit}.pi .min-h-86{min-height:86px}.pi .w-full{width:100%}.pi .w-font{width:1em}.pi .w-80{width:80px}.pi .w-24{width:24px}.pi .w-20{width:20px}.pi .w-30{width:30px}.pi .w-224{width:224px}.pi .w-68{width:68px}.pi .w-96{width:96px}.pi .w-144{width:144px}.pi .w-36{width:36px}.pi .w-50{width:50px}.pi .w-60{width:60px}.pi .w-42{width:42px}.pi .\\!w-auto{width:auto!important}.pi .w-26{width:26px}.pi .w-8{width:8px}.pi .w-1\\/2{width:50%}.pi .w-64{width:64px}.pi .w-32{width:32px}.pi .w-min{width:-webkit-min-content;width:-moz-min-content;width:min-content}.pi .w-56{width:56px}.pi .w-2{width:2px}.pi .w-18{width:18px}.pi .w-110{width:110px}.pi .w-40{width:40px}.pi .w-\\[4ch\\]{width:4ch}.pi .w-12{width:12px}.pi .w-16{width:16px}.pi .w-auto{width:auto}.pi .w-px{width:1px}.pi .w-28{width:28px}.pi .max-w-\\[calc\\(100vw-90px\\)\\]{max-width:calc(100vw - 90px)}.pi .max-w-max{max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}.pi .max-w-\\[calc\\(100\\%-40px\\)\\]{max-width:calc(100% - 40px)}.pi .max-w-384{max-width:384px}.pi .max-w-375{max-width:375px}.pi .max-w-full{max-width:100%}.pi .max-w-240{max-width:240px}.pi .max-w-320{max-width:320px}.pi .max-w-288{max-width:288px}.pi .max-w-112{max-width:112px}.pi .flex-auto{flex:1 1 auto}.pi .flex-shrink-0,.pi .shrink-0{flex-shrink:0}.pi .origin-\\[100\\%\\]{transform-origin:100%}.pi .translate-y-1{--tw-translate-y:1px}.pi .-translate-x-1\\/2,.pi .translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .-translate-x-1\\/2{--tw-translate-x:-50%}.pi .-translate-y-1\\/2{--tw-translate-y:-50%}.pi .-translate-y-1\\/2,.pi .rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-180{--tw-rotate:180deg}.pi .rotate-0{--tw-rotate:0deg}.pi .rotate-0,.pi .rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-90{--tw-rotate:90deg}.pi .-rotate-90{--tw-rotate:-90deg}.pi .-rotate-90,.pi .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .cursor-nwse-resize{cursor:nwse-resize}.pi .cursor-nesw-resize{cursor:nesw-resize}.pi .cursor-se-resize{cursor:se-resize}.pi .cursor-sw-resize{cursor:sw-resize}.pi .cursor-pointer{cursor:pointer}.pi .cursor-default{cursor:default}.pi .cursor-move{cursor:move}.pi .touch-none{touch-action:none}.pi .select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pi .resize{resize:both}.pi .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.pi .grid-cols-5-min-content{grid-template-columns:repeat(5,-webkit-min-content);grid-template-columns:repeat(5,min-content)}.pi .flex-row{flex-direction:row}.pi .flex-col{flex-direction:column}.pi .flex-nowrap{flex-wrap:nowrap}.pi .items-center{align-items:center}.pi .justify-start{justify-content:flex-start}.pi .justify-center{justify-content:center}.pi .justify-between{justify-content:space-between}.pi .gap-16{gap:16px}.pi .gap-10{gap:10px}.pi .gap-8{gap:8px}.pi .gap-32{gap:32px}.pi .gap-6{gap:6px}.pi .gap-20{gap:20px}.pi .gap-12{gap:12px}.pi .gap-18{gap:18px}.pi .overflow-auto{overflow:auto}.pi .overflow-hidden{overflow:hidden}.pi .overflow-x-auto{overflow-x:auto}.pi .overflow-y-auto{overflow-y:auto}.pi .overflow-y-hidden{overflow-y:hidden}.pi .truncate{overflow:hidden;text-overflow:ellipsis}.pi .truncate,.pi .whitespace-nowrap{white-space:nowrap}.pi .rounded{border-radius:4px}.pi .rounded-md{border-radius:6px}.pi .rounded-none{border-radius:0}.pi .rounded-2xl{border-radius:16px}.pi .rounded-full{border-radius:9999px}.pi .rounded-sm{border-radius:2px}.pi .rounded-lg{border-radius:8px}.pi .rounded-xl{border-radius:12px}.pi .rounded-\\[16px\\]{border-radius:16px}.pi .rounded-\\[64px\\]{border-radius:64px}.pi .rounded-\\[32px\\]{border-radius:32px}.pi .rounded-tr-none{border-top-right-radius:0}.pi .rounded-br-none{border-bottom-right-radius:0}.pi .rounded-tl-none{border-top-left-radius:0}.pi .rounded-bl-none{border-bottom-left-radius:0}.pi .border{border-width:1px}.pi .border-4{border-width:4px}.pi .border-2{border-width:2px}.pi .border-\\[3px\\]{border-width:3px}.pi .border-l-4{border-left-width:4px}.pi .border-t-4{border-top-width:4px}.pi .border-r-4{border-right-width:4px}.pi .border-b-4{border-bottom-width:4px}.pi .border-b{border-bottom-width:1px}.pi .border-t{border-top-width:1px}.pi .border-l{border-left-width:1px}.pi .border-dotted{border-style:dotted}.pi .border-none{border-style:none}.pi .border-divider{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .border-primary\\/50{border-color:rgb(var(--be-primary)/.5)}.pi .border-error\\/50{border-color:rgb(var(--be-error)/.5)}.pi .border-transparent{border-color:transparent}.pi .border-primary{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-error{--tw-border-opacity:1;border-color:rgb(var(--be-error)/var(--tw-border-opacity))}.pi .border-background{--tw-border-opacity:1;border-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-disabled-fg{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .border-primary-dark{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .border-text-main{border-color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .border-text-muted{border-color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .border-white\\/50{border-color:hsla(0,0%,100%,.5)}.pi .border-r-transparent{border-right-color:transparent}.pi .bg-background{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-divider{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .bg-paper{--tw-bg-opacity:1;background-color:rgb(var(--be-paper)/var(--tw-bg-opacity))}.pi .bg-controls{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-alt{--tw-bg-opacity:1;background-color:rgb(var(--be-background-alt)/var(--tw-bg-opacity))}.pi .bg{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-hover{background-color:rgb(var(--be-foreground-base)/var(--be-hover-opacity))}.pi .bg-transparent{background-color:transparent}.pi .bg-primary{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .bg-error{--tw-bg-opacity:1;background-color:rgb(var(--be-error)/var(--tw-bg-opacity))}.pi .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .bg-primary-light{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-light)/var(--tw-bg-opacity))}.pi .bg-background\\/70{background-color:rgb(var(--be-background)/.7)}.pi .bg-primary\\/focus{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .bg-primary\\/selected{background-color:rgb(var(--be-primary)/var(--be-selected-opacity))}.pi .bg-focus{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .bg-primary-dark{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .bg-disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .bg-disabled-fg{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .bg-slider-disabled{--tw-bg-opacity:1;background-color:rgb(189 189 189/var(--tw-bg-opacity))}.pi .bg-black\\/30{background-color:rgba(0,0,0,.3)}.pi .bg-white\\/50{background-color:hsla(0,0%,100%,.5)}.pi .bg-black\\/50{background-color:rgba(0,0,0,.5)}.pi .bg-opacity-95{--tw-bg-opacity:0.95}.pi .fill-current{fill:currentColor}.pi .fill-transparent{fill:transparent}.pi .fill-background{fill:rgb(var(--be-background))}.pi .stroke-current{stroke:currentColor}.pi .object-cover{-o-object-fit:cover;object-fit:cover}.pi .p-20{padding:20px}.pi .p-8{padding:8px}.pi .p-6{padding:6px}.pi .p-44{padding:44px}.pi .p-12{padding:12px}.pi .p-10{padding:10px}.pi .p-4{padding:4px}.pi .py-20{padding-bottom:20px;padding-top:20px}.pi .px-6{padding-left:6px;padding-right:6px}.pi .px-16{padding-left:16px;padding-right:16px}.pi .px-5vw{padding-left:5vw;padding-right:5vw}.pi .px-12{padding-left:12px;padding-right:12px}.pi .py-\\[9px\\]{padding-bottom:9px;padding-top:9px}.pi .px-8{padding-left:8px;padding-right:8px}.pi .py-4{padding-bottom:4px;padding-top:4px}.pi .px-14{padding-left:14px;padding-right:14px}.pi .px-18{padding-left:18px;padding-right:18px}.pi .px-26{padding-left:26px;padding-right:26px}.pi .px-32{padding-left:32px;padding-right:32px}.pi .px-22{padding-left:22px;padding-right:22px}.pi .py-28{padding-bottom:28px;padding-top:28px}.pi .px-24{padding-left:24px;padding-right:24px}.pi .px-10{padding-left:10px;padding-right:10px}.pi .px-2{padding-left:2px;padding-right:2px}.pi .py-8{padding-bottom:8px;padding-top:8px}.pi .px-20{padding-left:20px;padding-right:20px}.pi .py-14{padding-bottom:14px;padding-top:14px}.pi .pb-20{padding-bottom:20px}.pi .pb-4{padding-bottom:4px}.pi .pb-safe-area{padding-bottom:env(safe-area-inset-bottom)}.pi .pb-18{padding-bottom:18px}.pi .pt-6{padding-top:6px}.pi .pt-16{padding-top:16px}.pi .pb-10{padding-bottom:10px}.pi .pt-10{padding-top:10px}.pi .pl-12{padding-left:12px}.pi .pr-10{padding-right:10px}.pi .pl-10{padding-left:10px}.pi .pr-12{padding-right:12px}.pi .pl-36{padding-left:36px}.pi .pr-36{padding-right:36px}.pi .pb-16{padding-bottom:16px}.pi .text-left{text-align:left}.pi .text-center{text-align:center}.pi .text-right{text-align:right}.pi .align-middle{vertical-align:middle}.pi .text-sm{font-size:14px;line-height:20px}.pi .text-xs{font-size:12px;line-height:16px}.pi .text-base{font-size:16px;line-height:24px}.pi .text-lg{font-size:18px;line-height:28px}.pi .text-xl{font-size:20px;line-height:28px}.pi .font-medium{font-weight:500}.pi .font-semibold{font-weight:600}.pi .font-bold{font-weight:700}.pi .uppercase{text-transform:uppercase}.pi .capitalize{text-transform:capitalize}.pi .italic{font-style:italic}.pi .leading-none{line-height:1}.pi .tracking-wide{letter-spacing:.025em}.pi .text,.pi .text-main{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.pi .\\!text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))!important}.pi .text-disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .text-muted{color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .text-primary{--tw-text-opacity:1;color:rgb(var(--be-primary)/var(--tw-text-opacity))}.pi .text-error{--tw-text-opacity:1;color:rgb(var(--be-error)/var(--tw-text-opacity))}.pi .text-current{color:currentColor}.pi .text-on-primary{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .text-on-error{--tw-text-opacity:1;color:rgb(var(--be-on-error)/var(--tw-text-opacity))}.pi .underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.pi .no-underline{-webkit-text-decoration-line:none;text-decoration-line:none}.pi .opacity-0{opacity:0}.pi .opacity-100{opacity:1}.pi .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.pi .shadow,.pi .shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.pi .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.pi .shadow-md,.pi .shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.pi .outline-none{outline:2px solid transparent;outline-offset:2px}.pi .outline{outline-style:solid;outline-width:2px}.pi .outline-offset-2{outline-offset:2px}.pi .outline,.pi .outline-primary-light{outline-color:rgb(var(--be-primary-light))}.pi .ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.pi .ring,.pi .ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.pi .ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .ring-inset{--tw-ring-inset:inset}.pi .ring-primary-light{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--be-primary-light)/var(--tw-ring-opacity))}.pi .ring-black{--tw-ring-opacity:1;--tw-ring-color:rgb(0 0 0/var(--tw-ring-opacity))}.pi .ring-opacity-5{--tw-ring-opacity:0.05}.pi .blur{--tw-blur:blur(8px)}.pi .blur,.pi .grayscale{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .grayscale{--tw-grayscale:grayscale(100%)}.pi .invert{--tw-invert:invert(100%)}.pi .invert,.pi .sepia{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .sepia{--tw-sepia:sepia(100%)}.pi .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-shadow{transition-duration:.15s;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition{transition-duration:.15s;transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-button{transition-duration:.15s;transition-property:background-color,box-shadow,border-color,color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-width{transition-duration:.15s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,fill,stroke,-webkit-text-decoration-color;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,-webkit-text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .duration-200{transition-duration:.2s}.pi .duration-300{transition-duration:.3s}.pi .icon-xs{font-size:1rem}.pi .icon-sm{font-size:1.25rem}.pi .icon-md{font-size:1.5rem}.pi .icon-lg{font-size:2.1875rem}.pi .icon-xl{font-size:2.6875rem}.pi .no-tap-highlight{-webkit-tap-highlight-color:transparent}@media only screen and (min-device-width:768px){.pi .tiny-scrollbar{scrollbar-color:rgba(0,0,0,.2) transparent;scrollbar-width:thin}.pi .tiny-scrollbar::-webkit-scrollbar{background-color:transparent;height:6px;width:6px}.pi .tiny-scrollbar::-webkit-scrollbar-thumb{background-color:rgb(var(--be-foreground-base)/.2);border-radius:10px}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:start{background:transparent}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:end{background:transparent}}.pi .hide-scrollbar{scrollbar-width:none}.pi .hide-scrollbar::-webkit-scrollbar{background:transparent;height:0;width:0}.pi .svg-icon{fill:currentColor;display:inline-block;flex-shrink:0;transition-duration:.15s;transition-property:transform,fill;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pi .cropzone:not(.moving) .cropzone-transition{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .hover\\:border-primary:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .hover\\:border-error:hover{--tw-border-opacity:1;border-color:rgb(var(--be-error)/var(--tw-border-opacity))}.pi .hover\\:border-primary-dark:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .hover\\:border-error\\/90:hover{border-color:rgb(var(--be-error)/.9)}.pi .hover\\:bg-white\\/hover:hover{background-color:rgb(255 255 255/var(--be-hover-opacity))}.pi .hover\\:bg-primary\\/hover:hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .hover\\:bg-error\\/4:hover{background-color:rgb(var(--be-error)/4%)}.pi .hover\\:bg-hover:hover{background-color:rgb(var(--be-foreground-base)/var(--be-hover-opacity))}.pi .hover\\:bg-primary\\/4:hover{background-color:rgb(var(--be-primary)/4%)}.pi .hover\\:bg-primary-dark:hover{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:bg-error\\/90:hover{background-color:rgb(var(--be-error)/.9)}.pi .hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .focus\\:border-primary\\/60:focus{border-color:rgb(var(--be-primary)/.6)}.pi .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.pi .focus\\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus\\:ring-primary\\/focus:focus{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .disabled\\:pointer-events-none:disabled{pointer-events:none}.pi .disabled\\:cursor-default:disabled{cursor:default}.pi .disabled\\:border-disabled-bg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:border-transparent:disabled{border-color:transparent}.pi .disabled\\:border-r-transparent:disabled{border-right-color:transparent}.pi .disabled\\:bg-transparent:disabled{background-color:transparent}.pi .disabled\\:bg-disabled:disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:text-disabled:disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:shadow-none:disabled{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .dark .dark\\:bg-paper{--tw-bg-opacity:1;background-color:rgb(var(--be-paper)/var(--tw-bg-opacity))}@media (min-width:640px){.pi .sm\\:text-sm{font-size:14px;line-height:20px}}';ug.enableBoundaryChecking(!1);class mq{constructor(t){Te(this,"tools",{});Te(this,"fabric",null);if(t.sentryDsn&&CI({dsn:t.sentryDsn,integrations:[new y6],tracesSampleRate:1}),this.setConfig(t),J4(gq),!t.selector)throw new Error('Pixie required "selector" option.');const r=document.querySelector(t.selector);!r||(r.classList.add("pi"),pe.setState({editor:this}),fc.render(S(ee.StrictMode,{children:S(pq,{})}),r))}get state(){return A()}get version(){return vF}get defaultConfig(){return NS}open(t={}){var r;((r=A().config.ui)==null?void 0:r.visible)||(this.setConfig(Ow(t,{ui:{visible:!0}})),requestAnimationFrame(()=>{var n,i,s,u;V().zoom.fitToScreen(),V().history.addInitial(),Qv()&&((i=(n=A().config.ui)==null?void 0:n.openImageDialog)==null?void 0:i.show)&&this.togglePanel("newImage",!0),(u=(s=A().config).onOpen)==null||u.call(s)}))}close(){var t,r,n;!((t=A().config.ui)==null?void 0:t.visible)||(this.setConfig({ui:{visible:!1}}),(n=(r=A().config).onClose)==null||n.call(r))}setConfig(t){A().setConfig(t)}uploadAndAddImage(){return V().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return V().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return V().import.uploadAndOpenStateFile()}newCanvas(t,r,n){return V().canvas.openNew(t,r,n)}getState(t){return JSON.stringify(Nf(t))}setState(t){return V().import.loadState(t)}async setStateFromUrl(t){const r=await Lf(t);return V().import.loadState(r)}openTool(t){e0(t)}applyChanges(){A().applyChanges()}cancelChanges(){A().cancelChanges()}async resetEditor(t){await l0(t),await V().canvas.loadInitialContent()}togglePanel(t,r){A().togglePanel(t,r)}on(t,r){var n;(n=this.fabric)==null||n.on(t,r)}isDirty(){return A().dirty}get(t){return this.tools[t]}notify(t){return s0(t)}static init(t){return new Promise(r=>{const n=t.onLoad;t.onLoad=i=>{n==null||n(i),r(i)},new this(t)})}}return mq});
//# sourceMappingURL=pixie.umd.js.map