diff --git a/assets/index-6f685e16.js b/assets/index-6f685e16.js new file mode 100644 index 0000000..a78c265 --- /dev/null +++ b/assets/index-6f685e16.js @@ -0,0 +1,471 @@ +function TM(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function M6(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var D6={exports:{}},g0={},L6={exports:{}},Ue={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Yf=Symbol.for("react.element"),IM=Symbol.for("react.portal"),RM=Symbol.for("react.fragment"),kM=Symbol.for("react.strict_mode"),MM=Symbol.for("react.profiler"),DM=Symbol.for("react.provider"),LM=Symbol.for("react.context"),NM=Symbol.for("react.forward_ref"),BM=Symbol.for("react.suspense"),jM=Symbol.for("react.memo"),FM=Symbol.for("react.lazy"),nE=Symbol.iterator;function $M(e){return e===null||typeof e!="object"?null:(e=nE&&e[nE]||e["@@iterator"],typeof e=="function"?e:null)}var N6={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B6=Object.assign,j6={};function Ru(e,t,n){this.props=e,this.context=t,this.refs=j6,this.updater=n||N6}Ru.prototype.isReactComponent={};Ru.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ru.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function F6(){}F6.prototype=Ru.prototype;function Fw(e,t,n){this.props=e,this.context=t,this.refs=j6,this.updater=n||N6}var $w=Fw.prototype=new F6;$w.constructor=Fw;B6($w,Ru.prototype);$w.isPureReactComponent=!0;var rE=Array.isArray,$6=Object.prototype.hasOwnProperty,zw={current:null},z6={key:!0,ref:!0,__self:!0,__source:!0};function U6(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)$6.call(t,r)&&!z6.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(10?kn(ku,--Or):0,lu--,rn===10&&(lu=1,w0--),rn}function Br(){return rn=Or2||af(rn)>3?"":" "}function cD(e,t){for(;--t&&Br()&&!(rn<48||rn>102||rn>57&&rn<65||rn>70&&rn<97););return Zf(e,Mh()+(t<6&&ii()==32&&Br()==32))}function cv(e){for(;Br();)switch(rn){case e:return Or;case 34:case 39:e!==34&&e!==39&&cv(rn);break;case 40:e===41&&cv(e);break;case 92:Br();break}return Or}function fD(e,t){for(;Br()&&e+rn!==47+10;)if(e+rn===42+42&&ii()===47)break;return"/*"+Zf(t,Or-1)+"*"+v0(e===47?e:Br())}function dD(e){for(;!af(ii());)Br();return Zf(e,Or)}function hD(e){return q6(Lh("",null,null,null,[""],e=X6(e),0,[0],e))}function Lh(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,f=a,d=0,h=0,p=0,m=1,_=1,b=1,g=0,E="",T=o,O=i,A=r,C=E;_;)switch(p=g,g=Br()){case 40:if(p!=108&&kn(C,f-1)==58){uv(C+=nt(Dh(g),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:C+=Dh(g);break;case 9:case 10:case 13:case 32:C+=uD(p);break;case 92:C+=cD(Mh()-1,7);continue;case 47:switch(ii()){case 42:case 47:Fd(pD(fD(Br(),Mh()),t,n),l);break;default:C+="/"}break;case 123*m:s[u++]=Yo(C)*b;case 125*m:case 59:case 0:switch(g){case 0:case 125:_=0;case 59+c:b==-1&&(C=nt(C,/\f/g,"")),h>0&&Yo(C)-f&&Fd(h>32?aE(C+";",r,n,f-1):aE(nt(C," ","")+";",r,n,f-2),l);break;case 59:C+=";";default:if(Fd(A=iE(C,t,n,u,c,o,s,E,T=[],O=[],f),i),g===123)if(c===0)Lh(C,t,A,A,T,i,f,s,O);else switch(d===99&&kn(C,3)===110?100:d){case 100:case 108:case 109:case 115:Lh(e,A,A,r&&Fd(iE(e,A,A,0,0,o,s,E,o,T=[],f),O),o,O,f,s,r?T:O);break;default:Lh(C,A,A,A,[""],O,0,s,O)}}u=c=h=0,m=b=1,E=C="",f=a;break;case 58:f=1+Yo(C),h=p;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&lD()==125)continue}switch(C+=v0(g),g*m){case 38:b=c>0?1:(C+="\f",-1);break;case 44:s[u++]=(Yo(C)-1)*b,b=1;break;case 64:ii()===45&&(C+=Dh(Br())),d=ii(),c=f=Yo(E=C+=dD(Mh())),g++;break;case 45:p===45&&Yo(C)==2&&(m=0)}}return i}function iE(e,t,n,r,o,i,a,s,l,u,c){for(var f=o-1,d=o===0?i:[""],h=Ww(d),p=0,m=0,_=0;p0?d[b]+" "+g:nt(g,/&\f/g,d[b])))&&(l[_++]=E);return b0(e,t,n,o===0?Vw:s,l,u,c)}function pD(e,t,n){return b0(e,t,n,H6,v0(sD()),of(e,2,-2),0)}function aE(e,t,n,r){return b0(e,t,n,Hw,of(e,0,r),of(e,r+1,-1),r)}function Vl(e,t){for(var n="",r=Ww(e),o=0;o6)switch(kn(e,t+1)){case 109:if(kn(e,t+4)!==45)break;case 102:return nt(e,/(.+:)(.+)-([^]+)/,"$1"+tt+"$2-$3$1"+yp+(kn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~uv(e,"stretch")?Z6(nt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(kn(e,t+1)!==115)break;case 6444:switch(kn(e,Yo(e)-3-(~uv(e,"!important")&&10))){case 107:return nt(e,":",":"+tt)+e;case 101:return nt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+tt+(kn(e,14)===45?"inline-":"")+"box$3$1"+tt+"$2$3$1"+zn+"$2box$3")+e}break;case 5936:switch(kn(e,t+11)){case 114:return tt+e+zn+nt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return tt+e+zn+nt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return tt+e+zn+nt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return tt+e+zn+e+e}return e}var ED=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case Hw:t.return=Z6(t.value,t.length);break;case W6:return Vl([Xu(t,{value:nt(t.value,"@","@"+tt)})],o);case Vw:if(t.length)return aD(t.props,function(i){switch(iD(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Vl([Xu(t,{props:[nt(i,/:(read-\w+)/,":"+yp+"$1")]})],o);case"::placeholder":return Vl([Xu(t,{props:[nt(i,/:(plac\w+)/,":"+tt+"input-$1")]}),Xu(t,{props:[nt(i,/:(plac\w+)/,":"+yp+"$1")]}),Xu(t,{props:[nt(i,/:(plac\w+)/,zn+"input-$1")]})],o)}return""})}},CD=[ED],xD=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var _=m.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||CD,i={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var _=m.getAttribute("data-emotion").split(" "),b=1;b<_.length;b++)i[_[b]]=!0;s.push(m)});var l,u=[SD,_D];{var c,f=[mD,gD(function(m){c.insert(m)})],d=yD(u.concat(o,f)),h=function(_){return Vl(hD(_),d)};l=function(_,b,g,E){c=g,h(_?_+"{"+b.styles+"}":b.styles),E&&(p.inserted[b.name]=!0)}}var p={key:n,sheet:new JM({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:l};return p.sheet.hydrate(s),p};function Rs(){return Rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var BD={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},jD=/[A-Z]|^ms/g,FD=/_EMO_([^_]+?)_([^]*?)_EMO_/g,oO=function(t){return t.charCodeAt(1)===45},uE=function(t){return t!=null&&typeof t!="boolean"},Zm=Y6(function(e){return oO(e)?e:e.replace(jD,"-$&").toLowerCase()}),cE=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(FD,function(r,o,i){return Zo={name:o,styles:i,next:Zo},o})}return BD[t]!==1&&!oO(t)&&typeof n=="number"&&n!==0?n+"px":n};function sf(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Zo={name:n.name,styles:n.styles,next:Zo},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Zo={name:r.name,styles:r.styles,next:Zo},r=r.next;var o=n.styles+";";return o}return $D(e,t,n)}case"function":{if(e!==void 0){var i=Zo,a=n(e);return Zo=i,sf(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function $D(e,t,n){var r="";if(Array.isArray(n))for(var o=0;ow.jsx(R0,{styles:uO}),XD=({scope:e=""})=>w.jsx(R0,{styles:lO` + html { + line-height: 1.5; + -webkit-text-size-adjust: 100%; + font-family: system-ui, sans-serif; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + -moz-osx-font-smoothing: grayscale; + touch-action: manipulation; + } + + body { + position: relative; + min-height: 100%; + margin: 0; + font-feature-settings: "kern"; + } + + ${e} :where(*, *::before, *::after) { + border-width: 0; + border-style: solid; + box-sizing: border-box; + word-wrap: break-word; + } + + main { + display: block; + } + + ${e} hr { + border-top-width: 1px; + box-sizing: content-box; + height: 0; + overflow: visible; + } + + ${e} :where(pre, code, kbd,samp) { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 1em; + } + + ${e} a { + background-color: transparent; + color: inherit; + text-decoration: inherit; + } + + ${e} abbr[title] { + border-bottom: none; + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + + ${e} :where(b, strong) { + font-weight: bold; + } + + ${e} small { + font-size: 80%; + } + + ${e} :where(sub,sup) { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + ${e} sub { + bottom: -0.25em; + } + + ${e} sup { + top: -0.5em; + } + + ${e} img { + border-style: none; + } + + ${e} :where(button, input, optgroup, select, textarea) { + font-family: inherit; + font-size: 100%; + line-height: 1.15; + margin: 0; + } + + ${e} :where(button, input) { + overflow: visible; + } + + ${e} :where(button, select) { + text-transform: none; + } + + ${e} :where( + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner + ) { + border-style: none; + padding: 0; + } + + ${e} fieldset { + padding: 0.35em 0.75em 0.625em; + } + + ${e} legend { + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal; + } + + ${e} progress { + vertical-align: baseline; + } + + ${e} textarea { + overflow: auto; + } + + ${e} :where([type="checkbox"], [type="radio"]) { + box-sizing: border-box; + padding: 0; + } + + ${e} input[type="number"]::-webkit-inner-spin-button, + ${e} input[type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none !important; + } + + ${e} input[type="number"] { + -moz-appearance: textfield; + } + + ${e} input[type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px; + } + + ${e} input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none !important; + } + + ${e} ::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit; + } + + ${e} details { + display: block; + } + + ${e} summary { + display: list-item; + } + + template { + display: none; + } + + [hidden] { + display: none !important; + } + + ${e} :where( + blockquote, + dl, + dd, + h1, + h2, + h3, + h4, + h5, + h6, + hr, + figure, + p, + pre + ) { + margin: 0; + } + + ${e} button { + background: transparent; + padding: 0; + } + + ${e} fieldset { + margin: 0; + padding: 0; + } + + ${e} :where(ol, ul) { + margin: 0; + padding: 0; + } + + ${e} textarea { + resize: vertical; + } + + ${e} :where(button, [role="button"]) { + cursor: pointer; + } + + ${e} button::-moz-focus-inner { + border: 0 !important; + } + + ${e} table { + border-collapse: collapse; + } + + ${e} :where(h1, h2, h3, h4, h5, h6) { + font-size: inherit; + font-weight: inherit; + } + + ${e} :where(button, input, optgroup, select, textarea) { + padding: 0; + line-height: inherit; + color: inherit; + } + + ${e} :where(img, svg, video, canvas, audio, iframe, embed, object) { + display: block; + } + + ${e} :where(img, video) { + max-width: 100%; + height: auto; + } + + [data-js-focus-visible] + :focus:not([data-focus-visible-added]):not( + [data-focus-visible-disabled] + ) { + outline: none; + box-shadow: none; + } + + ${e} select::-ms-expand { + display: none; + } + + ${uO} + `});function qD(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function tn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i,defaultValue:a}=e,s=P.createContext(a);s.displayName=t;function l(){var u;const c=P.useContext(s);if(!c&&n){const f=new Error(i??qD(r,o));throw f.name="ContextError",(u=Error.captureStackTrace)==null||u.call(Error,f,l),f}return c}return[s.Provider,l,s]}var[YD,ZD]=tn({strict:!1,name:"PortalManagerContext"});function cO(e){const{children:t,zIndex:n}=e;return w.jsx(YD,{value:{zIndex:n},children:t})}cO.displayName="PortalManager";var ai=globalThis!=null&&globalThis.document?P.useLayoutEffect:P.useEffect,fO={exports:{}},Jr={},dO={exports:{}},hO={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(L,j){var F=L.length;L.push(j);e:for(;0>>1,U=L[B];if(0>>1;Bo(Q,F))Xo(J,Q)?(L[B]=J,L[X]=F,B=X):(L[B]=Q,L[W]=F,B=W);else if(Xo(J,F))L[B]=J,L[X]=F,B=X;else break e}}return j}function o(L,j){var F=L.sortIndex-j.sortIndex;return F!==0?F:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,d=3,h=!1,p=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(L){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=L)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function T(L){if(m=!1,E(L),!p)if(n(l)!==null)p=!0,N(O);else{var j=n(u);j!==null&&D(T,j.startTime-L)}}function O(L,j){p=!1,m&&(m=!1,b(y),y=-1),h=!0;var F=d;try{for(E(j),f=n(l);f!==null&&(!(f.expirationTime>j)||L&&!x());){var B=f.callback;if(typeof B=="function"){f.callback=null,d=f.priorityLevel;var U=B(f.expirationTime<=j);j=e.unstable_now(),typeof U=="function"?f.callback=U:f===n(l)&&r(l),E(j)}else r(l);f=n(l)}if(f!==null)var K=!0;else{var W=n(u);W!==null&&D(T,W.startTime-j),K=!1}return K}finally{f=null,d=F,h=!1}}var A=!1,C=null,y=-1,S=5,v=-1;function x(){return!(e.unstable_now()-vL||125B?(L.sortIndex=F,t(u,L),n(l)===null&&L===n(u)&&(m?(b(y),y=-1):m=!0,D(T,F-B))):(L.sortIndex=U,t(l,L),p||h||(p=!0,N(O))),L},e.unstable_shouldYield=x,e.unstable_wrapCallback=function(L){var j=d;return function(){var F=d;d=j;try{return L.apply(this,arguments)}finally{d=F}}}})(hO);dO.exports=hO;var QD=dO.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var pO=P,qr=QD;function oe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fv=Object.prototype.hasOwnProperty,JD=/^[: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]*$/,hE={},pE={};function eL(e){return fv.call(pE,e)?!0:fv.call(hE,e)?!1:JD.test(e)?pE[e]=!0:(hE[e]=!0,!1)}function tL(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nL(e,t,n,r){if(t===null||typeof t>"u"||tL(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ur(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var jn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jn[e]=new ur(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];jn[t]=new ur(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jn[e]=new ur(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jn[e]=new ur(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){jn[e]=new ur(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jn[e]=new ur(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jn[e]=new ur(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jn[e]=new ur(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jn[e]=new ur(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yw=/[\-:]([a-z])/g;function Zw(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(Yw,Zw);jn[t]=new ur(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(Yw,Zw);jn[t]=new ur(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(Yw,Zw);jn[t]=new ur(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jn[e]=new ur(e,1,!1,e.toLowerCase(),null,!1,!1)});jn.xlinkHref=new ur("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jn[e]=new ur(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qw(e,t,n,r){var o=jn.hasOwnProperty(t)?jn[t]:null;(o!==null?o.type!==0:r||!(2s||o[a]!==i[s]){var l=` +`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Jm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?pc(e):""}function rL(e){switch(e.tag){case 5:return pc(e.type);case 16:return pc("Lazy");case 13:return pc("Suspense");case 19:return pc("SuspenseList");case 0:case 2:case 15:return e=ey(e.type,!1),e;case 11:return e=ey(e.type.render,!1),e;case 1:return e=ey(e.type,!0),e;default:return""}}function mv(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 gl:return"Fragment";case yl:return"Portal";case dv:return"Profiler";case Jw:return"StrictMode";case hv:return"Suspense";case pv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gO:return(e.displayName||"Context")+".Consumer";case yO:return(e._context.displayName||"Context")+".Provider";case eb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tb:return t=e.displayName||null,t!==null?t:mv(e.type)||"Memo";case ra:t=e._payload,e=e._init;try{return mv(e(t))}catch{}}return null}function oL(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mv(t);case 8:return t===Jw?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Pa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iL(e){var t=wO(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zd(e){e._valueTracker||(e._valueTracker=iL(e))}function bO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=wO(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yv(e,t){var n=t.checked;return $t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function yE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Pa(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function SO(e,t){t=t.checked,t!=null&&Qw(e,"checked",t,!1)}function gv(e,t){SO(e,t);var n=Pa(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vv(e,t.type,n):t.hasOwnProperty("defaultValue")&&vv(e,t.type,Pa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gE(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function vv(e,t,n){(t!=="number"||gp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var mc=Array.isArray;function Hl(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ud.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ic={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},aL=["Webkit","ms","Moz","O"];Object.keys(Ic).forEach(function(e){aL.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ic[t]=Ic[e]})});function xO(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ic.hasOwnProperty(e)&&Ic[e]?(""+t).trim():t+"px"}function OO(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=xO(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var sL=$t({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 Sv(e,t){if(t){if(sL[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function _v(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ev=null;function nb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cv=null,Wl=null,Gl=null;function bE(e){if(e=ed(e)){if(typeof Cv!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=N0(t),Cv(e.stateNode,e.type,t))}}function AO(e){Wl?Gl?Gl.push(e):Gl=[e]:Wl=e}function PO(){if(Wl){var e=Wl,t=Gl;if(Gl=Wl=null,bE(e),t)for(e=0;e>>=0,e===0?32:31-(vL(e)/wL|0)|0}var Vd=64,Hd=4194304;function yc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=yc(s):(i&=a,i!==0&&(r=yc(i)))}else a=n&~o,a!==0?r=yc(a):i!==0&&(r=yc(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Qf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-No(t),e[t]=n}function EL(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=kc),TE=String.fromCharCode(32),IE=!1;function XO(e,t){switch(e){case"keyup":return ZL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qO(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vl=!1;function JL(e,t){switch(e){case"compositionend":return qO(t);case"keypress":return t.which!==32?null:(IE=!0,TE);case"textInput":return e=t.data,e===TE&&IE?null:e;default:return null}}function eN(e,t){if(vl)return e==="compositionend"||!cb&&XO(e,t)?(e=GO(),Bh=sb=ca=null,vl=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=DE(n)}}function JO(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?JO(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eA(){for(var e=window,t=gp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gp(e.document)}return t}function fb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function uN(e){var t=eA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&JO(n.ownerDocument.documentElement,n)){if(r!==null&&fb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=LE(n,i);var a=LE(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,wl=null,Iv=null,Dc=null,Rv=!1;function NE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rv||wl==null||wl!==gp(r)||(r=wl,"selectionStart"in r&&fb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dc&&yf(Dc,r)||(Dc=r,r=Cp(Iv,"onSelect"),0_l||(e.current=Bv[_l],Bv[_l]=null,_l--)}function vt(e,t){_l++,Bv[_l]=e.current,e.current=t}var Ta={},Gn=La(Ta),wr=La(!1),ks=Ta;function cu(e,t){var n=e.type.contextTypes;if(!n)return Ta;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function br(e){return e=e.childContextTypes,e!=null}function Op(){_t(wr),_t(Gn)}function VE(e,t,n){if(Gn.current!==Ta)throw Error(oe(168));vt(Gn,t),vt(wr,n)}function uA(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(oe(108,oL(e)||"Unknown",o));return $t({},n,r)}function Ap(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ta,ks=Gn.current,vt(Gn,e),vt(wr,wr.current),!0}function HE(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=uA(e,t,ks),r.__reactInternalMemoizedMergedChildContext=e,_t(wr),_t(Gn),vt(Gn,e)):_t(wr),vt(wr,n)}var wi=null,B0=!1,py=!1;function cA(e){wi===null?wi=[e]:wi.push(e)}function SN(e){B0=!0,cA(e)}function Na(){if(!py&&wi!==null){py=!0;var e=0,t=st;try{var n=wi;for(st=1;e>=a,o-=a,Ci=1<<32-No(t)+o|n<y?(S=C,C=null):S=C.sibling;var v=d(b,C,E[y],T);if(v===null){C===null&&(C=S);break}e&&C&&v.alternate===null&&t(b,C),g=i(v,g,y),A===null?O=v:A.sibling=v,A=v,C=S}if(y===E.length)return n(b,C),At&&Ja(b,y),O;if(C===null){for(;yy?(S=C,C=null):S=C.sibling;var x=d(b,C,v.value,T);if(x===null){C===null&&(C=S);break}e&&C&&x.alternate===null&&t(b,C),g=i(x,g,y),A===null?O=x:A.sibling=x,A=x,C=S}if(v.done)return n(b,C),At&&Ja(b,y),O;if(C===null){for(;!v.done;y++,v=E.next())v=f(b,v.value,T),v!==null&&(g=i(v,g,y),A===null?O=v:A.sibling=v,A=v);return At&&Ja(b,y),O}for(C=r(b,C);!v.done;y++,v=E.next())v=h(C,b,y,v.value,T),v!==null&&(e&&v.alternate!==null&&C.delete(v.key===null?y:v.key),g=i(v,g,y),A===null?O=v:A.sibling=v,A=v);return e&&C.forEach(function(I){return t(b,I)}),At&&Ja(b,y),O}function _(b,g,E,T){if(typeof E=="object"&&E!==null&&E.type===gl&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case $d:e:{for(var O=E.key,A=g;A!==null;){if(A.key===O){if(O=E.type,O===gl){if(A.tag===7){n(b,A.sibling),g=o(A,E.props.children),g.return=b,b=g;break e}}else if(A.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===ra&&ZE(O)===A.type){n(b,A.sibling),g=o(A,E.props),g.ref=ec(b,A,E),g.return=b,b=g;break e}n(b,A);break}else t(b,A);A=A.sibling}E.type===gl?(g=Ss(E.props.children,b.mode,T,E.key),g.return=b,b=g):(T=Wh(E.type,E.key,E.props,null,b.mode,T),T.ref=ec(b,g,E),T.return=b,b=T)}return a(b);case yl:e:{for(A=E.key;g!==null;){if(g.key===A)if(g.tag===4&&g.stateNode.containerInfo===E.containerInfo&&g.stateNode.implementation===E.implementation){n(b,g.sibling),g=o(g,E.children||[]),g.return=b,b=g;break e}else{n(b,g);break}else t(b,g);g=g.sibling}g=_y(E,b.mode,T),g.return=b,b=g}return a(b);case ra:return A=E._init,_(b,g,A(E._payload),T)}if(mc(E))return p(b,g,E,T);if(qu(E))return m(b,g,E,T);Zd(b,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,g!==null&&g.tag===6?(n(b,g.sibling),g=o(g,E),g.return=b,b=g):(n(b,g),g=Sy(E,b.mode,T),g.return=b,b=g),a(b)):n(b,g)}return _}var du=vA(!0),wA=vA(!1),td={},li=La(td),bf=La(td),Sf=La(td);function hs(e){if(e===td)throw Error(oe(174));return e}function bb(e,t){switch(vt(Sf,t),vt(bf,e),vt(li,td),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:bv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=bv(t,e)}_t(li),vt(li,t)}function hu(){_t(li),_t(bf),_t(Sf)}function bA(e){hs(Sf.current);var t=hs(li.current),n=bv(t,e.type);t!==n&&(vt(bf,e),vt(li,n))}function Sb(e){bf.current===e&&(_t(li),_t(bf))}var Lt=La(0);function Mp(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var my=[];function _b(){for(var e=0;en?n:4,e(!0);var r=yy.transition;yy.transition={};try{e(!1),t()}finally{st=n,yy.transition=r}}function NA(){return bo().memoizedState}function xN(e,t,n){var r=Sa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},BA(e))jA(t,n);else if(n=pA(e,t,n,r),n!==null){var o=or();Bo(n,e,r,o),FA(n,t,r)}}function ON(e,t,n){var r=Sa(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(BA(e))jA(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,$o(s,a)){var l=t.interleaved;l===null?(o.next=o,vb(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=pA(e,t,o,r),n!==null&&(o=or(),Bo(n,e,r,o),FA(n,t,r))}}function BA(e){var t=e.alternate;return e===Ft||t!==null&&t===Ft}function jA(e,t){Lc=Dp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function FA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ob(e,n)}}var Lp={readContext:wo,useCallback:Fn,useContext:Fn,useEffect:Fn,useImperativeHandle:Fn,useInsertionEffect:Fn,useLayoutEffect:Fn,useMemo:Fn,useReducer:Fn,useRef:Fn,useState:Fn,useDebugValue:Fn,useDeferredValue:Fn,useTransition:Fn,useMutableSource:Fn,useSyncExternalStore:Fn,useId:Fn,unstable_isNewReconciler:!1},AN={readContext:wo,useCallback:function(e,t){return Ko().memoizedState=[e,t===void 0?null:t],e},useContext:wo,useEffect:JE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zh(4194308,4,RA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zh(4194308,4,e,t)},useInsertionEffect:function(e,t){return zh(4,2,e,t)},useMemo:function(e,t){var n=Ko();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ko();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xN.bind(null,Ft,e),[r.memoizedState,e]},useRef:function(e){var t=Ko();return e={current:e},t.memoizedState=e},useState:QE,useDebugValue:Ab,useDeferredValue:function(e){return Ko().memoizedState=e},useTransition:function(){var e=QE(!1),t=e[0];return e=CN.bind(null,e[1]),Ko().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ft,o=Ko();if(At){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),_n===null)throw Error(oe(349));Ds&30||EA(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,JE(xA.bind(null,r,i,e),[e]),r.flags|=2048,Cf(9,CA.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ko(),t=_n.identifierPrefix;if(At){var n=xi,r=Ci;n=(r&~(1<<32-No(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_f++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[ei]=t,e[wf]=r,XA(e,t,!1,!1),t.stateNode=e;e:{switch(a=_v(n,r),n){case"dialog":bt("cancel",e),bt("close",e),o=r;break;case"iframe":case"object":case"embed":bt("load",e),o=r;break;case"video":case"audio":for(o=0;omu&&(t.flags|=128,r=!0,tc(i,!1),t.lanes=4194304)}else{if(!r)if(e=Mp(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),tc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!At)return $n(t),null}else 2*Zt()-i.renderingStartTime>mu&&n!==1073741824&&(t.flags|=128,r=!0,tc(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Zt(),t.sibling=null,n=Lt.current,vt(Lt,r?n&1|2:n&1),t):($n(t),null);case 22:case 23:return Mb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Mr&1073741824&&($n(t),t.subtreeFlags&6&&(t.flags|=8192)):$n(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function LN(e,t){switch(hb(t),t.tag){case 1:return br(t.type)&&Op(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hu(),_t(wr),_t(Gn),_b(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sb(t),null;case 13:if(_t(Lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));fu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(Lt),null;case 4:return hu(),null;case 10:return gb(t.type._context),null;case 22:case 23:return Mb(),null;case 24:return null;default:return null}}var Jd=!1,Hn=!1,NN=typeof WeakSet=="function"?WeakSet:Set,pe=null;function Ol(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Wt(e,t,r)}else n.current=null}function qv(e,t,n){try{n()}catch(r){Wt(e,t,r)}}var lC=!1;function BN(e,t){if(kv=_p,e=eA(),fb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(s=a+o),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++u===o&&(s=a),d===i&&++c===r&&(l=a),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Mv={focusedElem:e,selectionRange:n},_p=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,_=p.memoizedState,b=t.stateNode,g=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:To(t.type,m),_);b.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(T){Wt(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return p=lC,lC=!1,p}function Nc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&qv(t,n,i)}o=o.next}while(o!==r)}}function $0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Yv(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ZA(e){var t=e.alternate;t!==null&&(e.alternate=null,ZA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ei],delete t[wf],delete t[Nv],delete t[wN],delete t[bN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function QA(e){return e.tag===5||e.tag===3||e.tag===4}function uC(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||QA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xp));else if(r!==4&&(e=e.child,e!==null))for(Zv(e,t,n),e=e.sibling;e!==null;)Zv(e,t,n),e=e.sibling}function Qv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Qv(e,t,n),e=e.sibling;e!==null;)Qv(e,t,n),e=e.sibling}var Tn=null,Io=!1;function Ki(e,t,n){for(n=n.child;n!==null;)JA(e,t,n),n=n.sibling}function JA(e,t,n){if(si&&typeof si.onCommitFiberUnmount=="function")try{si.onCommitFiberUnmount(k0,n)}catch{}switch(n.tag){case 5:Hn||Ol(n,t);case 6:var r=Tn,o=Io;Tn=null,Ki(e,t,n),Tn=r,Io=o,Tn!==null&&(Io?(e=Tn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Tn.removeChild(n.stateNode));break;case 18:Tn!==null&&(Io?(e=Tn,n=n.stateNode,e.nodeType===8?hy(e.parentNode,n):e.nodeType===1&&hy(e,n),pf(e)):hy(Tn,n.stateNode));break;case 4:r=Tn,o=Io,Tn=n.stateNode.containerInfo,Io=!0,Ki(e,t,n),Tn=r,Io=o;break;case 0:case 11:case 14:case 15:if(!Hn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&qv(n,t,a),o=o.next}while(o!==r)}Ki(e,t,n);break;case 1:if(!Hn&&(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Wt(n,t,s)}Ki(e,t,n);break;case 21:Ki(e,t,n);break;case 22:n.mode&1?(Hn=(r=Hn)||n.memoizedState!==null,Ki(e,t,n),Hn=r):Ki(e,t,n);break;default:Ki(e,t,n)}}function cC(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new NN),t.forEach(function(r){var o=GN.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function xo(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=Zt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*FN(r/1960))-r,10e?16:e,fa===null)var r=!1;else{if(e=fa,fa=null,jp=0,qe&6)throw Error(oe(331));var o=qe;for(qe|=4,pe=e.current;pe!==null;){var i=pe,a=i.child;if(pe.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lZt()-Rb?bs(e,0):Ib|=n),Sr(e,t)}function sP(e,t){t===0&&(e.mode&1?(t=Hd,Hd<<=1,!(Hd&130023424)&&(Hd=4194304)):t=1);var n=or();e=Di(e,t),e!==null&&(Qf(e,t,n),Sr(e,n))}function WN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sP(e,n)}function GN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(t),sP(e,n)}var lP;lP=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wr.current)vr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return vr=!1,MN(e,t,n);vr=!!(e.flags&131072)}else vr=!1,At&&t.flags&1048576&&fA(t,Tp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Uh(e,t),e=t.pendingProps;var o=cu(t,Gn.current);Xl(t,n),o=Cb(null,t,r,e,o,n);var i=xb();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,br(r)?(i=!0,Ap(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,wb(t),o.updater=j0,t.stateNode=o,o._reactInternals=t,Uv(t,r,e,n),t=Wv(null,t,r,!0,i,n)):(t.tag=0,At&&i&&db(t),tr(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Uh(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=XN(r),e=To(r,e),o){case 0:t=Hv(null,t,r,e,n);break e;case 1:t=iC(null,t,r,e,n);break e;case 11:t=rC(null,t,r,e,n);break e;case 14:t=oC(null,t,r,To(r.type,e),n);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:To(r,o),Hv(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:To(r,o),iC(e,t,r,o,n);case 3:e:{if(WA(t),e===null)throw Error(oe(387));r=t.pendingProps,i=t.memoizedState,o=i.element,mA(e,t),kp(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=pu(Error(oe(423)),t),t=aC(e,t,r,n,o);break e}else if(r!==o){o=pu(Error(oe(424)),t),t=aC(e,t,r,n,o);break e}else for(Lr=va(t.stateNode.containerInfo.firstChild),jr=t,At=!0,Ro=null,n=wA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fu(),r===o){t=Li(e,t,n);break e}tr(e,t,r,n)}t=t.child}return t;case 5:return bA(t),e===null&&Fv(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Dv(r,o)?a=null:i!==null&&Dv(r,i)&&(t.flags|=32),HA(e,t),tr(e,t,a,n),t.child;case 6:return e===null&&Fv(t),null;case 13:return GA(e,t,n);case 4:return bb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=du(t,null,r,n):tr(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:To(r,o),rC(e,t,r,o,n);case 7:return tr(e,t,t.pendingProps,n),t.child;case 8:return tr(e,t,t.pendingProps.children,n),t.child;case 12:return tr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,vt(Ip,r._currentValue),r._currentValue=a,i!==null)if($o(i.value,a)){if(i.children===o.children&&!wr.current){t=Li(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Pi(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),$v(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(oe(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),$v(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}tr(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Xl(t,n),o=wo(o),r=r(o),t.flags|=1,tr(e,t,r,n),t.child;case 14:return r=t.type,o=To(r,t.pendingProps),o=To(r.type,o),oC(e,t,r,o,n);case 15:return UA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:To(r,o),Uh(e,t),t.tag=1,br(r)?(e=!0,Ap(t)):e=!1,Xl(t,n),gA(t,r,o),Uv(t,r,o,n),Wv(null,t,r,!0,e,n);case 19:return KA(e,t,n);case 22:return VA(e,t,n)}throw Error(oe(156,t.tag))};function uP(e,t){return LO(e,t)}function KN(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ho(e,t,n,r){return new KN(e,t,n,r)}function Lb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XN(e){if(typeof e=="function")return Lb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eb)return 11;if(e===tb)return 14}return 2}function _a(e,t){var n=e.alternate;return n===null?(n=ho(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Wh(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")Lb(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case gl:return Ss(n.children,o,i,t);case Jw:a=8,o|=8;break;case dv:return e=ho(12,n,t,o|2),e.elementType=dv,e.lanes=i,e;case hv:return e=ho(13,n,t,o),e.elementType=hv,e.lanes=i,e;case pv:return e=ho(19,n,t,o),e.elementType=pv,e.lanes=i,e;case vO:return U0(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case yO:a=10;break e;case gO:a=9;break e;case eb:a=11;break e;case tb:a=14;break e;case ra:a=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=ho(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Ss(e,t,n,r){return e=ho(7,e,r,t),e.lanes=n,e}function U0(e,t,n,r){return e=ho(22,e,r,t),e.elementType=vO,e.lanes=n,e.stateNode={isHidden:!1},e}function Sy(e,t,n){return e=ho(6,e,null,t),e.lanes=n,e}function _y(e,t,n){return t=ho(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qN(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ny(0),this.expirationTimes=ny(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ny(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Nb(e,t,n,r,o,i,a,s,l){return e=new qN(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ho(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wb(i),e}function YN(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hP)}catch(e){console.error(e)}}hP(),fO.exports=Jr;var K0=fO.exports;const tB=Qe(K0);var[pP,nB]=tn({strict:!1,name:"PortalContext"}),$b="chakra-portal",rB=".chakra-portal",oB=e=>w.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),iB=e=>{const{appendToParentPortal:t,children:n}=e,[r,o]=P.useState(null),i=P.useRef(null),[,a]=P.useState({});P.useEffect(()=>a({}),[]);const s=nB(),l=ZD();ai(()=>{if(!r)return;const c=r.ownerDocument,f=t?s??c.body:c.body;if(!f)return;i.current=c.createElement("div"),i.current.className=$b,f.appendChild(i.current),a({});const d=i.current;return()=>{f.contains(d)&&f.removeChild(d)}},[r]);const u=l!=null&&l.zIndex?w.jsx(oB,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return i.current?K0.createPortal(w.jsx(pP,{value:i.current,children:u}),i.current):w.jsx("span",{ref:c=>{c&&o(c)}})},aB=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,o=n.current,i=o??(typeof window<"u"?document.body:void 0),a=P.useMemo(()=>{const l=o==null?void 0:o.ownerDocument.createElement("div");return l&&(l.className=$b),l},[o]),[,s]=P.useState({});return ai(()=>s({}),[]),ai(()=>{if(!(!a||!i))return i.appendChild(a),()=>{i.removeChild(a)}},[a,i]),i&&a?K0.createPortal(w.jsx(pP,{value:r?a:null,children:t}),a):null};function Lu(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?w.jsx(aB,{containerRef:n,...r}):w.jsx(iB,{...r})}Lu.className=$b;Lu.selector=rB;Lu.displayName="Portal";function nd(){const e=P.useContext(lf);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}var zb=P.createContext({});zb.displayName="ColorModeContext";function X0(){const e=P.useContext(zb);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var nh={light:"chakra-ui-light",dark:"chakra-ui-dark"};function sB(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const o=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,o==null||o()},setClassName(r){document.body.classList.add(r?nh.dark:nh.light),document.body.classList.remove(r?nh.light:nh.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var o;return((o=n.query().matches)!=null?o:r==="dark")?"dark":"light"},addListener(r){const o=n.query(),i=a=>{r(a.matches?"dark":"light")};return typeof o.addListener=="function"?o.addListener(i):o.addEventListener("change",i),()=>{typeof o.removeListener=="function"?o.removeListener(i):o.removeEventListener("change",i)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var lB="chakra-ui-color-mode";function uB(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var cB=uB(lB),vC=()=>{};function wC(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function mP(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:o,disableTransitionOnChange:i}={},colorModeManager:a=cB}=e,s=o==="dark"?"dark":"light",[l,u]=P.useState(()=>wC(a,s)),[c,f]=P.useState(()=>wC(a)),{getSystemTheme:d,setClassName:h,setDataset:p,addListener:m}=P.useMemo(()=>sB({preventTransition:i}),[i]),_=o==="system"&&!l?c:l,b=P.useCallback(T=>{const O=T==="system"?d():T;u(O),h(O==="dark"),p(O),a.set(O)},[a,d,h,p]);ai(()=>{o==="system"&&f(d())},[]),P.useEffect(()=>{const T=a.get();if(T){b(T);return}if(o==="system"){b("system");return}b(s)},[a,s,o,b]);const g=P.useCallback(()=>{b(_==="dark"?"light":"dark")},[_,b]);P.useEffect(()=>{if(r)return m(b)},[r,m,b]);const E=P.useMemo(()=>({colorMode:t??_,toggleColorMode:t?vC:g,setColorMode:t?vC:b,forced:t!==void 0}),[_,g,b,t]);return w.jsx(zb.Provider,{value:E,children:n})}mP.displayName="ColorModeProvider";var fB=new Set(["dark","light","system"]);function dB(e){let t=e;return fB.has(t)||(t="light"),t}function hB(e={}){const{initialColorMode:t="light",type:n="localStorage",storageKey:r="chakra-ui-color-mode"}=e,o=dB(t),i=n==="cookie",a=`(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${o}",r="${r}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})(); + `,s=`(function(){try{var a=function(c){var v="(prefers-color-scheme: dark)",h=window.matchMedia(v).matches?"dark":"light",r=c==="system"?h:c,o=document.documentElement,s=document.body,l="chakra-ui-light",d="chakra-ui-dark",i=r==="dark";return s.classList.add(i?d:l),s.classList.remove(i?l:d),o.style.colorScheme=r,o.dataset.theme=r,r},n=a,m="${o}",e="${r}",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})(); + `;return`!${i?a:s}`.trim()}function pB(e={}){const{nonce:t}=e;return w.jsx("script",{id:"chakra-script",nonce:t,dangerouslySetInnerHTML:{__html:hB(e)}})}function yP(){const e=X0(),t=nd();return{...e,theme:t}}function mB(e,t,n){var r,o;if(t==null)return t;const i=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(o=(r=i(t))!=null?r:i(n))!=null?o:n}function yB(e,t,n){var r,o;if(t==null)return t;const i=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(o=(r=i(t))!=null?r:i(n))!=null?o:n}function gB(e,t,n){const r=nd();return vB(e,t,n)(r)}function vB(e,t,n){const r=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n];return i=>{const a=o.filter(Boolean),s=r.map((l,u)=>{var c,f;if(e==="breakpoints")return mB(i,l,(c=a[u])!=null?c:l);const d=`${e}.${l}`;return yB(i,d,(f=a[u])!=null?f:l)});return Array.isArray(t)?s:s[0]}}var _e=(...e)=>e.filter(Boolean).join(" ");function _r(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function po(e,...t){return wB(e)?e(...t):e}var wB=e=>typeof e=="function",Re=e=>e?"":void 0,Yl=e=>e?!0:void 0;function ke(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function q0(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var zp={exports:{}};zp.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",b="[object Null]",g="[object Object]",E="[object Proxy]",T="[object RegExp]",O="[object Set]",A="[object String]",C="[object Undefined]",y="[object WeakMap]",S="[object ArrayBuffer]",v="[object DataView]",x="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",k="[object Int16Array]",M="[object Int32Array]",N="[object Uint8Array]",D="[object Uint8ClampedArray]",L="[object Uint16Array]",j="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,B=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,K={};K[x]=K[I]=K[R]=K[k]=K[M]=K[N]=K[D]=K[L]=K[j]=!0,K[s]=K[l]=K[S]=K[c]=K[v]=K[f]=K[d]=K[h]=K[m]=K[_]=K[g]=K[T]=K[O]=K[A]=K[y]=!1;var W=typeof fo=="object"&&fo&&fo.Object===Object&&fo,Q=typeof self=="object"&&self&&self.Object===Object&&self,X=W||Q||Function("return this")(),J=t&&!t.nodeType&&t,te=J&&!0&&e&&!e.nodeType&&e,le=te&&te.exports===J,ge=le&&W.process,se=function(){try{var z=te&&te.require&&te.require("util").types;return z||ge&&ge.binding&&ge.binding("util")}catch{}}(),ue=se&&se.isTypedArray;function Ie(z,V,q){switch(q.length){case 0:return z.call(V);case 1:return z.call(V,q[0]);case 2:return z.call(V,q[0],q[1]);case 3:return z.call(V,q[0],q[1],q[2])}return z.apply(V,q)}function gt(z,V){for(var q=-1,he=Array(z);++q-1}function F9(z,V){var q=this.__data__,he=Dd(q,z);return he<0?(++this.size,q.push([z,V])):q[he][1]=V,this}yi.prototype.clear=L9,yi.prototype.delete=N9,yi.prototype.get=B9,yi.prototype.has=j9,yi.prototype.set=F9;function tl(z){var V=-1,q=z==null?0:z.length;for(this.clear();++V1?q[He-1]:void 0,Ct=He>2?q[2]:void 0;for(ht=z.length>3&&typeof ht=="function"?(He--,ht):void 0,Ct&&pM(q[0],q[1],Ct)&&(ht=He<3?void 0:ht,He=1),V=Object(V);++he-1&&z%1==0&&z0){if(++V>=o)return arguments[0]}else V=0;return z.apply(void 0,arguments)}}function _M(z){if(z!=null){try{return xn.call(z)}catch{}try{return z+""}catch{}}return""}function Bd(z,V){return z===V||z!==z&&V!==V}var Hm=G_(function(){return arguments}())?G_:function(z){return Gu(z)&&zt.call(z,"callee")&&!x9.call(z,"callee")},Wm=Array.isArray;function Gm(z){return z!=null&&Z_(z.length)&&!Km(z)}function EM(z){return Gu(z)&&Gm(z)}var Y_=A9||PM;function Km(z){if(!Xa(z))return!1;var V=Ld(z);return V==h||V==p||V==u||V==E}function Z_(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=a}function Xa(z){var V=typeof z;return z!=null&&(V=="object"||V=="function")}function Gu(z){return z!=null&&typeof z=="object"}function CM(z){if(!Gu(z)||Ld(z)!=g)return!1;var V=U_(z);if(V===null)return!0;var q=zt.call(V,"constructor")&&V.constructor;return typeof q=="function"&&q instanceof q&&xn.call(q)==Ha}var Q_=ue?ie(ue):eM;function xM(z){return uM(z,J_(z))}function J_(z){return Gm(z)?Y9(z,!0):tM(z)}var OM=cM(function(z,V,q,he){K_(z,V,q,he)});function AM(z){return function(){return z}}function eE(z){return z}function PM(){return!1}e.exports=OM})(zp,zp.exports);var bB=zp.exports;const mo=Qe(bB);var SB=e=>/!(important)?$/.test(e),bC=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,_B=(e,t)=>n=>{const r=String(t),o=SB(r),i=bC(r),a=e?`${e}.${i}`:i;let s=_r(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=bC(s),o?`${s} !important`:s};function Ub(e){const{scale:t,transform:n,compose:r}=e;return(i,a)=>{var s;const l=_B(t,i)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var rh=(...e)=>t=>e.reduce((n,r)=>r(n),t);function no(e,t){return n=>{const r={property:n,scale:e};return r.transform=Ub({scale:e,transform:t}),r}}var EB=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function CB(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:EB(t),transform:n?Ub({scale:n,compose:r}):r}}var gP=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function xB(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...gP].join(" ")}function OB(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...gP].join(" ")}var AB={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},PB={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function TB(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var IB={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},r2={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},RB=new Set(Object.values(r2)),o2=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),kB=e=>e.trim();function MB(e,t){if(e==null||o2.has(e))return e;if(!(i2(e)||o2.has(e)))return`url('${e}')`;const o=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=o==null?void 0:o[1],a=o==null?void 0:o[2];if(!i||!a)return e;const s=i.includes("-gradient")?i:`${i}-gradient`,[l,...u]=a.split(",").map(kB).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in r2?r2[l]:l;u.unshift(c);const f=u.map(d=>{if(RB.has(d))return d;const h=d.indexOf(" "),[p,m]=h!==-1?[d.substr(0,h),d.substr(h+1)]:[d],_=i2(m)?m:m&&m.split(" "),b=`colors.${p}`,g=b in t.__cssMap?t.__cssMap[b].varRef:p;return _?[g,...Array.isArray(_)?_:[_]].join(" "):g});return`${s}(${f.join(", ")})`}var i2=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),DB=(e,t)=>MB(e,t??{});function LB(e){return/^var\(--.+\)$/.test(e)}var NB=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Wo=e=>t=>`${e}(${t})`,Ye={filter(e){return e!=="auto"?e:AB},backdropFilter(e){return e!=="auto"?e:PB},ring(e){return TB(Ye.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?xB():e==="auto-gpu"?OB():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=NB(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(LB(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:DB,blur:Wo("blur"),opacity:Wo("opacity"),brightness:Wo("brightness"),contrast:Wo("contrast"),dropShadow:Wo("drop-shadow"),grayscale:Wo("grayscale"),hueRotate:Wo("hue-rotate"),invert:Wo("invert"),saturate:Wo("saturate"),sepia:Wo("sepia"),bgImage(e){return e==null||i2(e)||o2.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=IB[e])!=null?t:{},o={flexDirection:e};return n&&(o[n]=1),r&&(o[r]=1),o}},H={borderWidths:no("borderWidths"),borderStyles:no("borderStyles"),colors:no("colors"),borders:no("borders"),gradients:no("gradients",Ye.gradient),radii:no("radii",Ye.px),space:no("space",rh(Ye.vh,Ye.px)),spaceT:no("space",rh(Ye.vh,Ye.px)),degreeT(e){return{property:e,transform:Ye.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:Ub({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:no("sizes",rh(Ye.vh,Ye.px)),sizesT:no("sizes",rh(Ye.vh,Ye.fraction)),shadows:no("shadows"),logical:CB,blur:no("blur",Ye.blur)},Gh={background:H.colors("background"),backgroundColor:H.colors("backgroundColor"),backgroundImage:H.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Ye.bgClip},bgSize:H.prop("backgroundSize"),bgPosition:H.prop("backgroundPosition"),bg:H.colors("background"),bgColor:H.colors("backgroundColor"),bgPos:H.prop("backgroundPosition"),bgRepeat:H.prop("backgroundRepeat"),bgAttachment:H.prop("backgroundAttachment"),bgGradient:H.gradients("backgroundImage"),bgClip:{transform:Ye.bgClip}};Object.assign(Gh,{bgImage:Gh.backgroundImage,bgImg:Gh.backgroundImage});var et={border:H.borders("border"),borderWidth:H.borderWidths("borderWidth"),borderStyle:H.borderStyles("borderStyle"),borderColor:H.colors("borderColor"),borderRadius:H.radii("borderRadius"),borderTop:H.borders("borderTop"),borderBlockStart:H.borders("borderBlockStart"),borderTopLeftRadius:H.radii("borderTopLeftRadius"),borderStartStartRadius:H.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:H.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:H.radii("borderTopRightRadius"),borderStartEndRadius:H.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:H.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:H.borders("borderRight"),borderInlineEnd:H.borders("borderInlineEnd"),borderBottom:H.borders("borderBottom"),borderBlockEnd:H.borders("borderBlockEnd"),borderBottomLeftRadius:H.radii("borderBottomLeftRadius"),borderBottomRightRadius:H.radii("borderBottomRightRadius"),borderLeft:H.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:H.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:H.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:H.borders(["borderLeft","borderRight"]),borderInline:H.borders("borderInline"),borderY:H.borders(["borderTop","borderBottom"]),borderBlock:H.borders("borderBlock"),borderTopWidth:H.borderWidths("borderTopWidth"),borderBlockStartWidth:H.borderWidths("borderBlockStartWidth"),borderTopColor:H.colors("borderTopColor"),borderBlockStartColor:H.colors("borderBlockStartColor"),borderTopStyle:H.borderStyles("borderTopStyle"),borderBlockStartStyle:H.borderStyles("borderBlockStartStyle"),borderBottomWidth:H.borderWidths("borderBottomWidth"),borderBlockEndWidth:H.borderWidths("borderBlockEndWidth"),borderBottomColor:H.colors("borderBottomColor"),borderBlockEndColor:H.colors("borderBlockEndColor"),borderBottomStyle:H.borderStyles("borderBottomStyle"),borderBlockEndStyle:H.borderStyles("borderBlockEndStyle"),borderLeftWidth:H.borderWidths("borderLeftWidth"),borderInlineStartWidth:H.borderWidths("borderInlineStartWidth"),borderLeftColor:H.colors("borderLeftColor"),borderInlineStartColor:H.colors("borderInlineStartColor"),borderLeftStyle:H.borderStyles("borderLeftStyle"),borderInlineStartStyle:H.borderStyles("borderInlineStartStyle"),borderRightWidth:H.borderWidths("borderRightWidth"),borderInlineEndWidth:H.borderWidths("borderInlineEndWidth"),borderRightColor:H.colors("borderRightColor"),borderInlineEndColor:H.colors("borderInlineEndColor"),borderRightStyle:H.borderStyles("borderRightStyle"),borderInlineEndStyle:H.borderStyles("borderInlineEndStyle"),borderTopRadius:H.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:H.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:H.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:H.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(et,{rounded:et.borderRadius,roundedTop:et.borderTopRadius,roundedTopLeft:et.borderTopLeftRadius,roundedTopRight:et.borderTopRightRadius,roundedTopStart:et.borderStartStartRadius,roundedTopEnd:et.borderStartEndRadius,roundedBottom:et.borderBottomRadius,roundedBottomLeft:et.borderBottomLeftRadius,roundedBottomRight:et.borderBottomRightRadius,roundedBottomStart:et.borderEndStartRadius,roundedBottomEnd:et.borderEndEndRadius,roundedLeft:et.borderLeftRadius,roundedRight:et.borderRightRadius,roundedStart:et.borderInlineStartRadius,roundedEnd:et.borderInlineEndRadius,borderStart:et.borderInlineStart,borderEnd:et.borderInlineEnd,borderTopStartRadius:et.borderStartStartRadius,borderTopEndRadius:et.borderStartEndRadius,borderBottomStartRadius:et.borderEndStartRadius,borderBottomEndRadius:et.borderEndEndRadius,borderStartRadius:et.borderInlineStartRadius,borderEndRadius:et.borderInlineEndRadius,borderStartWidth:et.borderInlineStartWidth,borderEndWidth:et.borderInlineEndWidth,borderStartColor:et.borderInlineStartColor,borderEndColor:et.borderInlineEndColor,borderStartStyle:et.borderInlineStartStyle,borderEndStyle:et.borderInlineEndStyle});var BB={color:H.colors("color"),textColor:H.colors("color"),fill:H.colors("fill"),stroke:H.colors("stroke")},a2={boxShadow:H.shadows("boxShadow"),mixBlendMode:!0,blendMode:H.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:H.prop("backgroundBlendMode"),opacity:!0};Object.assign(a2,{shadow:a2.boxShadow});var jB={filter:{transform:Ye.filter},blur:H.blur("--chakra-blur"),brightness:H.propT("--chakra-brightness",Ye.brightness),contrast:H.propT("--chakra-contrast",Ye.contrast),hueRotate:H.degreeT("--chakra-hue-rotate"),invert:H.propT("--chakra-invert",Ye.invert),saturate:H.propT("--chakra-saturate",Ye.saturate),dropShadow:H.propT("--chakra-drop-shadow",Ye.dropShadow),backdropFilter:{transform:Ye.backdropFilter},backdropBlur:H.blur("--chakra-backdrop-blur"),backdropBrightness:H.propT("--chakra-backdrop-brightness",Ye.brightness),backdropContrast:H.propT("--chakra-backdrop-contrast",Ye.contrast),backdropHueRotate:H.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:H.propT("--chakra-backdrop-invert",Ye.invert),backdropSaturate:H.propT("--chakra-backdrop-saturate",Ye.saturate)},Up={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Ye.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:H.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:H.space("gap"),rowGap:H.space("rowGap"),columnGap:H.space("columnGap")};Object.assign(Up,{flexDir:Up.flexDirection});var vP={gridGap:H.space("gridGap"),gridColumnGap:H.space("gridColumnGap"),gridRowGap:H.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},FB={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Ye.outline},outlineOffset:!0,outlineColor:H.colors("outlineColor")},ao={width:H.sizesT("width"),inlineSize:H.sizesT("inlineSize"),height:H.sizes("height"),blockSize:H.sizes("blockSize"),boxSize:H.sizes(["width","height"]),minWidth:H.sizes("minWidth"),minInlineSize:H.sizes("minInlineSize"),minHeight:H.sizes("minHeight"),minBlockSize:H.sizes("minBlockSize"),maxWidth:H.sizes("maxWidth"),maxInlineSize:H.sizes("maxInlineSize"),maxHeight:H.sizes("maxHeight"),maxBlockSize:H.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (min-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?o:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (max-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?o:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:H.propT("float",Ye.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(ao,{w:ao.width,h:ao.height,minW:ao.minWidth,maxW:ao.maxWidth,minH:ao.minHeight,maxH:ao.maxHeight,overscroll:ao.overscrollBehavior,overscrollX:ao.overscrollBehaviorX,overscrollY:ao.overscrollBehaviorY});var $B={listStyleType:!0,listStylePosition:!0,listStylePos:H.prop("listStylePosition"),listStyleImage:!0,listStyleImg:H.prop("listStyleImage")};function zB(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(o))return s.get(o);const l=e(r,o,i,a);return s.set(o,l),l}},VB=UB(zB),HB={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},WB={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Ey=(e,t,n)=>{const r={},o=VB(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},GB={srOnly:{transform(e){return e===!0?HB:e==="focusable"?WB:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Ey(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Ey(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Ey(t,e,n)}},Fc={position:!0,pos:H.prop("position"),zIndex:H.prop("zIndex","zIndices"),inset:H.spaceT("inset"),insetX:H.spaceT(["left","right"]),insetInline:H.spaceT("insetInline"),insetY:H.spaceT(["top","bottom"]),insetBlock:H.spaceT("insetBlock"),top:H.spaceT("top"),insetBlockStart:H.spaceT("insetBlockStart"),bottom:H.spaceT("bottom"),insetBlockEnd:H.spaceT("insetBlockEnd"),left:H.spaceT("left"),insetInlineStart:H.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:H.spaceT("right"),insetInlineEnd:H.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Fc,{insetStart:Fc.insetInlineStart,insetEnd:Fc.insetInlineEnd});var KB={ring:{transform:Ye.ring},ringColor:H.colors("--chakra-ring-color"),ringOffset:H.prop("--chakra-ring-offset-width"),ringOffsetColor:H.colors("--chakra-ring-offset-color"),ringInset:H.prop("--chakra-ring-inset")},St={margin:H.spaceT("margin"),marginTop:H.spaceT("marginTop"),marginBlockStart:H.spaceT("marginBlockStart"),marginRight:H.spaceT("marginRight"),marginInlineEnd:H.spaceT("marginInlineEnd"),marginBottom:H.spaceT("marginBottom"),marginBlockEnd:H.spaceT("marginBlockEnd"),marginLeft:H.spaceT("marginLeft"),marginInlineStart:H.spaceT("marginInlineStart"),marginX:H.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:H.spaceT("marginInline"),marginY:H.spaceT(["marginTop","marginBottom"]),marginBlock:H.spaceT("marginBlock"),padding:H.space("padding"),paddingTop:H.space("paddingTop"),paddingBlockStart:H.space("paddingBlockStart"),paddingRight:H.space("paddingRight"),paddingBottom:H.space("paddingBottom"),paddingBlockEnd:H.space("paddingBlockEnd"),paddingLeft:H.space("paddingLeft"),paddingInlineStart:H.space("paddingInlineStart"),paddingInlineEnd:H.space("paddingInlineEnd"),paddingX:H.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:H.space("paddingInline"),paddingY:H.space(["paddingTop","paddingBottom"]),paddingBlock:H.space("paddingBlock")};Object.assign(St,{m:St.margin,mt:St.marginTop,mr:St.marginRight,me:St.marginInlineEnd,marginEnd:St.marginInlineEnd,mb:St.marginBottom,ml:St.marginLeft,ms:St.marginInlineStart,marginStart:St.marginInlineStart,mx:St.marginX,my:St.marginY,p:St.padding,pt:St.paddingTop,py:St.paddingY,px:St.paddingX,pb:St.paddingBottom,pl:St.paddingLeft,ps:St.paddingInlineStart,paddingStart:St.paddingInlineStart,pr:St.paddingRight,pe:St.paddingInlineEnd,paddingEnd:St.paddingInlineEnd});var XB={textDecorationColor:H.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:H.shadows("textShadow")},qB={clipPath:!0,transform:H.propT("transform",Ye.transform),transformOrigin:!0,translateX:H.spaceT("--chakra-translate-x"),translateY:H.spaceT("--chakra-translate-y"),skewX:H.degreeT("--chakra-skew-x"),skewY:H.degreeT("--chakra-skew-y"),scaleX:H.prop("--chakra-scale-x"),scaleY:H.prop("--chakra-scale-y"),scale:H.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:H.degreeT("--chakra-rotate")},YB={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:H.prop("transitionDuration","transition.duration"),transitionProperty:H.prop("transitionProperty","transition.property"),transitionTimingFunction:H.prop("transitionTimingFunction","transition.easing")},ZB={fontFamily:H.prop("fontFamily","fonts"),fontSize:H.prop("fontSize","fontSizes",Ye.px),fontWeight:H.prop("fontWeight","fontWeights"),lineHeight:H.prop("lineHeight","lineHeights"),letterSpacing:H.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},QB={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:H.spaceT("scrollMargin"),scrollMarginTop:H.spaceT("scrollMarginTop"),scrollMarginBottom:H.spaceT("scrollMarginBottom"),scrollMarginLeft:H.spaceT("scrollMarginLeft"),scrollMarginRight:H.spaceT("scrollMarginRight"),scrollMarginX:H.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:H.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:H.spaceT("scrollPadding"),scrollPaddingTop:H.spaceT("scrollPaddingTop"),scrollPaddingBottom:H.spaceT("scrollPaddingBottom"),scrollPaddingLeft:H.spaceT("scrollPaddingLeft"),scrollPaddingRight:H.spaceT("scrollPaddingRight"),scrollPaddingX:H.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:H.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function wP(e){return _r(e)&&e.reference?e.reference:String(e)}var Y0=(e,...t)=>t.map(wP).join(` ${e} `).replace(/calc/g,""),SC=(...e)=>`calc(${Y0("+",...e)})`,_C=(...e)=>`calc(${Y0("-",...e)})`,s2=(...e)=>`calc(${Y0("*",...e)})`,EC=(...e)=>`calc(${Y0("/",...e)})`,CC=e=>{const t=wP(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:s2(t,-1)},is=Object.assign(e=>({add:(...t)=>is(SC(e,...t)),subtract:(...t)=>is(_C(e,...t)),multiply:(...t)=>is(s2(e,...t)),divide:(...t)=>is(EC(e,...t)),negate:()=>is(CC(e)),toString:()=>e.toString()}),{add:SC,subtract:_C,multiply:s2,divide:EC,negate:CC});function JB(e,t="-"){return e.replace(/\s+/g,t)}function ej(e){const t=JB(e.toString());return nj(tj(t))}function tj(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function nj(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function rj(e,t=""){return[t,e].filter(Boolean).join("-")}function oj(e,t){return`var(${e}${t?`, ${t}`:""})`}function ij(e,t=""){return ej(`--${rj(e,t)}`)}function Ee(e,t,n){const r=ij(e,n);return{variable:r,reference:oj(r,t)}}function aj(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[o,i]=r;n[o]=Ee(`${e}-${o}`,i);continue}n[r]=Ee(`${e}-${r}`)}return n}function sj(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function lj(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function l2(e){if(e==null)return e;const{unitless:t}=lj(e);return t||typeof e=="number"?`${e}px`:e}var bP=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,Vb=e=>Object.fromEntries(Object.entries(e).sort(bP));function xC(e){const t=Vb(e);return Object.assign(Object.values(t),t)}function uj(e){const t=Object.keys(Vb(e));return new Set(t)}function OC(e){var t;if(!e)return e;e=(t=l2(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function vc(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${l2(e)})`),t&&n.push("and",`(max-width: ${l2(t)})`),n.join(" ")}function cj(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=xC(e),r=Object.entries(e).sort(bP).map(([a,s],l,u)=>{var c;let[,f]=(c=u[l+1])!=null?c:[];return f=parseFloat(f)>0?OC(f):void 0,{_minW:OC(s),breakpoint:a,minW:s,maxW:f,maxWQuery:vc(null,f),minWQuery:vc(s),minMaxQuery:vc(s,f)}}),o=uj(e),i=Array.from(o.values());return{keys:o,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>o.has(l))},asObject:Vb(e),asArray:xC(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>vc(a)).slice(1)],toArrayValue(a){if(!_r(a))throw new Error("toArrayValue: value must be an object");const s=i.map(l=>{var u;return(u=a[l])!=null?u:null});for(;sj(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const c=i[u];return c!=null&&l!=null&&(s[c]=l),s},{})}}}var On={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Xi=e=>SP(t=>e(t,"&"),"[role=group]","[data-group]",".group"),gi=e=>SP(t=>e(t,"~ &"),"[data-peer]",".peer"),SP=(e,...t)=>t.map(e).join(", "),Z0={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:Xi(On.hover),_peerHover:gi(On.hover),_groupFocus:Xi(On.focus),_peerFocus:gi(On.focus),_groupFocusVisible:Xi(On.focusVisible),_peerFocusVisible:gi(On.focusVisible),_groupActive:Xi(On.active),_peerActive:gi(On.active),_groupDisabled:Xi(On.disabled),_peerDisabled:gi(On.disabled),_groupInvalid:Xi(On.invalid),_peerInvalid:gi(On.invalid),_groupChecked:Xi(On.checked),_peerChecked:gi(On.checked),_groupFocusWithin:Xi(On.focusWithin),_peerFocusWithin:gi(On.focusWithin),_peerPlaceholderShown:gi(On.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},_P=Object.keys(Z0);function AC(e,t){return Ee(String(e).replace(/\./g,"-"),void 0,t)}function fj(e,t){let n={};const r={};for(const[o,i]of Object.entries(e)){const{isSemantic:a,value:s}=i,{variable:l,reference:u}=AC(o,t==null?void 0:t.cssVarPrefix);if(!a){if(o.startsWith("space")){const d=o.split("."),[h,...p]=d,m=`${h}.-${p.join(".")}`,_=is.negate(s),b=is.negate(u);r[m]={value:_,var:l,varRef:b}}n[l]=s,r[o]={value:s,var:l,varRef:u};continue}const c=d=>{const p=[String(o).split(".")[0],d].join(".");if(!e[p])return d;const{reference:_}=AC(p,t==null?void 0:t.cssVarPrefix);return _},f=_r(s)?s:{default:s};n=mo(n,Object.entries(f).reduce((d,[h,p])=>{var m,_;if(!p)return d;const b=c(`${p}`);if(h==="default")return d[l]=b,d;const g=(_=(m=Z0)==null?void 0:m[h])!=null?_:h;return d[g]={[l]:b},d},{})),r[o]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function dj(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function hj(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function pj(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function PC(e,t,n={}){const{stop:r,getKey:o}=n;function i(a,s=[]){var l;if(pj(a)||Array.isArray(a)){const u={};for(const[c,f]of Object.entries(a)){const d=(l=o==null?void 0:o(c))!=null?l:c,h=[...s,d];if(r!=null&&r(a,h))return t(a,s);u[d]=i(f,h)}return u}return t(a,s)}return i(e)}var mj=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function yj(e){return hj(e,mj)}function gj(e){return e.semanticTokens}function vj(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...o}=e;return o}var wj=e=>_P.includes(e)||e==="default";function bj({tokens:e,semanticTokens:t}){const n={};return PC(e,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!1,value:r})}),PC(t,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(wj)}),n}function Sj(e){var t;const n=vj(e),r=yj(n),o=gj(n),i=bj({tokens:r,semanticTokens:o}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=fj(i,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:cj(n.breakpoints)}),n}var Hb=mo({},Gh,et,BB,Up,ao,jB,KB,FB,vP,GB,Fc,a2,St,QB,ZB,XB,qB,$B,YB),_j=Object.assign({},St,ao,Up,vP,Fc),Ej=Object.keys(_j),Cj=[...Object.keys(Hb),..._P],xj={...Hb,...Z0},Oj=e=>e in xj,Aj=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const a in e){let s=po(e[a],t);if(s==null)continue;if(s=_r(s)&&n(s)?r(s):s,!Array.isArray(s)){i[a]=s;continue}const l=s.slice(0,o.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!Tj(t),Rj=(e,t)=>{var n,r;if(t==null)return t;const o=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},i=l=>{var u;return(u=o(l))!=null?u:l},[a,s]=Pj(t);return t=(r=(n=o(a))!=null?n:i(s))!=null?r:i(t),t};function kj(e){const{configs:t={},pseudos:n={},theme:r}=e,o=(i,a=!1)=>{var s,l,u;const c=po(i,r),f=Aj(c)(r);let d={};for(let h in f){const p=f[h];let m=po(p,r);h in n&&(h=n[h]),Ij(h,m)&&(m=Rj(r,m));let _=t[h];if(_===!0&&(_={property:h}),_r(m)){d[h]=(s=d[h])!=null?s:{},d[h]=mo({},d[h],o(m,!0));continue}let b=(u=(l=_==null?void 0:_.transform)==null?void 0:l.call(_,m,r,c))!=null?u:m;b=_!=null&&_.processResult?o(b,!0):b;const g=po(_==null?void 0:_.property,r);if(!a&&(_!=null&&_.static)){const E=po(_.static,r);d=mo({},d,E)}if(g&&Array.isArray(g)){for(const E of g)d[E]=b;continue}if(g){g==="&"&&_r(b)?d=mo({},d,b):d[g]=b;continue}if(_r(b)){d=mo({},d,b);continue}d[h]=b}return d};return o}var EP=e=>t=>kj({theme:t,pseudos:Z0,configs:Hb})(e);function wt(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Mj(e,t){if(Array.isArray(e))return e;if(_r(e))return t(e);if(e!=null)return[e]}function Dj(e,t){for(let n=t+1;n{mo(u,{[E]:d?g[E]:{[b]:g[E]}})});continue}if(!h){d?mo(u,g):u[b]=g;continue}u[b]=g}}return u}}function Nj(e){return t=>{var n;const{variant:r,size:o,theme:i}=t,a=Lj(i);return mo({},po((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",o,t),a(e,"variants",r,t))}}function Bj(e,t,n){var r,o,i;return(i=(o=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:o.varRef)!=null?i:n}function Rt(e){return dj(e,["styleConfig","size","variant","colorScheme"])}var jj=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function Fj(e){return _r(e)?jj.every(t=>Object.prototype.hasOwnProperty.call(e,t)):!1}var $j={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},zj={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},Uj={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Vj={property:$j,easing:zj,duration:Uj},Hj=Vj,Wj={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Gj=Wj,Kj={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Xj=Kj,qj={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Yj=qj,Zj={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Qj=Zj,Jj={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},eF=Jj,tF={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},nF=tF,rF={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},oF=rF,iF={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},CP=iF,xP={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},aF={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},sF={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},lF={...xP,...aF,container:sF},OP=lF,uF={breakpoints:Yj,zIndices:Gj,radii:eF,blur:oF,colors:Qj,...CP,sizes:OP,shadows:nF,space:xP,borders:Xj,transition:Hj},{defineMultiStyleConfig:cF,definePartsStyle:wc}=wt(["stepper","step","title","description","indicator","separator","icon","number"]),Si=Ee("stepper-indicator-size"),Pl=Ee("stepper-icon-size"),Tl=Ee("stepper-title-font-size"),bc=Ee("stepper-description-font-size"),rc=Ee("stepper-accent-color"),fF=wc(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[rc.variable]:`colors.${e}.500`,_dark:{[rc.variable]:`colors.${e}.200`}},title:{fontSize:Tl.reference,fontWeight:"medium"},description:{fontSize:bc.reference,color:"chakra-subtle-text"},number:{fontSize:Tl.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Pl.reference,height:Pl.reference},indicator:{flexShrink:0,borderRadius:"full",width:Si.reference,height:Si.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:rc.reference},"&[data-status=complete]":{bg:rc.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:rc.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${Si.reference} - 8px)`,top:`calc(${Si.reference} + 4px)`,insetStart:`calc(${Si.reference} / 2 - 1px)`}}})),dF=cF({baseStyle:fF,sizes:{xs:wc({stepper:{[Si.variable]:"sizes.4",[Pl.variable]:"sizes.3",[Tl.variable]:"fontSizes.xs",[bc.variable]:"fontSizes.xs"}}),sm:wc({stepper:{[Si.variable]:"sizes.6",[Pl.variable]:"sizes.4",[Tl.variable]:"fontSizes.sm",[bc.variable]:"fontSizes.xs"}}),md:wc({stepper:{[Si.variable]:"sizes.8",[Pl.variable]:"sizes.5",[Tl.variable]:"fontSizes.md",[bc.variable]:"fontSizes.sm"}}),lg:wc({stepper:{[Si.variable]:"sizes.10",[Pl.variable]:"sizes.6",[Tl.variable]:"fontSizes.lg",[bc.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function it(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function o(...c){r();for(const f of c)t[f]=l(f);return it(e,t)}function i(...c){for(const f of c)f in t||(t[f]=l(f));return it(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([f,d])=>[f,d.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([f,d])=>[f,d.className]))}function l(c){const h=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:h,selector:`.${h}`,toString:()=>c}}return{parts:o,toPart:l,extend:i,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var hF=it("accordion").parts("root","container","button","panel").extend("icon"),pF=it("alert").parts("title","description","container").extend("icon","spinner"),mF=it("avatar").parts("label","badge","container").extend("excessLabel","group"),yF=it("breadcrumb").parts("link","item","container").extend("separator");it("button").parts();var gF=it("checkbox").parts("control","icon","container").extend("label");it("progress").parts("track","filledTrack").extend("label");var vF=it("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),wF=it("editable").parts("preview","input","textarea"),bF=it("form").parts("container","requiredIndicator","helperText"),SF=it("formError").parts("text","icon"),_F=it("input").parts("addon","field","element","group"),EF=it("list").parts("container","item","icon"),CF=it("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),xF=it("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),OF=it("numberinput").parts("root","field","stepperGroup","stepper");it("pininput").parts("field");var AF=it("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),PF=it("progress").parts("label","filledTrack","track"),TF=it("radio").parts("container","control","label"),IF=it("select").parts("field","icon"),RF=it("slider").parts("container","track","thumb","filledTrack","mark"),kF=it("stat").parts("container","label","helpText","number","icon"),MF=it("switch").parts("container","track","thumb"),DF=it("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),LF=it("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),NF=it("tag").parts("container","label","closeButton"),BF=it("card").parts("container","header","body","footer");function ps(e,t,n){return Math.min(Math.max(e,n),t)}class jF extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Sc=jF;function Wb(e){if(typeof e!="string")throw new Sc(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=GF.test(e)?zF(e):e;const n=UF.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(Of(s,2),16)),parseInt(Of(a[3]||"f",2),16)/255]}const r=VF.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const o=HF.exec(t);if(o){const a=Array.from(o).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const i=WF.exec(t);if(i){const[a,s,l,u]=Array.from(i).slice(1).map(parseFloat);if(ps(0,100,s)!==s)throw new Sc(e);if(ps(0,100,l)!==l)throw new Sc(e);return[...KF(a,s,l),Number.isNaN(u)?1:u]}throw new Sc(e)}function FF(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const TC=e=>parseInt(e.replace(/_/g,""),36),$F="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=TC(t.substring(0,3)),r=TC(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function zF(e){const t=e.toLowerCase().trim(),n=$F[FF(t)];if(!n)throw new Sc(e);return`#${n}`}const Of=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),UF=new RegExp(`^#${Of("([a-f0-9])",3)}([a-f0-9])?$`,"i"),VF=new RegExp(`^#${Of("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),HF=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Of(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),WF=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,GF=/^[a-z]+$/i,IC=e=>Math.round(e*255),KF=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(IC);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),a=i*(1-Math.abs(o%2-1));let s=0,l=0,u=0;o>=0&&o<1?(s=i,l=a):o>=1&&o<2?(s=a,l=i):o>=2&&o<3?(l=i,u=a):o>=3&&o<4?(l=a,u=i):o>=4&&o<5?(s=a,u=i):o>=5&&o<6&&(s=i,u=a);const c=r-i/2,f=s+c,d=l+c,h=u+c;return[f,d,h].map(IC)};function XF(e,t,n,r){return`rgba(${ps(0,255,e).toFixed()}, ${ps(0,255,t).toFixed()}, ${ps(0,255,n).toFixed()}, ${parseFloat(ps(0,1,r).toFixed(3))})`}function qF(e,t){const[n,r,o,i]=Wb(e);return XF(n,r,o,i-t)}function YF(e){const[t,n,r,o]=Wb(e);let i=a=>{const s=ps(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${i(t)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}function ZF(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,nr=(e,t,n)=>{const r=ZF(e,`colors.${t}`,t);try{return YF(r),r}catch{return n??"#000000"}},JF=e=>{const[t,n,r]=Wb(e);return(t*299+n*587+r*114)/1e3},e$=e=>t=>{const n=nr(t,e);return JF(n)<128?"dark":"light"},t$=e=>t=>e$(e)(t)==="dark",yu=(e,t)=>n=>{const r=nr(n,e);return qF(r,1-t)};function RC(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + 45deg, + ${t} 25%, + transparent 25%, + transparent 50%, + ${t} 50%, + ${t} 75%, + transparent 75%, + transparent + )`,backgroundSize:`${e} ${e}`}}var n$=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function r$(e){const t=n$();return!e||QF(e)?t:e.string&&e.colors?i$(e.string,e.colors):e.string&&!e.colors?o$(e.string):e.colors&&!e.string?a$(e.colors):t}function o$(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${o.toString(16)}`.substr(-2)}return n}function i$(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function Gb(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function AP(e){return _r(e)&&e.reference?e.reference:String(e)}var Q0=(e,...t)=>t.map(AP).join(` ${e} `).replace(/calc/g,""),kC=(...e)=>`calc(${Q0("+",...e)})`,MC=(...e)=>`calc(${Q0("-",...e)})`,u2=(...e)=>`calc(${Q0("*",...e)})`,DC=(...e)=>`calc(${Q0("/",...e)})`,LC=e=>{const t=AP(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:u2(t,-1)},_i=Object.assign(e=>({add:(...t)=>_i(kC(e,...t)),subtract:(...t)=>_i(MC(e,...t)),multiply:(...t)=>_i(u2(e,...t)),divide:(...t)=>_i(DC(e,...t)),negate:()=>_i(LC(e)),toString:()=>e.toString()}),{add:kC,subtract:MC,multiply:u2,divide:DC,negate:LC});function s$(e){return!Number.isInteger(parseFloat(e.toString()))}function l$(e,t="-"){return e.replace(/\s+/g,t)}function PP(e){const t=l$(e.toString());return t.includes("\\.")?e:s$(e)?t.replace(".","\\."):e}function u$(e,t=""){return[t,PP(e)].filter(Boolean).join("-")}function c$(e,t){return`var(${PP(e)}${t?`, ${t}`:""})`}function f$(e,t=""){return`--${u$(e,t)}`}function mn(e,t){const n=f$(e,t==null?void 0:t.prefix);return{variable:n,reference:c$(n,d$(t==null?void 0:t.fallback))}}function d$(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:h$,definePartsStyle:Kh}=wt(MF.keys),$c=mn("switch-track-width"),_s=mn("switch-track-height"),Cy=mn("switch-track-diff"),p$=_i.subtract($c,_s),c2=mn("switch-thumb-x"),oc=mn("switch-bg"),m$=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[$c.reference],height:[_s.reference],transitionProperty:"common",transitionDuration:"fast",[oc.variable]:"colors.gray.300",_dark:{[oc.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[oc.variable]:`colors.${t}.500`,_dark:{[oc.variable]:`colors.${t}.200`}},bg:oc.reference}},y$={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[_s.reference],height:[_s.reference],_checked:{transform:`translateX(${c2.reference})`}},g$=Kh(e=>({container:{[Cy.variable]:p$,[c2.variable]:Cy.reference,_rtl:{[c2.variable]:_i(Cy).negate().toString()}},track:m$(e),thumb:y$})),v$={sm:Kh({container:{[$c.variable]:"1.375rem",[_s.variable]:"sizes.3"}}),md:Kh({container:{[$c.variable]:"1.875rem",[_s.variable]:"sizes.4"}}),lg:Kh({container:{[$c.variable]:"2.875rem",[_s.variable]:"sizes.6"}})},w$=h$({baseStyle:g$,sizes:v$,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:b$,definePartsStyle:Zl}=wt(DF.keys),S$=Zl({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Vp={"&[data-is-numeric=true]":{textAlign:"end"}},_$=Zl(e=>{const{colorScheme:t}=e;return{th:{color:Oe("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Vp},td:{borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Vp},caption:{color:Oe("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),E$=Zl(e=>{const{colorScheme:t}=e;return{th:{color:Oe("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Vp},td:{borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Vp},caption:{color:Oe("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e)},td:{background:Oe(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),C$={simple:_$,striped:E$,unstyled:{}},x$={sm:Zl({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:Zl({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Zl({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},O$=b$({baseStyle:S$,variants:C$,sizes:x$,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),yr=Ee("tabs-color"),ko=Ee("tabs-bg"),oh=Ee("tabs-border-color"),{defineMultiStyleConfig:A$,definePartsStyle:ui}=wt(LF.keys),P$=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},T$=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},I$=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},R$={p:4},k$=ui(e=>({root:P$(e),tab:T$(e),tablist:I$(e),tabpanel:R$})),M$={sm:ui({tab:{py:1,px:4,fontSize:"sm"}}),md:ui({tab:{fontSize:"md",py:2,px:4}}),lg:ui({tab:{fontSize:"lg",py:3,px:4}})},D$=ui(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",o=r?"borderStart":"borderBottom",i=r?"marginStart":"marginBottom";return{tablist:{[o]:"2px solid",borderColor:"inherit"},tab:{[o]:"2px solid",borderColor:"transparent",[i]:"-2px",_selected:{[yr.variable]:`colors.${t}.600`,_dark:{[yr.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[ko.variable]:"colors.gray.200",_dark:{[ko.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:yr.reference,bg:ko.reference}}}),L$=ui(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[oh.variable]:"transparent",_selected:{[yr.variable]:`colors.${t}.600`,[oh.variable]:"colors.white",_dark:{[yr.variable]:`colors.${t}.300`,[oh.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:oh.reference},color:yr.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),N$=ui(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[ko.variable]:"colors.gray.50",_dark:{[ko.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[ko.variable]:"colors.white",[yr.variable]:`colors.${t}.600`,_dark:{[ko.variable]:"colors.gray.800",[yr.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:yr.reference,bg:ko.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),B$=ui(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:nr(n,`${t}.700`),bg:nr(n,`${t}.100`)}}}}),j$=ui(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[yr.variable]:"colors.gray.600",_dark:{[yr.variable]:"inherit"},_selected:{[yr.variable]:"colors.white",[ko.variable]:`colors.${t}.600`,_dark:{[yr.variable]:"colors.gray.800",[ko.variable]:`colors.${t}.300`}},color:yr.reference,bg:ko.reference}}}),F$=ui({}),$$={line:D$,enclosed:L$,"enclosed-colored":N$,"soft-rounded":B$,"solid-rounded":j$,unstyled:F$},z$=A$({baseStyle:k$,sizes:M$,variants:$$,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),en=aj("badge",["bg","color","shadow"]),U$={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:en.bg.reference,color:en.color.reference,boxShadow:en.shadow.reference},V$=e=>{const{colorScheme:t,theme:n}=e,r=yu(`${t}.500`,.6)(n);return{[en.bg.variable]:`colors.${t}.500`,[en.color.variable]:"colors.white",_dark:{[en.bg.variable]:r,[en.color.variable]:"colors.whiteAlpha.800"}}},H$=e=>{const{colorScheme:t,theme:n}=e,r=yu(`${t}.200`,.16)(n);return{[en.bg.variable]:`colors.${t}.100`,[en.color.variable]:`colors.${t}.800`,_dark:{[en.bg.variable]:r,[en.color.variable]:`colors.${t}.200`}}},W$=e=>{const{colorScheme:t,theme:n}=e,r=yu(`${t}.200`,.8)(n);return{[en.color.variable]:`colors.${t}.500`,_dark:{[en.color.variable]:r},[en.shadow.variable]:`inset 0 0 0px 1px ${en.color.reference}`}},G$={solid:V$,subtle:H$,outline:W$},zc={baseStyle:U$,variants:G$,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:K$,definePartsStyle:Es}=wt(NF.keys),NC=Ee("tag-bg"),BC=Ee("tag-color"),xy=Ee("tag-shadow"),Xh=Ee("tag-min-height"),qh=Ee("tag-min-width"),Yh=Ee("tag-font-size"),Zh=Ee("tag-padding-inline"),X$={fontWeight:"medium",lineHeight:1.2,outline:0,[BC.variable]:en.color.reference,[NC.variable]:en.bg.reference,[xy.variable]:en.shadow.reference,color:BC.reference,bg:NC.reference,boxShadow:xy.reference,borderRadius:"md",minH:Xh.reference,minW:qh.reference,fontSize:Yh.reference,px:Zh.reference,_focusVisible:{[xy.variable]:"shadows.outline"}},q$={lineHeight:1.2,overflow:"visible"},Y$={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},Z$=Es({container:X$,label:q$,closeButton:Y$}),Q$={sm:Es({container:{[Xh.variable]:"sizes.5",[qh.variable]:"sizes.5",[Yh.variable]:"fontSizes.xs",[Zh.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Es({container:{[Xh.variable]:"sizes.6",[qh.variable]:"sizes.6",[Yh.variable]:"fontSizes.sm",[Zh.variable]:"space.2"}}),lg:Es({container:{[Xh.variable]:"sizes.8",[qh.variable]:"sizes.8",[Yh.variable]:"fontSizes.md",[Zh.variable]:"space.3"}})},J$={subtle:Es(e=>{var t;return{container:(t=zc.variants)==null?void 0:t.subtle(e)}}),solid:Es(e=>{var t;return{container:(t=zc.variants)==null?void 0:t.solid(e)}}),outline:Es(e=>{var t;return{container:(t=zc.variants)==null?void 0:t.outline(e)}})},ez=K$({variants:J$,baseStyle:Z$,sizes:Q$,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Oi,defineMultiStyleConfig:tz}=wt(_F.keys),Il=Ee("input-height"),Rl=Ee("input-font-size"),kl=Ee("input-padding"),Ml=Ee("input-border-radius"),nz=Oi({addon:{height:Il.reference,fontSize:Rl.reference,px:kl.reference,borderRadius:Ml.reference},field:{width:"100%",height:Il.reference,fontSize:Rl.reference,px:kl.reference,borderRadius:Ml.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),qi={lg:{[Rl.variable]:"fontSizes.lg",[kl.variable]:"space.4",[Ml.variable]:"radii.md",[Il.variable]:"sizes.12"},md:{[Rl.variable]:"fontSizes.md",[kl.variable]:"space.4",[Ml.variable]:"radii.md",[Il.variable]:"sizes.10"},sm:{[Rl.variable]:"fontSizes.sm",[kl.variable]:"space.3",[Ml.variable]:"radii.sm",[Il.variable]:"sizes.8"},xs:{[Rl.variable]:"fontSizes.xs",[kl.variable]:"space.2",[Ml.variable]:"radii.sm",[Il.variable]:"sizes.6"}},rz={lg:Oi({field:qi.lg,group:qi.lg}),md:Oi({field:qi.md,group:qi.md}),sm:Oi({field:qi.sm,group:qi.sm}),xs:Oi({field:qi.xs,group:qi.xs})};function Kb(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Oe("blue.500","blue.300")(e),errorBorderColor:n||Oe("red.500","red.300")(e)}}var oz=Oi(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Kb(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Oe("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:nr(t,r),boxShadow:`0 0 0 1px ${nr(t,r)}`},_focusVisible:{zIndex:1,borderColor:nr(t,n),boxShadow:`0 0 0 1px ${nr(t,n)}`}},addon:{border:"1px solid",borderColor:Oe("inherit","whiteAlpha.50")(e),bg:Oe("gray.100","whiteAlpha.300")(e)}}}),iz=Oi(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Kb(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Oe("gray.100","whiteAlpha.50")(e),_hover:{bg:Oe("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:nr(t,r)},_focusVisible:{bg:"transparent",borderColor:nr(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Oe("gray.100","whiteAlpha.50")(e)}}}),az=Oi(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Kb(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:nr(t,r),boxShadow:`0px 1px 0px 0px ${nr(t,r)}`},_focusVisible:{borderColor:nr(t,n),boxShadow:`0px 1px 0px 0px ${nr(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),sz=Oi({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),lz={outline:oz,filled:iz,flushed:az,unstyled:sz},rt=tz({baseStyle:nz,sizes:rz,variants:lz,defaultProps:{size:"md",variant:"outline"}}),jC,uz={...(jC=rt.baseStyle)==null?void 0:jC.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},FC,$C,cz={outline:e=>{var t,n;return(n=(t=rt.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=rt.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=rt.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:($C=(FC=rt.variants)==null?void 0:FC.unstyled.field)!=null?$C:{}},zC,UC,VC,HC,WC,GC,KC,XC,fz={xs:(UC=(zC=rt.sizes)==null?void 0:zC.xs.field)!=null?UC:{},sm:(HC=(VC=rt.sizes)==null?void 0:VC.sm.field)!=null?HC:{},md:(GC=(WC=rt.sizes)==null?void 0:WC.md.field)!=null?GC:{},lg:(XC=(KC=rt.sizes)==null?void 0:KC.lg.field)!=null?XC:{}},dz={baseStyle:uz,sizes:fz,variants:cz,defaultProps:{size:"md",variant:"outline"}},ih=mn("tooltip-bg"),Oy=mn("tooltip-fg"),hz=mn("popper-arrow-bg"),pz={bg:ih.reference,color:Oy.reference,[ih.variable]:"colors.gray.700",[Oy.variable]:"colors.whiteAlpha.900",_dark:{[ih.variable]:"colors.gray.300",[Oy.variable]:"colors.gray.900"},[hz.variable]:ih.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},mz={baseStyle:pz},{defineMultiStyleConfig:yz,definePartsStyle:_c}=wt(PF.keys),gz=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:o}=e,i=Oe(RC(),RC("1rem","rgba(0,0,0,0.1)"))(e),a=Oe(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( + to right, + transparent 0%, + ${nr(n,a)} 50%, + transparent 100% + )`;return{...!r&&o&&i,...r?{bgImage:s}:{bgColor:a}}},vz={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},wz=e=>({bg:Oe("gray.100","whiteAlpha.300")(e)}),bz=e=>({transitionProperty:"common",transitionDuration:"slow",...gz(e)}),Sz=_c(e=>({label:vz,filledTrack:bz(e),track:wz(e)})),_z={xs:_c({track:{h:"1"}}),sm:_c({track:{h:"2"}}),md:_c({track:{h:"3"}}),lg:_c({track:{h:"4"}})},Ez=yz({sizes:_z,baseStyle:Sz,defaultProps:{size:"md",colorScheme:"blue"}}),Cz=e=>typeof e=="function";function ir(e,...t){return Cz(e)?e(...t):e}var{definePartsStyle:Qh,defineMultiStyleConfig:xz}=wt(gF.keys),Uc=Ee("checkbox-size"),Oz=e=>{const{colorScheme:t}=e;return{w:Uc.reference,h:Uc.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Oe(`${t}.500`,`${t}.200`)(e),borderColor:Oe(`${t}.500`,`${t}.200`)(e),color:Oe("white","gray.900")(e),_hover:{bg:Oe(`${t}.600`,`${t}.300`)(e),borderColor:Oe(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Oe("gray.200","transparent")(e),bg:Oe("gray.200","whiteAlpha.300")(e),color:Oe("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Oe(`${t}.500`,`${t}.200`)(e),borderColor:Oe(`${t}.500`,`${t}.200`)(e),color:Oe("white","gray.900")(e)},_disabled:{bg:Oe("gray.100","whiteAlpha.100")(e),borderColor:Oe("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Oe("red.500","red.300")(e)}}},Az={_disabled:{cursor:"not-allowed"}},Pz={userSelect:"none",_disabled:{opacity:.4}},Tz={transitionProperty:"transform",transitionDuration:"normal"},Iz=Qh(e=>({icon:Tz,container:Az,control:ir(Oz,e),label:Pz})),Rz={sm:Qh({control:{[Uc.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:Qh({control:{[Uc.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:Qh({control:{[Uc.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},Hp=xz({baseStyle:Iz,sizes:Rz,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:kz,definePartsStyle:Jh}=wt(TF.keys),Mz=e=>{var t;const n=(t=ir(Hp.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Dz=Jh(e=>{var t,n,r,o;return{label:(n=(t=Hp).baseStyle)==null?void 0:n.call(t,e).label,container:(o=(r=Hp).baseStyle)==null?void 0:o.call(r,e).container,control:Mz(e)}}),Lz={md:Jh({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Jh({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Jh({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},Nz=kz({baseStyle:Dz,sizes:Lz,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Bz,definePartsStyle:jz}=wt(IF.keys),ah=Ee("select-bg"),qC,Fz={...(qC=rt.baseStyle)==null?void 0:qC.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:ah.reference,[ah.variable]:"colors.white",_dark:{[ah.variable]:"colors.gray.700"},"> option, > optgroup":{bg:ah.reference}},$z={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},zz=jz({field:Fz,icon:$z}),sh={paddingInlineEnd:"8"},YC,ZC,QC,JC,e3,t3,n3,r3,Uz={lg:{...(YC=rt.sizes)==null?void 0:YC.lg,field:{...(ZC=rt.sizes)==null?void 0:ZC.lg.field,...sh}},md:{...(QC=rt.sizes)==null?void 0:QC.md,field:{...(JC=rt.sizes)==null?void 0:JC.md.field,...sh}},sm:{...(e3=rt.sizes)==null?void 0:e3.sm,field:{...(t3=rt.sizes)==null?void 0:t3.sm.field,...sh}},xs:{...(n3=rt.sizes)==null?void 0:n3.xs,field:{...(r3=rt.sizes)==null?void 0:r3.xs.field,...sh},icon:{insetEnd:"1"}}},Vz=Bz({baseStyle:zz,sizes:Uz,variants:rt.variants,defaultProps:rt.defaultProps}),Ay=Ee("skeleton-start-color"),Py=Ee("skeleton-end-color"),Hz={[Ay.variable]:"colors.gray.100",[Py.variable]:"colors.gray.400",_dark:{[Ay.variable]:"colors.gray.800",[Py.variable]:"colors.gray.600"},background:Ay.reference,borderColor:Py.reference,opacity:.7,borderRadius:"sm"},Wz={baseStyle:Hz},Ty=Ee("skip-link-bg"),Gz={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Ty.variable]:"colors.white",_dark:{[Ty.variable]:"colors.gray.700"},bg:Ty.reference}},Kz={baseStyle:Gz},{defineMultiStyleConfig:Xz,definePartsStyle:J0}=wt(RF.keys),Af=Ee("slider-thumb-size"),Pf=Ee("slider-track-size"),ua=Ee("slider-bg"),qz=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...Gb({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},Yz=e=>({...Gb({orientation:e.orientation,horizontal:{h:Pf.reference},vertical:{w:Pf.reference}}),overflow:"hidden",borderRadius:"sm",[ua.variable]:"colors.gray.200",_dark:{[ua.variable]:"colors.whiteAlpha.200"},_disabled:{[ua.variable]:"colors.gray.300",_dark:{[ua.variable]:"colors.whiteAlpha.300"}},bg:ua.reference}),Zz=e=>{const{orientation:t}=e;return{...Gb({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:Af.reference,h:Af.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},Qz=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[ua.variable]:`colors.${t}.500`,_dark:{[ua.variable]:`colors.${t}.200`},bg:ua.reference}},Jz=J0(e=>({container:qz(e),track:Yz(e),thumb:Zz(e),filledTrack:Qz(e)})),eU=J0({container:{[Af.variable]:"sizes.4",[Pf.variable]:"sizes.1"}}),tU=J0({container:{[Af.variable]:"sizes.3.5",[Pf.variable]:"sizes.1"}}),nU=J0({container:{[Af.variable]:"sizes.2.5",[Pf.variable]:"sizes.0.5"}}),rU={lg:eU,md:tU,sm:nU},oU=Xz({baseStyle:Jz,sizes:rU,defaultProps:{size:"md",colorScheme:"blue"}}),as=mn("spinner-size"),iU={width:[as.reference],height:[as.reference]},aU={xs:{[as.variable]:"sizes.3"},sm:{[as.variable]:"sizes.4"},md:{[as.variable]:"sizes.6"},lg:{[as.variable]:"sizes.8"},xl:{[as.variable]:"sizes.12"}},sU={baseStyle:iU,sizes:aU,defaultProps:{size:"md"}},{defineMultiStyleConfig:lU,definePartsStyle:TP}=wt(kF.keys),uU={fontWeight:"medium"},cU={opacity:.8,marginBottom:"2"},fU={verticalAlign:"baseline",fontWeight:"semibold"},dU={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},hU=TP({container:{},label:uU,helpText:cU,number:fU,icon:dU}),pU={md:TP({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},mU=lU({baseStyle:hU,sizes:pU,defaultProps:{size:"md"}}),Iy=Ee("kbd-bg"),yU={[Iy.variable]:"colors.gray.100",_dark:{[Iy.variable]:"colors.whiteAlpha.100"},bg:Iy.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},gU={baseStyle:yU},vU={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},wU={baseStyle:vU},{defineMultiStyleConfig:bU,definePartsStyle:SU}=wt(EF.keys),_U={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},EU=SU({icon:_U}),CU=bU({baseStyle:EU}),{defineMultiStyleConfig:xU,definePartsStyle:OU}=wt(CF.keys),qo=Ee("menu-bg"),Ry=Ee("menu-shadow"),AU={[qo.variable]:"#fff",[Ry.variable]:"shadows.sm",_dark:{[qo.variable]:"colors.gray.700",[Ry.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:qo.reference,boxShadow:Ry.reference},PU={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[qo.variable]:"colors.gray.100",_dark:{[qo.variable]:"colors.whiteAlpha.100"}},_active:{[qo.variable]:"colors.gray.200",_dark:{[qo.variable]:"colors.whiteAlpha.200"}},_expanded:{[qo.variable]:"colors.gray.100",_dark:{[qo.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:qo.reference},TU={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},IU={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},RU={opacity:.6},kU={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},MU={transitionProperty:"common",transitionDuration:"normal"},DU=OU({button:MU,list:AU,item:PU,groupTitle:TU,icon:IU,command:RU,divider:kU}),LU=xU({baseStyle:DU}),{defineMultiStyleConfig:NU,definePartsStyle:f2}=wt(xF.keys),ky=Ee("modal-bg"),My=Ee("modal-shadow"),BU={bg:"blackAlpha.600",zIndex:"modal"},jU=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},FU=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[ky.variable]:"colors.white",[My.variable]:"shadows.lg",_dark:{[ky.variable]:"colors.gray.700",[My.variable]:"shadows.dark-lg"},bg:ky.reference,boxShadow:My.reference}},$U={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},zU={position:"absolute",top:"2",insetEnd:"3"},UU=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},VU={px:"6",py:"4"},HU=f2(e=>({overlay:BU,dialogContainer:ir(jU,e),dialog:ir(FU,e),header:$U,closeButton:zU,body:ir(UU,e),footer:VU}));function Oo(e){return f2(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var WU={xs:Oo("xs"),sm:Oo("sm"),md:Oo("md"),lg:Oo("lg"),xl:Oo("xl"),"2xl":Oo("2xl"),"3xl":Oo("3xl"),"4xl":Oo("4xl"),"5xl":Oo("5xl"),"6xl":Oo("6xl"),full:Oo("full")},GU=NU({baseStyle:HU,sizes:WU,defaultProps:{size:"md"}}),{defineMultiStyleConfig:KU,definePartsStyle:IP}=wt(OF.keys),Xb=mn("number-input-stepper-width"),RP=mn("number-input-input-padding"),XU=_i(Xb).add("0.5rem").toString(),Dy=mn("number-input-bg"),Ly=mn("number-input-color"),Ny=mn("number-input-border-color"),qU={[Xb.variable]:"sizes.6",[RP.variable]:XU},YU=e=>{var t,n;return(n=(t=ir(rt.baseStyle,e))==null?void 0:t.field)!=null?n:{}},ZU={width:Xb.reference},QU={borderStart:"1px solid",borderStartColor:Ny.reference,color:Ly.reference,bg:Dy.reference,[Ly.variable]:"colors.chakra-body-text",[Ny.variable]:"colors.chakra-border-color",_dark:{[Ly.variable]:"colors.whiteAlpha.800",[Ny.variable]:"colors.whiteAlpha.300"},_active:{[Dy.variable]:"colors.gray.200",_dark:{[Dy.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},JU=IP(e=>{var t;return{root:qU,field:(t=ir(YU,e))!=null?t:{},stepperGroup:ZU,stepper:QU}});function lh(e){var t,n,r;const o=(t=rt.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=o.field)==null?void 0:n.fontSize)!=null?r:"md",s=CP.fontSizes[a];return IP({field:{...o.field,paddingInlineEnd:RP.reference,verticalAlign:"top"},stepper:{fontSize:_i(s).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var eV={xs:lh("xs"),sm:lh("sm"),md:lh("md"),lg:lh("lg")},tV=KU({baseStyle:JU,sizes:eV,variants:rt.variants,defaultProps:rt.defaultProps}),o3,nV={...(o3=rt.baseStyle)==null?void 0:o3.field,textAlign:"center"},rV={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},i3,a3,oV={outline:e=>{var t,n,r;return(r=(n=ir((t=rt.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=ir((t=rt.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=ir((t=rt.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(a3=(i3=rt.variants)==null?void 0:i3.unstyled.field)!=null?a3:{}},iV={baseStyle:nV,sizes:rV,variants:oV,defaultProps:rt.defaultProps},{defineMultiStyleConfig:aV,definePartsStyle:sV}=wt(AF.keys),uh=mn("popper-bg"),lV=mn("popper-arrow-bg"),s3=mn("popper-arrow-shadow-color"),uV={zIndex:10},cV={[uh.variable]:"colors.white",bg:uh.reference,[lV.variable]:uh.reference,[s3.variable]:"colors.gray.200",_dark:{[uh.variable]:"colors.gray.700",[s3.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},fV={px:3,py:2,borderBottomWidth:"1px"},dV={px:3,py:2},hV={px:3,py:2,borderTopWidth:"1px"},pV={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},mV=sV({popper:uV,content:cV,header:fV,body:dV,footer:hV,closeButton:pV}),yV=aV({baseStyle:mV}),{definePartsStyle:d2,defineMultiStyleConfig:gV}=wt(vF.keys),By=Ee("drawer-bg"),jy=Ee("drawer-box-shadow");function ol(e){return d2(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var vV={bg:"blackAlpha.600",zIndex:"overlay"},wV={display:"flex",zIndex:"modal",justifyContent:"center"},bV=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[By.variable]:"colors.white",[jy.variable]:"shadows.lg",_dark:{[By.variable]:"colors.gray.700",[jy.variable]:"shadows.dark-lg"},bg:By.reference,boxShadow:jy.reference}},SV={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},_V={position:"absolute",top:"2",insetEnd:"3"},EV={px:"6",py:"2",flex:"1",overflow:"auto"},CV={px:"6",py:"4"},xV=d2(e=>({overlay:vV,dialogContainer:wV,dialog:ir(bV,e),header:SV,closeButton:_V,body:EV,footer:CV})),OV={xs:ol("xs"),sm:ol("md"),md:ol("lg"),lg:ol("2xl"),xl:ol("4xl"),full:ol("full")},AV=gV({baseStyle:xV,sizes:OV,defaultProps:{size:"xs"}}),{definePartsStyle:PV,defineMultiStyleConfig:TV}=wt(wF.keys),IV={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},RV={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},kV={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},MV=PV({preview:IV,input:RV,textarea:kV}),DV=TV({baseStyle:MV}),{definePartsStyle:LV,defineMultiStyleConfig:NV}=wt(bF.keys),Ql=Ee("form-control-color"),BV={marginStart:"1",[Ql.variable]:"colors.red.500",_dark:{[Ql.variable]:"colors.red.300"},color:Ql.reference},jV={mt:"2",[Ql.variable]:"colors.gray.600",_dark:{[Ql.variable]:"colors.whiteAlpha.600"},color:Ql.reference,lineHeight:"normal",fontSize:"sm"},FV=LV({container:{width:"100%",position:"relative"},requiredIndicator:BV,helperText:jV}),$V=NV({baseStyle:FV}),{definePartsStyle:zV,defineMultiStyleConfig:UV}=wt(SF.keys),Jl=Ee("form-error-color"),VV={[Jl.variable]:"colors.red.500",_dark:{[Jl.variable]:"colors.red.300"},color:Jl.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},HV={marginEnd:"0.5em",[Jl.variable]:"colors.red.500",_dark:{[Jl.variable]:"colors.red.300"},color:Jl.reference},WV=zV({text:VV,icon:HV}),GV=UV({baseStyle:WV}),KV={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},XV={baseStyle:KV},qV={fontFamily:"heading",fontWeight:"bold"},YV={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},ZV={baseStyle:qV,sizes:YV,defaultProps:{size:"xl"}},{defineMultiStyleConfig:QV,definePartsStyle:JV}=wt(yF.keys),Fy=Ee("breadcrumb-link-decor"),eH={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:Fy.reference,[Fy.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[Fy.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},tH=JV({link:eH}),nH=QV({baseStyle:tH}),rH={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},kP=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Oe("gray.800","whiteAlpha.900")(e),_hover:{bg:Oe("gray.100","whiteAlpha.200")(e)},_active:{bg:Oe("gray.200","whiteAlpha.300")(e)}};const r=yu(`${t}.200`,.12)(n),o=yu(`${t}.200`,.24)(n);return{color:Oe(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Oe(`${t}.50`,r)(e)},_active:{bg:Oe(`${t}.100`,o)(e)}}},oH=e=>{const{colorScheme:t}=e,n=Oe("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...ir(kP,e)}},iH={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},aH=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=Oe("gray.100","whiteAlpha.200")(e);return{bg:l,color:Oe("gray.800","whiteAlpha.900")(e),_hover:{bg:Oe("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:Oe("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:o="white",hoverBg:i=`${n}.600`,activeBg:a=`${n}.700`}=(t=iH[n])!=null?t:{},s=Oe(r,`${n}.200`)(e);return{bg:s,color:Oe(o,"gray.800")(e),_hover:{bg:Oe(i,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:Oe(a,`${n}.400`)(e)}}},sH=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Oe(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Oe(`${t}.700`,`${t}.500`)(e)}}},lH={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},uH={ghost:kP,outline:oH,solid:aH,link:sH,unstyled:lH},cH={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},fH={baseStyle:rH,variants:uH,sizes:cH,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Cs,defineMultiStyleConfig:dH}=wt(BF.keys),Wp=Ee("card-bg"),Ti=Ee("card-padding"),MP=Ee("card-shadow"),ep=Ee("card-radius"),DP=Ee("card-border-width","0"),LP=Ee("card-border-color"),hH=Cs({container:{[Wp.variable]:"colors.chakra-body-bg",backgroundColor:Wp.reference,boxShadow:MP.reference,borderRadius:ep.reference,color:"chakra-body-text",borderWidth:DP.reference,borderColor:LP.reference},body:{padding:Ti.reference,flex:"1 1 0%"},header:{padding:Ti.reference},footer:{padding:Ti.reference}}),pH={sm:Cs({container:{[ep.variable]:"radii.base",[Ti.variable]:"space.3"}}),md:Cs({container:{[ep.variable]:"radii.md",[Ti.variable]:"space.5"}}),lg:Cs({container:{[ep.variable]:"radii.xl",[Ti.variable]:"space.7"}})},mH={elevated:Cs({container:{[MP.variable]:"shadows.base",_dark:{[Wp.variable]:"colors.gray.700"}}}),outline:Cs({container:{[DP.variable]:"1px",[LP.variable]:"colors.chakra-border-color"}}),filled:Cs({container:{[Wp.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Ti.variable]:0},header:{[Ti.variable]:0},footer:{[Ti.variable]:0}}},yH=dH({baseStyle:hH,variants:mH,sizes:pH,defaultProps:{variant:"elevated",size:"md"}}),Vc=mn("close-button-size"),ic=mn("close-button-bg"),gH={w:[Vc.reference],h:[Vc.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[ic.variable]:"colors.blackAlpha.100",_dark:{[ic.variable]:"colors.whiteAlpha.100"}},_active:{[ic.variable]:"colors.blackAlpha.200",_dark:{[ic.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:ic.reference},vH={lg:{[Vc.variable]:"sizes.10",fontSize:"md"},md:{[Vc.variable]:"sizes.8",fontSize:"xs"},sm:{[Vc.variable]:"sizes.6",fontSize:"2xs"}},wH={baseStyle:gH,sizes:vH,defaultProps:{size:"md"}},{variants:bH,defaultProps:SH}=zc,_H={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:en.bg.reference,color:en.color.reference,boxShadow:en.shadow.reference},EH={baseStyle:_H,variants:bH,defaultProps:SH},CH={w:"100%",mx:"auto",maxW:"prose",px:"4"},xH={baseStyle:CH},OH={opacity:.6,borderColor:"inherit"},AH={borderStyle:"solid"},PH={borderStyle:"dashed"},TH={solid:AH,dashed:PH},IH={baseStyle:OH,variants:TH,defaultProps:{variant:"solid"}},{definePartsStyle:RH,defineMultiStyleConfig:kH}=wt(hF.keys),MH={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},DH={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},LH={pt:"2",px:"4",pb:"5"},NH={fontSize:"1.25em"},BH=RH({container:MH,button:DH,panel:LH,icon:NH}),jH=kH({baseStyle:BH}),{definePartsStyle:rd,defineMultiStyleConfig:FH}=wt(pF.keys),Fr=Ee("alert-fg"),Ni=Ee("alert-bg"),$H=rd({container:{bg:Ni.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Fr.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Fr.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function qb(e){const{theme:t,colorScheme:n}=e,r=yu(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var zH=rd(e=>{const{colorScheme:t}=e,n=qb(e);return{container:{[Fr.variable]:`colors.${t}.500`,[Ni.variable]:n.light,_dark:{[Fr.variable]:`colors.${t}.200`,[Ni.variable]:n.dark}}}}),UH=rd(e=>{const{colorScheme:t}=e,n=qb(e);return{container:{[Fr.variable]:`colors.${t}.500`,[Ni.variable]:n.light,_dark:{[Fr.variable]:`colors.${t}.200`,[Ni.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Fr.reference}}}),VH=rd(e=>{const{colorScheme:t}=e,n=qb(e);return{container:{[Fr.variable]:`colors.${t}.500`,[Ni.variable]:n.light,_dark:{[Fr.variable]:`colors.${t}.200`,[Ni.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Fr.reference}}}),HH=rd(e=>{const{colorScheme:t}=e;return{container:{[Fr.variable]:"colors.white",[Ni.variable]:`colors.${t}.500`,_dark:{[Fr.variable]:"colors.gray.900",[Ni.variable]:`colors.${t}.200`},color:Fr.reference}}}),WH={subtle:zH,"left-accent":UH,"top-accent":VH,solid:HH},GH=FH({baseStyle:$H,variants:WH,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:NP,defineMultiStyleConfig:KH}=wt(mF.keys),eu=Ee("avatar-border-color"),Hc=Ee("avatar-bg"),Tf=Ee("avatar-font-size"),gu=Ee("avatar-size"),XH={borderRadius:"full",border:"0.2em solid",borderColor:eu.reference,[eu.variable]:"white",_dark:{[eu.variable]:"colors.gray.800"}},qH={bg:Hc.reference,fontSize:Tf.reference,width:gu.reference,height:gu.reference,lineHeight:"1",[Hc.variable]:"colors.gray.200",_dark:{[Hc.variable]:"colors.whiteAlpha.400"}},YH=e=>{const{name:t,theme:n}=e,r=t?r$({string:t}):"colors.gray.400",o=t$(r)(n);let i="white";return o||(i="gray.800"),{bg:Hc.reference,fontSize:Tf.reference,color:i,borderColor:eu.reference,verticalAlign:"top",width:gu.reference,height:gu.reference,"&:not([data-loaded])":{[Hc.variable]:r},[eu.variable]:"colors.white",_dark:{[eu.variable]:"colors.gray.800"}}},ZH={fontSize:Tf.reference,lineHeight:"1"},QH=NP(e=>({badge:ir(XH,e),excessLabel:ir(qH,e),container:ir(YH,e),label:ZH}));function Yi(e){const t=e!=="100%"?OP[e]:void 0;return NP({container:{[gu.variable]:t??e,[Tf.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[gu.variable]:t??e,[Tf.variable]:`calc(${t??e} / 2.5)`}})}var JH={"2xs":Yi(4),xs:Yi(6),sm:Yi(8),md:Yi(12),lg:Yi(16),xl:Yi(24),"2xl":Yi(32),full:Yi("100%")},eW=KH({baseStyle:QH,sizes:JH,defaultProps:{size:"md"}}),tW={Accordion:jH,Alert:GH,Avatar:eW,Badge:zc,Breadcrumb:nH,Button:fH,Checkbox:Hp,CloseButton:wH,Code:EH,Container:xH,Divider:IH,Drawer:AV,Editable:DV,Form:$V,FormError:GV,FormLabel:XV,Heading:ZV,Input:rt,Kbd:gU,Link:wU,List:CU,Menu:LU,Modal:GU,NumberInput:tV,PinInput:iV,Popover:yV,Progress:Ez,Radio:Nz,Select:Vz,Skeleton:Wz,SkipLink:Kz,Slider:oU,Spinner:sU,Stat:mU,Switch:w$,Table:O$,Tabs:z$,Tag:ez,Textarea:dz,Tooltip:mz,Card:yH,Stepper:dF},nW={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},rW={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},oW="ltr",iW={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},BP={semanticTokens:nW,direction:oW,...uF,components:tW,styles:rW,config:iW};function Ec(e){return typeof e=="function"}function aW(...e){return t=>e.reduce((n,r)=>r(n),t)}var sW=e=>function(...n){let r=[...n],o=n[n.length-1];return Fj(o)&&r.length>1?r=r.slice(0,r.length-1):o=e,aW(...r.map(i=>a=>Ec(i)?i(a):uW(a,i)))(o)},lW=sW(BP);function uW(...e){return mo({},...e,jP)}function jP(e,t,n,r){if((Ec(e)||Ec(t))&&Object.prototype.hasOwnProperty.call(r,n))return(...o)=>{const i=Ec(e)?e(...o):e,a=Ec(t)?t(...o):t;return mo({},i,a,jP)}}function cW(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var fW=cW();function dW(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function hW(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(o))return s.get(o);const l=e(r,o,i,a);return s.set(o,l),l}},FP=pW(hW);function $P(e,t){const n={};return Object.keys(e).forEach(r=>{const o=e[r];t(o,r,e)&&(n[r]=o)}),n}var zP=e=>$P(e,t=>t!=null);function mW(e){return typeof e=="function"}function UP(e,...t){return mW(e)?e(...t):e}function yW(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var gW=typeof Element<"u",vW=typeof Map=="function",wW=typeof Set=="function",bW=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function tp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!tp(e[r],t[r]))return!1;return!0}var i;if(vW&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!tp(r.value[1],t.get(r.value[0])))return!1;return!0}if(wW&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(bW&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(gW&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&e.$$typeof)&&!tp(e[o[r]],t[o[r]]))return!1;return!0}return e!==e&&t!==t}var Yb=function(t,n){try{return tp(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const SW=Qe(Yb);function VP(e,t={}){var n;const{styleConfig:r,...o}=t,{theme:i,colorMode:a}=yP(),s=e?FP(i,`components.${e}`):void 0,l=r||s,u=mo({theme:i,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},zP(dW(o,["children"]))),c=P.useRef({});if(l){const d=Nj(l)(u);SW(c.current,d)||(c.current=d)}return c.current}function Eo(e,t={}){return VP(e,t)}function Pr(e,t={}){return VP(e,t)}var _W=new Set([...Cj,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),EW=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function CW(e){return EW.has(e)||!_W.has(e)}function xW(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(o in n&&delete n[o],n[o]=r[o]);return n}function HP(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var OW=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,AW=Y6(function(e){return OW.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),PW=AW,TW=function(t){return t!=="theme"},l3=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?PW:TW},u3=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(a){return t.__emotion_forwardProp(a)&&i(a)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},IW=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return nO(n,r,o),UD(function(){return rO(n,r,o)}),null},RW=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,a;n!==void 0&&(i=n.label,a=n.target);var s=u3(t,n,r),l=s||l3(o),u=!l("as");return function(){var c=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&f.push("label:"+i+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{f.push(c[0][0]);for(var d=c.length,h=1;ht=>{const{theme:n,css:r,__css:o,sx:i,...a}=t,s=$P(a,(f,d)=>Oj(d)),l=UP(e,t),u=xW({},o,l,zP(s),i),c=EP(u)(t.theme);return r?[c,r]:c};function $y(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=CW);const o=DW({baseStyle:n}),i=MW(e,r)(o);return ee.forwardRef(function(l,u){const{colorMode:c,forced:f}=X0();return ee.createElement(i,{ref:u,"data-theme":f?c:void 0,...l})})}function LW(){const e=new Map;return new Proxy($y,{apply(t,n,r){return $y(...r)},get(t,n){return e.has(n)||e.set(n,$y(n)),e.get(n)}})}var ne=LW();function de(e){return P.forwardRef(e)}function WP(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,o=P.createContext(void 0);o.displayName=r;function i(){var a;const s=P.useContext(o);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,i),l}return s}return[o.Provider,i,o]}function NW(e){const{cssVarsRoot:t,theme:n,children:r}=e,o=P.useMemo(()=>Sj(n),[n]);return w.jsxs(WD,{theme:o,children:[w.jsx(BW,{root:t}),r]})}function BW({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return w.jsx(R0,{styles:n=>({[t]:n.__cssVars})})}WP({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function jW(e){return WP({name:`${e}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${e} />" `})}function FW(){const{colorMode:e}=X0();return w.jsx(R0,{styles:t=>{const n=FP(t,"styles.global"),r=UP(n,{theme:t,colorMode:e});return r?EP(r)(t):void 0}})}var Zb=P.createContext({getDocument(){return document},getWindow(){return window}});Zb.displayName="EnvironmentContext";function $W({defer:e}={}){const[,t]=P.useReducer(n=>n+1,0);return ai(()=>{e&&t()},[e]),P.useContext(Zb)}function GP(e){const{children:t,environment:n,disabled:r}=e,o=P.useRef(null),i=P.useMemo(()=>n||{getDocument:()=>{var s,l;return(l=(s=o.current)==null?void 0:s.ownerDocument)!=null?l:document},getWindow:()=>{var s,l;return(l=(s=o.current)==null?void 0:s.ownerDocument.defaultView)!=null?l:window}},[n]),a=!r||!n;return w.jsxs(Zb.Provider,{value:i,children:[t,a&&w.jsx("span",{id:"__chakra_env",hidden:!0,ref:o})]})}GP.displayName="EnvironmentProvider";var zW=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetScope:o,resetCSS:i=!0,theme:a={},environment:s,cssVarsRoot:l,disableEnvironment:u,disableGlobalStyle:c}=e,f=w.jsx(GP,{environment:s,disabled:u,children:t});return w.jsx(NW,{theme:a,cssVarsRoot:l,children:w.jsxs(mP,{colorModeManager:n,options:a.config,children:[i?w.jsx(XD,{scope:o}):w.jsx(KD,{}),!c&&w.jsx(FW,{}),r?w.jsx(cO,{zIndex:r,children:f}):f]})})},UW=(e,t)=>e.find(n=>n.id===t);function f3(e,t){const n=KP(e,t),r=n?e[n].findIndex(o=>o.id===t):-1;return{position:n,index:r}}function KP(e,t){for(const[n,r]of Object.entries(e))if(UW(r,t))return n}function VW(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function HW(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,o=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,i=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:o,right:i,left:a}}function Ea(e,t=[]){const n=P.useRef(e);return P.useEffect(()=>{n.current=e}),P.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function WW(e,t){const n=Ea(e);P.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function Bs(e,t){const n=P.useRef(!1),r=P.useRef(!1);P.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),P.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const XP=P.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),em=P.createContext({}),od=P.createContext(null),tm=typeof document<"u",Kp=tm?P.useLayoutEffect:P.useEffect,qP=P.createContext({strict:!1});function GW(e,t,n,r){const{visualElement:o}=P.useContext(em),i=P.useContext(qP),a=P.useContext(od),s=P.useContext(XP).reducedMotion,l=P.useRef();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return P.useInsertionEffect(()=>{u&&u.update(n,a)}),Kp(()=>{u&&u.render()}),P.useEffect(()=>{u&&u.updateFeatures()}),(window.HandoffAppearAnimations?Kp:P.useEffect)(()=>{u&&u.animationState&&u.animationState.animateChanges()}),u}function Dl(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function KW(e,t,n){return P.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Dl(n)&&(n.current=r))},[t])}function If(e){return typeof e=="string"||Array.isArray(e)}function nm(e){return typeof e=="object"&&typeof e.start=="function"}const Qb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Jb=["initial",...Qb];function rm(e){return nm(e.animate)||Jb.some(t=>If(e[t]))}function YP(e){return!!(rm(e)||e.variants)}function XW(e,t){if(rm(e)){const{initial:n,animate:r}=e;return{initial:n===!1||If(n)?n:void 0,animate:If(r)?r:void 0}}return e.inherit!==!1?t:{}}function qW(e){const{initial:t,animate:n}=XW(e,P.useContext(em));return P.useMemo(()=>({initial:t,animate:n}),[d3(t),d3(n)])}function d3(e){return Array.isArray(e)?e.join(" "):e}const h3={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Rf={};for(const e in h3)Rf[e]={isEnabled:t=>h3[e].some(n=>!!t[n])};function YW(e){for(const t in e)Rf[t]={...Rf[t],...e[t]}}const eS=P.createContext({}),ZP=P.createContext({}),ZW=Symbol.for("motionComponentSymbol");function QW({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&YW(e);function i(s,l){let u;const c={...P.useContext(XP),...s,layoutId:JW(s)},{isStatic:f}=c,d=qW(s),h=r(s,f);if(!f&&tm){d.visualElement=GW(o,h,c,t);const p=P.useContext(ZP),m=P.useContext(qP).strict;d.visualElement&&(u=d.visualElement.loadFeatures(c,m,e,p))}return P.createElement(em.Provider,{value:d},u&&d.visualElement?P.createElement(u,{visualElement:d.visualElement,...c}):null,n(o,s,KW(h,d.visualElement,l),h,f,d.visualElement))}const a=P.forwardRef(i);return a[ZW]=o,a}function JW({layoutId:e}){const t=P.useContext(eS).id;return t&&e!==void 0?t+"-"+e:e}function eG(e){function t(r,o={}){return QW(e(r,o))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,o)=>(n.has(o)||n.set(o,t(o)),n.get(o))})}const tG=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function tS(e){return typeof e!="string"||e.includes("-")?!1:!!(tG.indexOf(e)>-1||/[A-Z]/.test(e))}const Xp={};function nG(e){Object.assign(Xp,e)}const id=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gs=new Set(id);function QP(e,{layout:t,layoutId:n}){return Gs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Xp[e]||e==="opacity")}const Ar=e=>!!(e&&e.getVelocity),rG={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},oG=id.length;function iG(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let a=0;at=>typeof t=="string"&&t.startsWith(e),eT=JP("--"),h2=JP("var(--"),aG=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,sG=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ia=(e,t,n)=>Math.min(Math.max(n,e),t),Ks={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Wc={...Ks,transform:e=>Ia(0,1,e)},ch={...Ks,default:1},Gc=e=>Math.round(e*1e5)/1e5,om=/(-)?([\d]*\.?[\d])+/g,tT=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,lG=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ad(e){return typeof e=="string"}const sd=e=>({test:t=>ad(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),na=sd("deg"),ci=sd("%"),Pe=sd("px"),uG=sd("vh"),cG=sd("vw"),p3={...ci,parse:e=>ci.parse(e)/100,transform:e=>ci.transform(e*100)},m3={...Ks,transform:Math.round},nT={borderWidth:Pe,borderTopWidth:Pe,borderRightWidth:Pe,borderBottomWidth:Pe,borderLeftWidth:Pe,borderRadius:Pe,radius:Pe,borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomRightRadius:Pe,borderBottomLeftRadius:Pe,width:Pe,maxWidth:Pe,height:Pe,maxHeight:Pe,size:Pe,top:Pe,right:Pe,bottom:Pe,left:Pe,padding:Pe,paddingTop:Pe,paddingRight:Pe,paddingBottom:Pe,paddingLeft:Pe,margin:Pe,marginTop:Pe,marginRight:Pe,marginBottom:Pe,marginLeft:Pe,rotate:na,rotateX:na,rotateY:na,rotateZ:na,scale:ch,scaleX:ch,scaleY:ch,scaleZ:ch,skew:na,skewX:na,skewY:na,distance:Pe,translateX:Pe,translateY:Pe,translateZ:Pe,x:Pe,y:Pe,z:Pe,perspective:Pe,transformPerspective:Pe,opacity:Wc,originX:p3,originY:p3,originZ:Pe,zIndex:m3,fillOpacity:Wc,strokeOpacity:Wc,numOctaves:m3};function nS(e,t,n,r){const{style:o,vars:i,transform:a,transformOrigin:s}=e;let l=!1,u=!1,c=!0;for(const f in t){const d=t[f];if(eT(f)){i[f]=d;continue}const h=nT[f],p=sG(d,h);if(Gs.has(f)){if(l=!0,a[f]=p,!c)continue;d!==(h.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,s[f]=p):o[f]=p}if(t.transform||(l||r?o.transform=iG(e.transform,n,c,r):o.transform&&(o.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:h=0}=s;o.transformOrigin=`${f} ${d} ${h}`}}const rS=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rT(e,t,n){for(const r in t)!Ar(t[r])&&!QP(r,n)&&(e[r]=t[r])}function fG({transformTemplate:e},t,n){return P.useMemo(()=>{const r=rS();return nS(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function dG(e,t,n){const r=e.style||{},o={};return rT(o,r,e),Object.assign(o,fG(e,t,n)),e.transformValues?e.transformValues(o):o}function hG(e,t,n){const r={},o=dG(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const pG=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function qp(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||pG.has(e)}let oT=e=>!qp(e);function mG(e){e&&(oT=t=>t.startsWith("on")?!qp(t):e(t))}try{mG(require("@emotion/is-prop-valid").default)}catch{}function yG(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(oT(o)||n===!0&&qp(o)||!t&&!qp(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function y3(e,t,n){return typeof e=="string"?e:Pe.transform(t+n*e)}function gG(e,t,n){const r=y3(t,e.x,e.width),o=y3(n,e.y,e.height);return`${r} ${o}`}const vG={offset:"stroke-dashoffset",array:"stroke-dasharray"},wG={offset:"strokeDashoffset",array:"strokeDasharray"};function bG(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?vG:wG;e[i.offset]=Pe.transform(-r);const a=Pe.transform(t),s=Pe.transform(n);e[i.array]=`${a} ${s}`}function oS(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...u},c,f,d){if(nS(e,u,c,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(o!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=gG(m,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),a!==void 0&&bG(h,a,s,l,!1)}const iT=()=>({...rS(),attrs:{}}),iS=e=>typeof e=="string"&&e.toLowerCase()==="svg";function SG(e,t,n,r){const o=P.useMemo(()=>{const i=iT();return oS(i,t,{enableHardwareAcceleration:!1},iS(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};rT(i,e.style,e),o.style={...i,...o.style}}return o}function _G(e=!1){return(n,r,o,{latestValues:i},a)=>{const l=(tS(n)?SG:hG)(r,i,a,n),c={...yG(r,typeof n=="string",e),...l,ref:o},{children:f}=r,d=P.useMemo(()=>Ar(f)?f.get():f,[f]);return P.createElement(n,{...c,children:d})}}const aS=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function aT(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const sT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function lT(e,t,n,r){aT(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(sT.has(o)?o:aS(o),t.attrs[o])}function sS(e,t){const{style:n}=e,r={};for(const o in n)(Ar(n[o])||t.style&&Ar(t.style[o])||QP(o,e))&&(r[o]=n[o]);return r}function uT(e,t){const n=sS(e,t);for(const r in e)if(Ar(e[r])||Ar(t[r])){const o=id.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[o]=e[r]}return n}function lS(e,t,n,r={},o={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),t}function cT(e){const t=P.useRef(null);return t.current===null&&(t.current=e()),t.current}const Yp=e=>Array.isArray(e),EG=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),CG=e=>Yp(e)?e[e.length-1]||0:e;function np(e){const t=Ar(e)?e.get():e;return EG(t)?t.toValue():t}function xG({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const a={latestValues:OG(r,o,i,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const fT=e=>(t,n)=>{const r=P.useContext(em),o=P.useContext(od),i=()=>xG(e,t,r,o);return n?i():cT(i)};function OG(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=np(i[d]);let{initial:a,animate:s}=e;const l=rm(e),u=YP(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const f=c?s:a;return f&&typeof f!="boolean"&&!nm(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=lS(e,h);if(!p)return;const{transitionEnd:m,transition:_,...b}=p;for(const g in b){let E=b[g];if(Array.isArray(E)){const T=c?E.length-1:0;E=E[T]}E!==null&&(o[g]=E)}for(const g in m)o[g]=m[g]}),o}const AG={useVisualState:fT({scrapeMotionValuesFromProps:uT,createRenderState:iT,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}oS(n,r,{enableHardwareAcceleration:!1},iS(t.tagName),e.transformTemplate),lT(t,n)}})},PG={useVisualState:fT({scrapeMotionValuesFromProps:sS,createRenderState:rS})};function TG(e,{forwardMotionProps:t=!1},n,r){return{...tS(e)?AG:PG,preloadedFeatures:n,useRender:_G(t),createVisualElement:r,Component:e}}function Ai(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const dT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function im(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const IG=e=>t=>dT(t)&&e(t,im(t));function Ii(e,t,n,r){return Ai(e,t,IG(n),r)}const RG=(e,t)=>n=>t(e(n)),Ca=(...e)=>e.reduce(RG);function hT(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const g3=hT("dragHorizontal"),v3=hT("dragVertical");function pT(e){let t=!1;if(e==="y")t=v3();else if(e==="x")t=g3();else{const n=g3(),r=v3();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function mT(){const e=pT(!0);return e?(e(),!1):!0}class Ba{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Gt=e=>e;function kG(e){let t=[],n=[],r=0,o=!1,i=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const f=c&&o,d=f?t:n;return u&&a.add(l),d.indexOf(l)===-1&&(d.push(l),f&&o&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(o){i=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(f[d]=kG(()=>n=!0),f),{}),a=f=>i[f].process(o),s=f=>{n=!1,o.delta=r?1e3/60:Math.max(Math.min(f-o.timestamp,MG),1),o.timestamp=f,o.isProcessing=!0,fh.forEach(a),o.isProcessing=!1,n&&t&&(r=!1,e(s))},l=()=>{n=!0,r=!0,o.isProcessing||e(s)};return{schedule:fh.reduce((f,d)=>{const h=i[d];return f[d]=(p,m=!1,_=!1)=>(n||l(),h.schedule(p,m,_)),f},{}),cancel:f=>fh.forEach(d=>i[d].cancel(f)),state:o,steps:i}}const{schedule:Tt,cancel:Bi,state:Vn,steps:zy}=DG(typeof requestAnimationFrame<"u"?requestAnimationFrame:Gt,!0);function w3(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),o=(i,a)=>{if(i.type==="touch"||mT())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[r]&&Tt.update(()=>s[r](i,a))};return Ii(e.current,n,o,{passive:!e.getProps()[r]})}class LG extends Ba{mount(){this.unmount=Ca(w3(this.node,!0),w3(this.node,!1))}unmount(){}}class NG extends Ba{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ca(Ai(this.node.current,"focus",()=>this.onFocus()),Ai(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const yT=(e,t)=>t?e===t?!0:yT(e,t.parentElement):!1;function Uy(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,im(n))}class BG extends Ba{constructor(){super(...arguments),this.removeStartListeners=Gt,this.removeEndListeners=Gt,this.removeAccessibleListeners=Gt,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),i=Ii(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Tt.update(()=>{yT(this.node.current,s.target)?u&&u(s,l):c&&c(s,l)})},{passive:!(r.onTap||r.onPointerUp)}),a=Ii(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Ca(i,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=i=>{if(i.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||Uy("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Tt.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Ai(this.node.current,"keyup",a),Uy("down",(s,l)=>{this.startPress(s,l)})},n=Ai(this.node.current,"keydown",t),r=()=>{this.isPressing&&Uy("cancel",(i,a)=>this.cancelPress(i,a))},o=Ai(this.node.current,"blur",r);this.removeAccessibleListeners=Ca(n,o)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Tt.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!mT()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Tt.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Ii(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Ai(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ca(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const p2=new WeakMap,Vy=new WeakMap,jG=e=>{const t=p2.get(e.target);t&&t(e)},FG=e=>{e.forEach(jG)};function $G({root:e,...t}){const n=e||document;Vy.has(n)||Vy.set(n,{});const r=Vy.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(FG,{root:e,...t})),r[o]}function zG(e,t,n){const r=$G(t);return p2.set(e,n),r.observe(e),()=>{p2.delete(e),r.unobserve(e)}}const UG={some:0,all:1};class VG extends Ba{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:UG[o]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return zG(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(HG(t,n))&&this.startObserver()}unmount(){}}function HG({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const WG={inView:{Feature:VG},tap:{Feature:BG},focus:{Feature:NG},hover:{Feature:LG}};function gT(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function KG(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function am(e,t,n){const r=e.getProps();return lS(r,t,n!==void 0?n:r.custom,GG(e),KG(e))}const XG="framerAppearId",qG="data-"+aS(XG);let YG=Gt,uS=Gt;const xa=e=>e*1e3,Ri=e=>e/1e3,ZG={current:!1},vT=e=>Array.isArray(e)&&typeof e[0]=="number";function wT(e){return!!(!e||typeof e=="string"&&bT[e]||vT(e)||Array.isArray(e)&&e.every(wT))}const Cc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Cc([0,.65,.55,1]),circOut:Cc([.55,0,1,.45]),backIn:Cc([.31,.01,.66,-.59]),backOut:Cc([.33,1.53,.69,.99])};function ST(e){if(e)return vT(e)?Cc(e):Array.isArray(e)?e.map(ST):bT[e]}function QG(e,t,n,{delay:r=0,duration:o,repeat:i=0,repeatType:a="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=ST(s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"})}function JG(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const _T=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,eK=1e-7,tK=12;function nK(e,t,n,r,o){let i,a,s=0;do a=t+(n-t)/2,i=_T(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>eK&&++snK(i,0,1,e,n);return i=>i===0||i===1?i:_T(o(i),t,r)}const rK=ld(.42,0,1,1),oK=ld(0,0,.58,1),ET=ld(.42,0,.58,1),iK=e=>Array.isArray(e)&&typeof e[0]!="number",CT=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xT=e=>t=>1-e(1-t),OT=e=>1-Math.sin(Math.acos(e)),cS=xT(OT),aK=CT(cS),AT=ld(.33,1.53,.69,.99),fS=xT(AT),sK=CT(fS),lK=e=>(e*=2)<1?.5*fS(e):.5*(2-Math.pow(2,-10*(e-1))),uK={linear:Gt,easeIn:rK,easeInOut:ET,easeOut:oK,circIn:OT,circInOut:aK,circOut:cS,backIn:fS,backInOut:sK,backOut:AT,anticipate:lK},b3=e=>{if(Array.isArray(e)){uS(e.length===4);const[t,n,r,o]=e;return ld(t,n,r,o)}else if(typeof e=="string")return uK[e];return e},dS=(e,t)=>n=>!!(ad(n)&&lG.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),PT=(e,t,n)=>r=>{if(!ad(r))return r;const[o,i,a,s]=r.match(om);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},cK=e=>Ia(0,255,e),Hy={...Ks,transform:e=>Math.round(cK(e))},ms={test:dS("rgb","red"),parse:PT("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Hy.transform(e)+", "+Hy.transform(t)+", "+Hy.transform(n)+", "+Gc(Wc.transform(r))+")"};function fK(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const m2={test:dS("#"),parse:fK,transform:ms.transform},Ll={test:dS("hsl","hue"),parse:PT("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ci.transform(Gc(t))+", "+ci.transform(Gc(n))+", "+Gc(Wc.transform(r))+")"},er={test:e=>ms.test(e)||m2.test(e)||Ll.test(e),parse:e=>ms.test(e)?ms.parse(e):Ll.test(e)?Ll.parse(e):m2.parse(e),transform:e=>ad(e)?e:e.hasOwnProperty("red")?ms.transform(e):Ll.transform(e)},jt=(e,t,n)=>-n*e+n*t+e;function Wy(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function dK({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=Wy(l,s,e+1/3),i=Wy(l,s,e),a=Wy(l,s,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}const Gy=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},hK=[m2,ms,Ll],pK=e=>hK.find(t=>t.test(e));function S3(e){const t=pK(e);let n=t.parse(e);return t===Ll&&(n=dK(n)),n}const TT=(e,t)=>{const n=S3(e),r=S3(t),o={...n};return i=>(o.red=Gy(n.red,r.red,i),o.green=Gy(n.green,r.green,i),o.blue=Gy(n.blue,r.blue,i),o.alpha=jt(n.alpha,r.alpha,i),ms.transform(o))};function mK(e){var t,n;return isNaN(e)&&ad(e)&&(((t=e.match(om))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(tT))===null||n===void 0?void 0:n.length)||0)>0}const IT={regex:aG,countKey:"Vars",token:"${v}",parse:Gt},RT={regex:tT,countKey:"Colors",token:"${c}",parse:er.parse},kT={regex:om,countKey:"Numbers",token:"${n}",parse:Ks.parse};function Ky(e,{regex:t,countKey:n,token:r,parse:o}){const i=e.tokenised.match(t);i&&(e["num"+n]=i.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...i.map(o)))}function Zp(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ky(n,IT),Ky(n,RT),Ky(n,kT),n}function MT(e){return Zp(e).values}function DT(e){const{values:t,numColors:n,numVars:r,tokenised:o}=Zp(e),i=t.length;return a=>{let s=o;for(let l=0;ltypeof e=="number"?0:e;function gK(e){const t=MT(e);return DT(e)(t.map(yK))}const Ra={test:mK,parse:MT,createTransformer:DT,getAnimatableNone:gK},LT=(e,t)=>n=>`${n>0?t:e}`;function NT(e,t){return typeof e=="number"?n=>jt(e,t,n):er.test(e)?TT(e,t):e.startsWith("var(")?LT(e,t):jT(e,t)}const BT=(e,t)=>{const n=[...e],r=n.length,o=e.map((i,a)=>NT(i,t[a]));return i=>{for(let a=0;a{const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=NT(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}},jT=(e,t)=>{const n=Ra.createTransformer(t),r=Zp(e),o=Zp(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?Ca(BT(r.values,o.values),n):LT(e,t)},kf=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},_3=(e,t)=>n=>jt(e,t,n);function wK(e){return typeof e=="number"?_3:typeof e=="string"?er.test(e)?TT:jT:Array.isArray(e)?BT:typeof e=="object"?vK:_3}function bK(e,t,n){const r=[],o=n||wK(e[0]),i=e.length-1;for(let a=0;at[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=bK(t,r,o),s=a.length,l=u=>{let c=0;if(s>1)for(;cl(Ia(e[0],e[i-1],u)):l}function SK(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=kf(0,t,r);e.push(jt(n,1,o))}}function _K(e){const t=[0];return SK(t,e.length-1),t}function EK(e,t){return e.map(n=>n*t)}function CK(e,t){return e.map(()=>t||ET).splice(0,e.length-1)}function Qp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=iK(r)?r.map(b3):b3(r),i={done:!1,value:t[0]},a=EK(n&&n.length===t.length?n:_K(t),e),s=FT(a,t,{ease:Array.isArray(o)?o:CK(t,o)});return{calculatedDuration:e,next:l=>(i.value=s(l),i.done=l>=e,i)}}function $T(e,t){return t?e*(1e3/t):0}const xK=5;function zT(e,t,n){const r=Math.max(t-xK,0);return $T(n-e(r),t-r)}const Xy=.001,OK=.01,E3=10,AK=.05,PK=1;function TK({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;YG(e<=xa(E3));let a=1-t;a=Ia(AK,PK,a),e=Ia(OK,E3,Ri(e)),a<1?(o=u=>{const c=u*a,f=c*e,d=c-n,h=y2(u,a),p=Math.exp(-f);return Xy-d/h*p},i=u=>{const f=u*a*e,d=f*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-f),m=y2(Math.pow(u,2),a);return(-o(u)+Xy>0?-1:1)*((d-h)*p)/m}):(o=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-Xy+c*f},i=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const s=5/e,l=RK(o,i,s);if(e=xa(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const IK=12;function RK(e,t,n){let r=n;for(let o=1;oe[n]!==void 0)}function DK(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!C3(e,MK)&&C3(e,kK)){const n=TK(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function UT({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],a={done:!1,value:o},{stiffness:s,damping:l,mass:u,velocity:c,duration:f,isResolvedFromDuration:d}=DK(r),h=c?-Ri(c):0,p=l/(2*Math.sqrt(s*u)),m=i-o,_=Ri(Math.sqrt(s/u)),b=Math.abs(m)<5;n||(n=b?.01:2),t||(t=b?.005:.5);let g;if(p<1){const E=y2(_,p);g=T=>{const O=Math.exp(-p*_*T);return i-O*((h+p*_*m)/E*Math.sin(E*T)+m*Math.cos(E*T))}}else if(p===1)g=E=>i-Math.exp(-_*E)*(m+(h+_*m)*E);else{const E=_*Math.sqrt(p*p-1);g=T=>{const O=Math.exp(-p*_*T),A=Math.min(E*T,300);return i-O*((h+p*_*m)*Math.sinh(A)+E*m*Math.cosh(A))/E}}return{calculatedDuration:d&&f||null,next:E=>{const T=g(E);if(d)a.done=E>=f;else{let O=h;E!==0&&(p<1?O=zT(g,E,T):O=0);const A=Math.abs(O)<=n,C=Math.abs(i-T)<=t;a.done=A&&C}return a.value=a.done?i:T,a}}}function x3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],d={done:!1,value:f},h=y=>s!==void 0&&yl,p=y=>s===void 0?l:l===void 0||Math.abs(s-y)-m*Math.exp(-y/r),E=y=>b+g(y),T=y=>{const S=g(y),v=E(y);d.done=Math.abs(S)<=u,d.value=d.done?b:v};let O,A;const C=y=>{h(d.value)&&(O=y,A=UT({keyframes:[d.value,p(d.value)],velocity:zT(E,y,d.value),damping:o,stiffness:i,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:y=>{let S=!1;return!A&&O===void 0&&(S=!0,T(y),C(y)),O!==void 0&&y>O?A.next(y-O):(!S&&T(y),d)}}}const LK=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Tt.update(t,!0),stop:()=>Bi(t),now:()=>Vn.isProcessing?Vn.timestamp:performance.now()}},O3=2e4;function A3(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=O3?1/0:t}const NK={decay:x3,inertia:x3,tween:Qp,keyframes:Qp,spring:UT};function Jp({autoplay:e=!0,delay:t=0,driver:n=LK,keyframes:r,type:o="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:f,...d}){let h=1,p=!1,m,_;const b=()=>{_=new Promise(B=>{m=B})};b();let g;const E=NK[o]||Qp;let T;E!==Qp&&typeof r[0]!="number"&&(T=FT([0,100],r,{clamp:!1}),r=[0,100]);const O=E({...d,keyframes:r});let A;s==="mirror"&&(A=E({...d,keyframes:[...r].reverse(),velocity:-(d.velocity||0)}));let C="idle",y=null,S=null,v=null;O.calculatedDuration===null&&i&&(O.calculatedDuration=A3(O));const{calculatedDuration:x}=O;let I=1/0,R=1/0;x!==null&&(I=x+a,R=I*(i+1)-a);let k=0;const M=B=>{if(S===null)return;h>0&&(S=Math.min(S,B)),h<0&&(S=Math.min(B-R/h,S)),y!==null?k=y:k=Math.round(B-S)*h;const U=k-t*(h>=0?1:-1),K=h>=0?U<0:U>R;k=Math.max(U,0),C==="finished"&&y===null&&(k=R);let W=k,Q=O;if(i){const le=k/I;let ge=Math.floor(le),se=le%1;!se&&le>=1&&(se=1),se===1&&ge--,ge=Math.min(ge,i+1);const ue=!!(ge%2);ue&&(s==="reverse"?(se=1-se,a&&(se-=a/I)):s==="mirror"&&(Q=A));let Ie=Ia(0,1,se);k>R&&(Ie=s==="reverse"&&ue?1:0),W=Ie*I}const X=K?{done:!1,value:r[0]}:Q.next(W);T&&(X.value=T(X.value));let{done:J}=X;!K&&x!==null&&(J=h>=0?k>=R:k<=0);const te=y===null&&(C==="finished"||C==="running"&&J);return f&&f(X.value),te&&L(),X},N=()=>{g&&g.stop(),g=void 0},D=()=>{C="idle",N(),m(),b(),S=v=null},L=()=>{C="finished",c&&c(),N(),m()},j=()=>{if(p)return;g||(g=n(M));const B=g.now();l&&l(),y!==null?S=B-y:(!S||C==="finished")&&(S=B),C==="finished"&&b(),v=S,y=null,C="running",g.start()};e&&j();const F={then(B,U){return _.then(B,U)},get time(){return Ri(k)},set time(B){B=xa(B),k=B,y!==null||!g||h===0?y=B:S=g.now()-B/h},get duration(){const B=O.calculatedDuration===null?A3(O):O.calculatedDuration;return Ri(B)},get speed(){return h},set speed(B){B===h||!g||(h=B,F.time=Ri(k))},get state(){return C},play:j,pause:()=>{C="paused",y=k},stop:()=>{p=!0,C!=="idle"&&(C="idle",u&&u(),D())},cancel:()=>{v!==null&&M(v),D()},complete:()=>{C="finished"},sample:B=>(S=0,M(B))};return F}function BK(e){let t;return()=>(t===void 0&&(t=e()),t)}const jK=BK(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),FK=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),dh=10,$K=2e4,zK=(e,t)=>t.type==="spring"||e==="backgroundColor"||!wT(t.ease);function UK(e,t,{onUpdate:n,onComplete:r,...o}){if(!(jK()&&FK.has(t)&&!o.repeatDelay&&o.repeatType!=="mirror"&&o.damping!==0&&o.type!=="inertia"))return!1;let a=!1,s,l;const u=()=>{l=new Promise(g=>{s=g})};u();let{keyframes:c,duration:f=300,ease:d,times:h}=o;if(zK(t,o)){const g=Jp({...o,repeat:0,delay:0});let E={done:!1,value:c[0]};const T=[];let O=0;for(;!E.done&&O<$K;)E=g.sample(O),T.push(E.value),O+=dh;h=void 0,c=T,f=O-dh,d="linear"}const p=QG(e.owner.current,t,c,{...o,duration:f,ease:d,times:h}),m=()=>p.cancel(),_=()=>{Tt.update(m),s(),u()};return p.onfinish=()=>{e.set(JG(c,o)),r&&r(),_()},{then(g,E){return l.then(g,E)},attachTimeline(g){return p.timeline=g,p.onfinish=null,Gt},get time(){return Ri(p.currentTime||0)},set time(g){p.currentTime=xa(g)},get speed(){return p.playbackRate},set speed(g){p.playbackRate=g},get duration(){return Ri(f)},play:()=>{a||(p.play(),Bi(m))},pause:()=>p.pause(),stop:()=>{if(a=!0,p.playState==="idle")return;const{currentTime:g}=p;if(g){const E=Jp({...o,autoplay:!1});e.setWithVelocity(E.sample(g-dh).value,E.sample(g).value,dh)}_()},complete:()=>p.finish(),cancel:_}}function VK({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Gt,pause:Gt,stop:Gt,then:i=>(i(),Promise.resolve()),cancel:Gt,complete:Gt});return t?Jp({keyframes:[0,1],duration:0,delay:t,onComplete:o}):o()}const HK={type:"spring",stiffness:500,damping:25,restSpeed:10},WK=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),GK={type:"keyframes",duration:.8},KK={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},XK=(e,{keyframes:t})=>t.length>2?GK:Gs.has(e)?e.startsWith("scale")?WK(t[1]):HK:KK,g2=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ra.test(t)||t==="0")&&!t.startsWith("url(")),qK=new Set(["brightness","contrast","saturate","opacity"]);function YK(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(om)||[];if(!r)return e;const o=n.replace(r,"");let i=qK.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const ZK=/([a-z-]*)\(.*?\)/g,v2={...Ra,getAnimatableNone:e=>{const t=e.match(ZK);return t?t.map(YK).join(" "):e}},QK={...nT,color:er,backgroundColor:er,outlineColor:er,fill:er,stroke:er,borderColor:er,borderTopColor:er,borderRightColor:er,borderBottomColor:er,borderLeftColor:er,filter:v2,WebkitFilter:v2},hS=e=>QK[e];function VT(e,t){let n=hS(e);return n!==v2&&(n=Ra),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const HT=e=>/^0[^.\s]+$/.test(e);function JK(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||HT(e)}function eX(e,t,n,r){const o=g2(t,n);let i;Array.isArray(n)?i=[...n]:i=[null,n];const a=r.from!==void 0?r.from:e.get();let s;const l=[];for(let u=0;uo=>{const i=WT(r,e)||{},a=i.delay||r.delay||0;let{elapsed:s=0}=r;s=s-xa(a);const l=eX(t,e,n,i),u=l[0],c=l[l.length-1],f=g2(e,u),d=g2(e,c);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...i,delay:-s,onUpdate:p=>{t.set(p),i.onUpdate&&i.onUpdate(p)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(tX(i)||(h={...h,...XK(e,h)}),h.duration&&(h.duration=xa(h.duration)),h.repeatDelay&&(h.repeatDelay=xa(h.repeatDelay)),!f||!d||ZG.current||i.type===!1)return VK(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=UK(t,e,h);if(p)return p}return Jp(h)};function e1(e){return!!(Ar(e)&&e.add)}const nX=e=>/^\-?\d*\.?\d+$/.test(e);function mS(e,t){e.indexOf(t)===-1&&e.push(t)}function yS(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class gS{constructor(){this.subscriptions=[]}add(t){return mS(this.subscriptions,t),()=>yS(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class oX{constructor(t,n={}){this.version="10.15.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,o=!0)=>{this.prev=this.current,this.current=r;const{delta:i,timestamp:a}=Vn;this.lastUpdated!==a&&(this.timeDelta=i,this.lastUpdated=a,Tt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Tt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=rX(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new gS);const r=this.events[t].add(n);return t==="change"?()=>{r(),Tt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$T(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function vu(e,t){return new oX(e,t)}const GT=e=>t=>t.test(e),iX={test:e=>e==="auto",parse:e=>e},KT=[Ks,Pe,ci,na,cG,uG,iX],ac=e=>KT.find(GT(e)),aX=[...KT,er,Ra],sX=e=>aX.find(GT(e));function lX(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,vu(n))}function uX(e,t){const n=am(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const a in i){const s=CG(i[a]);lX(e,a,s)}}function cX(e,t,n){var r,o;const i=Object.keys(t).filter(s=>!e.hasValue(s)),a=i.length;if(a)for(let s=0;sl.remove(f))),u.push(m)}return a&&Promise.all(u).then(()=>{a&&uX(e,a)}),u}function w2(e,t,n={}){const r=am(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(XT(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:f}=o;return pX(e,t,u+l,c,f,n)}:()=>Promise.resolve(),{when:s}=o;if(s){const[l,u]=s==="beforeChildren"?[i,a]:[a,i];return l().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function pX(e,t,n=0,r=0,o=1,i){const a=[],s=(e.variantChildren.size-1)*r,l=o===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(mX).forEach((u,c)=>{u.notify("AnimationStart",t),a.push(w2(u,t,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function mX(e,t){return e.sortNodePosition(t)}function yX(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>w2(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=w2(e,t,n);else{const o=typeof t=="function"?am(e,t,n.custom):t;r=Promise.all(XT(e,o,n))}return r.then(()=>e.notify("AnimationComplete",t))}const gX=[...Qb].reverse(),vX=Qb.length;function wX(e){return t=>Promise.all(t.map(({animation:n,options:r})=>yX(e,n,r)))}function bX(e){let t=wX(e);const n=_X();let r=!0;const o=(l,u)=>{const c=am(e,u);if(c){const{transition:f,transitionEnd:d,...h}=c;l={...l,...h,...d}}return l};function i(l){t=l(e)}function a(l,u){const c=e.getProps(),f=e.getVariantContext(!0)||{},d=[],h=new Set;let p={},m=1/0;for(let b=0;bm&&O;const v=Array.isArray(T)?T:[T];let x=v.reduce(o,{});A===!1&&(x={});const{prevResolvedValues:I={}}=E,R={...I,...x},k=M=>{S=!0,h.delete(M),E.needsAnimating[M]=!0};for(const M in R){const N=x[M],D=I[M];p.hasOwnProperty(M)||(N!==D?Yp(N)&&Yp(D)?!gT(N,D)||y?k(M):E.protectedKeys[M]=!0:N!==void 0?k(M):h.add(M):N!==void 0&&h.has(M)?k(M):E.protectedKeys[M]=!0)}E.prevProp=T,E.prevResolvedValues=x,E.isActive&&(p={...p,...x}),r&&e.blockInitialAnimation&&(S=!1),S&&!C&&d.push(...v.map(M=>({animation:M,options:{type:g,...l}})))}if(h.size){const b={};h.forEach(g=>{const E=e.getBaseTarget(g);E!==void 0&&(b[g]=E)}),d.push({animation:b})}let _=!!d.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(d):Promise.resolve()}function s(l,u,c){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=a(c,l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:a,setActive:s,setAnimateFunction:i,getState:()=>n}}function SX(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gT(t,e):!1}function qa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _X(){return{animate:qa(!0),whileInView:qa(),whileHover:qa(),whileTap:qa(),whileDrag:qa(),whileFocus:qa(),exit:qa()}}class EX extends Ba{constructor(t){super(t),t.animationState||(t.animationState=bX(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),nm(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let CX=0;class xX extends Ba{constructor(){super(...arguments),this.id=CX++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const i=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const OX={animation:{Feature:EX},exit:{Feature:xX}},P3=(e,t)=>Math.abs(e-t);function AX(e,t){const n=P3(e.x,t.x),r=P3(e.y,t.y);return Math.sqrt(n**2+r**2)}class qT{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=Yy(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,f=AX(u.offset,{x:0,y:0})>=3;if(!c&&!f)return;const{point:d}=u,{timestamp:h}=Vn;this.history.push({...d,timestamp:h});const{onStart:p,onMove:m}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=qy(c,this.transformPagePoint),Tt.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=Yy(u.type==="pointercancel"?this.lastMoveEventInfo:qy(c,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,h),d&&d(u,h)},!dT(t))return;this.handlers=n,this.transformPagePoint=r;const o=im(t),i=qy(o,this.transformPagePoint),{point:a}=i,{timestamp:s}=Vn;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,Yy(i,this.history)),this.removeListeners=Ca(Ii(window,"pointermove",this.handlePointerMove),Ii(window,"pointerup",this.handlePointerUp),Ii(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Bi(this.updatePoint)}}function qy(e,t){return t?{point:t(e.point)}:e}function T3(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Yy({point:e},t){return{point:e,delta:T3(e,YT(t)),offset:T3(e,PX(t)),velocity:TX(t,.1)}}function PX(e){return e[0]}function YT(e){return e[e.length-1]}function TX(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=YT(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>xa(t)));)n--;if(!r)return{x:0,y:0};const i=Ri(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Yr(e){return e.max-e.min}function b2(e,t=0,n=.01){return Math.abs(e-t)<=n}function I3(e,t,n,r=.5){e.origin=r,e.originPoint=jt(t.min,t.max,e.origin),e.scale=Yr(n)/Yr(t),(b2(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=jt(n.min,n.max,e.origin)-e.originPoint,(b2(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Kc(e,t,n,r){I3(e.x,t.x,n.x,r?r.originX:void 0),I3(e.y,t.y,n.y,r?r.originY:void 0)}function R3(e,t,n){e.min=n.min+t.min,e.max=e.min+Yr(t)}function IX(e,t,n){R3(e.x,t.x,n.x),R3(e.y,t.y,n.y)}function k3(e,t,n){e.min=t.min-n.min,e.max=e.min+Yr(t)}function Xc(e,t,n){k3(e.x,t.x,n.x),k3(e.y,t.y,n.y)}function RX(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?jt(n,e,r.max):Math.min(e,n)),e}function M3(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function kX(e,{top:t,left:n,bottom:r,right:o}){return{x:M3(e.x,n,o),y:M3(e.y,t,r)}}function D3(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=kf(t.min,t.max-r,e.min):r>o&&(n=kf(e.min,e.max-o,t.min)),Ia(0,1,n)}function LX(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const S2=.35;function NX(e=S2){return e===!1?e=0:e===!0&&(e=S2),{x:L3(e,"left","right"),y:L3(e,"top","bottom")}}function L3(e,t,n){return{min:N3(e,t),max:N3(e,n)}}function N3(e,t){return typeof e=="number"?e:e[t]||0}const B3=()=>({translate:0,scale:1,origin:0,originPoint:0}),Nl=()=>({x:B3(),y:B3()}),j3=()=>({min:0,max:0}),nn=()=>({x:j3(),y:j3()});function Xo(e){return[e("x"),e("y")]}function ZT({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function BX({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function jX(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Zy(e){return e===void 0||e===1}function _2({scale:e,scaleX:t,scaleY:n}){return!Zy(e)||!Zy(t)||!Zy(n)}function ts(e){return _2(e)||QT(e)||e.z||e.rotate||e.rotateX||e.rotateY}function QT(e){return F3(e.x)||F3(e.y)}function F3(e){return e&&e!=="0%"}function t1(e,t,n){const r=e-n,o=t*r;return n+o}function $3(e,t,n,r,o){return o!==void 0&&(e=t1(e,o,r)),t1(e,n,r)+t}function E2(e,t=0,n=1,r,o){e.min=$3(e.min,t,n,r,o),e.max=$3(e.max,t,n,r,o)}function JT(e,{x:t,y:n}){E2(e.x,t.translate,t.scale,t.originPoint),E2(e.y,n.translate,n.scale,n.originPoint)}function FX(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,a;for(let s=0;s1.0000000000001||e<.999999999999?e:1}function ia(e,t){e.min=e.min+t,e.max=e.max+t}function U3(e,t,[n,r,o]){const i=t[o]!==void 0?t[o]:.5,a=jt(e.min,e.max,i);E2(e,t[n],t[r],a,t.scale)}const $X=["x","scaleX","originX"],zX=["y","scaleY","originY"];function Bl(e,t){U3(e.x,t,$X),U3(e.y,t,zX)}function eI(e,t){return ZT(jX(e.getBoundingClientRect(),t))}function UX(e,t,n){const r=eI(e,n),{scroll:o}=t;return o&&(ia(r.x,o.offset.x),ia(r.y,o.offset.y)),r}const VX=new WeakMap;class HX{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=nn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=l=>{this.stopAnimation(),n&&this.snapToCursor(im(l,"page").point)},i=(l,u)=>{const{drag:c,dragPropagation:f,onDragStart:d}=this.getProps();if(c&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=pT(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xo(p=>{let m=this.getAxisMotionValue(p).get()||0;if(ci.test(m)){const{projection:_}=this.visualElement;if(_&&_.layout){const b=_.layout.layoutBox[p];b&&(m=Yr(b)*(parseFloat(m)/100))}}this.originPoint[p]=m}),d&&Tt.update(()=>d(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(l,u)=>{const{dragPropagation:c,dragDirectionLock:f,onDirectionLock:d,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(f&&this.currentDirection===null){this.currentDirection=WX(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new qT(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:s},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Tt.update(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!hh(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=RX(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},o=this.constraints;t&&Dl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=kX(r.layoutBox,t):this.constraints=!1,this.elastic=NX(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Xo(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=LX(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Dl(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=UX(r,o.root,this.visualElement.getTransformPagePoint());let a=MX(o.layout.layoutBox,i);if(n){const s=n(BX(a));this.hasMutatedConstraints=!!s,s&&(a=ZT(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Xo(c=>{if(!hh(c,n,this.currentDirection))return;let f=l&&l[c]||{};a&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(pS(t,r,0,n))}stopAnimation(){Xo(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Xo(n=>{const{drag:r}=this.getProps();if(!hh(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:s}=o.layout.layoutBox[n];i.set(t[n]-jt(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Dl(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Xo(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();o[a]=DX({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Xo(a=>{if(!hh(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(jt(l,u,o[a]))})}addListeners(){if(!this.visualElement.current)return;VX.set(this.visualElement,this);const t=this.visualElement.current,n=Ii(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Dl(l)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),r();const a=Ai(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Xo(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=S2,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:s}}}function hh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function WX(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class GX extends Ba{constructor(t){super(t),this.removeGroupControls=Gt,this.removeListeners=Gt,this.controls=new HX(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gt}unmount(){this.removeGroupControls(),this.removeListeners()}}const V3=e=>(t,n)=>{e&&Tt.update(()=>e(t,n))};class KX extends Ba{constructor(){super(...arguments),this.removePointerDownListener=Gt}onPointerDown(t){this.session=new qT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:V3(t),onStart:V3(n),onMove:r,onEnd:(i,a)=>{delete this.session,o&&Tt.update(()=>o(i,a))}}}mount(){this.removePointerDownListener=Ii(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function tI(){const e=P.useContext(od);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=P.useId();return P.useEffect(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}function XX(){return qX(P.useContext(od))}function qX(e){return e===null?!0:e.isPresent}const rp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function H3(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const sc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Pe.test(e))e=parseFloat(e);else return e;const n=H3(e,t.target.x),r=H3(e,t.target.y);return`${n}% ${r}%`}},YX={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ra.parse(e);if(o.length>5)return r;const i=Ra.createTransformer(e),a=typeof o[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;o[0+a]/=s,o[1+a]/=l;const u=jt(s,l,.5);return typeof o[2+a]=="number"&&(o[2+a]/=u),typeof o[3+a]=="number"&&(o[3+a]/=u),i(o)}};class ZX extends ee.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;nG(QX),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),rp.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,o||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||Tt.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nI(e){const[t,n]=tI(),r=P.useContext(eS);return ee.createElement(ZX,{...e,layoutGroup:r,switchLayoutGroup:P.useContext(ZP),isPresent:t,safeToRemove:n})}const QX={borderRadius:{...sc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:sc,borderTopRightRadius:sc,borderBottomLeftRadius:sc,borderBottomRightRadius:sc,boxShadow:YX},rI=["TopLeft","TopRight","BottomLeft","BottomRight"],JX=rI.length,W3=e=>typeof e=="string"?parseFloat(e):e,G3=e=>typeof e=="number"||Pe.test(e);function eq(e,t,n,r,o,i){o?(e.opacity=jt(0,n.opacity!==void 0?n.opacity:1,tq(r)),e.opacityExit=jt(t.opacity!==void 0?t.opacity:1,0,nq(r))):i&&(e.opacity=jt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(kf(e,t,r))}function X3(e,t){e.min=t.min,e.max=t.max}function ro(e,t){X3(e.x,t.x),X3(e.y,t.y)}function q3(e,t,n,r,o){return e-=t,e=t1(e,1/n,r),o!==void 0&&(e=t1(e,1/o,r)),e}function rq(e,t=0,n=1,r=.5,o,i=e,a=e){if(ci.test(t)&&(t=parseFloat(t),t=jt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=jt(i.min,i.max,r);e===i&&(s-=t),e.min=q3(e.min,t,n,s,o),e.max=q3(e.max,t,n,s,o)}function Y3(e,t,[n,r,o],i,a){rq(e,t[n],t[r],t[o],t.scale,i,a)}const oq=["x","scaleX","originX"],iq=["y","scaleY","originY"];function Z3(e,t,n,r){Y3(e.x,t,oq,n?n.x:void 0,r?r.x:void 0),Y3(e.y,t,iq,n?n.y:void 0,r?r.y:void 0)}function Q3(e){return e.translate===0&&e.scale===1}function iI(e){return Q3(e.x)&&Q3(e.y)}function aq(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function aI(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function J3(e){return Yr(e.x)/Yr(e.y)}class sq{constructor(){this.members=[]}add(t){mS(this.members,t),t.scheduleRender()}remove(t){if(yS(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ex(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const lq=(e,t)=>e.depth-t.depth;class uq{constructor(){this.children=[],this.isDirty=!1}add(t){mS(this.children,t),this.isDirty=!0}remove(t){yS(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lq),this.isDirty=!1,this.children.forEach(t)}}function cq(e,t){const n=performance.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Bi(r),e(i-t))};return Tt.read(r,!0),()=>Bi(r)}function fq(e){window.MotionDebug&&window.MotionDebug.record(e)}function dq(e){return e instanceof SVGElement&&e.tagName!=="svg"}function hq(e,t,n){const r=Ar(e)?e:vu(e);return r.start(pS("",r,t,n)),r.animation}const tx=["","X","Y","Z"],nx=1e3;let pq=0;const ns={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function sI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},s=t==null?void 0:t()){this.id=pq++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{ns.totalNodes=ns.resolvedTargetDeltas=ns.recalculatedProjection=0,this.nodes.forEach(gq),this.nodes.forEach(_q),this.nodes.forEach(Eq),this.nodes.forEach(vq),fq(ns)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=cq(d,250),rp.hasAnimatedSinceResize&&(rp.hasAnimatedSinceResize=!1,this.nodes.forEach(ox))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Pq,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=c.getProps(),g=!this.targetLayout||!aI(this.targetLayout,p)||h,E=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||E||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,E);const T={...WT(m,"layout"),onPlay:_,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else d||ox(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Bi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Cq),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(wq),this.sharedNodes.forEach(xq)}scheduleUpdateProjection(){Tt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const O=T/1e3;ix(f.x,a.x,O),ix(f.y,a.y,O),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xc(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Oq(this.relativeTarget,this.relativeTargetOrigin,d,O),E&&aq(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=nn()),ro(E,this.relativeTarget)),m&&(this.animationValues=c,eq(c,u,this.latestValues,O,g,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Bi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tt.update(()=>{rp.hasAnimatedSinceResize=!0,this.currentAnimation=hq(0,nx,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(nx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&lI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||nn();const f=Yr(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const d=Yr(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+d}ro(s,l),Bl(s,c),Kc(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new sq),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let c=0;c{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(rx),this.root.sharedNodes.clear()}}}function mq(e){e.updateLayout()}function yq(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,a=n.source!==e.layout.source;i==="size"?Xo(f=>{const d=a?n.measuredBox[f]:n.layoutBox[f],h=Yr(d);d.min=r[f].min,d.max=d.min+h}):lI(i,n.layoutBox,r)&&Xo(f=>{const d=a?n.measuredBox[f]:n.layoutBox[f],h=Yr(r[f]);d.max=d.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const s=Nl();Kc(s,r,n.layoutBox);const l=Nl();a?Kc(l,e.applyTransform(o,!0),n.measuredBox):Kc(l,r,n.layoutBox);const u=!iI(s);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=nn();Xc(p,n.layoutBox,d.layoutBox);const m=nn();Xc(m,r,h.layoutBox),aI(p,m)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function gq(e){ns.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function vq(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function wq(e){e.clearSnapshot()}function rx(e){e.clearMeasurements()}function bq(e){e.isLayoutDirty=!1}function Sq(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ox(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _q(e){e.resolveTargetDelta()}function Eq(e){e.calcProjection()}function Cq(e){e.resetRotation()}function xq(e){e.removeLeadSnapshot()}function ix(e,t,n){e.translate=jt(t.translate,0,n),e.scale=jt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ax(e,t,n,r){e.min=jt(t.min,n.min,r),e.max=jt(t.max,n.max,r)}function Oq(e,t,n,r){ax(e.x,t.x,n.x,r),ax(e.y,t.y,n.y,r)}function Aq(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Pq={duration:.45,ease:[.4,0,.1,1]},sx=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),lx=sx("applewebkit/")&&!sx("chrome/")?Math.round:Gt;function ux(e){e.min=lx(e.min),e.max=lx(e.max)}function Tq(e){ux(e.x),ux(e.y)}function lI(e,t,n){return e==="position"||e==="preserve-aspect"&&!b2(J3(t),J3(n),.2)}const Iq=sI({attachResizeListener:(e,t)=>Ai(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Qy={current:void 0},uI=sI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Qy.current){const e=new Iq({});e.mount(window),e.setOptions({layoutScroll:!0}),Qy.current=e}return Qy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Rq={pan:{Feature:KX},drag:{Feature:GX,ProjectionNode:uI,MeasureLayout:nI}},kq=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Mq(e){const t=kq.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function C2(e,t,n=1){const[r,o]=Mq(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);return i?i.trim():h2(o)?C2(o,t,n+1):o}function Dq(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(o=>{const i=o.get();if(!h2(i))return;const a=C2(i,r);a&&o.set(a)});for(const o in t){const i=t[o];if(!h2(i))continue;const a=C2(i,r);a&&(t[o]=a,n||(n={}),n[o]===void 0&&(n[o]=i))}return{target:t,transitionEnd:n}}const Lq=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),cI=e=>Lq.has(e),Nq=e=>Object.keys(e).some(cI),cx=e=>e===Ks||e===Pe,fx=(e,t)=>parseFloat(e.split(", ")[t]),dx=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return fx(o[1],t);{const i=r.match(/^matrix\((.+)\)$/);return i?fx(i[1],e):0}},Bq=new Set(["x","y","z"]),jq=id.filter(e=>!Bq.has(e));function Fq(e){const t=[];return jq.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const wu={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:dx(4,13),y:dx(5,14)};wu.translateX=wu.x;wu.translateY=wu.y;const $q=(e,t,n)=>{const r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),{display:a}=i,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=wu[u](r,i)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(s[u]),e[u]=wu[u](l,i)}),e},zq=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(cI);let i=[],a=!1;const s=[];if(o.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],f=ac(c);const d=t[l];let h;if(Yp(d)){const p=d.length,m=d[0]===null?1:0;c=d[m],f=ac(c);for(let _=m;_=0?window.pageYOffset:null,u=$q(t,e,s);return i.length&&i.forEach(([c,f])=>{e.getValue(c).set(f)}),e.render(),tm&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function Uq(e,t,n,r){return Nq(t)?zq(e,t,n,r):{target:t,transitionEnd:r}}const Vq=(e,t,n,r)=>{const o=Dq(e,t,r);return t=o.target,r=o.transitionEnd,Uq(e,t,n,r)},x2={current:null},fI={current:!1};function Hq(){if(fI.current=!0,!!tm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>x2.current=e.matches;e.addListener(t),t()}else x2.current=!1}function Wq(e,t,n){const{willChange:r}=t;for(const o in t){const i=t[o],a=n[o];if(Ar(i))e.addValue(o,i),e1(r)&&r.add(o);else if(Ar(a))e.addValue(o,vu(i,{owner:e})),e1(r)&&r.remove(o);else if(a!==i)if(e.hasValue(o)){const s=e.getValue(o);!s.hasAnimated&&s.set(i)}else{const s=e.getStaticValue(o);e.addValue(o,vu(s!==void 0?s:i,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const hx=new WeakMap,dI=Object.keys(Rf),Gq=dI.length,px=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Kq=Jb.length;class Xq{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Tt.render(this.render,!1,!0);const{latestValues:s,renderState:l}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.isControllingVariants=rm(n),this.isVariantNode=YP(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const f in c){const d=c[f];s[f]!==void 0&&Ar(d)&&(d.set(s[f],!1),e1(u)&&u.add(f))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,hx.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),fI.current||Hq(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:x2.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){hx.delete(this.current),this.projection&&this.projection.unmount(),Bi(this.notifyUpdate),Bi(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Gs.has(t),o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Tt.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,o,i){let a,s;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:i,layoutScroll:d,layoutRoot:h})}return s}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):nn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=vu(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,o=typeof r=="string"||typeof r=="object"?(n=lS(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&o!==void 0)return o;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ar(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new gS),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class hI extends Xq{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:o},i){let a=dX(r,t||{},this);if(o&&(n&&(n=o(n)),r&&(r=o(r)),a&&(a=o(a))),i){cX(this,r,a);const s=Vq(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function qq(e){return window.getComputedStyle(e)}class Yq extends hI{readValueFromInstance(t,n){if(Gs.has(n)){const r=hS(n);return r&&r.default||0}else{const r=qq(t),o=(eT(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return eI(t,n)}build(t,n,r,o){nS(t,n,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,n){return sS(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ar(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,o){aT(t,n,r,o)}}class Zq extends hI{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Gs.has(n)){const r=hS(n);return r&&r.default||0}return n=sT.has(n)?n:aS(n),t.getAttribute(n)}measureInstanceViewportBox(){return nn()}scrapeMotionValuesFromProps(t,n){return uT(t,n)}build(t,n,r,o){oS(t,n,r,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,r,o){lT(t,n,r,o)}mount(t){this.isSVGTag=iS(t.tagName),super.mount(t)}}const Qq=(e,t)=>tS(e)?new Zq(t,{enableHardwareAcceleration:!1}):new Yq(t,{enableHardwareAcceleration:!0}),Jq={layout:{ProjectionNode:uI,MeasureLayout:nI}},eY={...OX,...WG,...Rq,...Jq},Ui=eG((e,t)=>TG(e,t,eY,Qq));function pI(){const e=P.useRef(!1);return Kp(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function tY(){const e=pI(),[t,n]=P.useState(0),r=P.useCallback(()=>{e.current&&n(t+1)},[t]);return[P.useCallback(()=>Tt.postRender(r),[r]),t]}class nY extends P.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function rY({children:e,isPresent:t}){const n=P.useId(),r=P.useRef(null),o=P.useRef({width:0,height:0,top:0,left:0});return P.useInsertionEffect(()=>{const{width:i,height:a,top:s,left:l}=o.current;if(t||!r.current||!i||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` + [data-motion-pop-id="${n}"] { + position: absolute !important; + width: ${i}px !important; + height: ${a}px !important; + top: ${s}px !important; + left: ${l}px !important; + } + `),()=>{document.head.removeChild(u)}},[t]),P.createElement(nY,{isPresent:t,childRef:r,sizeRef:o},P.cloneElement(e,{ref:r}))}const Jy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a})=>{const s=cT(oY),l=P.useId(),u=P.useMemo(()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:c=>{s.set(c,!0);for(const f of s.values())if(!f)return;r&&r()},register:c=>(s.set(c,!1),()=>s.delete(c))}),i?void 0:[n]);return P.useMemo(()=>{s.forEach((c,f)=>s.set(f,!1))},[n]),P.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=P.createElement(rY,{isPresent:n},e)),P.createElement(od.Provider,{value:u},e)};function oY(){return new Map}function iY(e){return P.useEffect(()=>()=>e(),[])}const hl=e=>e.key||"";function aY(e,t){e.forEach(n=>{const r=hl(n);t.set(r,n)})}function sY(e){const t=[];return P.Children.forEach(e,n=>{P.isValidElement(n)&&t.push(n)}),t}const Nu=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:a="sync"})=>{const s=P.useContext(eS).forceRender||tY()[0],l=pI(),u=sY(e);let c=u;const f=P.useRef(new Map).current,d=P.useRef(c),h=P.useRef(new Map).current,p=P.useRef(!0);if(Kp(()=>{p.current=!1,aY(u,h),d.current=c}),iY(()=>{p.current=!0,h.clear(),f.clear()}),p.current)return P.createElement(P.Fragment,null,c.map(g=>P.createElement(Jy,{key:hl(g),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:i,mode:a},g)));c=[...c];const m=d.current.map(hl),_=u.map(hl),b=m.length;for(let g=0;g{if(_.indexOf(E)!==-1)return;const T=h.get(E);if(!T)return;const O=m.indexOf(E);let A=g;if(!A){const C=()=>{h.delete(E),f.delete(E);const y=d.current.findIndex(S=>S.key===E);if(d.current.splice(y,1),!f.size){if(d.current=u,l.current===!1)return;s(),r&&r()}};A=P.createElement(Jy,{key:hl(T),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:i,mode:a},T),f.set(E,A)}c.splice(O,0,A)}),c=c.map(g=>{const E=g.key;return f.has(E)?g:P.createElement(Jy,{key:hl(g),isPresent:!0,presenceAffectsLayout:i,mode:a},g)}),P.createElement(P.Fragment,null,f.size?c:c.map(g=>P.cloneElement(g)))};var lY={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},mI=P.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:o,requestClose:i=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=lY,toastSpacing:c="0.5rem"}=e,[f,d]=P.useState(s),h=XX();Bs(()=>{h||r==null||r()},[h]),Bs(()=>{d(s)},[s]);const p=()=>d(null),m=()=>d(s),_=()=>{h&&o()};P.useEffect(()=>{h&&i&&o()},[h,i,o]),WW(_,f);const b=P.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),g=P.useMemo(()=>VW(a),[a]);return w.jsx(Ui.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:p,onHoverEnd:m,custom:{position:a},style:g,children:w.jsx(ne.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:po(n,{id:t,onClose:_})})})});mI.displayName="ToastComponent";function uY(e,t){var n;const r=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=i==null?void 0:i[t])!=null?n:r}var mx={path:w.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[w.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),w.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),w.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Ge=de((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:i=!1,children:a,className:s,__css:l,...u}=e,c=_e("chakra-icon",s),f=Eo("Icon",e),d={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...l,...f},h={ref:t,focusable:i,className:c,__css:d},p=r??mx.viewBox;if(n&&typeof n!="string")return w.jsx(ne.svg,{as:n,...h,...u});const m=a??mx.path;return w.jsx(ne.svg,{verticalAlign:"middle",viewBox:p,...h,...u,children:m})});Ge.displayName="Icon";function cY(e){return w.jsx(Ge,{viewBox:"0 0 24 24",...e,children:w.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function fY(e){return w.jsx(Ge,{viewBox:"0 0 24 24",...e,children:w.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function yx(e){return w.jsx(Ge,{viewBox:"0 0 24 24",...e,children:w.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var dY=hi({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),sm=de((e,t)=>{const n=Eo("Spinner",e),{label:r="Loading...",thickness:o="2px",speed:i="0.45s",emptyColor:a="transparent",className:s,...l}=Rt(e),u=_e("chakra-spinner",s),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:o,borderBottomColor:a,borderLeftColor:a,animation:`${dY} ${i} linear infinite`,...n};return w.jsx(ne.div,{ref:t,__css:c,className:u,...l,children:r&&w.jsx(ne.span,{srOnly:!0,children:r})})});sm.displayName="Spinner";var[hY,vS]=tn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[pY,wS]=tn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),yI={info:{icon:fY,colorScheme:"blue"},warning:{icon:yx,colorScheme:"orange"},success:{icon:cY,colorScheme:"green"},error:{icon:yx,colorScheme:"red"},loading:{icon:sm,colorScheme:"blue"}};function mY(e){return yI[e].colorScheme}function yY(e){return yI[e].icon}var gI=de(function(t,n){const r=wS(),{status:o}=vS(),i={display:"inline",...r.description};return w.jsx(ne.div,{ref:n,"data-status":o,...t,className:_e("chakra-alert__desc",t.className),__css:i})});gI.displayName="AlertDescription";function vI(e){const{status:t}=vS(),n=yY(t),r=wS(),o=t==="loading"?r.spinner:r.icon;return w.jsx(ne.span,{display:"inherit","data-status":t,...e,className:_e("chakra-alert__icon",e.className),__css:o,children:e.children||w.jsx(n,{h:"100%",w:"100%"})})}vI.displayName="AlertIcon";var wI=de(function(t,n){const r=wS(),{status:o}=vS();return w.jsx(ne.div,{ref:n,"data-status":o,...t,className:_e("chakra-alert__title",t.className),__css:r.title})});wI.displayName="AlertTitle";var bI=de(function(t,n){var r;const{status:o="info",addRole:i=!0,...a}=Rt(t),s=(r=t.colorScheme)!=null?r:mY(o),l=Pr("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return w.jsx(hY,{value:{status:o},children:w.jsx(pY,{value:l,children:w.jsx(ne.div,{"data-status":o,role:i?"alert":void 0,ref:n,...a,className:_e("chakra-alert",t.className),__css:u})})})});bI.displayName="Alert";function gY(e){return w.jsx(Ge,{focusable:"false","aria-hidden":!0,...e,children:w.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var lm=de(function(t,n){const r=Eo("CloseButton",t),{children:o,isDisabled:i,__css:a,...s}=Rt(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return w.jsx(ne.button,{type:"button","aria-label":"Close",ref:n,disabled:i,__css:{...l,...r,...a},...s,children:o||w.jsx(gY,{width:"1em",height:"1em"})})});lm.displayName="CloseButton";var vY={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},ti=wY(vY);function wY(e){let t=e;const n=new Set,r=o=>{t=o(t),n.forEach(i=>i())};return{getState:()=>t,subscribe:o=>(n.add(o),()=>{r(()=>e),n.delete(o)}),removeToast:(o,i)=>{r(a=>({...a,[i]:a[i].filter(s=>s.id!=o)}))},notify:(o,i)=>{const a=bY(o,i),{position:s,id:l}=a;return r(u=>{var c,f;const h=s.includes("top")?[a,...(c=u[s])!=null?c:[]]:[...(f=u[s])!=null?f:[],a];return{...u,[s]:h}}),l},update:(o,i)=>{o&&r(a=>{const s={...a},{position:l,index:u}=f3(s,o);return l&&u!==-1&&(s[l][u]={...s[l][u],...i,message:SI(i)}),s})},closeAll:({positions:o}={})=>{r(i=>(o??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=i[u].map(c=>({...c,requestClose:!0})),l),{...i}))},close:o=>{r(i=>{const a=KP(i,o);return a?{...i,[a]:i[a].map(s=>s.id==o?{...s,requestClose:!0}:s)}:i})},isActive:o=>!!f3(ti.getState(),o).position}}var gx=0;function bY(e,t={}){var n,r;gx+=1;const o=(n=t.id)!=null?n:gx,i=(r=t.position)!=null?r:"bottom";return{id:o,message:e,position:i,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>ti.removeToast(String(o),i),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var SY=e=>{const{status:t,variant:n="solid",id:r,title:o,isClosable:i,onClose:a,description:s,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return w.jsxs(bI,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[w.jsx(vI,{children:u}),w.jsxs(ne.div,{flex:"1",maxWidth:"100%",children:[o&&w.jsx(wI,{id:c==null?void 0:c.title,children:o}),s&&w.jsx(gI,{id:c==null?void 0:c.description,display:"block",children:s})]}),i&&w.jsx(lm,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function SI(e={}){const{render:t,toastComponent:n=SY}=e;return o=>typeof t=="function"?t({...o,...e}):w.jsx(n,{...o,...e})}function _Y(e,t){const n=o=>{var i;return{...t,...o,position:uY((i=o==null?void 0:o.position)!=null?i:t==null?void 0:t.position,e)}},r=o=>{const i=n(o),a=SI(i);return ti.notify(a,i)};return r.update=(o,i)=>{ti.update(o,n(i))},r.promise=(o,i)=>{const a=r({...i.loading,status:"loading",duration:null});o.then(s=>r.update(a,{status:"success",duration:5e3,...po(i.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...po(i.error,s)}))},r.closeAll=ti.closeAll,r.close=ti.close,r.isActive=ti.isActive,r}var[EY,CY]=tn({name:"ToastOptionsContext",strict:!1}),xY=e=>{const t=P.useSyncExternalStore(ti.subscribe,ti.getState,ti.getState),{motionVariants:n,component:r=mI,portalProps:o}=e,a=Object.keys(t).map(s=>{const l=t[s];return w.jsx("div",{role:"region","aria-live":"polite","aria-label":"Notifications",id:`chakra-toast-manager-${s}`,style:HW(s),children:w.jsx(Nu,{initial:!1,children:l.map(u=>w.jsx(r,{motionVariants:n,...u},u.id))})},s)});return w.jsx(Lu,{...o,children:a})};function Vi(e){const{theme:t}=yP(),n=CY();return P.useMemo(()=>_Y(t.direction,{...n,...e}),[e,t.direction,n])}var OY=e=>function({children:n,theme:r=e,toastOptions:o,...i}){return w.jsxs(zW,{theme:r,...i,children:[w.jsx(EY,{value:o==null?void 0:o.defaultOptions,children:n}),w.jsx(xY,{...o})]})},AY=OY(BP),PY=Object.defineProperty,TY=(e,t,n)=>t in e?PY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ut=(e,t,n)=>(TY(e,typeof t!="symbol"?t+"":t,n),n);function vx(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var IY=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function wx(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function bx(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var O2=typeof window<"u"?P.useLayoutEffect:P.useEffect,n1=e=>e,RY=class{constructor(){Ut(this,"descendants",new Map),Ut(this,"register",e=>{if(e!=null)return IY(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),Ut(this,"unregister",e=>{this.descendants.delete(e);const t=vx(Array.from(this.descendants.keys()));this.assignIndex(t)}),Ut(this,"destroy",()=>{this.descendants.clear()}),Ut(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),Ut(this,"count",()=>this.descendants.size),Ut(this,"enabledCount",()=>this.enabledValues().length),Ut(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),Ut(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),Ut(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),Ut(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),Ut(this,"first",()=>this.item(0)),Ut(this,"firstEnabled",()=>this.enabledItem(0)),Ut(this,"last",()=>this.item(this.descendants.size-1)),Ut(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),Ut(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),Ut(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),Ut(this,"next",(e,t=!0)=>{const n=wx(e,this.count(),t);return this.item(n)}),Ut(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=wx(r,this.enabledCount(),t);return this.enabledItem(o)}),Ut(this,"prev",(e,t=!0)=>{const n=bx(e,this.count()-1,t);return this.item(n)}),Ut(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=bx(r,this.enabledCount()-1,t);return this.enabledItem(o)}),Ut(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=vx(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function kY(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Jt(...e){return t=>{e.forEach(n=>{kY(n,t)})}}function MY(...e){return P.useMemo(()=>Jt(...e),e)}function DY(){const e=P.useRef(new RY);return O2(()=>()=>e.current.destroy()),e.current}var[LY,_I]=tn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function NY(e){const t=_I(),[n,r]=P.useState(-1),o=P.useRef(null);O2(()=>()=>{o.current&&t.unregister(o.current)},[]),O2(()=>{if(!o.current)return;const a=Number(o.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const i=n1(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Jt(i,o)}}function BY(){return[n1(LY),()=>n1(_I()),()=>DY(),o=>NY(o)]}var Sx={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},xs={enter:{duration:.2,ease:Sx.easeOut},exit:{duration:.1,ease:Sx.easeIn}},Os={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},jY={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Os.enter(xs.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Os.exit(xs.exit,n),transitionEnd:t==null?void 0:t.exit}}},EI={initial:"exit",animate:"enter",exit:"exit",variants:jY},FY=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:i,transition:a,transitionEnd:s,delay:l,...u}=t,c=o||r?"enter":"exit",f=r?o&&r:!0,d={transition:a,transitionEnd:s,delay:l};return w.jsx(Nu,{custom:d,children:f&&w.jsx(Ui.div,{ref:n,className:_e("chakra-fade",i),custom:d,...EI,animate:c,...u})})});FY.displayName="Fade";var $Y={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(i=n==null?void 0:n.exit)!=null?i:Os.exit(xs.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Os.enter(xs.enter,n),transitionEnd:e==null?void 0:e.enter}}},CI={initial:"exit",animate:"enter",exit:"exit",variants:$Y},zY=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:c,...f}=t,d=r?o&&r:!0,h=o||r?"enter":"exit",p={initialScale:a,reverse:i,transition:l,transitionEnd:u,delay:c};return w.jsx(Nu,{custom:p,children:d&&w.jsx(Ui.div,{ref:n,className:_e("chakra-offset-slide",s),...CI,animate:h,custom:p,...f})})});zY.displayName="ScaleFade";var UY={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,x:e,y:t,transition:(i=n==null?void 0:n.exit)!=null?i:Os.exit(xs.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Os.enter(xs.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:i})=>{var a;const s={x:t,y:e};return{opacity:0,transition:(a=n==null?void 0:n.exit)!=null?a:Os.exit(xs.exit,i),...o?{...s,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...s,...r==null?void 0:r.exit}}}}},A2={initial:"initial",animate:"enter",exit:"exit",variants:UY},VY=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:c,delay:f,...d}=t,h=r?o&&r:!0,p=o||r?"enter":"exit",m={offsetX:s,offsetY:l,reverse:i,transition:u,transitionEnd:c,delay:f};return w.jsx(Nu,{custom:m,children:h&&w.jsx(Ui.div,{ref:n,className:_e("chakra-offset-slide",a),custom:m,...A2,animate:p,...d})})});VY.displayName="SlideFade";var[HY,WY]=tn({name:"AvatarStylesContext",hookName:"useAvatarStyles",providerName:""});function GY(e){var t;const n=e.split(" "),r=(t=n[0])!=null?t:"",o=n.length>1?n[n.length-1]:"";return r&&o?`${r.charAt(0)}${o.charAt(0)}`:r.charAt(0)}function xI(e){const{name:t,getInitials:n,...r}=e,o=WY();return w.jsx(ne.div,{role:"img","aria-label":t,...r,__css:o.label,children:t?n==null?void 0:n(t):null})}xI.displayName="AvatarName";var OI=e=>w.jsxs(ne.svg,{viewBox:"0 0 128 128",color:"#fff",width:"100%",height:"100%",className:"chakra-avatar__svg",...e,children:[w.jsx("path",{fill:"currentColor",d:"M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"}),w.jsx("path",{fill:"currentColor",d:"M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"})]}),P2=de(function(t,n){const{htmlWidth:r,htmlHeight:o,alt:i,...a}=t;return w.jsx("img",{width:r,height:o,ref:n,alt:i,...a})});P2.displayName="NativeImage";function AI(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:i,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,c]=P.useState("pending");P.useEffect(()=>{c(n?"loading":"pending")},[n]);const f=P.useRef(),d=P.useCallback(()=>{if(!n)return;h();const p=new Image;p.src=n,a&&(p.crossOrigin=a),r&&(p.srcset=r),s&&(p.sizes=s),t&&(p.loading=t),p.onload=m=>{h(),c("loaded"),o==null||o(m)},p.onerror=m=>{h(),c("failed"),i==null||i(m)},f.current=p},[n,a,r,s,o,i,t]),h=()=>{f.current&&(f.current.onload=null,f.current.onerror=null,f.current=null)};return ai(()=>{if(!l)return u==="loading"&&d(),()=>{h()}},[u,d,l]),l?"loaded":u}var KY=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function XY(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Bu=de(function(t,n){const{fallbackSrc:r,fallback:o,src:i,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:c,crossOrigin:f,fallbackStrategy:d="beforeLoadOrError",referrerPolicy:h,...p}=t,m=r!==void 0||o!==void 0,_=u!=null||c||!m,b=AI({...t,crossOrigin:f,ignoreFallback:_}),g=KY(b,d),E={ref:n,objectFit:l,objectPosition:s,..._?p:XY(p,["onError","onLoad"])};return g?o||w.jsx(ne.img,{as:P2,className:"chakra-image__placeholder",src:r,...E}):w.jsx(ne.img,{as:P2,src:i,srcSet:a,crossOrigin:f,loading:u,referrerPolicy:h,className:"chakra-image",...E})});Bu.displayName="Image";function PI(e){const{src:t,srcSet:n,onError:r,onLoad:o,getInitials:i,name:a,borderRadius:s,loading:l,iconLabel:u,icon:c=w.jsx(OI,{}),ignoreFallback:f,referrerPolicy:d,crossOrigin:h}=e,m=AI({src:t,onError:r,crossOrigin:h,ignoreFallback:f})==="loaded";return!t||!m?a?w.jsx(xI,{className:"chakra-avatar__initials",getInitials:i,name:a}):P.cloneElement(c,{role:"img","aria-label":u}):w.jsx(ne.img,{src:t,srcSet:n,alt:a,onLoad:o,referrerPolicy:d,crossOrigin:h??void 0,className:"chakra-avatar__img",loading:l,__css:{width:"100%",height:"100%",objectFit:"cover",borderRadius:s}})}PI.displayName="AvatarImage";var qY={display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",textTransform:"uppercase",fontWeight:"medium",position:"relative",flexShrink:0},r1=de((e,t)=>{const n=Pr("Avatar",e),[r,o]=P.useState(!1),{src:i,srcSet:a,name:s,showBorder:l,borderRadius:u="full",onError:c,onLoad:f,getInitials:d=GY,icon:h=w.jsx(OI,{}),iconLabel:p=" avatar",loading:m,children:_,borderColor:b,ignoreFallback:g,crossOrigin:E,referrerPolicy:T,...O}=Rt(e),A={borderRadius:u,borderWidth:l?"2px":void 0,...qY,...n.container};return b&&(A.borderColor=b),w.jsx(ne.span,{ref:t,...O,className:_e("chakra-avatar",e.className),"data-loaded":Re(r),__css:A,children:w.jsxs(HY,{value:n,children:[w.jsx(PI,{src:i,srcSet:a,loading:m,onLoad:ke(f,()=>{o(!0)}),onError:c,getInitials:d,name:s,borderRadius:u,icon:h,iconLabel:p,ignoreFallback:g,crossOrigin:E,referrerPolicy:T}),_]})})});r1.displayName="Avatar";function TI(e){return P.Children.toArray(e).filter(t=>P.isValidElement(t))}var[YY,ZY]=tn({strict:!1,name:"ButtonGroupContext"}),QY={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},JY={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},ud=de(function(t,n){const{size:r,colorScheme:o,variant:i,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,orientation:c="horizontal",...f}=t,d=_e("chakra-button__group",a),h=P.useMemo(()=>({size:r,colorScheme:o,variant:i,isDisabled:u}),[r,o,i,u]);let p={display:"inline-flex",...l?QY[c]:JY[c](s)};const m=c==="vertical";return w.jsx(YY,{value:h,children:w.jsx(ne.div,{ref:n,role:"group",__css:p,className:d,"data-attached":l?"":void 0,"data-orientation":c,flexDir:m?"column":void 0,...f})})});ud.displayName="ButtonGroup";function eZ(e){const[t,n]=P.useState(!e);return{ref:P.useCallback(i=>{i&&n(i.tagName==="BUTTON")},[]),type:t?"button":void 0}}function T2(e){const{children:t,className:n,...r}=e,o=P.isValidElement(t)?P.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,i=_e("chakra-button__icon",n);return w.jsx(ne.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:i,children:o})}T2.displayName="ButtonIcon";function I2(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=w.jsx(sm,{color:"currentColor",width:"1em",height:"1em"}),className:i,__css:a,...s}=e,l=_e("chakra-button__spinner",i),u=n==="start"?"marginEnd":"marginStart",c=P.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return w.jsx(ne.div,{className:l,...s,__css:c,children:o})}I2.displayName="ButtonSpinner";var be=de((e,t)=>{const n=ZY(),r=Eo("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:i,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:c,iconSpacing:f="0.5rem",type:d,spinner:h,spinnerPlacement:p="start",className:m,as:_,...b}=Rt(e),g=P.useMemo(()=>{const A={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:A}}},[r,n]),{ref:E,type:T}=eZ(_),O={rightIcon:u,leftIcon:l,iconSpacing:f,children:s};return w.jsxs(ne.button,{ref:MY(t,E),as:_,type:d??T,"data-active":Re(a),"data-loading":Re(i),__css:g,className:_e("chakra-button",m),...b,disabled:o||i,children:[i&&p==="start"&&w.jsx(I2,{className:"chakra-button__spinner--start",label:c,placement:"start",spacing:f,children:h}),i?c||w.jsx(ne.span,{opacity:0,children:w.jsx(_x,{...O})}):w.jsx(_x,{...O}),i&&p==="end"&&w.jsx(I2,{className:"chakra-button__spinner--end",label:c,placement:"end",spacing:f,children:h})]})});be.displayName="Button";function _x(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return w.jsxs(w.Fragment,{children:[t&&w.jsx(T2,{marginEnd:o,children:t}),r,n&&w.jsx(T2,{marginStart:o,children:n})]})}var um=de((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":i,...a}=e,s=n||r,l=P.isValidElement(s)?P.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return w.jsx(be,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i,...a,children:l})});um.displayName="IconButton";var[tZ,bS]=jW("Card"),nZ=de(function(t,n){const{className:r,...o}=t,i=bS();return w.jsx(ne.div,{ref:n,className:_e("chakra-card__body",r),__css:i.body,...o})}),rZ=de(function(t,n){const{className:r,justify:o,...i}=t,a=bS();return w.jsx(ne.div,{ref:n,className:_e("chakra-card__footer",r),__css:{display:"flex",justifyContent:o,...a.footer},...i})}),oZ=de(function(t,n){const{className:r,...o}=t,i=bS();return w.jsx(ne.div,{ref:n,className:_e("chakra-card__header",r),__css:i.header,...o})}),iZ=de(function(t,n){const{className:r,children:o,direction:i="column",justify:a,align:s,...l}=Rt(t),u=Pr("Card",t);return w.jsx(ne.div,{ref:n,className:_e("chakra-card",r),__css:{display:"flex",flexDirection:i,justifyContent:a,alignItems:s,position:"relative",minWidth:0,wordWrap:"break-word",...u.container},...l,children:w.jsx(tZ,{value:u,children:o})})}),[Nye,aZ]=tn({name:"CheckboxGroupContext",strict:!1});function sZ(e){const[t,n]=P.useState(e),[r,o]=P.useState(!1);return e!==t&&(o(!0),n(e)),r}function lZ(e){return w.jsx(ne.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:w.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function uZ(e){return w.jsx(ne.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:w.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function cZ(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?uZ:lZ;return n||t?w.jsx(ne.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:w.jsx(o,{...r})}):null}var[fZ,II]=tn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[dZ,cd]=tn({strict:!1,name:"FormControlContext"});function hZ(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:i,...a}=e,s=P.useId(),l=t||`field-${s}`,u=`${l}-label`,c=`${l}-feedback`,f=`${l}-helptext`,[d,h]=P.useState(!1),[p,m]=P.useState(!1),[_,b]=P.useState(!1),g=P.useCallback((C={},y=null)=>({id:f,...C,ref:Jt(y,S=>{S&&m(!0)})}),[f]),E=P.useCallback((C={},y=null)=>({...C,ref:y,"data-focus":Re(_),"data-disabled":Re(o),"data-invalid":Re(r),"data-readonly":Re(i),id:C.id!==void 0?C.id:u,htmlFor:C.htmlFor!==void 0?C.htmlFor:l}),[l,o,_,r,i,u]),T=P.useCallback((C={},y=null)=>({id:c,...C,ref:Jt(y,S=>{S&&h(!0)}),"aria-live":"polite"}),[c]),O=P.useCallback((C={},y=null)=>({...C,...a,ref:y,role:"group"}),[a]),A=P.useCallback((C={},y=null)=>({...C,ref:y,role:"presentation","aria-hidden":!0,children:C.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!_,onFocus:()=>b(!0),onBlur:()=>b(!1),hasFeedbackText:d,setHasFeedbackText:h,hasHelpText:p,setHasHelpText:m,id:l,labelId:u,feedbackId:c,helpTextId:f,htmlProps:a,getHelpTextProps:g,getErrorMessageProps:T,getRootProps:O,getLabelProps:E,getRequiredIndicatorProps:A}}var Jn=de(function(t,n){const r=Pr("Form",t),o=Rt(t),{getRootProps:i,htmlProps:a,...s}=hZ(o),l=_e("chakra-form-control",t.className);return w.jsx(dZ,{value:s,children:w.jsx(fZ,{value:r,children:w.jsx(ne.div,{...i({},n),className:l,__css:r.container})})})});Jn.displayName="FormControl";var rs=de(function(t,n){const r=cd(),o=II(),i=_e("chakra-form__helper-text",t.className);return w.jsx(ne.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:i})});rs.displayName="FormHelperText";var In=de(function(t,n){var r;const o=Eo("FormLabel",t),i=Rt(t),{className:a,children:s,requiredIndicator:l=w.jsx(RI,{}),optionalIndicator:u=null,...c}=i,f=cd(),d=(r=f==null?void 0:f.getLabelProps(c,n))!=null?r:{ref:n,...c};return w.jsxs(ne.label,{...d,className:_e("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...o},children:[s,f!=null&&f.isRequired?l:u]})});In.displayName="FormLabel";var RI=de(function(t,n){const r=cd(),o=II();if(!(r!=null&&r.isRequired))return null;const i=_e("chakra-form__required-indicator",t.className);return w.jsx(ne.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:i})});RI.displayName="RequiredIndicator";function kI(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...i}=MI(e);return{...i,disabled:t,readOnly:r,required:o,"aria-invalid":Yl(n),"aria-required":Yl(o),"aria-readonly":Yl(r)}}function MI(e){var t,n,r;const o=cd(),{id:i,disabled:a,readOnly:s,required:l,isRequired:u,isInvalid:c,isReadOnly:f,isDisabled:d,onFocus:h,onBlur:p,...m}=e,_=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&_.push(o.feedbackId),o!=null&&o.hasHelpText&&_.push(o.helpTextId),{...m,"aria-describedby":_.join(" ")||void 0,id:i??(o==null?void 0:o.id),isDisabled:(t=a??d)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=s??f)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=l??u)!=null?r:o==null?void 0:o.isRequired,isInvalid:c??(o==null?void 0:o.isInvalid),onFocus:ke(o==null?void 0:o.onFocus,h),onBlur:ke(o==null?void 0:o.onBlur,p)}}var pZ={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};const mZ=()=>typeof document<"u";let Ex=!1,fd=null,js=!1,R2=!1;const k2=new Set;function SS(e,t){k2.forEach(n=>n(e,t))}const yZ=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function gZ(e){return!(e.metaKey||!yZ&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Cx(e){js=!0,gZ(e)&&(fd="keyboard",SS("keyboard",e))}function il(e){if(fd="pointer",e.type==="mousedown"||e.type==="pointerdown"){js=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;SS("pointer",e)}}function vZ(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function wZ(e){vZ(e)&&(js=!0,fd="virtual")}function bZ(e){e.target===window||e.target===document||(!js&&!R2&&(fd="virtual",SS("virtual",e)),js=!1,R2=!1)}function SZ(){js=!1,R2=!0}function xx(){return fd!=="pointer"}function _Z(){if(!mZ()||Ex)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){js=!0,e.apply(this,n)},document.addEventListener("keydown",Cx,!0),document.addEventListener("keyup",Cx,!0),document.addEventListener("click",wZ,!0),window.addEventListener("focus",bZ,!0),window.addEventListener("blur",SZ,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",il,!0),document.addEventListener("pointermove",il,!0),document.addEventListener("pointerup",il,!0)):(document.addEventListener("mousedown",il,!0),document.addEventListener("mousemove",il,!0),document.addEventListener("mouseup",il,!0)),Ex=!0}function DI(e){_Z(),e(xx());const t=()=>e(xx());return k2.add(t),()=>{k2.delete(t)}}function EZ(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function LI(e={}){const t=MI(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:i,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:c,isChecked:f,isFocusable:d,onChange:h,isIndeterminate:p,name:m,value:_,tabIndex:b=void 0,"aria-label":g,"aria-labelledby":E,"aria-invalid":T,...O}=e,A=EZ(O,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),C=Ea(h),y=Ea(s),S=Ea(l),[v,x]=P.useState(!1),[I,R]=P.useState(!1),[k,M]=P.useState(!1),[N,D]=P.useState(!1);P.useEffect(()=>DI(x),[]);const L=P.useRef(null),[j,F]=P.useState(!0),[B,U]=P.useState(!!c),K=f!==void 0,W=K?f:B,Q=P.useCallback(ie=>{if(r||n){ie.preventDefault();return}K||U(W?ie.target.checked:p?!0:ie.target.checked),C==null||C(ie)},[r,n,W,K,p,C]);ai(()=>{L.current&&(L.current.indeterminate=!!p)},[p]),Bs(()=>{n&&R(!1)},[n,R]),ai(()=>{const ie=L.current;if(!(ie!=null&&ie.form))return;const Ce=()=>{U(!!c)};return ie.form.addEventListener("reset",Ce),()=>{var Ne;return(Ne=ie.form)==null?void 0:Ne.removeEventListener("reset",Ce)}},[]);const X=n&&!d,J=P.useCallback(ie=>{ie.key===" "&&D(!0)},[D]),te=P.useCallback(ie=>{ie.key===" "&&D(!1)},[D]);ai(()=>{if(!L.current)return;L.current.checked!==W&&U(L.current.checked)},[L.current]);const le=P.useCallback((ie={},Ce=null)=>{const Ne=ze=>{I&&ze.preventDefault(),D(!0)};return{...ie,ref:Ce,"data-active":Re(N),"data-hover":Re(k),"data-checked":Re(W),"data-focus":Re(I),"data-focus-visible":Re(I&&v),"data-indeterminate":Re(p),"data-disabled":Re(n),"data-invalid":Re(i),"data-readonly":Re(r),"aria-hidden":!0,onMouseDown:ke(ie.onMouseDown,Ne),onMouseUp:ke(ie.onMouseUp,()=>D(!1)),onMouseEnter:ke(ie.onMouseEnter,()=>M(!0)),onMouseLeave:ke(ie.onMouseLeave,()=>M(!1))}},[N,W,n,I,v,k,p,i,r]),ge=P.useCallback((ie={},Ce=null)=>({...ie,ref:Ce,"data-active":Re(N),"data-hover":Re(k),"data-checked":Re(W),"data-focus":Re(I),"data-focus-visible":Re(I&&v),"data-indeterminate":Re(p),"data-disabled":Re(n),"data-invalid":Re(i),"data-readonly":Re(r)}),[N,W,n,I,v,k,p,i,r]),se=P.useCallback((ie={},Ce=null)=>({...A,...ie,ref:Jt(Ce,Ne=>{Ne&&F(Ne.tagName==="LABEL")}),onClick:ke(ie.onClick,()=>{var Ne;j||((Ne=L.current)==null||Ne.click(),requestAnimationFrame(()=>{var ze;(ze=L.current)==null||ze.focus({preventScroll:!0})}))}),"data-disabled":Re(n),"data-checked":Re(W),"data-invalid":Re(i)}),[A,n,W,i,j]),ue=P.useCallback((ie={},Ce=null)=>({...ie,ref:Jt(L,Ce),type:"checkbox",name:m,value:_,id:a,tabIndex:b,onChange:ke(ie.onChange,Q),onBlur:ke(ie.onBlur,y,()=>R(!1)),onFocus:ke(ie.onFocus,S,()=>R(!0)),onKeyDown:ke(ie.onKeyDown,J),onKeyUp:ke(ie.onKeyUp,te),required:o,checked:W,disabled:X,readOnly:r,"aria-label":g,"aria-labelledby":E,"aria-invalid":T?!!T:i,"aria-describedby":u,"aria-disabled":n,style:pZ}),[m,_,a,Q,y,S,J,te,o,W,X,r,g,E,T,i,u,n,b]),Ie=P.useCallback((ie={},Ce=null)=>({...ie,ref:Ce,onMouseDown:ke(ie.onMouseDown,CZ),"data-disabled":Re(n),"data-checked":Re(W),"data-invalid":Re(i)}),[W,n,i]);return{state:{isInvalid:i,isFocused:I,isChecked:W,isActive:N,isHovered:k,isIndeterminate:p,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:se,getCheckboxProps:le,getIndicatorProps:ge,getInputProps:ue,getLabelProps:Ie,htmlProps:A}}function CZ(e){e.preventDefault(),e.stopPropagation()}var xZ={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},OZ={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},AZ=hi({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),PZ=hi({from:{opacity:0},to:{opacity:1}}),TZ=hi({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),NI=de(function(t,n){const r=aZ(),o={...r,...t},i=Pr("Checkbox",o),a=Rt(t),{spacing:s="0.5rem",className:l,children:u,iconColor:c,iconSize:f,icon:d=w.jsx(cZ,{}),isChecked:h,isDisabled:p=r==null?void 0:r.isDisabled,onChange:m,inputProps:_,...b}=a;let g=h;r!=null&&r.value&&a.value&&(g=r.value.includes(a.value));let E=m;r!=null&&r.onChange&&a.value&&(E=q0(r.onChange,m));const{state:T,getInputProps:O,getCheckboxProps:A,getLabelProps:C,getRootProps:y}=LI({...b,isDisabled:p,isChecked:g,onChange:E}),S=sZ(T.isChecked),v=P.useMemo(()=>({animation:S?T.isIndeterminate?`${PZ} 20ms linear, ${TZ} 200ms linear`:`${AZ} 200ms linear`:void 0,fontSize:f,color:c,...i.icon}),[c,f,S,T.isIndeterminate,i.icon]),x=P.cloneElement(d,{__css:v,isIndeterminate:T.isIndeterminate,isChecked:T.isChecked});return w.jsxs(ne.label,{__css:{...OZ,...i.container},className:_e("chakra-checkbox",l),...y(),children:[w.jsx("input",{className:"chakra-checkbox__input",...O(_,n)}),w.jsx(ne.span,{__css:{...xZ,...i.control},className:"chakra-checkbox__control",...A(),children:x}),u&&w.jsx(ne.span,{className:"chakra-checkbox__label",...C(),__css:{marginStart:s,...i.label},children:u})]})});NI.displayName="Checkbox";function tu(e,t,n,r){const o=Ea(n);return P.useEffect(()=>{const i=typeof e=="function"?e():e??document;if(!(!n||!i))return i.addEventListener(t,o,r),()=>{i.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const i=typeof e=="function"?e():e??document;i==null||i.removeEventListener(t,o,r)}}function IZ(e){return"current"in e}var BI=()=>typeof window<"u";function RZ(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var kZ=e=>BI()&&e.test(navigator.vendor),MZ=e=>BI()&&e.test(RZ()),DZ=()=>MZ(/mac|iphone|ipad|ipod/i),LZ=()=>DZ()&&kZ(/apple/i);function NZ(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var i,a;return(a=(i=t.current)==null?void 0:i.ownerDocument)!=null?a:document};tu(o,"pointerdown",i=>{if(!LZ()||!r)return;const a=i.target,l=(n??[t]).some(u=>{const c=IZ(u)?u.current:u;return(c==null?void 0:c.contains(a))||c===a});o().activeElement!==a&&l&&(i.preventDefault(),a.focus())})}function BZ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var jI={exports:{}},jZ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",FZ=jZ,$Z=FZ;function FI(){}function $I(){}$I.resetWarningCache=FI;var zZ=function(){function e(r,o,i,a,s,l){if(l!==$Z){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:$I,resetWarningCache:FI};return n.PropTypes=n,n};jI.exports=zZ();var UZ=jI.exports,M2="data-focus-lock",zI="data-focus-lock-disabled",VZ="data-no-focus-lock",HZ="data-autofocus-inside",WZ="data-no-autofocus";function GZ(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function KZ(e,t){var n=P.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function UI(e,t){return KZ(t||null,function(n){return e.forEach(function(r){return GZ(r,n)})})}var eg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},ni=function(){return ni=Object.assign||function(t){for(var n,r=1,o=arguments.length;r=0}).sort(fQ)},dQ=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],xS=dQ.join(","),hQ="".concat(xS,", [data-focus-guard]"),a5=function(e,t){return pi((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?hQ:xS)?[r]:[],a5(r))},[])},pQ=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?cm([e.contentDocument.body],t):[e]},cm=function(e,t){return e.reduce(function(n,r){var o,i=a5(r,t),a=(o=[]).concat.apply(o,i.map(function(s){return pQ(s,t)}));return n.concat(a,r.parentNode?pi(r.parentNode.querySelectorAll(xS)).filter(function(s){return s===r}):[])},[])},mQ=function(e){var t=e.querySelectorAll("[".concat(HZ,"]"));return pi(t).map(function(n){return cm([n])}).reduce(function(n,r){return n.concat(r)},[])},OS=function(e,t){return pi(e).filter(function(n){return e5(t,n)}).filter(function(n){return lQ(n)})},Ox=function(e,t){return t===void 0&&(t=new Map),pi(e).filter(function(n){return t5(t,n)})},L2=function(e,t,n){return i5(OS(cm(e,n),t),!0,n)},Ax=function(e,t){return i5(OS(cm(e),t),!1)},yQ=function(e,t){return OS(mQ(e),t)},nu=function(e,t){return e.shadowRoot?nu(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:pi(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?nu(o,t):!1}return nu(n,t)})},gQ=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},s5=function(e){return e.parentNode?s5(e.parentNode):e},AS=function(e){var t=o1(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(M2);return n.push.apply(n,o?gQ(pi(s5(r).querySelectorAll("[".concat(M2,'="').concat(o,'"]:not([').concat(zI,'="disabled"])')))):[r]),n},[])},vQ=function(e){try{return e()}catch{return}},Df=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Df(t.shadowRoot):t instanceof HTMLIFrameElement&&vQ(function(){return t.contentWindow.document})?Df(t.contentWindow.document):t}},wQ=function(e,t){return e===t},bQ=function(e,t){return!!pi(e.querySelectorAll("iframe")).some(function(n){return wQ(n,t)})},l5=function(e,t){return t===void 0&&(t=Df(ZI(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:AS(e).some(function(n){return nu(n,t)||bQ(n,t)})},SQ=function(e){e===void 0&&(e=document);var t=Df(e);return t?pi(e.querySelectorAll("[".concat(VZ,"]"))).some(function(n){return nu(n,t)}):!1},_Q=function(e,t){return t.filter(o5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},PS=function(e,t){return o5(e)&&e.name?_Q(e,t):e},EQ=function(e){var t=new Set;return e.forEach(function(n){return t.add(PS(n,e))}),e.filter(function(n){return t.has(n)})},Px=function(e){return e[0]&&e.length>1?PS(e[0],e):e[0]},Tx=function(e,t){return e.length>1?e.indexOf(PS(e[t],e)):t},u5="NEW_FOCUS",CQ=function(e,t,n,r){var o=e.length,i=e[0],a=e[o-1],s=CS(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,c=r?e.indexOf(r):-1,f=l-u,d=t.indexOf(i),h=t.indexOf(a),p=EQ(t),m=n!==void 0?p.indexOf(n):-1,_=m-(r?p.indexOf(r):l),b=Tx(e,0),g=Tx(e,o-1);if(l===-1||c===-1)return u5;if(!f&&c>=0)return c;if(l<=d&&s&&Math.abs(f)>1)return g;if(l>=h&&s&&Math.abs(f)>1)return b;if(f&&Math.abs(_)>1)return c;if(l<=d)return g;if(l>h)return b;if(f)return Math.abs(f)>1?c:(o+c+f)%o}},xQ=function(e){return function(t){var n,r=(n=n5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},OQ=function(e,t,n){var r=e.map(function(i){var a=i.node;return a}),o=Ox(r.filter(xQ(n)));return o&&o.length?Px(o):Px(Ox(t))},N2=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&N2(e.parentNode.host||e.parentNode,t),t},tg=function(e,t){for(var n=N2(e),r=N2(t),o=0;o=0)return i}return!1},c5=function(e,t,n){var r=o1(e),o=o1(t),i=r[0],a=!1;return o.filter(Boolean).forEach(function(s){a=tg(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=tg(i,l);u&&(!a||nu(u,a)?a=u:a=tg(u,a))})}),a},AQ=function(e,t){return e.reduce(function(n,r){return n.concat(yQ(r,t))},[])},PQ=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(cQ)},TQ=function(e,t){var n=Df(o1(e).length>0?document:ZI(e).ownerDocument),r=AS(e).filter(i1),o=c5(n||e,e,r),i=new Map,a=Ax(r,i),s=L2(r,i).filter(function(h){var p=h.node;return i1(p)});if(!(!s[0]&&(s=a,!s[0]))){var l=Ax([o],i).map(function(h){var p=h.node;return p}),u=PQ(l,s),c=u.map(function(h){var p=h.node;return p}),f=CQ(c,l,n,t);if(f===u5){var d=OQ(a,c,AQ(r,i));if(d)return{node:d};console.warn("focus-lock: cannot find any node to move focus into");return}return f===void 0?f:u[f]}},IQ=function(e){var t=AS(e).filter(i1),n=c5(e,e,t),r=new Map,o=L2([n],r,!0),i=L2(t,r).filter(function(a){var s=a.node;return i1(s)}).map(function(a){var s=a.node;return s});return o.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:i.indexOf(s)>=0,guard:CS(s)}})},RQ=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},ng=0,rg=!1,f5=function(e,t,n){n===void 0&&(n={});var r=TQ(e,t);if(!rg&&r){if(ng>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),rg=!0,setTimeout(function(){rg=!1},1);return}ng++,RQ(r.node,n.focusOptions),ng--}};function TS(e){setTimeout(e,1)}var kQ=function(){return document&&document.activeElement===document.body},MQ=function(){return kQ()||SQ()},ru=null,jl=null,ou=null,Lf=!1,DQ=function(){return!0},LQ=function(t){return(ru.whiteList||DQ)(t)},NQ=function(t,n){ou={observerNode:t,portaledElement:n}},BQ=function(t){return ou&&ou.portaledElement===t};function Ix(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else if(a.lockItem){if(i!==e)return;o=null}else break}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var jQ=function(t){return t&&"current"in t?t.current:t},FQ=function(t){return t?!!Lf:Lf==="meanwhile"},$Q=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},zQ=function(t,n){return n.some(function(r){return $Q(t,r,r)})},a1=function(){var t=!1;if(ru){var n=ru,r=n.observed,o=n.persistentFocus,i=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||ou&&ou.portaledElement,c=document&&document.activeElement;if(u){var f=[u].concat(a.map(jQ).filter(Boolean));if((!c||LQ(c))&&(o||FQ(s)||!MQ()||!jl&&i)&&(u&&!(l5(f)||c&&zQ(c,f)||BQ(c))&&(document&&!jl&&c&&!i?(c.blur&&c.blur(),document.body.focus()):(t=f5(f,jl,{focusOptions:l}),ou={})),Lf=!1,jl=document&&document.activeElement),document){var d=document&&document.activeElement,h=IQ(f),p=h.map(function(m){var _=m.node;return _}).indexOf(d);p>-1&&(h.filter(function(m){var _=m.guard,b=m.node;return _&&b.dataset.focusAutoGuard}).forEach(function(m){var _=m.node;return _.removeAttribute("tabIndex")}),Ix(p,h.length,1,h),Ix(p,-1,-1,h))}}}return t},d5=function(t){a1()&&t&&(t.stopPropagation(),t.preventDefault())},IS=function(){return TS(a1)},UQ=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||NQ(r,n)},VQ=function(){return null},h5=function(){Lf="just",TS(function(){Lf="meanwhile"})},HQ=function(){document.addEventListener("focusin",d5),document.addEventListener("focusout",IS),window.addEventListener("blur",h5)},WQ=function(){document.removeEventListener("focusin",d5),document.removeEventListener("focusout",IS),window.removeEventListener("blur",h5)};function GQ(e){return e.filter(function(t){var n=t.disabled;return!n})}function KQ(e){var t=e.slice(-1)[0];t&&!ru&&HQ();var n=ru,r=n&&t&&t.id===n.id;ru=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var i=o.id;return i===n.id}).length||n.returnFocus(!t)),t?(jl=null,(!r||n.observed!==t.observed)&&t.onActivation(),a1(),TS(a1)):(WQ(),jl=null)}XI.assignSyncMedium(UQ);qI.assignMedium(IS);YZ.assignMedium(function(e){return e({moveFocusInside:f5,focusInside:l5})});const XQ=rQ(GQ,KQ)(VQ);var p5=P.forwardRef(function(t,n){return P.createElement(YI,Rs({sideCar:XQ,ref:n},t))}),m5=YI.propTypes||{};m5.sideCar;BZ(m5,["sideCar"]);p5.propTypes={};const Rx=p5;function y5(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function RS(e){var t;if(!y5(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function qQ(e){var t,n;return(n=(t=g5(e))==null?void 0:t.defaultView)!=null?n:window}function g5(e){return y5(e)?e.ownerDocument:document}function YQ(e){return g5(e).activeElement}function ZQ(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function QQ(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function v5(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:RS(e)&&ZQ(e)?e:v5(QQ(e))}var w5=e=>e.hasAttribute("tabindex"),JQ=e=>w5(e)&&e.tabIndex===-1;function eJ(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function b5(e){return e.parentElement&&b5(e.parentElement)?!0:e.hidden}function tJ(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function S5(e){if(!RS(e)||b5(e)||eJ(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():tJ(e)?!0:w5(e)}function nJ(e){return e?RS(e)&&S5(e)&&!JQ(e):!1}var rJ=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],oJ=rJ.join(),iJ=e=>e.offsetWidth>0&&e.offsetHeight>0;function _5(e){const t=Array.from(e.querySelectorAll(oJ));return t.unshift(e),t.filter(n=>S5(n)&&iJ(n))}var kx,aJ=(kx=Rx.default)!=null?kx:Rx,E5=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:i,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,c=P.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&_5(r.current).length===0&&requestAnimationFrame(()=>{var p;(p=r.current)==null||p.focus()})},[t,r]),f=P.useCallback(()=>{var h;(h=n==null?void 0:n.current)==null||h.focus()},[n]),d=o&&!n;return w.jsx(aJ,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:c,onDeactivation:f,returnFocus:d,children:i})};E5.displayName="FocusLock";var sJ=fW?P.useLayoutEffect:P.useEffect;function Mx(e,t=[]){const n=P.useRef(e);return sJ(()=>{n.current=e}),P.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function lJ(e,t){const n=P.useId();return P.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function uJ(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Wn(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=Mx(n),a=Mx(t),[s,l]=P.useState(e.defaultIsOpen||!1),[u,c]=uJ(r,s),f=lJ(o,"disclosure"),d=P.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),h=P.useCallback(()=>{u||l(!0),i==null||i()},[u,i]),p=P.useCallback(()=>{(c?d:h)()},[c,h,d]);return{isOpen:!!c,onOpen:h,onClose:d,onToggle:p,isControlled:u,getButtonProps:(m={})=>({...m,"aria-expanded":c,"aria-controls":f,onClick:yW(m.onClick,p)}),getDisclosureProps:(m={})=>({...m,hidden:!c,id:f})}}var[cJ,fJ]=tn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),C5=de(function(t,n){const r=Pr("Input",t),{children:o,className:i,...a}=Rt(t),s=_e("chakra-input__group",i),l={},u=TI(o),c=r.field;u.forEach(d=>{var h,p;r&&(c&&d.type.id==="InputLeftElement"&&(l.paddingStart=(h=c.height)!=null?h:c.h),c&&d.type.id==="InputRightElement"&&(l.paddingEnd=(p=c.height)!=null?p:c.h),d.type.id==="InputRightAddon"&&(l.borderEndRadius=0),d.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const f=u.map(d=>{var h,p;const m=HP({size:((h=d.props)==null?void 0:h.size)||t.size,variant:((p=d.props)==null?void 0:p.variant)||t.variant});return d.type.id!=="Input"?P.cloneElement(d,m):P.cloneElement(d,Object.assign(m,l,d.props))});return w.jsx(ne.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...a,children:w.jsx(cJ,{value:r,children:f})})});C5.displayName="InputGroup";var dJ={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},hJ=ne("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),kS=de(function(t,n){var r;const{placement:o="left",...i}=t,a=(r=dJ[o])!=null?r:{},s=fJ();return w.jsx(hJ,{ref:n,...i,__css:{...s.addon,...a}})});kS.displayName="InputAddon";var MS=de(function(t,n){return w.jsx(kS,{ref:n,placement:"left",...t,className:_e("chakra-input__left-addon",t.className)})});MS.displayName="InputLeftAddon";MS.id="InputLeftAddon";var x5=de(function(t,n){return w.jsx(kS,{ref:n,placement:"right",...t,className:_e("chakra-input__right-addon",t.className)})});x5.displayName="InputRightAddon";x5.id="InputRightAddon";var Ht=de(function(t,n){const{htmlSize:r,...o}=t,i=Pr("Input",o),a=Rt(o),s=kI(a),l=_e("chakra-input",t.className);return w.jsx(ne.input,{size:r,...s,__css:i.field,ref:n,className:l})});Ht.displayName="Input";Ht.id="Input";var vn=de(function(t,n){const r=Eo("Link",t),{className:o,isExternal:i,...a}=Rt(t);return w.jsx(ne.a,{target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:n,className:_e("chakra-link",o),...a,__css:r})});vn.displayName="Link";var ju=de(function(t,n){const{templateAreas:r,gap:o,rowGap:i,columnGap:a,column:s,row:l,autoFlow:u,autoRows:c,templateRows:f,autoColumns:d,templateColumns:h,...p}=t,m={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:i,gridColumnGap:a,gridAutoColumns:d,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:c,gridTemplateRows:f,gridTemplateColumns:h};return w.jsx(ne.div,{ref:n,__css:m,...p})});ju.displayName="Grid";function O5(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):_r(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Xs=ne("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Xs.displayName="Spacer";var me=de(function(t,n){const r=Eo("Text",t),{className:o,align:i,decoration:a,casing:s,...l}=Rt(t),u=HP({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return w.jsx(ne.p,{ref:n,className:_e("chakra-text",t.className),...u,...l,__css:r})});me.displayName="Text";var A5=e=>w.jsx(ne.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});A5.displayName="StackItem";function pJ(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":O5(n,o=>r[o])}}var fm=de((e,t)=>{const{isInline:n,direction:r,align:o,justify:i,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:c,shouldWrapChildren:f,...d}=e,h=n?"row":r??"column",p=P.useMemo(()=>pJ({spacing:a,direction:h}),[a,h]),m=!!u,_=!f&&!m,b=P.useMemo(()=>{const E=TI(l);return _?E:E.map((T,O)=>{const A=typeof T.key<"u"?T.key:O,C=O+1===E.length,S=f?w.jsx(A5,{children:T},A):T;if(!m)return S;const v=P.cloneElement(u,{__css:p}),x=C?null:v;return w.jsxs(P.Fragment,{children:[S,x]},A)})},[u,p,m,_,f,l]),g=_e("chakra-stack",c);return w.jsx(ne.div,{ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:h,flexWrap:s,gap:m?void 0:a,className:g,...d,children:b})});fm.displayName="Stack";var As=de((e,t)=>w.jsx(fm,{align:"center",...e,direction:"column",ref:t}));As.displayName="VStack";var pt=de((e,t)=>w.jsx(fm,{align:"center",...e,direction:"row",ref:t}));pt.displayName="HStack";var jo=de(function(t,n){const r=Eo("Heading",t),{className:o,...i}=Rt(t);return w.jsx(ne.h2,{ref:n,className:_e("chakra-heading",t.className),...i,__css:r})});jo.displayName="Heading";var ve=ne("div");ve.displayName="Box";var P5=de(function(t,n){const{size:r,centerContent:o=!0,...i}=t,a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return w.jsx(ve,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...i})});P5.displayName="Square";var mJ=de(function(t,n){const{size:r,...o}=t;return w.jsx(P5,{size:r,ref:n,borderRadius:"9999px",...o})});mJ.displayName="Circle";var T5=de(function(e,t){const{ratio:n=4/3,children:r,className:o,...i}=e,a=P.Children.only(r),s=_e("chakra-aspect-ratio",o);return w.jsx(ne.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:O5(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...i,children:a})});T5.displayName="AspectRatio";var I5=de(function(t,n){const{className:r,centerContent:o,...i}=Rt(t),a=Eo("Container",t);return w.jsx(ne.div,{ref:n,className:_e("chakra-container",r),...i,__css:{...a,...o&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});I5.displayName="Container";var B2=de(function(t,n){const{direction:r,align:o,justify:i,wrap:a,basis:s,grow:l,shrink:u,...c}=t,f={display:"flex",flexDirection:r,alignItems:o,justifyContent:i,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return w.jsx(ne.div,{ref:n,__css:f,...c})});B2.displayName="Flex";function yJ(e,t={}){const{ssr:n=!0,fallback:r}=t,{getWindow:o}=$W(),i=Array.isArray(e)?e:[e];let a=Array.isArray(r)?r:[r];a=a.filter(u=>u!=null);const[s,l]=P.useState(()=>i.map((u,c)=>({media:u,matches:n?!!a[c]:o().matchMedia(u).matches})));return P.useEffect(()=>{const u=o();l(i.map(d=>({media:d,matches:u.matchMedia(d).matches})));const c=i.map(d=>u.matchMedia(d)),f=d=>{l(h=>h.slice().map(p=>p.media===d.media?{...p,matches:d.matches}:p))};return c.forEach(d=>{typeof d.addListener=="function"?d.addListener(f):d.addEventListener("change",f)}),()=>{c.forEach(d=>{typeof d.removeListener=="function"?d.removeListener(f):d.removeEventListener("change",f)})}},[o]),s.map(u=>u.matches)}function gJ(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function vJ(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=P.useState([]),i=P.useRef(),a=()=>{i.current&&(clearTimeout(i.current),i.current=null)},s=()=>{a(),i.current=setTimeout(()=>{o([]),i.current=null},t)};P.useEffect(()=>a,[]);function l(u){return c=>{if(c.key==="Backspace"){const f=[...r];f.pop(),o(f);return}if(gJ(c)){const f=r.concat(c.key);n(c)&&(c.preventDefault(),c.stopPropagation()),o(f),u(f.join("")),s()}}}return l}function wJ(e,t,n,r){if(t==null)return r;if(!r)return e.find(a=>n(a).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let i;return o.includes(r)?(i=o.indexOf(r)+1,i===o.length&&(i=0),o[i]):(i=e.indexOf(o[0]),e[i])}return r}function bJ(){const e=P.useRef(new Map),t=e.current,n=P.useCallback((o,i,a,s)=>{e.current.set(a,{type:i,el:o,options:s}),o.addEventListener(i,a,s)},[]),r=P.useCallback((o,i,a,s)=>{o.removeEventListener(i,a,s),e.current.delete(a)},[]);return P.useEffect(()=>()=>{t.forEach((o,i)=>{r(o.el,o.type,i,o.options)})},[r,t]),{add:n,remove:r}}function og(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function SJ(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:i=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:c,tabIndex:f,onMouseOver:d,onMouseLeave:h,...p}=e,[m,_]=P.useState(!0),[b,g]=P.useState(!1),E=bJ(),T=D=>{D&&D.tagName!=="BUTTON"&&_(!1)},O=m?f:f||0,A=n&&!r,C=P.useCallback(D=>{if(n){D.stopPropagation(),D.preventDefault();return}D.currentTarget.focus(),l==null||l(D)},[n,l]),y=P.useCallback(D=>{b&&og(D)&&(D.preventDefault(),D.stopPropagation(),g(!1),E.remove(document,"keyup",y,!1))},[b,E]),S=P.useCallback(D=>{if(u==null||u(D),n||D.defaultPrevented||D.metaKey||!og(D.nativeEvent)||m)return;const L=o&&D.key==="Enter";i&&D.key===" "&&(D.preventDefault(),g(!0)),L&&(D.preventDefault(),D.currentTarget.click()),E.add(document,"keyup",y,!1)},[n,m,u,o,i,E,y]),v=P.useCallback(D=>{if(c==null||c(D),n||D.defaultPrevented||D.metaKey||!og(D.nativeEvent)||m)return;i&&D.key===" "&&(D.preventDefault(),g(!1),D.currentTarget.click())},[i,m,n,c]),x=P.useCallback(D=>{D.button===0&&(g(!1),E.remove(document,"mouseup",x,!1))},[E]),I=P.useCallback(D=>{if(D.button!==0)return;if(n){D.stopPropagation(),D.preventDefault();return}m||g(!0),D.currentTarget.focus({preventScroll:!0}),E.add(document,"mouseup",x,!1),a==null||a(D)},[n,m,a,E,x]),R=P.useCallback(D=>{D.button===0&&(m||g(!1),s==null||s(D))},[s,m]),k=P.useCallback(D=>{if(n){D.preventDefault();return}d==null||d(D)},[n,d]),M=P.useCallback(D=>{b&&(D.preventDefault(),g(!1)),h==null||h(D)},[b,h]),N=Jt(t,T);return m?{...p,ref:N,type:"button","aria-disabled":A?void 0:n,disabled:A,onClick:C,onMouseDown:a,onMouseUp:s,onKeyUp:c,onKeyDown:u,onMouseOver:d,onMouseLeave:h}:{...p,ref:N,role:"button","data-active":Re(b),"aria-disabled":n?"true":void 0,tabIndex:A?void 0:O,onClick:C,onMouseDown:I,onMouseUp:R,onKeyUp:v,onKeyDown:S,onMouseOver:k,onMouseLeave:M}}function _J(e){const t=e.current;if(!t)return!1;const n=YQ(t);return!n||t.contains(n)?!1:!!nJ(n)}function R5(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,i=n&&!r;Bs(()=>{if(!i||_J(e))return;const a=(o==null?void 0:o.current)||e.current;let s;if(a)return s=requestAnimationFrame(()=>{a.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(s)}},[i,e,o])}var EJ={preventScroll:!0,shouldFocus:!1};function CJ(e,t=EJ){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:i}=t,a=xJ(e)?e.current:e,s=o&&i,l=P.useRef(s),u=P.useRef(i);ai(()=>{!u.current&&i&&(l.current=s),u.current=i},[i,s]);const c=P.useCallback(()=>{if(!(!i||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var f;(f=n.current)==null||f.focus({preventScroll:r})});else{const f=_5(a);f.length>0&&requestAnimationFrame(()=>{f[0].focus({preventScroll:r})})}},[i,r,a,n]);Bs(()=>{c()},[c]),tu(a,"transitionend",c)}function xJ(e){return"current"in e}var al=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),on={arrowShadowColor:al("--popper-arrow-shadow-color"),arrowSize:al("--popper-arrow-size","8px"),arrowSizeHalf:al("--popper-arrow-size-half"),arrowBg:al("--popper-arrow-bg"),transformOrigin:al("--popper-transform-origin"),arrowOffset:al("--popper-arrow-offset")};function OJ(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var AJ={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},PJ=e=>AJ[e],Dx={scroll:!0,resize:!0};function TJ(e){let t;return typeof e=="object"?t={enabled:!0,options:{...Dx,...e}}:t={enabled:e,options:Dx},t}var IJ={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},RJ={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{Lx(e)},effect:({state:e})=>()=>{Lx(e)}},Lx=e=>{e.elements.popper.style.setProperty(on.transformOrigin.var,PJ(e.placement))},kJ={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{MJ(e)}},MJ=e=>{var t;if(!e.placement)return;const n=DJ(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:on.arrowSize.varRef,height:on.arrowSize.varRef,zIndex:-1});const r={[on.arrowSizeHalf.var]:`calc(${on.arrowSize.varRef} / 2 - 1px)`,[on.arrowOffset.var]:`calc(${on.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},DJ=e=>{if(e.startsWith("top"))return{property:"bottom",value:on.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:on.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:on.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:on.arrowOffset.varRef}},LJ={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{Nx(e)},effect:({state:e})=>()=>{Nx(e)}},Nx=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=OJ(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:on.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},NJ={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},BJ={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function jJ(e,t="ltr"){var n,r;const o=((n=NJ[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=BJ[e])!=null?r:o}var Er="top",So="bottom",_o="right",Cr="left",DS="auto",dd=[Er,So,_o,Cr],bu="start",Nf="end",FJ="clippingParents",k5="viewport",lc="popper",$J="reference",Bx=dd.reduce(function(e,t){return e.concat([t+"-"+bu,t+"-"+Nf])},[]),M5=[].concat(dd,[DS]).reduce(function(e,t){return e.concat([t,t+"-"+bu,t+"-"+Nf])},[]),zJ="beforeRead",UJ="read",VJ="afterRead",HJ="beforeMain",WJ="main",GJ="afterMain",KJ="beforeWrite",XJ="write",qJ="afterWrite",YJ=[zJ,UJ,VJ,HJ,WJ,GJ,KJ,XJ,qJ];function di(e){return e?(e.nodeName||"").toLowerCase():null}function Zr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Fs(e){var t=Zr(e).Element;return e instanceof t||e instanceof Element}function vo(e){var t=Zr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function LS(e){if(typeof ShadowRoot>"u")return!1;var t=Zr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ZJ(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!vo(i)||!di(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function QJ(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!vo(o)||!di(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const JJ={name:"applyStyles",enabled:!0,phase:"write",fn:ZJ,effect:QJ,requires:["computeStyles"]};function fi(e){return e.split("-")[0]}var Ps=Math.max,s1=Math.min,Su=Math.round;function j2(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function D5(){return!/^((?!chrome|android).)*safari/i.test(j2())}function _u(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&vo(e)&&(o=e.offsetWidth>0&&Su(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Su(r.height)/e.offsetHeight||1);var a=Fs(e)?Zr(e):window,s=a.visualViewport,l=!D5()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/o,c=(r.top+(l&&s?s.offsetTop:0))/i,f=r.width/o,d=r.height/i;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function NS(e){var t=_u(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function L5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&LS(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ji(e){return Zr(e).getComputedStyle(e)}function eee(e){return["table","td","th"].indexOf(di(e))>=0}function ja(e){return((Fs(e)?e.ownerDocument:e.document)||window.document).documentElement}function dm(e){return di(e)==="html"?e:e.assignedSlot||e.parentNode||(LS(e)?e.host:null)||ja(e)}function jx(e){return!vo(e)||ji(e).position==="fixed"?null:e.offsetParent}function tee(e){var t=/firefox/i.test(j2()),n=/Trident/i.test(j2());if(n&&vo(e)){var r=ji(e);if(r.position==="fixed")return null}var o=dm(e);for(LS(o)&&(o=o.host);vo(o)&&["html","body"].indexOf(di(o))<0;){var i=ji(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function hd(e){for(var t=Zr(e),n=jx(e);n&&eee(n)&&ji(n).position==="static";)n=jx(n);return n&&(di(n)==="html"||di(n)==="body"&&ji(n).position==="static")?t:n||tee(e)||t}function BS(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qc(e,t,n){return Ps(e,s1(t,n))}function nee(e,t,n){var r=qc(e,t,n);return r>n?n:r}function N5(){return{top:0,right:0,bottom:0,left:0}}function B5(e){return Object.assign({},N5(),e)}function j5(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var ree=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,B5(typeof t!="number"?t:j5(t,dd))};function oee(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=fi(n.placement),l=BS(s),u=[Cr,_o].indexOf(s)>=0,c=u?"height":"width";if(!(!i||!a)){var f=ree(o.padding,n),d=NS(i),h=l==="y"?Er:Cr,p=l==="y"?So:_o,m=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],_=a[l]-n.rects.reference[l],b=hd(i),g=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,E=m/2-_/2,T=f[h],O=g-d[c]-f[p],A=g/2-d[c]/2+E,C=qc(T,A,O),y=l;n.modifiersData[r]=(t={},t[y]=C,t.centerOffset=C-A,t)}}function iee(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||L5(t.elements.popper,o)&&(t.elements.arrow=o))}const aee={name:"arrow",enabled:!0,phase:"main",fn:oee,effect:iee,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Eu(e){return e.split("-")[1]}var see={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lee(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Su(n*o)/o||0,y:Su(r*o)/o||0}}function Fx(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=a.x,h=d===void 0?0:d,p=a.y,m=p===void 0?0:p,_=typeof c=="function"?c({x:h,y:m}):{x:h,y:m};h=_.x,m=_.y;var b=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),E=Cr,T=Er,O=window;if(u){var A=hd(n),C="clientHeight",y="clientWidth";if(A===Zr(n)&&(A=ja(n),ji(A).position!=="static"&&s==="absolute"&&(C="scrollHeight",y="scrollWidth")),A=A,o===Er||(o===Cr||o===_o)&&i===Nf){T=So;var S=f&&A===O&&O.visualViewport?O.visualViewport.height:A[C];m-=S-r.height,m*=l?1:-1}if(o===Cr||(o===Er||o===So)&&i===Nf){E=_o;var v=f&&A===O&&O.visualViewport?O.visualViewport.width:A[y];h-=v-r.width,h*=l?1:-1}}var x=Object.assign({position:s},u&&see),I=c===!0?lee({x:h,y:m},Zr(n)):{x:h,y:m};if(h=I.x,m=I.y,l){var R;return Object.assign({},x,(R={},R[T]=g?"0":"",R[E]=b?"0":"",R.transform=(O.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",R))}return Object.assign({},x,(t={},t[T]=g?m+"px":"",t[E]=b?h+"px":"",t.transform="",t))}function uee(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:fi(t.placement),variation:Eu(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Fx(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Fx(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const cee={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:uee,data:{}};var ph={passive:!0};function fee(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,l=Zr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",n.update,ph)}),s&&l.addEventListener("resize",n.update,ph),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",n.update,ph)}),s&&l.removeEventListener("resize",n.update,ph)}}const dee={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fee,data:{}};var hee={left:"right",right:"left",bottom:"top",top:"bottom"};function op(e){return e.replace(/left|right|bottom|top/g,function(t){return hee[t]})}var pee={start:"end",end:"start"};function $x(e){return e.replace(/start|end/g,function(t){return pee[t]})}function jS(e){var t=Zr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function FS(e){return _u(ja(e)).left+jS(e).scrollLeft}function mee(e,t){var n=Zr(e),r=ja(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=D5();(u||!u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+FS(e),y:l}}function yee(e){var t,n=ja(e),r=jS(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Ps(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ps(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+FS(e),l=-r.scrollTop;return ji(o||n).direction==="rtl"&&(s+=Ps(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}function $S(e){var t=ji(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function F5(e){return["html","body","#document"].indexOf(di(e))>=0?e.ownerDocument.body:vo(e)&&$S(e)?e:F5(dm(e))}function Yc(e,t){var n;t===void 0&&(t=[]);var r=F5(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=Zr(r),a=o?[i].concat(i.visualViewport||[],$S(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Yc(dm(a)))}function F2(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function gee(e,t){var n=_u(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function zx(e,t,n){return t===k5?F2(mee(e,n)):Fs(t)?gee(t,n):F2(yee(ja(e)))}function vee(e){var t=Yc(dm(e)),n=["absolute","fixed"].indexOf(ji(e).position)>=0,r=n&&vo(e)?hd(e):e;return Fs(r)?t.filter(function(o){return Fs(o)&&L5(o,r)&&di(o)!=="body"}):[]}function wee(e,t,n,r){var o=t==="clippingParents"?vee(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(l,u){var c=zx(e,u,r);return l.top=Ps(c.top,l.top),l.right=s1(c.right,l.right),l.bottom=s1(c.bottom,l.bottom),l.left=Ps(c.left,l.left),l},zx(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function $5(e){var t=e.reference,n=e.element,r=e.placement,o=r?fi(r):null,i=r?Eu(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(o){case Er:l={x:a,y:t.y-n.height};break;case So:l={x:a,y:t.y+t.height};break;case _o:l={x:t.x+t.width,y:s};break;case Cr:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=o?BS(o):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case bu:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Nf:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Bf(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,l=s===void 0?FJ:s,u=n.rootBoundary,c=u===void 0?k5:u,f=n.elementContext,d=f===void 0?lc:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,_=m===void 0?0:m,b=B5(typeof _!="number"?_:j5(_,dd)),g=d===lc?$J:lc,E=e.rects.popper,T=e.elements[p?g:d],O=wee(Fs(T)?T:T.contextElement||ja(e.elements.popper),l,c,a),A=_u(e.elements.reference),C=$5({reference:A,element:E,strategy:"absolute",placement:o}),y=F2(Object.assign({},E,C)),S=d===lc?y:A,v={top:O.top-S.top+b.top,bottom:S.bottom-O.bottom+b.bottom,left:O.left-S.left+b.left,right:S.right-O.right+b.right},x=e.modifiersData.offset;if(d===lc&&x){var I=x[o];Object.keys(v).forEach(function(R){var k=[_o,So].indexOf(R)>=0?1:-1,M=[Er,So].indexOf(R)>=0?"y":"x";v[R]+=I[M]*k})}return v}function bee(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?M5:l,c=Eu(r),f=c?s?Bx:Bx.filter(function(p){return Eu(p)===c}):dd,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=Bf(e,{placement:m,boundary:o,rootBoundary:i,padding:a})[fi(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function See(e){if(fi(e)===DS)return[];var t=op(e);return[$x(e),t,$x(t)]}function _ee(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,_=t.options.placement,b=fi(_),g=b===_,E=l||(g||!p?[op(_)]:See(_)),T=[_].concat(E).reduce(function(W,Q){return W.concat(fi(Q)===DS?bee(t,{placement:Q,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:m}):Q)},[]),O=t.rects.reference,A=t.rects.popper,C=new Map,y=!0,S=T[0],v=0;v=0,M=k?"width":"height",N=Bf(t,{placement:x,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),D=k?R?_o:Cr:R?So:Er;O[M]>A[M]&&(D=op(D));var L=op(D),j=[];if(i&&j.push(N[I]<=0),s&&j.push(N[D]<=0,N[L]<=0),j.every(function(W){return W})){S=x,y=!1;break}C.set(x,j)}if(y)for(var F=p?3:1,B=function(Q){var X=T.find(function(J){var te=C.get(J);if(te)return te.slice(0,Q).every(function(le){return le})});if(X)return S=X,"break"},U=F;U>0;U--){var K=B(U);if(K==="break")break}t.placement!==S&&(t.modifiersData[r]._skip=!0,t.placement=S,t.reset=!0)}}const Eee={name:"flip",enabled:!0,phase:"main",fn:_ee,requiresIfExists:["offset"],data:{_skip:!1}};function Ux(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Vx(e){return[Er,_o,So,Cr].some(function(t){return e[t]>=0})}function Cee(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Bf(t,{elementContext:"reference"}),s=Bf(t,{altBoundary:!0}),l=Ux(a,r),u=Ux(s,o,i),c=Vx(l),f=Vx(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const xee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Cee};function Oee(e,t,n){var r=fi(e),o=[Cr,Er].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[Cr,_o].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function Aee(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=M5.reduce(function(c,f){return c[f]=Oee(f,t.rects,i),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const Pee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Aee};function Tee(e){var t=e.state,n=e.name;t.modifiersData[n]=$5({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Iee={name:"popperOffsets",enabled:!0,phase:"read",fn:Tee,data:{}};function Ree(e){return e==="x"?"y":"x"}function kee(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,m=p===void 0?0:p,_=Bf(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),b=fi(t.placement),g=Eu(t.placement),E=!g,T=BS(b),O=Ree(T),A=t.modifiersData.popperOffsets,C=t.rects.reference,y=t.rects.popper,S=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,v=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(A){if(i){var R,k=T==="y"?Er:Cr,M=T==="y"?So:_o,N=T==="y"?"height":"width",D=A[T],L=D+_[k],j=D-_[M],F=h?-y[N]/2:0,B=g===bu?C[N]:y[N],U=g===bu?-y[N]:-C[N],K=t.elements.arrow,W=h&&K?NS(K):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:N5(),X=Q[k],J=Q[M],te=qc(0,C[N],W[N]),le=E?C[N]/2-F-te-X-v.mainAxis:B-te-X-v.mainAxis,ge=E?-C[N]/2+F+te+J+v.mainAxis:U+te+J+v.mainAxis,se=t.elements.arrow&&hd(t.elements.arrow),ue=se?T==="y"?se.clientTop||0:se.clientLeft||0:0,Ie=(R=x==null?void 0:x[T])!=null?R:0,gt=D+le-Ie-ue,ie=D+ge-Ie,Ce=qc(h?s1(L,gt):L,D,h?Ps(j,ie):j);A[T]=Ce,I[T]=Ce-D}if(s){var Ne,ze=T==="x"?Er:Cr,fr=T==="x"?So:_o,Kt=A[O],Cn=O==="y"?"height":"width",xn=Kt+_[ze],zt=Kt-_[fr],Co=[Er,Cr].indexOf(b)!==-1,Vo=(Ne=x==null?void 0:x[O])!=null?Ne:0,Ha=Co?xn:Kt-C[Cn]-y[Cn]-Vo+v.altAxis,Wa=Co?Kt+C[Cn]+y[Cn]-Vo-v.altAxis:zt,Gi=h&&Co?nee(Ha,Kt,Wa):qc(h?Ha:xn,Kt,h?Wa:zt);A[O]=Gi,I[O]=Gi-Kt}t.modifiersData[r]=I}}const Mee={name:"preventOverflow",enabled:!0,phase:"main",fn:kee,requiresIfExists:["offset"]};function Dee(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Lee(e){return e===Zr(e)||!vo(e)?jS(e):Dee(e)}function Nee(e){var t=e.getBoundingClientRect(),n=Su(t.width)/e.offsetWidth||1,r=Su(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Bee(e,t,n){n===void 0&&(n=!1);var r=vo(t),o=vo(t)&&Nee(t),i=ja(t),a=_u(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((di(t)!=="body"||$S(i))&&(s=Lee(t)),vo(t)?(l=_u(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=FS(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function jee(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function Fee(e){var t=jee(e);return YJ.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function $ee(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function zee(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Hx={placement:"bottom",modifiers:[],strategy:"absolute"};function Wx(){for(var e=arguments.length,t=new Array(e),n=0;n{}),E=P.useCallback(()=>{var v;!t||!p.current||!m.current||((v=g.current)==null||v.call(g),_.current=Hee(p.current,m.current,{placement:b,modifiers:[LJ,kJ,RJ,{...IJ,enabled:!!d},{name:"eventListeners",...TJ(a)},{name:"arrow",options:{padding:i}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!f,options:{boundary:c}},...n??[]],strategy:o}),_.current.forceUpdate(),g.current=_.current.destroy)},[b,t,n,d,a,i,s,l,u,f,c,o]);P.useEffect(()=>()=>{var v;!p.current&&!m.current&&((v=_.current)==null||v.destroy(),_.current=null)},[]);const T=P.useCallback(v=>{p.current=v,E()},[E]),O=P.useCallback((v={},x=null)=>({...v,ref:Jt(T,x)}),[T]),A=P.useCallback(v=>{m.current=v,E()},[E]),C=P.useCallback((v={},x=null)=>({...v,ref:Jt(A,x),style:{...v.style,position:o,minWidth:d?void 0:"max-content",inset:"0 auto auto 0"}}),[o,A,d]),y=P.useCallback((v={},x=null)=>{const{size:I,shadowColor:R,bg:k,style:M,...N}=v;return{...N,ref:x,"data-popper-arrow":"",style:Wee(v)}},[]),S=P.useCallback((v={},x=null)=>({...v,ref:x,"data-popper-arrow-inner":""}),[]);return{update(){var v;(v=_.current)==null||v.update()},forceUpdate(){var v;(v=_.current)==null||v.forceUpdate()},transformOrigin:on.transformOrigin.varRef,referenceRef:T,popperRef:A,getPopperProps:C,getArrowProps:y,getArrowInnerProps:S,getReferenceProps:O}}function Wee(e){const{size:t,shadowColor:n,bg:r,style:o}=e,i={...o,position:"absolute"};return t&&(i["--popper-arrow-size"]=t),n&&(i["--popper-arrow-shadow-color"]=n),r&&(i["--popper-arrow-bg"]=r),i}function US(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=Ea(n),a=Ea(t),[s,l]=P.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,c=r!==void 0,f=P.useId(),d=o??`disclosure-${f}`,h=P.useCallback(()=>{c||l(!1),a==null||a()},[c,a]),p=P.useCallback(()=>{c||l(!0),i==null||i()},[c,i]),m=P.useCallback(()=>{u?h():p()},[u,p,h]);function _(g={}){return{...g,"aria-expanded":u,"aria-controls":d,onClick(E){var T;(T=g.onClick)==null||T.call(g,E),m()}}}function b(g={}){return{...g,hidden:!u,id:d}}return{isOpen:u,onOpen:p,onClose:h,onToggle:m,isControlled:c,getButtonProps:_,getDisclosureProps:b}}function Gee(e){const{ref:t,handler:n,enabled:r=!0}=e,o=Ea(n),a=P.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;P.useEffect(()=>{if(!r)return;const s=f=>{ig(f,t)&&(a.isPointerDown=!0)},l=f=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&ig(f,t)&&(a.isPointerDown=!1,o(f))},u=f=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&ig(f,t)&&(a.isPointerDown=!1,o(f))},c=z5(t.current);return c.addEventListener("mousedown",s,!0),c.addEventListener("mouseup",l,!0),c.addEventListener("touchstart",s,!0),c.addEventListener("touchend",u,!0),()=>{c.removeEventListener("mousedown",s,!0),c.removeEventListener("mouseup",l,!0),c.removeEventListener("touchstart",s,!0),c.removeEventListener("touchend",u,!0)}},[n,t,o,a,r])}function ig(e,t){var n;const r=e.target;return r&&!z5(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function z5(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function U5(e){const{isOpen:t,ref:n}=e,[r,o]=P.useState(t),[i,a]=P.useState(!1);return P.useEffect(()=>{i||(o(t),a(!0))},[t,i,r]),tu(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=qQ(n.current),c=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(c)}}}function V5(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[Kee,Xee,qee,Yee]=BY(),[Zee,pd]=tn({strict:!1,name:"MenuContext"});function Qee(e,...t){const n=P.useId(),r=e||n;return P.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function H5(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Gx(e){return H5(e).activeElement===e}function Jee(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:i=!0,isLazy:a,isOpen:s,defaultIsOpen:l,onClose:u,onOpen:c,placement:f="bottom-start",lazyBehavior:d="unmount",direction:h,computePositionOnMount:p=!1,...m}=e,_=P.useRef(null),b=P.useRef(null),g=qee(),E=P.useCallback(()=>{requestAnimationFrame(()=>{var K;(K=_.current)==null||K.focus({preventScroll:!1})})},[]),T=P.useCallback(()=>{const K=setTimeout(()=>{var W;if(o)(W=o.current)==null||W.focus();else{const Q=g.firstEnabled();Q&&R(Q.index)}});L.current.add(K)},[g,o]),O=P.useCallback(()=>{const K=setTimeout(()=>{const W=g.lastEnabled();W&&R(W.index)});L.current.add(K)},[g]),A=P.useCallback(()=>{c==null||c(),i?T():E()},[i,T,E,c]),{isOpen:C,onOpen:y,onClose:S,onToggle:v}=US({isOpen:s,defaultIsOpen:l,onClose:u,onOpen:A});Gee({enabled:C&&r,ref:_,handler:K=>{var W;(W=b.current)!=null&&W.contains(K.target)||S()}});const x=zS({...m,enabled:C||p,placement:f,direction:h}),[I,R]=P.useState(-1);Bs(()=>{C||R(-1)},[C]),R5(_,{focusRef:b,visible:C,shouldFocus:!0});const k=U5({isOpen:C,ref:_}),[M,N]=Qee(t,"menu-button","menu-list"),D=P.useCallback(()=>{y(),E()},[y,E]),L=P.useRef(new Set([]));ate(()=>{L.current.forEach(K=>clearTimeout(K)),L.current.clear()});const j=P.useCallback(()=>{y(),T()},[T,y]),F=P.useCallback(()=>{y(),O()},[y,O]),B=P.useCallback(()=>{var K,W;const Q=H5(_.current),X=(K=_.current)==null?void 0:K.contains(Q.activeElement);if(!(C&&!X))return;const te=(W=g.item(I))==null?void 0:W.node;te==null||te.focus()},[C,I,g]),U=P.useRef(null);return{openAndFocusMenu:D,openAndFocusFirstItem:j,openAndFocusLastItem:F,onTransitionEnd:B,unstable__animationState:k,descendants:g,popper:x,buttonId:M,menuId:N,forceUpdate:x.forceUpdate,orientation:"vertical",isOpen:C,onToggle:v,onOpen:y,onClose:S,menuRef:_,buttonRef:b,focusedIndex:I,closeOnSelect:n,closeOnBlur:r,autoSelect:i,setFocusedIndex:R,isLazy:a,lazyBehavior:d,initialFocusRef:o,rafId:U}}function ete(e={},t=null){const n=pd(),{onToggle:r,popper:o,openAndFocusFirstItem:i,openAndFocusLastItem:a}=n,s=P.useCallback(l=>{const u=l.key,f={Enter:i,ArrowDown:i,ArrowUp:a}[u];f&&(l.preventDefault(),l.stopPropagation(),f(l))},[i,a]);return{...e,ref:Jt(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":Re(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:ke(e.onClick,r),onKeyDown:ke(e.onKeyDown,s)}}function $2(e){var t;return ote(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function tte(e={},t=null){const n=pd();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:r,setFocusedIndex:o,menuRef:i,isOpen:a,onClose:s,menuId:l,isLazy:u,lazyBehavior:c,unstable__animationState:f}=n,d=Xee(),h=vJ({preventDefault:b=>b.key!==" "&&$2(b.target)}),p=P.useCallback(b=>{if(!b.currentTarget.contains(b.target))return;const g=b.key,T={Tab:A=>A.preventDefault(),Escape:s,ArrowDown:()=>{const A=d.nextEnabled(r);A&&o(A.index)},ArrowUp:()=>{const A=d.prevEnabled(r);A&&o(A.index)}}[g];if(T){b.preventDefault(),T(b);return}const O=h(A=>{const C=wJ(d.values(),A,y=>{var S,v;return(v=(S=y==null?void 0:y.node)==null?void 0:S.textContent)!=null?v:""},d.item(r));if(C){const y=d.indexOf(C.node);o(y)}});$2(b.target)&&O(b)},[d,r,h,s,o]),m=P.useRef(!1);a&&(m.current=!0);const _=V5({wasSelected:m.current,enabled:u,mode:c,isSelected:f.present});return{...e,ref:Jt(i,t),children:_?e.children:null,tabIndex:-1,role:"menu",id:l,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:ke(e.onKeyDown,p)}}function nte(e={}){const{popper:t,isOpen:n}=pd();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function rte(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:i,onFocus:a,isDisabled:s,isFocusable:l,closeOnSelect:u,type:c,...f}=e,d=pd(),{setFocusedIndex:h,focusedIndex:p,closeOnSelect:m,onClose:_,menuRef:b,isOpen:g,menuId:E,rafId:T}=d,O=P.useRef(null),A=`${E}-menuitem-${P.useId()}`,{index:C,register:y}=Yee({disabled:s&&!l}),S=P.useCallback(D=>{n==null||n(D),!s&&h(C)},[h,C,s,n]),v=P.useCallback(D=>{r==null||r(D),O.current&&!Gx(O.current)&&S(D)},[S,r]),x=P.useCallback(D=>{o==null||o(D),!s&&h(-1)},[h,s,o]),I=P.useCallback(D=>{i==null||i(D),$2(D.currentTarget)&&(u??m)&&_()},[_,i,m,u]),R=P.useCallback(D=>{a==null||a(D),h(C)},[h,a,C]),k=C===p,M=s&&!l;Bs(()=>{g&&(k&&!M&&O.current?(T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(()=>{var D;(D=O.current)==null||D.focus(),T.current=null})):b.current&&!Gx(b.current)&&b.current.focus({preventScroll:!0}))},[k,M,b,g]);const N=SJ({onClick:I,onFocus:R,onMouseEnter:S,onMouseMove:v,onMouseLeave:x,ref:Jt(y,O,t),isDisabled:s,isFocusable:l});return{...f,...N,type:c??N.type,id:A,role:"menuitem",tabIndex:k?0:-1}}function ote(e){var t;if(!ite(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function ite(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function ate(e,t=[]){return P.useEffect(()=>()=>e(),t)}var[ste,md]=tn({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),VS=e=>{const{children:t}=e,n=Pr("Menu",e),r=Rt(e),{direction:o}=nd(),{descendants:i,...a}=Jee({...r,direction:o}),s=P.useMemo(()=>a,[a]),{isOpen:l,onClose:u,forceUpdate:c}=s;return w.jsx(Kee,{value:i,children:w.jsx(Zee,{value:s,children:w.jsx(ste,{value:n,children:po(t,{isOpen:l,onClose:u,forceUpdate:c})})})})};VS.displayName="Menu";var W5=de((e,t)=>{const n=md();return w.jsx(ne.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});W5.displayName="MenuCommand";var lte=de((e,t)=>{const{type:n,...r}=e,o=md(),i=r.as||n?n??void 0:"button",a=P.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return w.jsx(ne.button,{ref:t,type:i,...r,__css:a})}),G5=e=>{const{className:t,children:n,...r}=e,o=md(),i=P.Children.only(n),a=P.isValidElement(i)?P.cloneElement(i,{focusable:"false","aria-hidden":!0,className:_e("chakra-menu__icon",i.props.className)}):null,s=_e("chakra-menu__icon-wrapper",t);return w.jsx(ne.span,{className:s,...r,__css:o.icon,children:a})};G5.displayName="MenuIcon";var Qo=de((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:i="0.75rem",children:a,...s}=e,l=rte(s,t),c=n||o?w.jsx("span",{style:{pointerEvents:"none",flex:1},children:a}):a;return w.jsxs(lte,{...l,className:_e("chakra-menu__menuitem",l.className),children:[n&&w.jsx(G5,{fontSize:"0.8em",marginEnd:r,children:n}),c,o&&w.jsx(W5,{marginStart:i,children:o})]})});Qo.displayName="MenuItem";var ute={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},cte=ne(Ui.div),HS=de(function(t,n){var r,o;const{rootProps:i,motionProps:a,...s}=t,{isOpen:l,onTransitionEnd:u,unstable__animationState:c}=pd(),f=tte(s,n),d=nte(i),h=md();return w.jsx(ne.div,{...d,__css:{zIndex:(o=t.zIndex)!=null?o:(r=h.list)==null?void 0:r.zIndex},children:w.jsx(cte,{variants:ute,initial:!1,animate:l?"enter":"exit",__css:{outline:0,...h.list},...a,className:_e("chakra-menu__menu-list",f.className),...f,onUpdate:u,onAnimationComplete:q0(c.onComplete,f.onAnimationComplete)})})});HS.displayName="MenuList";var fte=de((e,t)=>{const n=md();return w.jsx(ne.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),WS=de((e,t)=>{const{children:n,as:r,...o}=e,i=ete(o,t),a=r||fte;return w.jsx(a,{...i,className:_e("chakra-menu__menu-button",e.className),children:w.jsx(ne.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});WS.displayName="MenuButton";var dte={slideInBottom:{...A2,custom:{offsetY:16,reverse:!0}},slideInRight:{...A2,custom:{offsetX:16,reverse:!0}},scale:{...CI,custom:{initialScale:.95,reverse:!0}},none:{}},hte=ne(Ui.section),pte=e=>dte[e||"none"],K5=P.forwardRef((e,t)=>{const{preset:n,motionProps:r=pte(n),...o}=e;return w.jsx(hte,{ref:t,...r,...o})});K5.displayName="ModalTransition";var mte=Object.defineProperty,yte=(e,t,n)=>t in e?mte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gte=(e,t,n)=>(yte(e,typeof t!="symbol"?t+"":t,n),n),vte=class{constructor(){gte(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},z2=new vte;function X5(e,t){const[n,r]=P.useState(0);return P.useEffect(()=>{const o=e.current;if(o){if(t){const i=z2.add(o);r(i)}return()=>{z2.remove(o),r(0)}}},[t,e]),n}var wte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sl=new WeakMap,mh=new WeakMap,yh={},ag=0,q5=function(e){return e&&(e.host||q5(e.parentNode))},bte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=q5(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ste=function(e,t,n,r){var o=bte(t,Array.isArray(e)?e:[e]);yh[n]||(yh[n]=new WeakMap);var i=yh[n],a=[],s=new Set,l=new Set(o),u=function(f){!f||s.has(f)||(s.add(f),u(f.parentNode))};o.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(d){if(s.has(d))c(d);else{var h=d.getAttribute(r),p=h!==null&&h!=="false",m=(sl.get(d)||0)+1,_=(i.get(d)||0)+1;sl.set(d,m),i.set(d,_),a.push(d),m===1&&p&&mh.set(d,!0),_===1&&d.setAttribute(n,"true"),p||d.setAttribute(r,"true")}})};return c(t),s.clear(),ag++,function(){a.forEach(function(f){var d=sl.get(f)-1,h=i.get(f)-1;sl.set(f,d),i.set(f,h),d||(mh.has(f)||f.removeAttribute(r),mh.delete(f)),h||f.removeAttribute(n)}),ag--,ag||(sl=new WeakMap,sl=new WeakMap,mh=new WeakMap,yh={})}},_te=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||wte(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ste(r,o,n,"aria-hidden")):function(){return null}};function Ete(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=P.useRef(null),c=P.useRef(null),[f,d,h]=xte(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Cte(u,t&&a);const p=X5(u,t),m=P.useRef(null),_=P.useCallback(S=>{m.current=S.target},[]),b=P.useCallback(S=>{S.key==="Escape"&&(S.stopPropagation(),i&&(n==null||n()),l==null||l())},[i,n,l]),[g,E]=P.useState(!1),[T,O]=P.useState(!1),A=P.useCallback((S={},v=null)=>({role:"dialog",...S,ref:Jt(v,u),id:f,tabIndex:-1,"aria-modal":!0,"aria-labelledby":g?d:void 0,"aria-describedby":T?h:void 0,onClick:ke(S.onClick,x=>x.stopPropagation())}),[h,T,f,d,g]),C=P.useCallback(S=>{S.stopPropagation(),m.current===S.target&&z2.isTopModal(u.current)&&(o&&(n==null||n()),s==null||s())},[n,o,s]),y=P.useCallback((S={},v=null)=>({...S,ref:Jt(v,c),onClick:ke(S.onClick,C),onKeyDown:ke(S.onKeyDown,b),onMouseDown:ke(S.onMouseDown,_)}),[b,_,C]);return{isOpen:t,onClose:n,headerId:d,bodyId:h,setBodyMounted:O,setHeaderMounted:E,dialogRef:u,overlayRef:c,getDialogProps:A,getDialogContainerProps:y,index:p}}function Cte(e,t){const n=e.current;P.useEffect(()=>{if(!(!e.current||!t))return _te(e.current)},[t,e,n])}function xte(e,...t){const n=P.useId(),r=e||n;return P.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[Ote,Fu]=tn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Ate,$s]=tn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),$r=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:i,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:c,preserveScrollBarGap:f,motionPreset:d,lockFocusAcrossFrames:h,onCloseComplete:p}=t,m=Pr("Modal",t),b={...Ete(t),autoFocus:o,trapFocus:i,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:c,preserveScrollBarGap:f,motionPreset:d,lockFocusAcrossFrames:h};return w.jsx(Ate,{value:b,children:w.jsx(Ote,{value:m,children:w.jsx(Nu,{onExitComplete:p,children:b.isOpen&&w.jsx(Lu,{...n,children:r})})})})};$r.displayName="Modal";var ip="right-scroll-bar-position",ap="width-before-scroll-bar",Pte="with-scroll-bars-hidden",Tte="--removed-body-scroll-bar-size",Y5=GI(),sg=function(){},hm=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:sg,onWheelCapture:sg,onTouchMoveCapture:sg}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,f=e.shards,d=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,_=e.as,b=_===void 0?"div":_,g=e.gapMode,E=VI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=d,O=UI([n,t]),A=ni(ni({},E),o);return P.createElement(P.Fragment,null,c&&P.createElement(T,{sideCar:Y5,removeScrollBar:u,shards:f,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:g}),a?P.cloneElement(P.Children.only(s),ni(ni({},A),{ref:O})):P.createElement(b,ni({},A,{className:l,ref:O}),s))});hm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hm.classNames={fullWidth:ap,zeroRight:ip};var Kx,Ite=function(){if(Kx)return Kx;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rte(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ite();return t&&e.setAttribute("nonce",t),e}function kte(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Mte(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Dte=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rte())&&(kte(t,n),Mte(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Lte=function(){var e=Dte();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Z5=function(){var e=Lte(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Nte={left:0,top:0,right:0,gap:0},lg=function(e){return parseInt(e||"",10)||0},Bte=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[lg(n),lg(r),lg(o)]},jte=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Nte;var t=Bte(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Fte=Z5(),$te=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Pte,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(ip,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(ap,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(ip," .").concat(ip,` { + right: 0 `).concat(r,`; + } + + .`).concat(ap," .").concat(ap,` { + margin-right: 0 `).concat(r,`; + } + + body { + `).concat(Tte,": ").concat(s,`px; + } +`)},zte=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=P.useMemo(function(){return jte(o)},[o]);return P.createElement(Fte,{styles:$te(i,!t,o,n?"":"!important")})},U2=!1;if(typeof window<"u")try{var gh=Object.defineProperty({},"passive",{get:function(){return U2=!0,!0}});window.addEventListener("test",gh,gh),window.removeEventListener("test",gh,gh)}catch{U2=!1}var ll=U2?{passive:!1}:!1,Ute=function(e){return e.tagName==="TEXTAREA"},Q5=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ute(e)&&n[t]==="visible")},Vte=function(e){return Q5(e,"overflowY")},Hte=function(e){return Q5(e,"overflowX")},Xx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=J5(e,r);if(o){var i=eR(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Wte=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Gte=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},J5=function(e,t){return e==="v"?Vte(t):Hte(t)},eR=function(e,t){return e==="v"?Wte(t):Gte(t)},Kte=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xte=function(e,t,n,r,o){var i=Kte(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),u=!1,c=a>0,f=0,d=0;do{var h=eR(e,s),p=h[0],m=h[1],_=h[2],b=m-_-i*p;(p||b)&&J5(e,s)&&(f+=b,d+=p),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(o&&f===0||!o&&a>f)||!c&&(o&&d===0||!o&&-a>d))&&(u=!0),u},vh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qx=function(e){return[e.deltaX,e.deltaY]},Yx=function(e){return e&&"current"in e?e.current:e},qte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yte=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Zte=0,ul=[];function Qte(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),o=P.useState(Zte++)[0],i=P.useState(Z5)[0],a=P.useRef(e);P.useEffect(function(){a.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=XZ([e.lockRef.current],(e.shards||[]).map(Yx),!0).filter(Boolean);return m.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=P.useCallback(function(m,_){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var b=vh(m),g=n.current,E="deltaX"in m?m.deltaX:g[0]-b[0],T="deltaY"in m?m.deltaY:g[1]-b[1],O,A=m.target,C=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in m&&C==="h"&&A.type==="range")return!1;var y=Xx(C,A);if(!y)return!0;if(y?O=C:(O=C==="v"?"h":"v",y=Xx(C,A)),!y)return!1;if(!r.current&&"changedTouches"in m&&(E||T)&&(r.current=O),!O)return!0;var S=r.current||O;return Xte(S,_,m,S==="h"?E:T,!0)},[]),l=P.useCallback(function(m){var _=m;if(!(!ul.length||ul[ul.length-1]!==i)){var b="deltaY"in _?qx(_):vh(_),g=t.current.filter(function(O){return O.name===_.type&&O.target===_.target&&qte(O.delta,b)})[0];if(g&&g.should){_.cancelable&&_.preventDefault();return}if(!g){var E=(a.current.shards||[]).map(Yx).filter(Boolean).filter(function(O){return O.contains(_.target)}),T=E.length>0?s(_,E[0]):!a.current.noIsolation;T&&_.cancelable&&_.preventDefault()}}},[]),u=P.useCallback(function(m,_,b,g){var E={name:m,delta:_,target:b,should:g};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),c=P.useCallback(function(m){n.current=vh(m),r.current=void 0},[]),f=P.useCallback(function(m){u(m.type,qx(m),m.target,s(m,e.lockRef.current))},[]),d=P.useCallback(function(m){u(m.type,vh(m),m.target,s(m,e.lockRef.current))},[]);P.useEffect(function(){return ul.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,ll),document.addEventListener("touchmove",l,ll),document.addEventListener("touchstart",c,ll),function(){ul=ul.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,ll),document.removeEventListener("touchmove",l,ll),document.removeEventListener("touchstart",c,ll)}},[]);var h=e.removeScrollBar,p=e.inert;return P.createElement(P.Fragment,null,p?P.createElement(i,{styles:Yte(o)}):null,h?P.createElement(zte,{gapMode:e.gapMode}):null)}const Jte=qZ(Y5,Qte);var tR=P.forwardRef(function(e,t){return P.createElement(hm,ni({},e,{ref:t,sideCar:Jte}))});tR.classNames=hm.classNames;const ene=tR;function tne(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:c,isOpen:f}=$s(),[d,h]=tI();P.useEffect(()=>{!d&&h&&setTimeout(h)},[d,h]);const p=X5(r,f);return w.jsx(E5,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:c,children:w.jsx(ene,{removeScrollBar:!u,allowPinchZoom:a,enabled:p===1&&i,forwardProps:!0,children:e.children})})}var zr=de((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:i,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=$s(),u=s(a,t),c=l(o),f=_e("chakra-modal__content",n),d=Fu(),h={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...d.dialog},p={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...d.dialogContainer},{motionPreset:m}=$s();return w.jsx(tne,{children:w.jsx(ne.div,{...c,className:"chakra-modal__content-container",tabIndex:-1,__css:p,children:w.jsx(K5,{preset:m,motionProps:i,className:f,...u,__css:h,children:r})})})});zr.displayName="ModalContent";var yd=de((e,t)=>{const{className:n,...r}=e,o=_e("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...Fu().footer};return w.jsx(ne.footer,{ref:t,...r,__css:a,className:o})});yd.displayName="ModalFooter";var Ur=de((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:i}=$s();P.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=_e("chakra-modal__header",n),l={flex:0,...Fu().header};return w.jsx(ne.header,{ref:t,className:a,id:o,...r,__css:l})});Ur.displayName="ModalHeader";var nne=ne(Ui.div),Vr=de((e,t)=>{const{className:n,transition:r,motionProps:o,...i}=e,a=_e("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Fu().overlay},{motionPreset:u}=$s(),f=o||(u==="none"?{}:EI);return w.jsx(nne,{...f,__css:l,ref:t,className:a,...i})});Vr.displayName="ModalOverlay";var Hr=de((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:i}=$s();P.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=_e("chakra-modal__body",n),s=Fu();return w.jsx(ne.div,{ref:t,className:a,id:o,...r,__css:s.body})});Hr.displayName="ModalBody";var Wr=de((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:i}=$s(),a=_e("chakra-modal__close-btn",r),s=Fu();return w.jsx(lm,{ref:t,__css:s.closeButton,className:a,onClick:ke(n,l=>{l.stopPropagation(),i()}),...o})});Wr.displayName="ModalCloseButton";var[rne,qs]=tn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[one,gd]=tn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),nR=de(function(t,n){const{getHeaderProps:r}=qs(),o=gd();return w.jsx(ne.header,{...r(t,n),className:_e("chakra-popover__header",t.className),__css:o.header})});nR.displayName="PopoverHeader";function GS(e){const t=P.Children.only(e.children),{getTriggerProps:n}=qs();return P.cloneElement(t,n(t.props,t.ref))}GS.displayName="PopoverTrigger";var cl={click:"click",hover:"hover"};function ine(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:i=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=cl.click,openDelay:c=200,closeDelay:f=200,isLazy:d,lazyBehavior:h="unmount",computePositionOnMount:p,...m}=e,{isOpen:_,onClose:b,onOpen:g,onToggle:E}=US(e),T=P.useRef(null),O=P.useRef(null),A=P.useRef(null),C=P.useRef(!1),y=P.useRef(!1);_&&(y.current=!0);const[S,v]=P.useState(!1),[x,I]=P.useState(!1),R=P.useId(),k=o??R,[M,N,D,L]=["popover-trigger","popover-content","popover-header","popover-body"].map(ie=>`${ie}-${k}`),{referenceRef:j,getArrowProps:F,getPopperProps:B,getArrowInnerProps:U,forceUpdate:K}=zS({...m,enabled:_||!!p}),W=U5({isOpen:_,ref:A});NZ({enabled:_,ref:O}),R5(A,{focusRef:O,visible:_,shouldFocus:i&&u===cl.click}),CJ(A,{focusRef:r,visible:_,shouldFocus:a&&u===cl.click});const Q=V5({wasSelected:y.current,enabled:d,mode:h,isSelected:W.present}),X=P.useCallback((ie={},Ce=null)=>{const Ne={...ie,style:{...ie.style,transformOrigin:on.transformOrigin.varRef,[on.arrowSize.var]:s?`${s}px`:void 0,[on.arrowShadowColor.var]:l},ref:Jt(A,Ce),children:Q?ie.children:null,id:N,tabIndex:-1,role:"dialog",onKeyDown:ke(ie.onKeyDown,ze=>{n&&ze.key==="Escape"&&b()}),onBlur:ke(ie.onBlur,ze=>{const fr=Zx(ze),Kt=ug(A.current,fr),Cn=ug(O.current,fr);_&&t&&(!Kt&&!Cn)&&b()}),"aria-labelledby":S?D:void 0,"aria-describedby":x?L:void 0};return u===cl.hover&&(Ne.role="tooltip",Ne.onMouseEnter=ke(ie.onMouseEnter,()=>{C.current=!0}),Ne.onMouseLeave=ke(ie.onMouseLeave,ze=>{ze.nativeEvent.relatedTarget!==null&&(C.current=!1,setTimeout(()=>b(),f))})),Ne},[Q,N,S,D,x,L,u,n,b,_,t,f,l,s]),J=P.useCallback((ie={},Ce=null)=>B({...ie,style:{visibility:_?"visible":"hidden",...ie.style}},Ce),[_,B]),te=P.useCallback((ie,Ce=null)=>({...ie,ref:Jt(Ce,T,j)}),[T,j]),le=P.useRef(),ge=P.useRef(),se=P.useCallback(ie=>{T.current==null&&j(ie)},[j]),ue=P.useCallback((ie={},Ce=null)=>{const Ne={...ie,ref:Jt(O,Ce,se),id:M,"aria-haspopup":"dialog","aria-expanded":_,"aria-controls":N};return u===cl.click&&(Ne.onClick=ke(ie.onClick,E)),u===cl.hover&&(Ne.onFocus=ke(ie.onFocus,()=>{le.current===void 0&&g()}),Ne.onBlur=ke(ie.onBlur,ze=>{const fr=Zx(ze),Kt=!ug(A.current,fr);_&&t&&Kt&&b()}),Ne.onKeyDown=ke(ie.onKeyDown,ze=>{ze.key==="Escape"&&b()}),Ne.onMouseEnter=ke(ie.onMouseEnter,()=>{C.current=!0,le.current=window.setTimeout(()=>g(),c)}),Ne.onMouseLeave=ke(ie.onMouseLeave,()=>{C.current=!1,le.current&&(clearTimeout(le.current),le.current=void 0),ge.current=window.setTimeout(()=>{C.current===!1&&b()},f)})),Ne},[M,_,N,u,se,E,g,t,b,c,f]);P.useEffect(()=>()=>{le.current&&clearTimeout(le.current),ge.current&&clearTimeout(ge.current)},[]);const Ie=P.useCallback((ie={},Ce=null)=>({...ie,id:D,ref:Jt(Ce,Ne=>{v(!!Ne)})}),[D]),gt=P.useCallback((ie={},Ce=null)=>({...ie,id:L,ref:Jt(Ce,Ne=>{I(!!Ne)})}),[L]);return{forceUpdate:K,isOpen:_,onAnimationComplete:W.onComplete,onClose:b,getAnchorProps:te,getArrowProps:F,getArrowInnerProps:U,getPopoverPositionerProps:J,getPopoverProps:X,getTriggerProps:ue,getHeaderProps:Ie,getBodyProps:gt}}function ug(e,t){return e===t||(e==null?void 0:e.contains(t))}function Zx(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function KS(e){const t=Pr("Popover",e),{children:n,...r}=Rt(e),o=nd(),i=ine({...r,direction:o.direction});return w.jsx(rne,{value:i,children:w.jsx(one,{value:t,children:po(n,{isOpen:i.isOpen,onClose:i.onClose,forceUpdate:i.forceUpdate})})})}KS.displayName="Popover";var cg=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function XS(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:i,boxShadow:a,shadowColor:s}=e,{getArrowProps:l,getArrowInnerProps:u}=qs(),c=gd(),f=(t=n??r)!=null?t:o,d=i??a;return w.jsx(ne.div,{...l(),className:"chakra-popover__arrow-positioner",children:w.jsx(ne.div,{className:_e("chakra-popover__arrow",e.className),...u(e),__css:{"--popper-arrow-shadow-color":cg("colors",s),"--popper-arrow-bg":cg("colors",f),"--popper-arrow-shadow":cg("shadows",d),...c.arrow}})})}XS.displayName="PopoverArrow";var qS=de(function(t,n){const{getBodyProps:r}=qs(),o=gd();return w.jsx(ne.div,{...r(t,n),className:_e("chakra-popover__body",t.className),__css:o.body})});qS.displayName="PopoverBody";var YS=de(function(t,n){const{onClose:r}=qs(),o=gd();return w.jsx(lm,{size:"sm",onClick:r,className:_e("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});YS.displayName="PopoverCloseButton";function ane(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var sne={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},lne=ne(Ui.section),rR=de(function(t,n){const{variants:r=sne,...o}=t,{isOpen:i}=qs();return w.jsx(lne,{ref:n,variants:ane(r),initial:!1,animate:i?"enter":"exit",...o})});rR.displayName="PopoverTransition";var ZS=de(function(t,n){const{rootProps:r,motionProps:o,...i}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=qs(),u=gd(),c={position:"relative",display:"flex",flexDirection:"column",...u.content};return w.jsx(ne.div,{...s(r),__css:u.popper,className:"chakra-popover__popper",children:w.jsx(rR,{...o,...a(i,n),onAnimationComplete:q0(l,i.onAnimationComplete),className:_e("chakra-popover__content",t.className),__css:c})})});ZS.displayName="PopoverContent";function une(e,t,n){return(e-t)*100/(n-t)}hi({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});hi({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var cne=hi({"0%":{left:"-40%"},"100%":{left:"100%"}}),fne=hi({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function dne(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:i,isIndeterminate:a,role:s="progressbar"}=e,l=une(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof i=="function"?i(t,l):o})(),role:s},percent:l,value:t}}var[hne,pne]=tn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),mne=de((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:i,role:a,...s}=e,l=dne({value:o,min:n,max:r,isIndeterminate:i,role:a}),c={height:"100%",...pne().filledTrack};return w.jsx(ne.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:c})}),oR=de((e,t)=>{var n;const{value:r,min:o=0,max:i=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:c,"aria-label":f,"aria-labelledby":d,"aria-valuetext":h,title:p,role:m,..._}=Rt(e),b=Pr("Progress",e),g=u??((n=b.track)==null?void 0:n.borderRadius),E={animation:`${fne} 1s linear infinite`},A={...!c&&a&&s&&E,...c&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${cne} 1s ease infinite normal none running`}},C={overflow:"hidden",position:"relative",...b.track};return w.jsx(ne.div,{ref:t,borderRadius:g,__css:C,..._,children:w.jsxs(hne,{value:b,children:[w.jsx(mne,{"aria-label":f,"aria-labelledby":d,"aria-valuetext":h,min:o,max:i,value:r,isIndeterminate:c,css:A,borderRadius:g,title:p,role:m}),l]})})});oR.displayName="Progress";function yne(e){return e&&_r(e)&&_r(e.target)}function gne(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:i,isFocusable:a,isNative:s,...l}=e,[u,c]=P.useState(r||""),f=typeof n<"u",d=f?n:u,h=P.useRef(null),p=P.useCallback(()=>{const O=h.current;if(!O)return;let A="input:not(:disabled):checked";const C=O.querySelector(A);if(C){C.focus();return}A="input:not(:disabled)";const y=O.querySelector(A);y==null||y.focus()},[]),_=`radio-${P.useId()}`,b=o||_,g=P.useCallback(O=>{const A=yne(O)?O.target.value:O;f||c(A),t==null||t(String(A))},[t,f]),E=P.useCallback((O={},A=null)=>({...O,ref:Jt(A,h),role:"radiogroup"}),[]),T=P.useCallback((O={},A=null)=>({...O,ref:A,name:b,[s?"checked":"isChecked"]:d!=null?O.value===d:void 0,onChange(y){g(y)},"data-radiogroup":!0}),[s,b,g,d]);return{getRootProps:E,getRadioProps:T,name:b,ref:h,focus:p,setValue:c,value:d,onChange:g,isDisabled:i,isFocusable:a,htmlProps:l}}var[vne,iR]=tn({name:"RadioGroupContext",strict:!1}),aR=de((e,t)=>{const{colorScheme:n,size:r,variant:o,children:i,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:c,onChange:f,getRootProps:d,name:h,htmlProps:p}=gne(u),m=P.useMemo(()=>({name:h,size:r,onChange:f,colorScheme:n,value:c,variant:o,isDisabled:s,isFocusable:l}),[h,r,f,n,c,o,s,l]);return w.jsx(vne,{value:m,children:w.jsx(ne.div,{...d(p,t),className:_e("chakra-radio-group",a),children:i})})});aR.displayName="RadioGroup";var wne={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function bne(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:i,isRequired:a,onChange:s,isInvalid:l,name:u,value:c,id:f,"data-radiogroup":d,"aria-describedby":h,...p}=e,m=`radio-${P.useId()}`,_=cd(),g=!!iR()||!!d;let T=!!_&&!g?_.id:m;T=f??T;const O=o??(_==null?void 0:_.isDisabled),A=i??(_==null?void 0:_.isReadOnly),C=a??(_==null?void 0:_.isRequired),y=l??(_==null?void 0:_.isInvalid),[S,v]=P.useState(!1),[x,I]=P.useState(!1),[R,k]=P.useState(!1),[M,N]=P.useState(!1),[D,L]=P.useState(!!t),j=typeof n<"u",F=j?n:D;P.useEffect(()=>DI(v),[]);const B=P.useCallback(se=>{if(A||O){se.preventDefault();return}j||L(se.target.checked),s==null||s(se)},[j,O,A,s]),U=P.useCallback(se=>{se.key===" "&&N(!0)},[N]),K=P.useCallback(se=>{se.key===" "&&N(!1)},[N]),W=P.useCallback((se={},ue=null)=>({...se,ref:ue,"data-active":Re(M),"data-hover":Re(R),"data-disabled":Re(O),"data-invalid":Re(y),"data-checked":Re(F),"data-focus":Re(x),"data-focus-visible":Re(x&&S),"data-readonly":Re(A),"aria-hidden":!0,onMouseDown:ke(se.onMouseDown,()=>N(!0)),onMouseUp:ke(se.onMouseUp,()=>N(!1)),onMouseEnter:ke(se.onMouseEnter,()=>k(!0)),onMouseLeave:ke(se.onMouseLeave,()=>k(!1))}),[M,R,O,y,F,x,A,S]),{onFocus:Q,onBlur:X}=_??{},J=P.useCallback((se={},ue=null)=>{const Ie=O&&!r;return{...se,id:T,ref:ue,type:"radio",name:u,value:c,onChange:ke(se.onChange,B),onBlur:ke(X,se.onBlur,()=>I(!1)),onFocus:ke(Q,se.onFocus,()=>I(!0)),onKeyDown:ke(se.onKeyDown,U),onKeyUp:ke(se.onKeyUp,K),checked:F,disabled:Ie,readOnly:A,required:C,"aria-invalid":Yl(y),"aria-disabled":Yl(Ie),"aria-required":Yl(C),"data-readonly":Re(A),"aria-describedby":h,style:wne}},[O,r,T,u,c,B,X,Q,U,K,F,A,C,y,h]);return{state:{isInvalid:y,isFocused:x,isChecked:F,isActive:M,isHovered:R,isDisabled:O,isReadOnly:A,isRequired:C},getCheckboxProps:W,getRadioProps:W,getInputProps:J,getLabelProps:(se={},ue=null)=>({...se,ref:ue,onMouseDown:ke(se.onMouseDown,Sne),"data-disabled":Re(O),"data-checked":Re(F),"data-invalid":Re(y)}),getRootProps:(se,ue=null)=>({...se,ref:ue,"data-disabled":Re(O),"data-checked":Re(F),"data-invalid":Re(y)}),htmlProps:p}}function Sne(e){e.preventDefault(),e.stopPropagation()}function _ne(e,t){const n={},r={};for(const[o,i]of Object.entries(e))t.includes(o)?n[o]=i:r[o]=i;return[n,r]}var xc=de((e,t)=>{var n;const r=iR(),{onChange:o,value:i}=e,a=Pr("Radio",{...r,...e}),s=Rt(e),{spacing:l="0.5rem",children:u,isDisabled:c=r==null?void 0:r.isDisabled,isFocusable:f=r==null?void 0:r.isFocusable,inputProps:d,...h}=s;let p=e.isChecked;(r==null?void 0:r.value)!=null&&i!=null&&(p=r.value===i);let m=o;r!=null&&r.onChange&&i!=null&&(m=q0(r.onChange,o));const _=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:b,getCheckboxProps:g,getLabelProps:E,getRootProps:T,htmlProps:O}=bne({...h,isChecked:p,isFocusable:f,isDisabled:c,onChange:m,name:_}),[A,C]=_ne(O,Ej),y=g(C),S=b(d,t),v=E(),x=Object.assign({},A,T()),I={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},R={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},k={userSelect:"none",marginStart:l,...a.label};return w.jsxs(ne.label,{className:"chakra-radio",...x,__css:I,children:[w.jsx("input",{className:"chakra-radio__input",...S}),w.jsx(ne.span,{className:"chakra-radio__control",...y,__css:R}),u&&w.jsx(ne.span,{className:"chakra-radio__label",...v,__css:k,children:u})]})});xc.displayName="Radio";function Ene(){const e=P.useRef(!0);return P.useEffect(()=>{e.current=!1},[]),e.current}function Cne(e){const t=P.useRef();return P.useEffect(()=>{t.current=e},[e]),t.current}var xne=ne("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),V2=Ee("skeleton-start-color"),H2=Ee("skeleton-end-color"),One=hi({from:{opacity:0},to:{opacity:1}}),Ane=hi({from:{borderColor:V2.reference,background:V2.reference},to:{borderColor:H2.reference,background:H2.reference}}),sR=de((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=Eo("Skeleton",n),o=Ene(),{startColor:i="",endColor:a="",isLoaded:s,fadeDuration:l,speed:u,className:c,fitContent:f,...d}=Rt(n),[h,p]=gB("colors",[i,a]),m=Cne(s),_=_e("chakra-skeleton",c),b={...h&&{[V2.variable]:h},...p&&{[H2.variable]:p}};if(s){const g=o||m?"none":`${One} ${l}s`;return w.jsx(ne.div,{ref:t,className:_,__css:{animation:g},...d})}return w.jsx(xne,{ref:t,className:_,...d,__css:{width:f?"fit-content":void 0,...r,...b,_dark:{...r._dark,...b},animation:`${u}s linear infinite alternate ${Ane}`}})});sR.displayName="Skeleton";var W2=de(function(t,n){const r=Pr("Switch",t),{spacing:o="0.5rem",children:i,...a}=Rt(t),{getIndicatorProps:s,getInputProps:l,getCheckboxProps:u,getRootProps:c,getLabelProps:f}=LI(a),d=P.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),h=P.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),p=P.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return w.jsxs(ne.label,{...c(),className:_e("chakra-switch",t.className),__css:d,children:[w.jsx("input",{className:"chakra-switch__input",...l({},n)}),w.jsx(ne.span,{...u(),className:"chakra-switch__track",__css:h,children:w.jsx(ne.span,{__css:r.thumb,className:"chakra-switch__thumb",...s()})}),i&&w.jsx(ne.span,{className:"chakra-switch__label",...f(),__css:p,children:i})]})});W2.displayName="Switch";var[Pne,vd]=tn({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),wd=de((e,t)=>{const n=Pr("Table",e),{className:r,layout:o,...i}=Rt(e);return w.jsx(Pne,{value:n,children:w.jsx(ne.table,{ref:t,__css:{tableLayout:o,...n.table},className:_e("chakra-table",r),...i})})});wd.displayName="Table";var pm=de((e,t)=>{const n=vd();return w.jsx(ne.thead,{...e,ref:t,__css:n.thead})}),ka=de((e,t)=>{const n=vd();return w.jsx(ne.tr,{...e,ref:t,__css:n.tr})}),mm=de((e,t)=>{const n=vd();return w.jsx(ne.tbody,{...e,ref:t,__css:n.tbody})}),Nt=de(({isNumeric:e,...t},n)=>{const r=vd();return w.jsx(ne.td,{...t,ref:n,__css:r.td,"data-is-numeric":e})}),Bt=de(({isNumeric:e,...t},n)=>{const r=vd();return w.jsx(ne.th,{...t,ref:n,__css:r.th,"data-is-numeric":e})});function Tne(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Ine=["h","minH","height","minHeight"],QS=de((e,t)=>{const n=Eo("Textarea",e),{className:r,rows:o,...i}=Rt(e),a=kI(i),s=o?Tne(n,Ine):n;return w.jsx(ne.textarea,{ref:t,rows:o,...a,className:_e("chakra-textarea",r),__css:s})});QS.displayName="Textarea";var Rne={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},G2=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},sp=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function kne(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:i,closeOnPointerDown:a=o,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:c,id:f,isOpen:d,defaultIsOpen:h,arrowSize:p=10,arrowShadowColor:m,arrowPadding:_,modifiers:b,isDisabled:g,gutter:E,offset:T,direction:O,...A}=e,{isOpen:C,onOpen:y,onClose:S}=US({isOpen:d,defaultIsOpen:h,onOpen:l,onClose:u}),{referenceRef:v,getPopperProps:x,getArrowInnerProps:I,getArrowProps:R}=zS({enabled:C,placement:c,arrowPadding:_,modifiers:b,gutter:E,offset:T,direction:O}),k=P.useId(),N=`tooltip-${f??k}`,D=P.useRef(null),L=P.useRef(),j=P.useCallback(()=>{L.current&&(clearTimeout(L.current),L.current=void 0)},[]),F=P.useRef(),B=P.useCallback(()=>{F.current&&(clearTimeout(F.current),F.current=void 0)},[]),U=P.useCallback(()=>{B(),S()},[S,B]),K=Mne(D,U),W=P.useCallback(()=>{if(!g&&!L.current){C&&K();const ue=sp(D);L.current=ue.setTimeout(y,t)}},[K,g,C,y,t]),Q=P.useCallback(()=>{j();const ue=sp(D);F.current=ue.setTimeout(U,n)},[n,U,j]),X=P.useCallback(()=>{C&&r&&Q()},[r,Q,C]),J=P.useCallback(()=>{C&&a&&Q()},[a,Q,C]),te=P.useCallback(ue=>{C&&ue.key==="Escape"&&Q()},[C,Q]);tu(()=>G2(D),"keydown",s?te:void 0),tu(()=>{const ue=D.current;if(!ue)return null;const Ie=v5(ue);return Ie.localName==="body"?sp(D):Ie},"scroll",()=>{C&&i&&U()},{passive:!0,capture:!0}),P.useEffect(()=>{g&&(j(),C&&S())},[g,C,S,j]),P.useEffect(()=>()=>{j(),B()},[j,B]),tu(()=>D.current,"pointerleave",Q);const le=P.useCallback((ue={},Ie=null)=>({...ue,ref:Jt(D,Ie,v),onPointerEnter:ke(ue.onPointerEnter,ie=>{ie.pointerType!=="touch"&&W()}),onClick:ke(ue.onClick,X),onPointerDown:ke(ue.onPointerDown,J),onFocus:ke(ue.onFocus,W),onBlur:ke(ue.onBlur,Q),"aria-describedby":C?N:void 0}),[W,Q,J,C,N,X,v]),ge=P.useCallback((ue={},Ie=null)=>x({...ue,style:{...ue.style,[on.arrowSize.var]:p?`${p}px`:void 0,[on.arrowShadowColor.var]:m}},Ie),[x,p,m]),se=P.useCallback((ue={},Ie=null)=>{const gt={...ue.style,position:"relative",transformOrigin:on.transformOrigin.varRef};return{ref:Ie,...A,...ue,id:N,role:"tooltip",style:gt}},[A,N]);return{isOpen:C,show:W,hide:Q,getTriggerProps:le,getTooltipProps:se,getTooltipPositionerProps:ge,getArrowProps:R,getArrowInnerProps:I}}var fg="chakra-ui:close-tooltip";function Mne(e,t){return P.useEffect(()=>{const n=G2(e);return n.addEventListener(fg,t),()=>n.removeEventListener(fg,t)},[t,e]),()=>{const n=G2(e),r=sp(e);n.dispatchEvent(new r.CustomEvent(fg))}}function Dne(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Lne(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Nne=ne(Ui.div),l1=de((e,t)=>{var n,r;const o=Eo("Tooltip",e),i=Rt(e),a=nd(),{children:s,label:l,shouldWrapChildren:u,"aria-label":c,hasArrow:f,bg:d,portalProps:h,background:p,backgroundColor:m,bgColor:_,motionProps:b,...g}=i,E=(r=(n=p??m)!=null?n:d)!=null?r:_;if(E){o.bg=E;const x=Bj(a,"colors",E);o[on.arrowBg.var]=x}const T=kne({...g,direction:a.direction}),O=typeof s=="string"||u;let A;if(O)A=w.jsx(ne.span,{display:"inline-block",tabIndex:0,...T.getTriggerProps(),children:s});else{const x=P.Children.only(s);A=P.cloneElement(x,T.getTriggerProps(x.props,x.ref))}const C=!!c,y=T.getTooltipProps({},t),S=C?Dne(y,["role","id"]):y,v=Lne(y,["role","id"]);return l?w.jsxs(w.Fragment,{children:[A,w.jsx(Nu,{children:T.isOpen&&w.jsx(Lu,{...h,children:w.jsx(ne.div,{...T.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:w.jsxs(Nne,{variants:Rne,initial:"exit",animate:"enter",exit:"exit",...b,...S,__css:o,children:[l,C&&w.jsx(ne.span,{srOnly:!0,...v,children:c}),f&&w.jsx(ne.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:w.jsx(ne.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):w.jsx(w.Fragment,{children:s})});l1.displayName="Tooltip";var K2={},Qx=K0;K2.createRoot=Qx.createRoot,K2.hydrateRoot=Qx.hydrateRoot;/** + * @remix-run/router v1.8.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function jf(){return jf=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ym(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jne(){return Math.random().toString(36).substr(2,8)}function e4(e,t){return{usr:e.state,key:e.key,idx:t}}function X2(e,t,n,r){return n===void 0&&(n=null),jf({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ys(t):t,{state:n,key:t&&t.key||r||jne()})}function u1(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ys(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Fne(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s=da.Pop,l=null,u=c();u==null&&(u=0,a.replaceState(jf({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function f(){s=da.Pop;let _=c(),b=_==null?null:_-u;u=_,l&&l({action:s,location:m.location,delta:b})}function d(_,b){s=da.Push;let g=X2(m.location,_,b);n&&n(g,_),u=c()+1;let E=e4(g,u),T=m.createHref(g);try{a.pushState(E,"",T)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;o.location.assign(T)}i&&l&&l({action:s,location:m.location,delta:1})}function h(_,b){s=da.Replace;let g=X2(m.location,_,b);n&&n(g,_),u=c();let E=e4(g,u),T=m.createHref(g);a.replaceState(E,"",T),i&&l&&l({action:s,location:m.location,delta:0})}function p(_){let b=o.location.origin!=="null"?o.location.origin:o.location.href,g=typeof _=="string"?_:u1(_);return sn(b,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,b)}let m={get action(){return s},get location(){return e(o,a)},listen(_){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Jx,f),l=_,()=>{o.removeEventListener(Jx,f),l=null}},createHref(_){return t(o,_)},createURL:p,encodeLocation(_){let b=p(_);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:d,replace:h,go(_){return a.go(_)}};return m}var t4;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(t4||(t4={}));function $ne(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Ys(t):t,o=JS(r.pathname||"/",n);if(o==null)return null;let i=lR(e);zne(i);let a=null;for(let s=0;a==null&&s{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(sn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Oa([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(sn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),lR(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Xne(u,i.index),routesMeta:c})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let l of uR(i.path))o(i,a,l)}),t}function uR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=uR(r.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function zne(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:qne(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Une=/^:\w+$/,Vne=3,Hne=2,Wne=1,Gne=10,Kne=-2,n4=e=>e==="*";function Xne(e,t){let n=e.split("/"),r=n.length;return n.some(n4)&&(r+=Kne),t&&(r+=Hne),n.filter(o=>!n4(o)).reduce((o,i)=>o+(Une.test(i)?Vne:i===""?Wne:Gne),r)}function qne(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Yne(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{if(c==="*"){let d=s[f]||"";a=i.slice(0,i.length-d.length).replace(/(.)\/+$/,"$1")}return u[c]=ere(s[f]||"",c),u},{}),pathname:i,pathnameBase:a,pattern:e}}function Qne(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ym(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Jne(e){try{return decodeURI(e)}catch(t){return ym(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ere(e,t){try{return decodeURIComponent(e)}catch(n){return ym(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function JS(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function tre(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Ys(e):e;return{pathname:n?n.startsWith("/")?n:nre(n,t):t,search:ore(r),hash:ire(o)}}function nre(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function dg(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function cR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fR(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Ys(e):(o=jf({},e),sn(!o.pathname||!o.pathname.includes("?"),dg("?","pathname","search",o)),sn(!o.pathname||!o.pathname.includes("#"),dg("#","pathname","hash",o)),sn(!o.search||!o.search.includes("#"),dg("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(r||a==null)s=n;else{let f=t.length-1;if(a.startsWith("..")){let d=a.split("/");for(;d[0]==="..";)d.shift(),f-=1;o.pathname=d.join("/")}s=f>=0?t[f]:"/"}let l=tre(o,s),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Oa=e=>e.join("/").replace(/\/\/+/g,"/"),rre=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ore=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ire=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function are(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const dR=["post","put","patch","delete"];new Set(dR);const sre=["get",...dR];new Set(sre);/** + * React Router v6.15.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function c1(){return c1=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),a=P.useRef(!1);return mR(()=>{a.current=!0}),P.useCallback(function(l,u){if(u===void 0&&(u={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let c=fR(l,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Oa([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,i,o,e])}const fre=P.createContext(null);function dre(e){let t=P.useContext(Hi).outlet;return t&&P.createElement(fre.Provider,{value:e},t)}function t_(){let{matches:e}=P.useContext(Hi),t=e[e.length-1];return t?t.params:{}}function n_(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=P.useContext(Hi),{pathname:o}=Sd(),i=JSON.stringify(cR(r).map(a=>a.pathnameBase));return P.useMemo(()=>fR(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function hre(e,t){return pre(e,t)}function pre(e,t,n){bd()||sn(!1);let{navigator:r}=P.useContext(Zs),{matches:o}=P.useContext(Hi),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let s=i?i.pathnameBase:"/";i&&i.route;let l=Sd(),u;if(t){var c;let m=typeof t=="string"?Ys(t):t;s==="/"||(c=m.pathname)!=null&&c.startsWith(s)||sn(!1),u=m}else u=l;let f=u.pathname||"/",d=s==="/"?f:f.slice(s.length)||"/",h=$ne(e,{pathname:d}),p=wre(h&&h.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:Oa([s,r.encodeLocation?r.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?s:Oa([s,r.encodeLocation?r.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n);return t&&p?P.createElement(gm.Provider,{value:{location:c1({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:da.Pop}},p):p}function mre(){let e=Ere(),t=are(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),n?P.createElement("pre",{style:o},n):null,i)}const yre=P.createElement(mre,null);class gre extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?P.createElement(Hi.Provider,{value:this.props.routeContext},P.createElement(pR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vre(e){let{routeContext:t,match:n,children:r}=e,o=P.useContext(e_);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),P.createElement(Hi.Provider,{value:t},r)}function wre(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let s=i.findIndex(l=>l.route.id&&(a==null?void 0:a[l.route.id]));s>=0||sn(!1),i=i.slice(0,Math.min(i.length,s+1))}return i.reduceRight((s,l,u)=>{let c=l.route.id?a==null?void 0:a[l.route.id]:null,f=null;n&&(f=l.route.errorElement||yre);let d=t.concat(i.slice(0,u+1)),h=()=>{let p;return c?p=f:l.route.Component?p=P.createElement(l.route.Component,null):l.route.element?p=l.route.element:p=s,P.createElement(vre,{match:l,routeContext:{outlet:s,matches:d,isDataRoute:n!=null},children:p})};return n&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?P.createElement(gre,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:h(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):h()},null)}var yR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(yR||{}),f1=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(f1||{});function bre(e){let t=P.useContext(e_);return t||sn(!1),t}function Sre(e){let t=P.useContext(hR);return t||sn(!1),t}function _re(e){let t=P.useContext(Hi);return t||sn(!1),t}function gR(e){let t=_re(),n=t.matches[t.matches.length-1];return n.route.id||sn(!1),n.route.id}function Ere(){var e;let t=P.useContext(pR),n=Sre(f1.UseRouteError),r=gR(f1.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function Cre(){let{router:e}=bre(yR.UseNavigateStable),t=gR(f1.UseNavigateStable),n=P.useRef(!1);return mR(()=>{n.current=!0}),P.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,c1({fromRouteId:t},i)))},[e,t])}function xre(e){return dre(e.context)}function Po(e){sn(!1)}function Ore(e){let{basename:t="/",children:n=null,location:r,navigationType:o=da.Pop,navigator:i,static:a=!1}=e;bd()&&sn(!1);let s=t.replace(/^\/*/,"/"),l=P.useMemo(()=>({basename:s,navigator:i,static:a}),[s,i,a]);typeof r=="string"&&(r=Ys(r));let{pathname:u="/",search:c="",hash:f="",state:d=null,key:h="default"}=r,p=P.useMemo(()=>{let m=JS(u,s);return m==null?null:{location:{pathname:m,search:c,hash:f,state:d,key:h},navigationType:o}},[s,u,c,f,d,h,o]);return p==null?null:P.createElement(Zs.Provider,{value:l},P.createElement(gm.Provider,{children:n,value:p}))}function Are(e){let{children:t,location:n}=e;return hre(q2(t),n)}new Promise(()=>{});function q2(e,t){t===void 0&&(t=[]);let n=[];return P.Children.forEach(e,(r,o)=>{if(!P.isValidElement(r))return;let i=[...t,o];if(r.type===P.Fragment){n.push.apply(n,q2(r.props.children,i));return}r.type!==Po&&sn(!1),!r.props.index||!r.props.children||sn(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=q2(r.props.children,i)),n.push(a)}),n}/** + * React Router DOM v6.15.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function d1(){return d1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Pre(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Tre(e,t){return e.button===0&&(!t||t==="_self")&&!Pre(e)}const Ire=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Rre=["aria-current","caseSensitive","className","end","style","to","children"],kre="startTransition",r4=lv[kre];function Mre(e){let{basename:t,children:n,future:r,window:o}=e,i=P.useRef();i.current==null&&(i.current=Bne({window:o,v5Compat:!0}));let a=i.current,[s,l]=P.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},c=P.useCallback(f=>{u&&r4?r4(()=>l(f)):l(f)},[l,u]);return P.useLayoutEffect(()=>a.listen(c),[a,c]),P.createElement(Ore,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a})}const Dre=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Lre=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ff=P.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:l,to:u,preventScrollReset:c}=t,f=vR(t,Ire),{basename:d}=P.useContext(Zs),h,p=!1;if(typeof u=="string"&&Lre.test(u)&&(h=u,Dre))try{let g=new URL(window.location.href),E=u.startsWith("//")?new URL(g.protocol+u):new URL(u),T=JS(E.pathname,d);E.origin===g.origin&&T!=null?u=T+E.search+E.hash:p=!0}catch{}let m=lre(u,{relative:o}),_=Nre(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:o});function b(g){r&&r(g),g.defaultPrevented||_(g)}return P.createElement("a",d1({},f,{href:h||m,onClick:p||i?r:b,ref:n,target:l}))}),h1=P.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:l,children:u}=t,c=vR(t,Rre),f=n_(l,{relative:c.relative}),d=Sd(),h=P.useContext(hR),{navigator:p}=P.useContext(Zs),m=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,_=d.pathname,b=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;o||(_=_.toLowerCase(),b=b?b.toLowerCase():null,m=m.toLowerCase());let g=_===m||!a&&_.startsWith(m)&&_.charAt(m.length)==="/",E=b!=null&&(b===m||!a&&b.startsWith(m)&&b.charAt(m.length)==="/"),T=g?r:void 0,O;typeof i=="function"?O=i({isActive:g,isPending:E}):O=[i,g?"active":null,E?"pending":null].filter(Boolean).join(" ");let A=typeof s=="function"?s({isActive:g,isPending:E}):s;return P.createElement(Ff,d1({},c,{"aria-current":T,className:O,ref:n,style:A,to:l}),typeof u=="function"?u({isActive:g,isPending:E}):u)});var o4;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(o4||(o4={}));var i4;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(i4||(i4={}));function Nre(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a}=t===void 0?{}:t,s=ure(),l=Sd(),u=n_(e,{relative:a});return P.useCallback(c=>{if(Tre(c,n)){c.preventDefault();let f=r!==void 0?r:u1(l)===u1(u);s(e,{replace:f,state:o,preventScrollReset:i,relative:a})}},[l,s,u,r,o,n,e,i,a])}let Bre=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var $f={};Object.defineProperty($f,"__esModule",{value:!0});$f.bech32m=Lo=$f.bech32=void 0;const p1="qpzry9x8gf2tvdw0s3jn54khce6mua7l",wR={};for(let e=0;e>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function a4(e){let t=1;for(let n=0;n126)return"Invalid prefix ("+e+")";t=iu(t)^r>>5}t=iu(t);for(let n=0;n=n;)i-=n,s.push(o>>i&a);if(r)i>0&&s.push(o<=t)return"Excess padding";if(o<l)throw new TypeError("Exceeds length limit");a=a.toLowerCase();let u=a4(a);if(typeof u=="string")throw new Error(u);let c=a+"1";for(let f=0;f>5)throw new Error("Non 5-bit word");u=iu(u)^d,c+=p1.charAt(d)}for(let f=0;f<6;++f)u=iu(u);u^=t;for(let f=0;f<6;++f){const d=u>>(5-f)*5&31;c+=p1.charAt(d)}return c}function r(a,s){if(s=s||90,a.length<8)return a+" too short";if(a.length>s)return"Exceeds length limit";const l=a.toLowerCase(),u=a.toUpperCase();if(a!==l&&a!==u)return"Mixed-case string "+a;a=l;const c=a.lastIndexOf("1");if(c===-1)return"No separator character for "+a;if(c===0)return"Missing prefix for "+a;const f=a.slice(0,c),d=a.slice(c+1);if(d.length<6)return"Data too short";let h=a4(f);if(typeof h=="string")return h;const p=[];for(let m=0;m=d.length)&&p.push(b)}return h!==t?"Invalid checksum for "+a:{prefix:f,words:p}}function o(a,s){const l=r(a,s);if(typeof l=="object")return l}function i(a,s){const l=r(a,s);if(typeof l=="object")return l;throw new Error(l)}return{decodeUnsafe:o,decode:i,encode:n,toWords:jre,fromWordsUnsafe:Fre,fromWords:$re}}var Lo=$f.bech32=bR("bech32");$f.bech32m=bR("bech32m");var SR={};(function(e){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(x){if(!Number.isSafeInteger(x))throw new Error(`Wrong integer: ${x}`)}e.assertNumber=t;function n(...x){const I=(M,N)=>D=>M(N(D)),R=Array.from(x).reverse().reduce((M,N)=>M?I(M,N.encode):N.encode,void 0),k=x.reduce((M,N)=>M?I(M,N.decode):N.decode,void 0);return{encode:R,decode:k}}function r(x){return{encode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return I.map(R=>{if(t(R),R<0||R>=x.length)throw new Error(`Digit index outside alphabet: ${R} (alphabet: ${x.length})`);return x[R]})},decode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("alphabet.decode input should be array of strings");return I.map(R=>{if(typeof R!="string")throw new Error(`alphabet.decode: not string element=${R}`);const k=x.indexOf(R);if(k===-1)throw new Error(`Unknown letter: "${R}". Allowed: ${x}`);return k})}}}function o(x=""){if(typeof x!="string")throw new Error("join separator should be string");return{encode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("join.encode input should be array of strings");for(let R of I)if(typeof R!="string")throw new Error(`join.encode: non-string input=${R}`);return I.join(x)},decode:I=>{if(typeof I!="string")throw new Error("join.decode input should be string");return I.split(x)}}}function i(x,I="="){if(t(x),typeof I!="string")throw new Error("padding chr should be string");return{encode(R){if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("padding.encode input should be array of strings");for(let k of R)if(typeof k!="string")throw new Error(`padding.encode: non-string input=${k}`);for(;R.length*x%8;)R.push(I);return R},decode(R){if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("padding.encode input should be array of strings");for(let M of R)if(typeof M!="string")throw new Error(`padding.decode: non-string input=${M}`);let k=R.length;if(k*x%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;k>0&&R[k-1]===I;k--)if(!((k-1)*x%8))throw new Error("Invalid padding: string has too much padding");return R.slice(0,k)}}}function a(x){if(typeof x!="function")throw new Error("normalize fn should be function");return{encode:I=>I,decode:I=>x(I)}}function s(x,I,R){if(I<2)throw new Error(`convertRadix: wrong from=${I}, base cannot be less than 2`);if(R<2)throw new Error(`convertRadix: wrong to=${R}, base cannot be less than 2`);if(!Array.isArray(x))throw new Error("convertRadix: data should be array");if(!x.length)return[];let k=0;const M=[],N=Array.from(x);for(N.forEach(D=>{if(t(D),D<0||D>=I)throw new Error(`Wrong integer: ${D}`)});;){let D=0,L=!0;for(let j=k;jI?l(I,x%I):x,u=(x,I)=>x+(I-l(x,I));function c(x,I,R,k){if(!Array.isArray(x))throw new Error("convertRadix2: data should be array");if(I<=0||I>32)throw new Error(`convertRadix2: wrong from=${I}`);if(R<=0||R>32)throw new Error(`convertRadix2: wrong to=${R}`);if(u(I,R)>32)throw new Error(`convertRadix2: carry overflow from=${I} to=${R} carryBits=${u(I,R)}`);let M=0,N=0;const D=2**R-1,L=[];for(const j of x){if(t(j),j>=2**I)throw new Error(`convertRadix2: invalid data word=${j} from=${I}`);if(M=M<32)throw new Error(`convertRadix2: carry overflow pos=${N} from=${I}`);for(N+=I;N>=R;N-=R)L.push((M>>N-R&D)>>>0);M&=2**N-1}if(M=M<=I)throw new Error("Excess padding");if(!k&&M)throw new Error(`Non-zero padding: ${M}`);return k&&N>0&&L.push(M>>>0),L}function f(x){return t(x),{encode:I=>{if(!(I instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return s(Array.from(I),2**8,x)},decode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(s(I,x,2**8))}}}function d(x,I=!1){if(t(x),x<=0||x>32)throw new Error("radix2: bits should be in (0..32]");if(u(8,x)>32||u(x,8)>32)throw new Error("radix2: carry overflow");return{encode:R=>{if(!(R instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return c(Array.from(R),8,x,!I)},decode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(c(R,x,8,I))}}}function h(x){if(typeof x!="function")throw new Error("unsafeWrapper fn should be function");return function(...I){try{return x.apply(null,I)}catch{}}}function p(x,I){if(t(x),typeof I!="function")throw new Error("checksum fn should be function");return{encode(R){if(!(R instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const k=I(R).slice(0,x),M=new Uint8Array(R.length+x);return M.set(R),M.set(k,R.length),M},decode(R){if(!(R instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const k=R.slice(0,-x),M=I(k).slice(0,x),N=R.slice(-x);for(let D=0;Dx.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),o("")),e.base64url=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),o(""));const m=x=>n(f(58),r(x),o(""));e.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const _=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(x){let I="";for(let R=0;Rn(p(4,I=>x(x(I))),e.base58);e.base58check=b;const g=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),E=[996825010,642813549,513874426,1027748829,705979059];function T(x){const I=x>>25;let R=(x&33554431)<<5;for(let k=0;k>k&1)===1&&(R^=E[k]);return R}function O(x,I,R=1){const k=x.length;let M=1;for(let N=0;N126)throw new Error(`Invalid prefix (${x})`);M=T(M)^D>>5}M=T(M);for(let N=0;NK)throw new TypeError(`Length ${W} exceeds limit ${K}`);return B=B.toLowerCase(),`${B}1${g.encode(U)}${O(B,U,I)}`}function L(B,U=90){if(typeof B!="string")throw new Error(`bech32.decode input should be string, not ${typeof B}`);if(B.length<8||U!==!1&&B.length>U)throw new TypeError(`Wrong string length: ${B.length} (${B}). Expected (8..${U})`);const K=B.toLowerCase();if(B!==K&&B!==B.toUpperCase())throw new Error("String must be lowercase or uppercase");B=K;const W=B.lastIndexOf("1");if(W===0||W===-1)throw new Error('Letter "1" must be present between prefix and data only');const Q=B.slice(0,W),X=B.slice(W+1);if(X.length<6)throw new Error("Data must be at least 6 characters long");const J=g.decode(X).slice(0,-6),te=O(Q,J,I);if(!X.endsWith(te))throw new Error(`Invalid checksum in ${B}: expected "${te}"`);return{prefix:Q,words:J}}const j=h(L);function F(B){const{prefix:U,words:K}=L(B,!1);return{prefix:U,words:K,bytes:k(K)}}return{encode:D,decode:L,decodeToBytes:F,decodeUnsafe:j,fromWords:k,fromWordsUnsafe:N,toWords:M}}e.bech32=A("bech32"),e.bech32m=A("bech32m"),e.utf8={encode:x=>new TextDecoder().decode(x),decode:x=>new TextEncoder().encode(x)},e.hex=n(d(4),r("0123456789abcdef"),o(""),a(x=>{if(typeof x!="string"||x.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof x} with length ${x.length}`);return x.toLowerCase()}));const C={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},y=`Invalid encoding type. Available types: ${Object.keys(C).join(", ")}`,S=(x,I)=>{if(typeof x!="string"||!C.hasOwnProperty(x))throw new TypeError(y);if(!(I instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return C[x].encode(I)};e.bytesToString=S,e.str=e.bytesToString;const v=(x,I)=>{if(!C.hasOwnProperty(x))throw new TypeError(y);if(typeof I!="string")throw new TypeError("stringToBytes() expects string");return C[x].decode(I)};e.stringToBytes=v,e.bytes=e.stringToBytes})(SR);const{bech32:Jo,hex:Mo,utf8:zre}=SR,s4={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},l4={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},u4={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},c4={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},wh=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],Ure={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},Vre=BigInt("2100000000000000000"),f4=BigInt(1e11),Y2={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},_R={};for(let e=0,t=Object.keys(Y2);eMo.encode(Jo.fromWordsUnsafe(e)),16:e=>Mo.encode(Jo.fromWordsUnsafe(e)),13:e=>zre.encode(Jo.fromWordsUnsafe(e)),19:e=>Mo.encode(Jo.fromWordsUnsafe(e)),23:e=>Mo.encode(Jo.fromWordsUnsafe(e)),27:e=>Mo.encode(Jo.fromWordsUnsafe(e)),6:m1,24:m1,3:Gre,5:Kre};function Wre(e){return t=>({tagCode:parseInt(e),words:Jo.encode("unknown",t,Number.MAX_SAFE_INTEGER)})}function m1(e){return e.reverse().reduce((t,n,r)=>t+n*Math.pow(32,r),0)}function Gre(e){const t=[];let n,r,o,i,a,s=Jo.fromWordsUnsafe(e);for(;s.length>0;)n=Mo.encode(s.slice(0,33)),r=Mo.encode(s.slice(33,41)),o=parseInt(Mo.encode(s.slice(41,45)),16),i=parseInt(Mo.encode(s.slice(45,49)),16),a=parseInt(Mo.encode(s.slice(49,51)),16),s=s.slice(51),t.push({pubkey:n,short_channel_id:r,fee_base_msat:o,fee_proportional_millionths:i,cltv_expiry_delta:a});return t}function Kre(e){const t=e.slice().reverse().map(o=>[!!(o&1),!!(o&2),!!(o&4),!!(o&8),!!(o&16)]).reduce((o,i)=>o.concat(i),[]);for(;t.length{let a;t[i*2]?a="required":t[i*2+1]?a="supported":a="unsupported",n[o]=a});const r=t.slice(wh.length*2);return n.extra_bits={start_bit:wh.length*2,bits:r,has_required:r.reduce((o,i,a)=>a%2!==0?o||!1:o||i,!1)},n}function ER(e,t){let n,r;if(e.slice(-1).match(/^[munp]$/))n=e.slice(-1),r=e.slice(0,-1);else{if(e.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=e}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const o=BigInt(r),i=n?o*f4/Ure[n]:o*f4;if(n==="p"&&o%BigInt(10)!==BigInt(0)||i>Vre)throw new Error("Amount is outside of valid range");return t?i.toString():i}function Xre(e,t){if(typeof e!="string")throw new Error("Lightning Payment Request must be string");if(e.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=Jo.decode(e,Number.MAX_SAFE_INTEGER);e=e.toLowerCase();const o=r.prefix;let i=r.words,a=e.slice(o.length+1),s=i.slice(-104);i=i.slice(0,-104);let l=o.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(l&&!l[2]&&(l=o.match(/^ln(\S+)$/)),!l)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const u=l[1];let c;if(t){if(t.bech32===void 0||t.pubKeyHash===void 0||t.scriptHash===void 0||!Array.isArray(t.validWitnessVersions))throw new Error("Invalid network");c=t}else switch(u){case s4.bech32:c=s4;break;case l4.bech32:c=l4;break;case u4.bech32:c=u4;break;case c4.bech32:c=c4;break}if(!c||c.bech32!==u)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:u,value:c});const f=l[2];let d;if(f){const T=l[3];d=ER(f+T,!0),n.push({name:"amount",letters:l[2]+l[3],value:d})}else d=null;n.push({name:"separator",letters:"1"});const h=m1(i.slice(0,7));i=i.slice(7),n.push({name:"timestamp",letters:a.slice(0,7),value:h}),a=a.slice(7);let p,m,_,b;for(;i.length>0;){const T=i[0].toString();p=_R[T]||"unknown_tag",m=Hre[T]||Wre(T),i=i.slice(1),_=m1(i.slice(0,2)),i=i.slice(2),b=i.slice(0,_),i=i.slice(_),n.push({name:p,tag:a[0],letters:a.slice(0,1+2+_),value:m(b)}),a=a.slice(1+2+_)}n.push({name:"signature",letters:a.slice(0,104),value:Mo.encode(Jo.fromWordsUnsafe(s))}),a=a.slice(104),n.push({name:"checksum",letters:a});let g={paymentRequest:e,sections:n,get expiry(){let T=n.find(O=>O.name==="expiry");if(T)return E("timestamp")+T.value},get route_hints(){return n.filter(T=>T.name==="route_hint").map(T=>T.value)}};for(let T in Y2)T!=="route_hint"&&Object.defineProperty(g,T,{get(){return E(T)}});return g;function E(T){let O=n.find(A=>A.name===T);return O?O.value:void 0}}var qre={decode:Xre,hrpToMillisat:ER};function Z2(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Yre(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function CR(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Zre(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Z2(e.outputLen),Z2(e.blockLen)}function Qre(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Jre(e,t){CR(e);const n=t.outputLen;if(e.lengthe instanceof Uint8Array,pg=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Go=(e,t)=>e<<32-t|e>>>t,eoe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!eoe)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function toe(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function o_(e){if(typeof e=="string"&&(e=toe(e)),!xR(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function noe(...e){const t=new Uint8Array(e.reduce((r,o)=>r+o.length,0));let n=0;return e.forEach(r=>{if(!xR(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class OR{clone(){return this._cloneInto()}}function AR(e){const t=r=>e().update(o_(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function PR(e=32){if(hg&&typeof hg.getRandomValues=="function")return hg.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function roe(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),l=r?4:0,u=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+u,s,r)}class ooe extends OR{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=pg(this.buffer)}update(t){ys.exists(this);const{view:n,buffer:r,blockLen:o}=this;t=o_(t);const i=t.length;for(let a=0;ao-a&&(this.process(r,0),a=0);for(let f=a;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&n,aoe=(e,t,n)=>e&t^e&n^t&n,soe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Zi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qi=new Uint32Array(64);class TR extends ooe{constructor(){super(64,32,8,!1),this.A=Zi[0]|0,this.B=Zi[1]|0,this.C=Zi[2]|0,this.D=Zi[3]|0,this.E=Zi[4]|0,this.F=Zi[5]|0,this.G=Zi[6]|0,this.H=Zi[7]|0}get(){const{A:t,B:n,C:r,D:o,E:i,F:a,G:s,H:l}=this;return[t,n,r,o,i,a,s,l]}set(t,n,r,o,i,a,s,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=s|0,this.H=l|0}process(t,n){for(let f=0;f<16;f++,n+=4)Qi[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const d=Qi[f-15],h=Qi[f-2],p=Go(d,7)^Go(d,18)^d>>>3,m=Go(h,17)^Go(h,19)^h>>>10;Qi[f]=m+Qi[f-7]+p+Qi[f-16]|0}let{A:r,B:o,C:i,D:a,E:s,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=Go(s,6)^Go(s,11)^Go(s,25),h=c+d+ioe(s,l,u)+soe[f]+Qi[f]|0,m=(Go(r,2)^Go(r,13)^Go(r,22))+aoe(r,o,i)|0;c=u,u=l,l=s,s=a+h|0,a=i,i=o,o=r,r=h+m|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,o,i,a,s,l,u,c)}roundClean(){Qi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class loe extends TR{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const y1=AR(()=>new TR);AR(()=>new loe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const IR=BigInt(0),vm=BigInt(1),uoe=BigInt(2),wm=e=>e instanceof Uint8Array,coe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function zo(e){if(!wm(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+o.length,0));let n=0;return e.forEach(r=>{if(!wm(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function doe(e,t){if(e.length!==t.length)return!1;for(let n=0;nIR;e>>=vm,t+=1);return t}function moe(e,t){return e>>BigInt(t)&vm}const yoe=(e,t,n)=>e|(n?vm:IR)<(uoe<new Uint8Array(e),d4=e=>Uint8Array.from(e);function MR(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=mg(e),o=mg(e),i=0;const a=()=>{r.fill(1),o.fill(0),i=0},s=(...f)=>n(o,r,...f),l=(f=mg())=>{o=s(d4([0]),f),r=s(),f.length!==0&&(o=s(d4([1]),f),r=s())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f{a(),l(f);let h;for(;!(h=d(u()));)l();return a(),h}}const goe={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function _d(e,t,n={}){const r=(o,i,a)=>{const s=goe[i];if(typeof s!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=e[o];if(!(a&&l===void 0)&&!s(l,e))throw new Error(`Invalid param ${String(o)}=${l} (${typeof l}), expected ${i}`)};for(const[o,i]of Object.entries(t))r(o,i,!1);for(const[o,i]of Object.entries(n))r(o,i,!0);return e}const voe=Object.freeze(Object.defineProperty({__proto__:null,bitGet:moe,bitLen:poe,bitMask:s_,bitSet:yoe,bytesToHex:zo,bytesToNumberBE:xr,bytesToNumberLE:a_,concatBytes:zs,createHmacDrbg:MR,ensureBytes:Rn,equalBytes:doe,hexToBytes:Cu,hexToNumber:i_,numberToBytesBE:Aa,numberToBytesLE:kR,numberToHexUnpadded:RR,numberToVarBytesBE:foe,utf8ToBytes:hoe,validateObject:_d},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bn=BigInt(0),Qt=BigInt(1),ss=BigInt(2),woe=BigInt(3),Q2=BigInt(4),h4=BigInt(5),p4=BigInt(8);BigInt(9);BigInt(16);function Mn(e,t){const n=e%t;return n>=bn?n:t+n}function boe(e,t,n){if(n<=bn||t 0");if(n===Qt)return bn;let r=Qt;for(;t>bn;)t&Qt&&(r=r*e%n),e=e*e%n,t>>=Qt;return r}function oo(e,t,n){let r=e;for(;t-- >bn;)r*=r,r%=n;return r}function J2(e,t){if(e===bn||t<=bn)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Mn(e,t),r=t,o=bn,i=Qt;for(;n!==bn;){const s=r/n,l=r%n,u=o-i*s;r=n,n=l,o=i,i=u}if(r!==Qt)throw new Error("invert: does not exist");return Mn(o,t)}function Soe(e){const t=(e-Qt)/ss;let n,r,o;for(n=e-Qt,r=0;n%ss===bn;n/=ss,r++);for(o=ss;o(r[o]="function",r),t);return _d(e,n)}function xoe(e,t,n){if(n 0");if(n===bn)return e.ONE;if(n===Qt)return t;let r=e.ONE,o=t;for(;n>bn;)n&Qt&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Qt;return r}function Ooe(e,t){const n=new Array(t.length),r=t.reduce((i,a,s)=>e.is0(a)?i:(n[s]=i,e.mul(i,a)),e.ONE),o=e.inv(r);return t.reduceRight((i,a,s)=>e.is0(a)?i:(n[s]=e.mul(i,n[s]),e.mul(i,a)),o),n}function l_(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Aoe(e,t,n=!1,r={}){if(e<=bn)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:i}=l_(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=_oe(e),s=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:s_(o),ZERO:bn,ONE:Qt,create:l=>Mn(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return bn<=l&&ll===bn,isOdd:l=>(l&Qt)===Qt,neg:l=>Mn(-l,e),eql:(l,u)=>l===u,sqr:l=>Mn(l*l,e),add:(l,u)=>Mn(l+u,e),sub:(l,u)=>Mn(l-u,e),mul:(l,u)=>Mn(l*u,e),pow:(l,u)=>xoe(s,l,u),div:(l,u)=>Mn(l*J2(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>J2(l,e),sqrt:r.sqrt||(l=>a(s,l)),invertBatch:l=>Ooe(s,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?kR(l,i):Aa(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?a_(l):xr(l)}});return Object.freeze(s)}function Poe(e,t,n=!1){e=Rn("privateHash",e);const r=e.length,o=l_(t).nByteLength+8;if(o<24||r1024)throw new Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${r}`);const i=n?a_(e):xr(e);return Mn(i,t-Qt)+Qt}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Toe=BigInt(0),yg=BigInt(1);function Ioe(e,t){const n=(o,i)=>{const a=i.negate();return o?a:i},r=o=>{const i=Math.ceil(t/o)+1,a=2**(o-1);return{windows:i,windowSize:a}};return{constTimeNegate:n,unsafeLadder(o,i){let a=e.ZERO,s=o;for(;i>Toe;)i&yg&&(a=a.add(s)),s=s.double(),i>>=yg;return a},precomputeWindow(o,i){const{windows:a,windowSize:s}=r(i),l=[];let u=o,c=u;for(let f=0;f>=h,_>l&&(_-=d,a+=yg);const b=m,g=m+Math.abs(_)-1,E=p%2!==0,T=_<0;_===0?c=c.add(n(E,i[b])):u=u.add(n(T,i[g]))}return{p:u,f:c}},wNAFCached(o,i,a,s){const l=o._WINDOW_SIZE||1;let u=i.get(o);return u||(u=this.precomputeWindow(o,l),l!==1&&i.set(o,s(u))),this.wNAF(l,u,a)}}}function DR(e){return Coe(e.Fp),_d(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...l_(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Roe(e){const t=DR(e);_d(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:koe,hexToBytes:Moe}=voe,gs={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=gs;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:koe(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=gs,n=typeof e=="string"?Moe(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:o,l:i}=gs._parseInt(n.subarray(2)),{d:a,l:s}=gs._parseInt(i);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=t(n(e.s)),o=t(n(e.r)),i=r.length/2,a=o.length/2,s=n(i),l=n(a);return`30${n(a+i+4)}02${l}${o}02${s}${r}`}},Ei=BigInt(0),lo=BigInt(1);BigInt(2);const m4=BigInt(3);BigInt(4);function Doe(e){const t=Roe(e),{Fp:n}=t,r=t.toBytes||((p,m,_)=>{const b=m.toAffine();return zs(Uint8Array.from([4]),n.toBytes(b.x),n.toBytes(b.y))}),o=t.fromBytes||(p=>{const m=p.subarray(1),_=n.fromBytes(m.subarray(0,n.BYTES)),b=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:_,y:b}});function i(p){const{a:m,b:_}=t,b=n.sqr(p),g=n.mul(b,p);return n.add(n.add(g,n.mul(p,m)),_)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(p){return typeof p=="bigint"&&Ein.eql(E,n.ZERO);return g(_)&&g(b)?f.ZERO:new f(_,b,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const _=n.invertBatch(m.map(b=>b.pz));return m.map((b,g)=>b.toAffine(_[g])).map(f.fromAffine)}static fromHex(m){const _=f.fromAffine(o(Rn("pointHex",m)));return _.assertValidity(),_}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:m,y:_}=this.toAffine();if(!n.isValid(m)||!n.isValid(_))throw new Error("bad point: x or y not FE");const b=n.sqr(_),g=i(m);if(!n.eql(b,g))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:_,py:b,pz:g}=this,{px:E,py:T,pz:O}=m,A=n.eql(n.mul(_,O),n.mul(E,g)),C=n.eql(n.mul(b,O),n.mul(T,g));return A&&C}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:_}=t,b=n.mul(_,m4),{px:g,py:E,pz:T}=this;let O=n.ZERO,A=n.ZERO,C=n.ZERO,y=n.mul(g,g),S=n.mul(E,E),v=n.mul(T,T),x=n.mul(g,E);return x=n.add(x,x),C=n.mul(g,T),C=n.add(C,C),O=n.mul(m,C),A=n.mul(b,v),A=n.add(O,A),O=n.sub(S,A),A=n.add(S,A),A=n.mul(O,A),O=n.mul(x,O),C=n.mul(b,C),v=n.mul(m,v),x=n.sub(y,v),x=n.mul(m,x),x=n.add(x,C),C=n.add(y,y),y=n.add(C,y),y=n.add(y,v),y=n.mul(y,x),A=n.add(A,y),v=n.mul(E,T),v=n.add(v,v),y=n.mul(v,x),O=n.sub(O,y),C=n.mul(v,S),C=n.add(C,C),C=n.add(C,C),new f(O,A,C)}add(m){c(m);const{px:_,py:b,pz:g}=this,{px:E,py:T,pz:O}=m;let A=n.ZERO,C=n.ZERO,y=n.ZERO;const S=t.a,v=n.mul(t.b,m4);let x=n.mul(_,E),I=n.mul(b,T),R=n.mul(g,O),k=n.add(_,b),M=n.add(E,T);k=n.mul(k,M),M=n.add(x,I),k=n.sub(k,M),M=n.add(_,g);let N=n.add(E,O);return M=n.mul(M,N),N=n.add(x,R),M=n.sub(M,N),N=n.add(b,g),A=n.add(T,O),N=n.mul(N,A),A=n.add(I,R),N=n.sub(N,A),y=n.mul(S,M),A=n.mul(v,R),y=n.add(A,y),A=n.sub(I,y),y=n.add(I,y),C=n.mul(A,y),I=n.add(x,x),I=n.add(I,x),R=n.mul(S,R),M=n.mul(v,M),I=n.add(I,R),R=n.sub(x,R),R=n.mul(S,R),M=n.add(M,R),x=n.mul(I,M),C=n.add(C,x),x=n.mul(N,M),A=n.mul(k,A),A=n.sub(A,x),x=n.mul(k,I),y=n.mul(N,y),y=n.add(y,x),new f(A,C,y)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,_=>{const b=n.invertBatch(_.map(g=>g.pz));return _.map((g,E)=>g.toAffine(b[E])).map(f.fromAffine)})}multiplyUnsafe(m){const _=f.ZERO;if(m===Ei)return _;if(s(m),m===lo)return this;const{endo:b}=t;if(!b)return h.unsafeLadder(this,m);let{k1neg:g,k1:E,k2neg:T,k2:O}=b.splitScalar(m),A=_,C=_,y=this;for(;E>Ei||O>Ei;)E&lo&&(A=A.add(y)),O&lo&&(C=C.add(y)),y=y.double(),E>>=lo,O>>=lo;return g&&(A=A.negate()),T&&(C=C.negate()),C=new f(n.mul(C.px,b.beta),C.py,C.pz),A.add(C)}multiply(m){s(m);let _=m,b,g;const{endo:E}=t;if(E){const{k1neg:T,k1:O,k2neg:A,k2:C}=E.splitScalar(_);let{p:y,f:S}=this.wNAF(O),{p:v,f:x}=this.wNAF(C);y=h.constTimeNegate(T,y),v=h.constTimeNegate(A,v),v=new f(n.mul(v.px,E.beta),v.py,v.pz),b=y.add(v),g=S.add(x)}else{const{p:T,f:O}=this.wNAF(_);b=T,g=O}return f.normalizeZ([b,g])[0]}multiplyAndAddUnsafe(m,_,b){const g=f.BASE,E=(O,A)=>A===Ei||A===lo||!O.equals(g)?O.multiplyUnsafe(A):O.multiply(A),T=E(this,_).add(E(m,b));return T.is0()?void 0:T}toAffine(m){const{px:_,py:b,pz:g}=this,E=this.is0();m==null&&(m=E?n.ONE:n.inv(g));const T=n.mul(_,m),O=n.mul(b,m),A=n.mul(g,m);if(E)return{x:n.ZERO,y:n.ZERO};if(!n.eql(A,n.ONE))throw new Error("invZ was invalid");return{x:T,y:O}}isTorsionFree(){const{h:m,isTorsionFree:_}=t;if(m===lo)return!0;if(_)return _(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:_}=t;return m===lo?this:_?_(f,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return zo(this.toRawBytes(m))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=t.nBitLength,h=Ioe(f,t.endo?Math.ceil(d/2):d);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:a}}function Loe(e){const t=DR(e);return _d(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Noe(e){const t=Loe(e),{Fp:n,n:r}=t,o=n.BYTES+1,i=2*n.BYTES+1;function a(M){return Eizo(Aa(M,t.nByteLength));function p(M){const N=r>>lo;return M>N}function m(M){return p(M)?s(-M):M}const _=(M,N,D)=>xr(M.slice(N,D));class b{constructor(N,D,L){this.r=N,this.s=D,this.recovery=L,this.assertValidity()}static fromCompact(N){const D=t.nByteLength;return N=Rn("compactSignature",N,D*2),new b(_(N,0,D),_(N,D,2*D))}static fromDER(N){const{r:D,s:L}=gs.toSig(Rn("DER",N));return new b(D,L)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new b(this.r,this.s,N)}recoverPublicKey(N){const{r:D,s:L,recovery:j}=this,F=C(Rn("msgHash",N));if(j==null||![0,1,2,3].includes(j))throw new Error("recovery id invalid");const B=j===2||j===3?D+t.n:D;if(B>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const U=j&1?"03":"02",K=u.fromHex(U+h(B)),W=l(B),Q=s(-F*W),X=s(L*W),J=u.BASE.multiplyAndAddUnsafe(K,Q,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Cu(this.toDERHex())}toDERHex(){return gs.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Cu(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const g={isValidPrivateKey(M){try{return c(M),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const M=t.randomBytes(n.BYTES+8),N=Poe(M,r);return Aa(N,t.nByteLength)},precompute(M=8,N=u.BASE){return N._setWindowSize(M),N.multiply(BigInt(3)),N}};function E(M,N=!0){return u.fromPrivateKey(M).toRawBytes(N)}function T(M){const N=M instanceof Uint8Array,D=typeof M=="string",L=(N||D)&&M.length;return N?L===o||L===i:D?L===2*o||L===2*i:M instanceof u}function O(M,N,D=!0){if(T(M))throw new Error("first arg must be private key");if(!T(N))throw new Error("second arg must be public key");return u.fromHex(N).multiply(c(M)).toRawBytes(D)}const A=t.bits2int||function(M){const N=xr(M),D=M.length*8-t.nBitLength;return D>0?N>>BigInt(D):N},C=t.bits2int_modN||function(M){return s(A(M))},y=s_(t.nBitLength);function S(M){if(typeof M!="bigint")throw new Error("bigint expected");if(!(Ei<=M&&Mle in D))throw new Error("sign() legacy options not supported");const{hash:L,randomBytes:j}=t;let{lowS:F,prehash:B,extraEntropy:U}=D;F==null&&(F=!0),M=Rn("msgHash",M),B&&(M=Rn("prehashed msgHash",L(M)));const K=C(M),W=c(N),Q=[S(W),S(K)];if(U!=null){const le=U===!0?j(n.BYTES):U;Q.push(Rn("extraEntropy",le,n.BYTES))}const X=zs(...Q),J=K;function te(le){const ge=A(le);if(!d(ge))return;const se=l(ge),ue=u.BASE.multiply(ge).toAffine(),Ie=s(ue.x);if(Ie===Ei)return;const gt=s(se*s(J+Ie*W));if(gt===Ei)return;let ie=(ue.x===Ie?0:2)|Number(ue.y&lo),Ce=gt;return F&&p(gt)&&(Ce=m(gt),ie^=1),new b(Ie,Ce,ie)}return{seed:X,k2sig:te}}const x={lowS:t.lowS,prehash:!1},I={lowS:t.lowS,prehash:!1};function R(M,N,D=x){const{seed:L,k2sig:j}=v(M,N,D),F=t;return MR(F.hash.outputLen,F.nByteLength,F.hmac)(L,j)}u.BASE._setWindowSize(8);function k(M,N,D,L=I){var ue;const j=M;if(N=Rn("msgHash",N),D=Rn("publicKey",D),"strict"in L)throw new Error("options.strict was renamed to lowS");const{lowS:F,prehash:B}=L;let U,K;try{if(typeof j=="string"||j instanceof Uint8Array)try{U=b.fromDER(j)}catch(Ie){if(!(Ie instanceof gs.Err))throw Ie;U=b.fromCompact(j)}else if(typeof j=="object"&&typeof j.r=="bigint"&&typeof j.s=="bigint"){const{r:Ie,s:gt}=j;U=new b(Ie,gt)}else throw new Error("PARSE");K=u.fromHex(D)}catch(Ie){if(Ie.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(F&&U.hasHighS())return!1;B&&(N=t.hash(N));const{r:W,s:Q}=U,X=C(N),J=l(Q),te=s(X*J),le=s(W*J),ge=(ue=u.BASE.multiplyAndAddUnsafe(K,te,le))==null?void 0:ue.toAffine();return ge?s(ge.x)===W:!1}return{CURVE:t,getPublicKey:E,getSharedSecret:O,sign:R,verify:k,ProjectivePoint:u,Signature:b,utils:g}}class LR extends OR{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,ys.hash(t);const r=o_(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?t.create().update(r).digest():r);for(let a=0;anew LR(e,t).update(n).digest();NR.create=(e,t)=>new LR(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Boe(e){return{hash:e,hmac:(t,...n)=>NR(e,t,noe(...n)),randomBytes:PR}}function joe(e,t){const n=r=>Noe({...e,...Boe(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bm=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),g1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),BR=BigInt(1),v1=BigInt(2),y4=(e,t)=>(e+t/v1)/t;function jR(e){const t=bm,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),l=BigInt(88),u=e*e*e%t,c=u*u*e%t,f=oo(c,n,t)*c%t,d=oo(f,n,t)*c%t,h=oo(d,v1,t)*u%t,p=oo(h,o,t)*h%t,m=oo(p,i,t)*p%t,_=oo(m,s,t)*m%t,b=oo(_,l,t)*_%t,g=oo(b,s,t)*m%t,E=oo(g,n,t)*c%t,T=oo(E,a,t)*p%t,O=oo(T,r,t)*u%t,A=oo(O,v1,t);if(!ew.eql(ew.sqr(A),e))throw new Error("Cannot find square root");return A}const ew=Aoe(bm,void 0,void 0,{sqrt:jR}),u_=joe({a:BigInt(0),b:BigInt(7),Fp:ew,n:g1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=g1,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-BR*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,a=BigInt("0x100000000000000000000000000000000"),s=y4(i*e,t),l=y4(-r*e,t);let u=Mn(e-s*n-l*o,t),c=Mn(-s*r-l*i,t);const f=u>a,d=c>a;if(f&&(u=t-u),d&&(c=t-c),u>a||c>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},y1),Sm=BigInt(0),FR=e=>typeof e=="bigint"&&Smtypeof e=="bigint"&&Smo.charCodeAt(0)));n=zs(r,r),g4[e]=n}return y1(zs(n,...t))}const c_=e=>e.toRawBytes(!0).slice(1),tw=e=>Aa(e,32),gg=e=>Mn(e,bm),zf=e=>Mn(e,g1),f_=u_.ProjectivePoint,$oe=(e,t,n)=>f_.BASE.multiplyAndAddUnsafe(e,t,n);function nw(e){let t=u_.utils.normPrivateKeyToScalar(e),n=f_.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:zf(-t),bytes:c_(n)}}function $R(e){if(!FR(e))throw new Error("bad x: need 0 < x < p");const t=gg(e*e),n=gg(t*e+BigInt(7));let r=jR(n);r%v1!==Sm&&(r=gg(-r));const o=new f_(e,r,BR);return o.assertValidity(),o}function zR(...e){return zf(xr(w1("BIP0340/challenge",...e)))}function zoe(e){return nw(e).bytes}function Uoe(e,t,n=PR(32)){const r=Rn("message",e),{bytes:o,scalar:i}=nw(t),a=Rn("auxRand",n,32),s=tw(i^xr(w1("BIP0340/aux",a))),l=w1("BIP0340/nonce",s,o,r),u=zf(xr(l));if(u===Sm)throw new Error("sign failed: k is zero");const{bytes:c,scalar:f}=nw(u),d=zR(c,o,r),h=new Uint8Array(64);if(h.set(c,0),h.set(tw(zf(f+d*i)),32),!UR(h,r,o))throw new Error("sign: Invalid signature produced");return h}function UR(e,t,n){const r=Rn("signature",e,64),o=Rn("message",t),i=Rn("publicKey",n,32);try{const a=$R(xr(i)),s=xr(r.subarray(0,32));if(!FR(s))return!1;const l=xr(r.subarray(32,64));if(!Foe(l))return!1;const u=zR(tw(s),c_(a),o),c=$oe(a,l,zf(-u));return!(!c||!c.hasEvenY()||c.toAffine().x!==s)}catch{return!1}}const b1=(()=>({getPublicKey:zoe,sign:Uoe,verify:UR,utils:{randomPrivateKey:u_.utils.randomPrivateKey,lift_x:$R,pointToBytes:c_,numberToBytesBE:Aa,bytesToNumberBE:xr,taggedHash:w1,mod:Mn}}))();var d_=(e=>(e.PublicKeys="npub",e.PrivateKeys="nsec",e.NoteIDs="note",e.LNURL="lnurl",e.Profile="nprofile",e.Event="nevent",e.Relay="nrelay",e.EventCoordinate="naddr",e))(d_||{}),Ed=(e=>(e.AUTH="AUTH",e.CLOSE="CLOSE",e.COUNT="COUNT",e.EVENT="EVENT",e.REQ="REQ",e))(Ed||{}),ar=(e=>(e[e.METADATA=0]="METADATA",e[e.SHORT_TEXT_NOTE=1]="SHORT_TEXT_NOTE",e[e.RECOMMEND_RELAY=2]="RECOMMEND_RELAY",e[e.CONTACTS=3]="CONTACTS",e[e.ENCRYPTED_DIRECT_MESSAGES=4]="ENCRYPTED_DIRECT_MESSAGES",e[e.EVENT_DELETION=5]="EVENT_DELETION",e[e.REPOST=6]="REPOST",e[e.REACTION=7]="REACTION",e[e.BADGE_AWARD=8]="BADGE_AWARD",e[e.GENERIC_REPOST=16]="GENERIC_REPOST",e[e.CHANNEL_CREATION=40]="CHANNEL_CREATION",e[e.CHANNEL_METADATA=41]="CHANNEL_METADATA",e[e.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",e[e.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",e[e.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",e[e.FILE_METADATA=1063]="FILE_METADATA",e[e.LIVE_CHAT_MESSAGE=1311]="LIVE_CHAT_MESSAGE",e[e.REPORTING=1984]="REPORTING",e[e.LABEL=1985]="LABEL",e[e.ZAP_REQUEST=9734]="ZAP_REQUEST",e[e.ZAP_RECEIPT=9735]="ZAP_RECEIPT",e[e.MUTE_LIST=1e4]="MUTE_LIST",e[e.PIN_LIST=10001]="PIN_LIST",e[e.RELAY_LIST_METADATA=10002]="RELAY_LIST_METADATA",e[e.WALLET_INFO=13194]="WALLET_INFO",e[e.CLIENT_AUTHENTICATION=22242]="CLIENT_AUTHENTICATION",e[e.WALLET_REQUEST=23194]="WALLET_REQUEST",e[e.WALLET_RESPONSE=23195]="WALLET_RESPONSE",e[e.NOSTR_CONNECT=24133]="NOSTR_CONNECT",e[e.HTTP_AUTH=27235]="HTTP_AUTH",e[e.CATEGORIZED_PEOPLE_LIST=3e4]="CATEGORIZED_PEOPLE_LIST",e[e.CATEGORIZED_BOOKMARK_LIST=30001]="CATEGORIZED_BOOKMARK_LIST",e[e.PROFILE_BADGES=30008]="PROFILE_BADGES",e[e.BADGE_DEFINITION=30009]="BADGE_DEFINITION",e[e.CREATE_OR_UPDATE_A_STALL=30017]="CREATE_OR_UPDATE_A_STALL",e[e.CREATE_OR_UPDATE_A_PRODUCT=30018]="CREATE_OR_UPDATE_A_PRODUCT",e[e.LONG_FORM_CONTENT=30023]="LONG_FORM_CONTENT",e[e.DRAFT_LONG_FORM_CONTENT=30024]="DRAFT_LONG_FORM_CONTENT",e[e.APPLICATION_SPECIFIC_DATA=30078]="APPLICATION_SPECIFIC_DATA",e[e.LIVE_EVENT=30311]="LIVE_EVENT",e[e.CLASSIFIED_LISTING=30402]="CLASSIFIED_LISTING",e[e.DRAFT_CLASSIFIED_LISTING=30403]="DRAFT_CLASSIFIED_LISTING",e[e.HANDLER_RECOMMENDATION=31989]="HANDLER_RECOMMENDATION",e[e.HANDLER_INFORMATION=31990]="HANDLER_INFORMATION",e))(ar||{}),VR=(e=>(e.GITHUB="github",e.TWITTER="twitter",e.MASTODON="mastodon",e.TELEGRAM="telegram",e))(VR||{}),pl=(e=>(e.AUTH="AUTH",e.COUNT="COUNT",e.EOSE="EOSE",e.EVENT="EVENT",e.NOTICE="NOTICE",e.OK="OK",e))(pl||{});function HR(e){const t=new Uint8Array(Math.ceil(e.length/2));for(let n=0;nt.toString(16).padStart(2,"0")).join("")}function Voe(e){const t=[];for(const i of e){const a=new Uint8Array([i.type]);let s;i.type===1?s=new TextEncoder().encode(i.value):i.type===3?s=new Uint32Array([i.value]):s=HR(i.value);const l=new Uint8Array([s.length]);t.push(a),t.push(l),t.push(s)}let n=t.reduce((i,a)=>i+a.length,0);const r=new Uint8Array(n);let o=0;for(const i of t)r.set(i,o),o+=i.length;return r}function Hoe(e){let t=0;const n=[];for(;t{let n;return t.type===3?n=t.value:t.type===1?n=new TextDecoder().decode(t.value):n=WR(t.value),{type:t.type,value:n}})}function GR(e,t){let n;e==="npub"||e==="nsec"||e==="note"||e==="lnurl"?n=HR(t[0].value):n=Voe(t);const r=Lo.toWords(new Uint8Array(n.buffer));return Lo.encode(e,r,1023)}function Cd(e){const{prefix:t,words:n}=Lo.decode(e,1023),r=new Uint8Array(Lo.fromWords(n));let o;if(t==="npub"||t==="nsec"||t==="note"||t==="lnurl")o=[{type:0,value:WR(r)}];else if(t==="nprofile"||t==="nevent"||t==="nrelay"||t==="naddr"){const i=Hoe(r);o=Woe(i)}else throw new Error("Unknown prefix: "+t);return{prefix:t,tlvItems:o}}function Goe(e){return qre.decode(e)}function Koe(e){const t=e.tags.filter(r=>r[0]==="amount");if(t.length===0)return;const n=[];for(const r of t)r.length===2&&n.push(r[1]);return n&&n.length>0?n:void 0}function Xoe(e){return["amount",e]}function KR(e){if(!e.tags)return;let t=!1,n="";for(const r of e.tags)r.find(i=>i==="content-warning")&&(t=!0,r.length===2&&r[0]==="content-warning"||r.length===3&&r[2]==="content-warning"&&r[0]==="l"?n=r[1]:n="N/A");return t?n:void 0}var qoe=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/,Yoe=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/g,XR=(e=>(e.npub="npub",e.nsec="nsec",e.note="note",e.lnurl="lnurl",e.nprofile="nprofile",e.nevent="nevent",e))(XR||{});function Zoe(e){if(typeof e!="string")return null;const t=e.match(qoe);return t&&t.length===3?{prefix:t[1],bech32:`${t[1]}${t[2]}`}:null}function Qoe(e){return Zoe(e)!==null}function qR(e){return/^(wss?):\/\/([a-zA-Z0-9.-]+)(:\d+)?(\/[a-zA-Z0-9_/.-]*)?$/.test(e)}function Joe(e,t){if(!e||e==="")return{isValid:!0};if(t===6)try{return JSON.parse(e),{isValid:!0}}catch(n){return console.error(n),{isValid:!1,error:"Invalid JSON format"}}else if(t===2&&!qR(e))return{isValid:!1,error:`Expected a valid websocket URL, got ${e}.`};return eie(e)?{isValid:!1,error:"HTML tags are not allowed"}:{isValid:!0}}function eie(e){return/<[^>]*>/.test(e)}var YR=[{name:"www.youtube.com"},{name:"music.youtube.com"},{name:"youtu.be",rewrite:e=>`https://www.youtube.com/watch?v=${e.split("/").pop()}`},{name:"twitch.tv"},{name:"vimeo.com"},{name:"rumble.com"}],tie=["jpg","jpeg","png","gif","webp"],nie=["mp4","webm","ogg"],rie=YR.map(e=>e.name.replace(/\./g,"\\.")).join("|"),oie=nie.join("|"),iie=`https?:\\/\\/(${rie})\\/\\w+\\/([a-zA-Z0-9_-]+)(?:\\?[a-zA-Z0-9_=&-]+)?|https?:\\/\\/\\S+\\.(${oie})`,aie=new RegExp(iie,"gi"),sie=tie.join("|"),lie=new RegExp(`\\bhttps?:\\/\\/\\S+?\\.(${sie})(?:\\?\\S+)?\\b`,"gi");function ZR(e){if(e===void 0)return;const t=e==null?void 0:e.match(lie),n=e==null?void 0:e.match(aie),o=Array.from(e.matchAll(Yoe),s=>s.slice(1,3)).map(([s,l])=>Object.values(XR).includes(s)?{type:s,data:l}:null).filter(s=>s!==null),i=/#[a-zA-Z0-9_-]+/gi,a=e==null?void 0:e.match(i);return t&&e&&t.forEach(s=>e=e.replace(s,"")),n&&e&&n.forEach(s=>e=e.replace(s,"")),n&&n.forEach((s,l)=>{const u=YR.find(c=>s.includes(c.name));u!=null&&u.rewrite&&(n[l]=u.rewrite(s))}),{images:t||void 0,videos:n||void 0,nurls:o&&o.length>0?o:void 0,tags:a||void 0,text:e.trim()}}function uie(e){if(!e)return;let t=[];for(let n of e){if(!Array.isArray(n)||n.length<2||n.length>3||n[0]!=="a")continue;let r=n[1].split(":");if(r.length!==3)continue;let o=r[0],i=r[1],a=r[2],s;n.length===3&&(s=n[2]),t.push({kind:o,pubkey:i,identifier:a,relay:s})}if(t.length!==0)return t}function cie(e){const t=uie(e.tags);if(t)return t}function fie(e){const{kind:t,pubkey:n,identifier:r,relay:o}=e;return o?[`a:${t}:${n}:${r}, ${o}`]:[`a:${t}:${n}:${r}`]}function die(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({eventId:r[1]}):r.length===3?n.push({eventId:r[1],relayUrl:r[2]}):r.length===4&&n.push({eventId:r[1],relayUrl:r[2],marker:r[3]});return n&&n.length>0?n:void 0}function hie(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(let r=0;r2&&(r===1?n.push({eventId:t[r][1],relayUrl:"",marker:"mention"}):r>1&&n.push({eventId:t[r][1],relayUrl:"",marker:"reply"}));return n&&n.length>0?n:void 0}function pie(e){return!e.tags||e.tags.length===0?!1:e.tags.filter(n=>n[0]==="e"&&n.length>2).length===0}function mie(e){const t=e.tags.filter(n=>n[0]==="expiration");if(t.length!==0)return parseInt(t[0][1])}function yie(e){const t=[],n=e.tags.filter(r=>r[0]==="d");if(n.length!==0){for(const r of n){let o=r[1]||"";t.includes(o)||t.push(o)}return t&&t.length>0?t:void 0}}function gie(e){return["d",e]}function vie(e){const t=e.tags.filter(r=>r[0]==="lnurl");if(t.length===0)return;const n=[];for(const r of t)r.length>0&&n.push(r[1]);return n&&n.length>0?n:void 0}function wie(e){return["lnurl",e]}function bie(e){const t=e.tags.filter(n=>n[0]==="nonce");if(t.length!==0)return[parseInt(t[0][1]),parseInt(t[0][2])]}function Sie(e,t){if(e.hasNonceTag())throw new Error("Event already has a nonce.");if(t.length!==2)throw new Error("Nonce must be an array of 2 numbers: [miningResult, difficulty]");const n=t[0].toString(),r=t[1].toString();return e.addTag(["nonce",n,r]),e}function _ie(e,t){return e.tags=e.tags.filter(n=>n[0]!=="nonce"),e.addNonceTag(t),e}function Eie(e){const t=e.tags.filter(r=>r[0]==="p");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push([r[1]]):r.length===3&&n.push([r[1],r[2]]);return n}function Cie(e){const t=e.tags.filter(r=>r[0]==="relays");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({url:r[1],read:!0,write:!0}):r.length===3&&n.push({url:r[1],read:r[2]==="read",write:r[2]==="write"});return n.length>0?n:void 0}function xie(e){if(e.kind!==1984)throw new Error(`Event is not a report: ${e.kind}. Expected 1984.`);const t=e.tags.filter(s=>s[0]==="p");if(!t||t.length===0)return;let n;const r=e.tags.filter(s=>s[0]==="e");r.length>0&&r[0].length>0&&(n=r[0][1]);let o;t[0].length===3?o=t[0][2]:r.length>0&&r[0].length===3&&(o=r[0][2]);let i;return t[0].length>0&&(i=t[0][1]),!o||!i?void 0:{eventId:n,kind:o,publicKey:i,content:e.content&&e.content!==""?e.content:void 0}}function Oie(e){const{eventId:t,kind:n,publicKey:r}=e;if(!n)throw new Error("Report must have a kind.");if(!r)throw new Error("Report must mention a public key.");if(n==="impersonation"&&t)throw new Error("Impersonation reports should refer to a person, not an event.");const o=[];return t?(o.push(["e",t,n]),r&&o.push(["p",r])):r&&o.push(["p",r,n]),o}function Aie(e){const t=e.tags.filter(n=>n[0]==="subject");if(t.length!==0)return t[0][1]}function QR(e){return e?e.startsWith("Re:"):!1}function Pie(e){return QR(e)?e:`Re: ${e}`}function Tie(e){const t=e.tags?e.tags.filter(n=>n[0]==="t"):[];return t.length>0?t.map(n=>n[1]):void 0}function Iie(){const e=b1.utils.randomPrivateKey(),t=b1.getPublicKey(e);return{privateKey:zo(e),publicKey:zo(t)}}function Rie(e){return zo(b1.getPublicKey(Buffer.from(e,"hex")))}function kie(e){return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}var JR=new TextEncoder,v4=new TextDecoder("utf-8");function ek(e){const t=y1(JR.encode(e));return zo(t)}function tk({callback:e,amount:t,event:n,lnurl:r}){return`${e}?amount=${t}&nostr=${n}&lnurl=${r}`}function Mie(e){if(e.allowsNostr&&e.nostrPubkey)return!0}function Die(e,t){const n=e.amount?e.amount:void 0,r=e.lnurl?e.lnurl:void 0;if(!n||!r)return!0;const o=Goe(t.pr);let i;const a=o.sections.find(s=>s.name==="amount");if(a)i=a.value;else return!1;return!(n&&n.toString()!==i)}function Lie(e){const t=new sr(e),n=t.hasPublicKeyTags();if(!n)throw new Error("No pubkey tags found");if(e.kind!==9734)throw new Error("Event is not a zap request");const r=n[0],o=t.hasRelaysTag(),i={pubkey:r,content:"",id:t.id,sig:t.sig,kind:t.kind,tags:t.tags,relays:o};return JSON.stringify(i)}function Nie(e){let t=/,*?((lnurl)([0-9]{1,}[a-z0-9]+){1})/.exec(e.toLowerCase());return t?t[1]:null}function Bie(e){if(e=e.trim(),e.toLowerCase().slice(0,6)==="lnurl1"){const{words:t}=Lo.decode(e,2e4),n=new Uint8Array(Lo.fromWords(t));return v4.decode(n)}else if(e.slice(0,9)==="lnurlc://"||e.slice(0,9)==="lnurlw://"||e.slice(0,9)==="lnurlp://"||e.slice(0,10)==="keyauth://"){let[t,n]=e.split("://");return(n.match(/\.onion($|\W)/)?"http":"https")+"://"+n}else if(e.slice(0,8)==="https://"){let t=Nie(e);if(t){const{words:n}=Lo.decode(t,2e4),r=new Uint8Array(Lo.fromWords(n));return v4.decode(r)}return e}throw new Error(`invalid url ${e}`)}function nk(e){const t=JR.encode(e),n=Lo.toWords(new Uint8Array(t));return Lo.encode("lnurl",n,2e4)}function rk(e){return e.endsWith(".onion")}function jie(e){const[t,n]=e.split("@");return`${rk(n)?"http":"https"}://${n}/.well-known/lnurlp/${t}`}function Fie(e){const[t,n]=e.split("@");return`${rk(n)?"http":"https"}://${n}/.well-known/nostr.json?name=${t}`}function $ie(e){let t=0;for(let n=0;nl[0]==="nonce");i!==-1?e.tags[i][1]=r.toString():e.tags.push(["nonce",r.toString(),o]);const a=JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]);if(e.id=ek(a),$ie(e.id)>=t)return console.log("Proof of work complete"),e.tags=e.tags.filter(l=>l[0]!=="nonce"),e.tags.push(["nonce",r.toString(),o]),e;if(n&&r>=n)return;r++}}function h_(e){return/^[a-z0-9\.\-_\/@]*$/.test(e)}function Uie(e){return e.toLowerCase()}function Vie(e,t){if(e.length!==64)throw new Error("Invalid event hash");const n=b1.sign(e,t);return zo(n)}function Hie(e){return e?JSON.stringify(e):""}function Wie(e){try{const t=JSON.parse(e);return{name:t.name??null,display_name:t.display_name??null,picture:t.picture??null,banner:t.banner??null,nip05:t.nip05??null,website:t.website??null,about:t.about??null,image:t.image??null,npub:t.npub??null,lud16:t.lud16??null,lud06:t.lud06??null}}catch(t){return console.error("Unable to parse user metadata string",t),null}}var Gie=class{constructor(e){if(e){if(!h_(e.identity))throw new Error("Invalid identity. Valid: a-z, 0-9, -, _, @");this.type=e.type,this.identity=Uie(e.identity),this.proof=e.proof}}toTag(){switch(this.type){case"github":return["i",`github:${this.identity}`,this.proof];case"twitter":return["i",`twitter:${this.identity}`,this.proof];case"mastodon":return["i",`mastodon:${this.identity}`,this.proof];case"telegram":return["i",`telegram:${this.identity}`,this.proof];default:throw new Error(`Unknown claim type ${this.type}. Valid: github, twitter, mastodon, telegram`)}}fromTag(e){if(ok(e))return this.type=e[1].split(":")[0],this.identity=e[1].split(":")[1],this.proof=e[2],this}};function ok(e){return!(e.length!==3||!Object.values(VR).includes(e[1].split(":")[0])||!h_(e[1].split(":")[1]))}function ik(e){const t=e.tags.filter(r=>r[0]==="i"&&ok(r));if(t.length===0)return;const n=[];for(const r of t){const o=new Gie;o.fromTag(r),n.push(o)}return n}var sr=class{constructor(e){this.id=e.id?e.id:"",this.pubkey=e.pubkey?e.pubkey:"",this.created_at=e.created_at?e.created_at:Math.floor(Date.now()/1e3),this.kind=e.kind!=null?e.kind:1,this.tags=e.tags&&e.tags.length>0?e.tags:[],this.content=e.content,this.sig=e.sig?e.sig:""}generateId(){if(this.pubkey==="")throw new Error("Cannot generate event ID without a public key. Set a public key first.");const e=kie(this.ToObj());this.id=ek(e)}sign(e){if(this.id==="")throw new Error("Cannot sign event without an ID. Generate ID first.");this.pubkey=e.publicKey,this.sig=Vie(this.id,e.privateKey)}signAndGenerateId(e){this.pubkey=e.publicKey,this.generateId(),this.sign(e)}ToObj(){const e={};for(const[t,n]of Object.entries(this))n!==void 0&&(e[t]=n);return e}toURI(){return encodeURI(JSON.stringify(this.ToObj()))}proofOfWork(e,t){const n=zie(this,e,t);if(n)this.id=n.id,this.tags=n.tags;else throw new Error("Failed to generate proof of work.")}hasMentions(){const e=this.extractContent();if(!e)return;const t=e==null?void 0:e.nurls.filter(n=>n.type==="npub");return t.length>0?t:void 0}setContentWithoutChecks(e){return this.content=e,this}extractContent(){return ZR(this.content)}addTag(e){this.tags||(this.tags=[]),this.tags.push(e)}removeTag(e){this.tags&&(this.tags=this.tags.filter(t=>t[0]!==e[0]&&t[1]!==e[1]))}addEventTag(e){const t=e.relayUrl?e.relayUrl:"";let n=["e",e.eventId];e.marker?n=[...n,t,e.marker]:e.relayUrl&&(n=[...n,e.relayUrl]),this.addTag(n)}hasEventTags(){return pie(this)?hie(this):die(this)}hasTags(){return Tie(this)}addPublicKeyTag(e,t){const n=["p",e];t&&n.push(t),this.addTag(n)}hasPublicKeyTags(){return Eie(this)}addRelaysTag(e){const t=this.tags.filter(n=>n[0]==="relays");if(t.length===0)this.tags.push(["relays",...e]);else for(const n of t)n.splice(1,0,...e)}hasRelaysTag(){return Cie(this)}addEventCoordinatesTag(e){this.addTag(fie(e))}hasEventCoordinatesTags(){return cie(this)}addIdentifierTag(e){this.addTag(gie(e))}hasIdentifierTags(){return yie(this)}addLnurlTag(e){this.addTag(wie(e))}hasLnurlTags(){return vie(this)}addAmountTag(e){this.addTag(Xoe(e))}hasAmountTags(){return Koe(this)}addKindTag(e){this.addTag(["k",e.toString()])}addExpirationTag(e){if(this.hasExpirationTag())throw new Error("Event already has an expiration.");this.addTag(["expiration",e.toString()])}hasExpirationTag(){return mie(this)}addSubjectTag(e){if(this.kind!==1)throw new Error(`Event kind ${this.kind} should not have a subject.`);if(this.hasSubjectTag())throw new Error("Event already has a subject.");this.addTag(["subject",e])}hasSubjectTag(){return Aie(this)}addNonceTag(e){const t=Sie(this,e);this.tags=t.tags}hasNonceTag(){return bie(this)}replaceNonceTag(e){const t=_ie(this,e);this.tags=t.tags}addContentWarningTag(e){if(this.hasContentWarningTag())throw new Error("Event already has a content warning.");this.addTag(["content-warning",e||""])}hasContentWarningTag(){return KR(this)}addExternalIdentityClaimTag(e){this.addTag(e.toTag())}hasExternalIdentityClaimTag(){return ik(this)}addReportTags(e){if(this.kind!==1984)throw new Error(`Event kind ${this.kind} should not have a report. Expected 1984.`);if(this.hasReportTags())throw new Error("Event already has report tags.");Oie(e).forEach(n=>this.addTag(n))}hasReportTags(){return xie(this)}newZapReceipt(e){if(this.kind!==9734)throw new Error(`Event kind ${this.kind} should not have a zap receipt. Expected 9734.`);return eae({bolt11:e.bolt11,description:e.description,preimage:e.preimage,zapRequest:this})}determineRequiredNIP(){const e=[];return this.hasExternalIdentityClaimTag()&&e.push(39),this.hasExpirationTag()&&e.push(40),e}isReadyToPublish(){if(this.id==="")return{isReady:!1,reason:"Event has no ID."};if(this.pubkey==="")return{isReady:!1,reason:"Event has no pubkey."};if(this.sig==="")return{isReady:!1,reason:"Event has no signature."};const e=Joe(this.content,this.kind);return e.isValid?{isReady:!0}:{isReady:!1,reason:e.error}}isReadyToPublishOrThrow(){const e=this.isReadyToPublish();if(!e.isReady)throw new Error(e.reason)}};function Kie(e){const t=new sr({content:e.text,kind:1});return e.subject&&t.addSubjectTag(e.subject),t}function Xie(e){const t=new sr({content:e.text,kind:e.isDraft?30024:30023});return e.identifier&&t.addEventTag({eventId:e.identifier}),t}function qie(e){const t=new sr({content:e.text,kind:1}),n=new sr(e.inResponseTo);if(n.kind!==1)throw new Error("Event you are responding to be SHORT_TEXT_NOTE");const r=n.hasSubjectTag();r?QR(r)?t.addSubjectTag(r):t.addSubjectTag(Pie(r)):console.log("Event you are responding to does not have a subject.");const o=n.hasEventTags(),i=o?o.find(l=>l.marker==="root"):void 0;i?(t.addEventTag({eventId:i.eventId,relayUrl:e.relayUrl,marker:"root"}),t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"reply"})):t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"root"});const a=n.hasPublicKeyTags(),s=[];a&&s.push(a),s.push([n.pubkey,e.relayUrl]);for(const l of s)t.addPublicKeyTag(l[0],l[1]);return t}function Yie(e){if(e.text!=="+"&&e.text!=="-")throw new Error("Reaction must be either '+' or '-'");const t=new sr({content:e.text,kind:7,tags:[]});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function ak(e){const t=new sr({content:JSON.stringify({...e.inResponseTo,relay:e.relayUrl}),kind:6});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function Zie(e){const t=new sr({content:Hie(e.userMetadata),kind:0,tags:[]});if(e.claims)for(const n of e.claims)h_(n.identity)?t.addExternalIdentityClaimTag(n):console.log("Invalid provider name",n.identity);return e.mastodonUrl&&t.addTag(["mostr",e.mastodonUrl]),t}function Qie(e){if(!qR(e.relayUrl))throw new Error("Invalid server URL");const t=new sr({content:e.relayUrl,kind:2});return e.nonce&&t.addNonceTag(e.nonce),t}function sk(e){const t=new sr({content:"",kind:9734});return e.relayUrls&&e.relayUrls.length>0&&t.addRelaysTag(e.relayUrls),t.addAmountTag(e.amount.toString()),t.addLnurlTag(e.lnurl),t.addPublicKeyTag(e.recipientPubkey),e.eventId&&t.addEventTag({eventId:e.eventId}),t}function Jie(e,t,n){const r=sk(e);r.signAndGenerateId(n);const o=r.toURI();return{event:r,eventUri:o,invoiceUrl:tk({callback:t,amount:e.amount,event:o,lnurl:e.lnurl})}}function eae(e){const t=e.zapRequest.tags.find(i=>i[0]==="p"),n=e.zapRequest.tags.find(i=>i[0]==="e"),r=Lie(e.zapRequest),o=new sr({content:"",kind:9735,tags:[t,["bolt11",e.bolt11],["description",r]],created_at:e.zapRequest.created_at});return n&&o.addEventTag({eventId:n[1]}),e.preimage&&o.addTag(["preimage",e.preimage]),o}function tae(e){return new sr({content:"",kind:22242,tags:[["relay",e.relayUrl],["challenge",e.challenge]]})}function nae(e){const t=new sr({content:"",kind:3});for(const n of e.contacts)t.tags.push(["p",n.key,n.relayUrl?n.relayUrl:"",n.petname?n.petname:""]);return t}var Fa=class{constructor(e){this.ids=e==null?void 0:e.ids,this.authors=e==null?void 0:e.authors,this.kinds=e==null?void 0:e.kinds,this["#e"]=e==null?void 0:e["#e"],this["#p"]=e==null?void 0:e["#p"],this["#t"]=e==null?void 0:e["#t"],this.since=e==null?void 0:e.since,this.until=e==null?void 0:e.until,this.limit=e==null?void 0:e.limit}addId(e){this.ids||(this.ids=[]),this.ids.push(e)}addAuthor(e){this.authors||(this.authors=[]),this.authors.push(e)}addKind(e){this.kinds||(this.kinds=[]),this.kinds.push(e)}updateLimit(e){this.limit=e}toObj(){return JSON.parse(JSON.stringify(this))}},rae=class{constructor(e){this.pubkey=(e==null?void 0:e.pubkey)||void 0,this.claims=(e==null?void 0:e.claims)||[],this.data=(e==null?void 0:e.data)||{},this.lastUpdated=(e==null?void 0:e.lastUpdated)||0}loaded(){return this.data!==void 0}hasZapInfo(){return this.lightningZapInfo!==void 0}fromPublicKey(e){return this.pubkey=e,this}fromEvent(e,t=!0){const n=new sr(e);if(n.kind!==0){if(t)throw new Error("wrong event kind");return}if(this.pubkey&&this.pubkey!==""&&n.pubkey!==this.pubkey){if(t)throw new Error("wrong event pubkey");return}if(this.pubkey=n.pubkey,this.lastUpdated=n.created_at,n.content&&n.content!==""){const o=Wie(n.content);o&&(this.data=o)}const r=ik(e);return r&&(this.claims=r),this}getNip05Url(){var t;const e=((t=this.data)==null?void 0:t.nip05)||void 0;if(e)return Fie(e)}validateWellKnown(e){return e?Object.keys(e.names).find(n=>e.names[n]===this.pubkey)?(this.nip05isValid=!0,!0):(this.nip05isValid=!1,!1):!1}getLud16(){var e;return((e=this.data)==null?void 0:e.lud16)||void 0}getLud16Url(){const e=this.getLud16();if(e)return jie(e)}getLud06(){var e;return((e=this.data)==null?void 0:e.lud06)||void 0}getLud06Url(){const e=this.getLud06();if(e)return Bie(e)}getLud16Or06(){const e=this.getLud06();if(e)return{type:"lud06",url:e};const t=this.getLud16();if(t)return{type:"lud16",url:t}}getLud16Or06Url(){const e=this.getLud06Url();if(e)return{type:"lud06",url:e};const t=this.getLud16Url();if(t)return{type:"lud16",url:t}}getMetadataFilter(){const e=new Fa;return e.addAuthor(this.pubkey),e.addKind(0),e}toJson(){return{pubkey:this.pubkey,claims:this.claims,data:this.data,lightningZapInfo:this.lightningZapInfo,lastUpdated:this.lastUpdated,nip05isValid:this.nip05isValid}}fromJson(e){return this.pubkey=e.pubkey,this.claims=e.claims,this.data=e.data,this.lightningZapInfo=e.lightningZapInfo,this.lastUpdated=e.lastUpdated,this.nip05isValid=e.nip05isValid,this}};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const lk=Symbol("Comlink.proxy"),oae=Symbol("Comlink.endpoint"),iae=Symbol("Comlink.releaseProxy"),vg=Symbol("Comlink.finalizer"),lp=Symbol("Comlink.thrown"),uk=e=>typeof e=="object"&&e!==null||typeof e=="function",aae={canHandle:e=>uk(e)&&e[lk],serialize(e){const{port1:t,port2:n}=new MessageChannel;return fk(e,t),[n,[n]]},deserialize(e){return e.start(),hk(e)}},sae={canHandle:e=>uk(e)&&lp in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},ck=new Map([["proxy",aae],["throw",sae]]);function lae(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function fk(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(o){if(!o||!o.data)return;if(!lae(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:i,type:a,path:s}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(ls);let u;try{const c=s.slice(0,-1).reduce((d,h)=>d[h],e),f=s.reduce((d,h)=>d[h],e);switch(a){case"GET":u=f;break;case"SET":c[s.slice(-1)[0]]=ls(o.data.value),u=!0;break;case"APPLY":u=f.apply(c,l);break;case"CONSTRUCT":{const d=new f(...l);u=pae(d)}break;case"ENDPOINT":{const{port1:d,port2:h}=new MessageChannel;fk(e,h),u=hae(d,[d])}break;case"RELEASE":u=void 0;break;default:return}}catch(c){u={value:c,[lp]:0}}Promise.resolve(u).catch(c=>({value:c,[lp]:0})).then(c=>{const[f,d]=E1(c);t.postMessage(Object.assign(Object.assign({},f),{id:i}),d),a==="RELEASE"&&(t.removeEventListener("message",r),dk(t),vg in e&&typeof e[vg]=="function"&&e[vg]())}).catch(c=>{const[f,d]=E1({value:new TypeError("Unserializable return value"),[lp]:0});t.postMessage(Object.assign(Object.assign({},f),{id:i}),d)})}),t.start&&t.start()}function uae(e){return e.constructor.name==="MessagePort"}function dk(e){uae(e)&&e.close()}function hk(e,t){return rw(e,[],t)}function bh(e){if(e)throw new Error("Proxy has been released and is not useable")}function pk(e){return ml(e,{type:"RELEASE"}).then(()=>{dk(e)})}const S1=new WeakMap,_1="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(S1.get(e)||0)-1;S1.set(e,t),t===0&&pk(e)});function cae(e,t){const n=(S1.get(t)||0)+1;S1.set(t,n),_1&&_1.register(e,t,e)}function fae(e){_1&&_1.unregister(e)}function rw(e,t=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(i,a){if(bh(r),a===iae)return()=>{fae(o),pk(e),r=!0};if(a==="then"){if(t.length===0)return{then:()=>o};const s=ml(e,{type:"GET",path:t.map(l=>l.toString())}).then(ls);return s.then.bind(s)}return rw(e,[...t,a])},set(i,a,s){bh(r);const[l,u]=E1(s);return ml(e,{type:"SET",path:[...t,a].map(c=>c.toString()),value:l},u).then(ls)},apply(i,a,s){bh(r);const l=t[t.length-1];if(l===oae)return ml(e,{type:"ENDPOINT"}).then(ls);if(l==="bind")return rw(e,t.slice(0,-1));const[u,c]=w4(s);return ml(e,{type:"APPLY",path:t.map(f=>f.toString()),argumentList:u},c).then(ls)},construct(i,a){bh(r);const[s,l]=w4(a);return ml(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:s},l).then(ls)}});return cae(o,e),o}function dae(e){return Array.prototype.concat.apply([],e)}function w4(e){const t=e.map(E1);return[t.map(n=>n[0]),dae(t.map(n=>n[1]))]}const mk=new WeakMap;function hae(e,t){return mk.set(e,t),e}function pae(e){return Object.assign(e,{[lk]:!0})}function E1(e){for(const[t,n]of ck)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},mk.get(e)||[]]}function ls(e){switch(e.type){case"HANDLER":return ck.get(e.name).deserialize(e.value);case"RAW":return e.value}}function ml(e,t,n){return new Promise(r=>{const o=mae();e.addEventListener("message",function i(a){!a.data||!a.data.id||a.data.id!==o||(e.removeEventListener("message",i),r(a.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)})}function mae(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const b4=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const f=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(d=>d(t,f))}},o=()=>t,s={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,s),s},yae=e=>e?b4(e):b4;var yk={exports:{}},gk={},vk={exports:{}},wk={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var xu=P;function gae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vae=typeof Object.is=="function"?Object.is:gae,wae=xu.useState,bae=xu.useEffect,Sae=xu.useLayoutEffect,_ae=xu.useDebugValue;function Eae(e,t){var n=t(),r=wae({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Sae(function(){o.value=n,o.getSnapshot=t,wg(o)&&i({inst:o})},[e,n,t]),bae(function(){return wg(o)&&i({inst:o}),e(function(){wg(o)&&i({inst:o})})},[e]),_ae(n),n}function wg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vae(e,n)}catch{return!0}}function Cae(e,t){return t()}var xae=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Cae:Eae;wk.useSyncExternalStore=xu.useSyncExternalStore!==void 0?xu.useSyncExternalStore:xae;vk.exports=wk;var Oae=vk.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var _m=P,Aae=Oae;function Pae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tae=typeof Object.is=="function"?Object.is:Pae,Iae=Aae.useSyncExternalStore,Rae=_m.useRef,kae=_m.useEffect,Mae=_m.useMemo,Dae=_m.useDebugValue;gk.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Rae(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Mae(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),o!==void 0&&a.hasValue){var p=a.value;if(o(p,h))return f=p}return f=h}if(p=f,Tae(c,h))return p;var m=r(h);return o!==void 0&&o(p,m)?p:(c=h,f=m)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,o]);var s=Iae(e,i[0],i[1]);return kae(function(){a.hasValue=!0,a.value=s},[s]),Dae(s),s};yk.exports=gk;var Lae=yk.exports;const Nae=Qe(Lae),{useSyncExternalStoreWithSelector:Bae}=Nae;function jae(e,t=e.getState,n){const r=Bae(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return P.useDebugValue(r),r}const S4=e=>{const t=typeof e=="function"?yae(e):e,n=(r,o)=>jae(t,r,o);return Object.assign(n,t),n},Fae=e=>e?S4(e):S4,bk=100,ow={"wss://relay.shitforce.one":{read:!0,write:!0},"wss://relay.nostr.band":{read:!0,write:!0},"wss://offchain.pub":{read:!0,write:!1},"wss://nos.lol":{read:!0,write:!1},"wss://relay.snort.social":{read:!0,write:!1},"wss://relay.damus.io":{read:!0,write:!0},"wss://soloco.nl":{read:!0,write:!1},"wss://eden.nostr.land":{read:!0,write:!0},"wss://nostr.gruntwerk.org":{read:!0,write:!1},"wss://relay.cryptocculture.com":{read:!0,write:!1},"wss://relay.nostr.bg":{read:!0,write:!1},"wss://relay.nostrich.de":{read:!0,write:!1},"wss://relay.nostr.ro":{read:!0,write:!1}};function $ae(){const e=localStorage.getItem("nostr-client:keystore:keystore");if(e)if(e==="localstore"){const t=localStorage.getItem("nostr-client:keystore:public-key"),n=localStorage.getItem("nostr-client:keystore:private-key");if(t&&n)return{keystore:"localstore",publicKey:t,privateKey:n}}else{if(e==="nos2x")return{keystore:"nos2x",publicKey:void 0,privateKey:void 0};if(e==="download")return{keystore:"download",publicKey:void 0,privateKey:void 0}}return{keystore:"none",publicKey:void 0,privateKey:void 0}}function bg(e){localStorage.setItem("nostr-client:keystore:keystore",e.keystore),e.keystore==="localstore"&&e.publicKey&&e.privateKey?(localStorage.setItem("nostr-client:keystore:public-key",e.publicKey),localStorage.setItem("nostr-client:keystore:private-key",e.privateKey)):e.keystore==="nos2x"||e.keystore}const zae=500,_4=new Worker(new URL("/nostr-ts/assets/worker-ef9cca43.js",self.location),{type:"module"});function Uae(e,t){let n=null,r=[];return function(o){if(o.data.type==="event:update"){const i=o.data.data.event.id,a=r.findIndex(s=>s.data.type==="event:update"?s.data.data.event.id===i:!1);a!==-1?r[a]=o:r.push(o)}else r.push(o);n||(n=setTimeout(()=>{e(r),r=[],n=null},t))}}const Z=Fae((e,t)=>({status:"loading",store:hk(_4),_processEvents:n=>{n.forEach(r=>{const o=r.data;if(o.type!=="RAW")switch(o.type){case"event:notify":break;case"event:new":t().addEvent(o.data,o.view);break;case"event:update":t().updateEvent(o.data);break;case"relay:message":e({relayEvents:[...t().relayEvents,o.data]});break;case"status:change":e({status:o.data}),console.log(`Status changed to ${o.data}`);break;default:console.log(`Unsupported payload type: ${o.type}`)}})},init:async()=>{try{await t().loadKeyStore();const n=Uae(t()._processEvents,zae);_4.addEventListener("message",n),await t().store.init()}catch(n){console.error("Initialization failed:",n)}},connected:!1,connect:async n=>{t().connected||(await t().store.connect(n),e({connected:!0}))},disconnect:async()=>{await t().store.disconnect(),e({connected:!1})},getRelays:async()=>t().store.getRelays(),updateRelay:async(n,r)=>t().store.updateRelay(n,r),relayAuth:async(n,r)=>{const o=t().keypair;if(!o)throw new Error("Keypair not initialized");const i=t().keystore,a=tae({relayUrl:n,challenge:r});if(a.pubkey=o.publicKey,a.generateId(),i==="localstore"){if(!o.privateKey||o.privateKey==="")throw new Error("No private key available");a.sign({privateKey:o.privateKey,publicKey:o.publicKey})}else if(i==="nos2x")if(window.nostr&&window.nostr.signEvent){const s=await window.nostr.signEvent(a.ToObj());if(!s.sig)throw new Error("No signature");a.sig=s.sig}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore");await t().subscribe({type:Ed.AUTH,signedEvent:a.ToObj(),relayUrls:[n],options:{timeoutIn:3e5}})},relayEvents:[],getSubscriptions:async n=>t().store.getSubscriptions(n),subscribe:async n=>t().store.subscribe(n),unsubscribe:async n=>t().store.unsubscribe(n),unsubscribeAll:async()=>t().store.unsubscribeAll(),unsubscribeByToken:async n=>(console.log("=> CLIENT: Unsubscribe by token",n),e(r=>({events:{...r.events,[n]:[]},eventsNewest:{...r.eventsNewest,[n]:0},eventsNewer:{...r.eventsNewer,[n]:[]}})),t().store.unsubscribeByToken(n)),keystore:"none",loadKeyStore:()=>{const n=$ae();e({keystore:n.keystore}),n.keystore==="localstore"&&n.publicKey&&n.privateKey&&(e({keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0}),t().store.setUserPubkey(n.publicKey))},saveKeyStore:()=>{const n=t().keystore;if(n==="localstore"){const r=t().keypair;bg(r?{keystore:n,publicKey:r.publicKey,privateKey:r.privateKey}:{keystore:n})}},resetKeyStore:()=>{bg({keystore:"none"}),e({keystore:"none",keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1}),t().store.setUserPubkey("")},setKeyStore:n=>{n.keystore==="localstore"?n.publicKey&&n.privateKey&&(e({keystore:n.keystore,keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0}),t().saveKeyStore(),t().store.setUserPubkey(n.publicKey)):n.keystore==="nos2x"?(e({keystore:n.keystore,keypair:{publicKey:n.publicKey||""},keypairIsLoaded:!0}),t().store.setUserPubkey(n.publicKey||"")):console.error(`Unknown keystore ${n.keystore}`)},keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1,getPopularEvents:async()=>t().store.getPopularEvents(),getPopularUsers:async()=>t().store.getPopularUsers(),calculatePopular:async()=>t().store.calculatePopular(),count:async n=>(console.log("=> CLIENT: TODO Count",n),new Promise(r=>r([]))),countEvents:async()=>new Promise(n=>n(0)),getEvent:async(n,r)=>{const o=await t().store.getEvent(n,r);return o&&e(i=>{const a=i.events;return i.events[r.view]=[o],{events:a}}),o},nextQuery:void 0,getEvents:async(n,r)=>{var u,c;if(!n){const f=t().nextQuery;if(!f)throw new Error("No query params provided and no next query set");n={token:f.token,query:f.next}}const{token:o,query:i}=n,a=r||"append",s=i.reqCount?i.reqCount===0:!0;s&&e({nextQuery:void 0});const l=await t().store.getEvents(n);if(t().nextQuery&&o!==((u=t().nextQuery)==null?void 0:u.token)||!l.events||l.events.length===0)return l.next;if(!n.query.reqCount||n.query.reqCount===0){const f=(c=l.events)==null?void 0:c.reduce((d,h)=>d.event.created_at>h.event.created_at?d:h);e({eventsNewest:{...t().eventsNewest,token:(f==null?void 0:f.event.created_at)||0}})}return e(f=>{const d={...f.events};return l.events&&l.events.length>0&&(s||a==="replace"?d[o]=l.events:a==="prepend"?d[o]=[...l.events,...d[o]||[]]:d[o]=[...d[o]||[],...l.events]),{events:d,nextQuery:{token:o,next:l.next}}}),l.next},getEventReplies:async(n,r,o)=>{const i=await t().store.getEventReplies(n,r,o);if(i)return e(a=>{const s=a.events;return a.events[r]=i,{events:s}}),i.length},events:{},eventsNewest:{},mergeNewerEvents:n=>{e(r=>{const o=r.events[n]||[],i=r.eventsNewer[n]||[];i.sort((s,l)=>s.event.created_at>l.event.created_at?-1:1),t().requestInformation({source:"events:related",idsOrKeys:[...i.map(s=>s.event.id)]},{view:n,timeoutIn:1e4,isLive:!0}),t().requestInformation({source:"users",idsOrKeys:[...new Set([...i.map(s=>s.event.pubkey)])]},{view:n,timeoutIn:1e4,isLive:!0});const a=[...i,...o];return{events:{...r.events,[n]:a},eventsNewer:{...r.eventsNewer,[n]:[]}}})},eventsNewer:{},addEvent:(n,r)=>{e(o=>{const i=o.eventsNewest[r]||0,s=(i===0?!0:n.event.created_at>i)?"eventsNewer":"events",l=o[s][r]||[];return l.find(c=>c.event.id===n.event.id)?o:{[s]:{...o[s],[r]:[...l,n]}}})},updateEvent:(n,r)=>{if(r){const i=(t().events[r]||[]).findIndex(a=>a.event.id===n.event.id);if(i!==-1){e(a=>{const s=a.events[r]||[];return s[i]=n,{events:{...a.events,[r]:s}}});return}}else{let o=!1;["events","eventsNewer"].forEach(i=>{if(o)return;const a=i==="events"?t().events:t().eventsNewer;for(const s in a)if(Object.prototype.hasOwnProperty.call(a,s)){const u=a[s].findIndex(c=>c.event.id===n.event.id);if(u!==-1){o=!0,e(c=>{const f=c[i][s]||[];return f[u]=n,{[i]:{...c[i],[s]:f}}});return}}})}},maxEvents:bk,setMaxEvents:async n=>{e({maxEvents:n})},determineApplicableRelays:async n=>{const r=await t().getRelays();if(!r){console.log("=> CLIENT: No relays found");return}const i=(n.relayUrls&&n.relayUrls.length>0?r.filter(a=>{var s;return(s=n.relayUrls)==null?void 0:s.includes(a.url)}):r).filter(a=>a.isReady&&a.write);if(i.length===0){console.log("=> CLIENT: No ready relays found");return}return console.log(`=> CLIENT: Found ${i.length} ready relays`),{relays:i,pow:0}},generateQueueItems:async n=>{const r=await t().determineApplicableRelays(n);if(!r)return;const o=[];for(const i of r.relays){const{relayUrls:a,...s}=n;o.push({...s,id:Bre(),relayUrl:i.url,send:!1})}return console.log(o),o},getQueueItems:async()=>t().store.getQueueItems(),getUser:async n=>t().store.getUser(n),addUser:async n=>t().store.addUser(n),updateUser:async(n,r)=>t().store.updateUser(n,r),countUsers:async()=>t().store.countUsers(),eventProofOfWork:async(n,r)=>new Promise(o=>{const i=new Worker(new URL("/nostr-ts/assets/pow-worker-3948d45b.js",self.location),{type:"module"});i.onmessage=function(a){o(a.data.result),i.terminate()},i.postMessage({event:n,bits:r})}),sendEvent:async n=>t().store.sendEvent(n),signEvent:async n=>{const r=t().keystore;if(n.pubkey||(n.pubkey=t().keypair.publicKey),n.id||n.generateId(),r==="localstore"){const o=t().keypair;if(!o)throw new Error("Keypair not initialized");return n.sign({privateKey:o.privateKey||"",publicKey:o.publicKey}),n}else if(r==="nos2x")if(window.nostr&&window.nostr.signEvent){const o=await window.nostr.signEvent(n.ToObj());if(!o.sig)throw new Error("No signature");return n.sig=o.sig,n}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore")},signAndSendEvent:async n=>{const r=t().keypair;if(!r)throw new Error("Keypair not initialized");let o=n.event;o.pubkey=r.publicKey,o.generateId();let i=n.relayUrls;const a=await t().determineApplicableRelays(n);if(!a)throw new Error("No relays available");i=a.relays.map(c=>c.url);let s=n.pow;const l=a.pow;if(s&&s!==0){if(s0){const c=await t().generateQueueItems({...n,relayUrls:i,pow:s});c&&(u=c),await t().store.addQueueItems(u);const f=await t().eventProofOfWork(n.event,s);o=new sr(f);for(const d of u)d.event=o,d.powDone=Date.now()}if(o=await t().signEvent(o),o.isReadyToPublishOrThrow(),u.length===0){const c=await t().generateQueueItems({...n,relayUrls:i,pow:s,event:o});c&&(u=c),await t().store.addQueueItems(u)}else for(const c of u)c.event=o,await t().store.updateQueueItem(c);return await t().store.sendQueueItems(u),o.id},followUser:async n=>{await t().store.followUser(n.pubkey)},unfollowUser:async n=>{await t().store.unfollowUser(n)},followingUser:async n=>{const r=await t().store.getUser(n);return(r==null?void 0:r.following)||!1},getAllUsersFollowing:async()=>t().store.getAllUsersFollowing(),blockUser:async n=>{await t().store.blockUser(n.pubkey);const r=t().events;e(o=>{const i={};for(const[a,s]of Object.entries(r))i[a]=s.filter(l=>l.event.pubkey!==n.pubkey);return{events:i}})},unblockUser:async n=>t().store.unblockUser(n),getAllUsersBlocked:async()=>t().store.getAllUsersBlocked(),lastContactsUpdate:async n=>t().store.lastContactsUpdate(n),createList:async n=>t().store.createList(n),updateList:async(n,r)=>t().store.updateList(n,r),deleteList:async n=>t().store.deleteList(n),getAllLists:async()=>t().store.getAllLists(),getList:async n=>t().store.getList(n),getListsWithUser:async n=>t().store.getListsWithUser(n),addUserToList:async(n,r)=>t().store.addUserToList(n,r),removeUserFromList:async(n,r)=>t().store.removeUserFromList(n,r),requestInformation:(n,r)=>t().store.requestInformation(n,r)}));var Sh,iw,Vae=(Sh=function(e,t){return Sh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},Sh(e,t)},function(e,t){function n(){this.constructor=e}Sh(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),Hae=function(e){function t(n){var r,o,i,a=this.constructor,s=e.call(this,n)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),r=s,o=a.prototype,(i=Object.setPrototypeOf)?i(r,o):r.__proto__=o,function(l,u){u===void 0&&(u=l.constructor);var c=Error.captureStackTrace;c&&c(l,u)}(s),s}return Vae(t,e),t}(Error),Wae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tr=function(e){function t(n){n===void 0&&(n=void 0);var r=e.call(this,n)||this;return r.message=n,r}return Wae(t,e),t.prototype.getKind=function(){return this.constructor.kind},t.kind="Exception",t}(Hae),Gae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yt=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Gae(t,e),t.kind="ArgumentException",t}(Tr),Kae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Me=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Kae(t,e),t.kind="IllegalArgumentException",t}(Tr),Sk=function(){function e(t){if(this.binarizer=t,t===null)throw new Me("Binarizer must be non-null.")}return e.prototype.getWidth=function(){return this.binarizer.getWidth()},e.prototype.getHeight=function(){return this.binarizer.getHeight()},e.prototype.getBlackRow=function(t,n){return this.binarizer.getBlackRow(t,n)},e.prototype.getBlackMatrix=function(){return this.matrix!==null&&this.matrix!==void 0||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},e.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},e.prototype.crop=function(t,n,r,o){var i=this.binarizer.getLuminanceSource().crop(t,n,r,o);return new e(this.binarizer.createBinarizer(i))},e.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},e.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new e(this.binarizer.createBinarizer(t))},e.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new e(this.binarizer.createBinarizer(t))},e.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},e}(),Xae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hn=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Xae(t,e),t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(Tr),qae=function(){function e(t){this.source=t}return e.prototype.getLuminanceSource=function(){return this.source},e.prototype.getWidth=function(){return this.source.getWidth()},e.prototype.getHeight=function(){return this.source.getHeight()},e}(),It=function(){function e(){}return e.arraycopy=function(t,n,r,o,i){for(;i--;)r[o++]=t[n++]},e.currentTimeMillis=function(){return Date.now()},e}(),Yae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),p_=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Yae(t,e),t.kind="IndexOutOfBoundsException",t}(Tr),Zae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),E4=function(e){function t(n,r){n===void 0&&(n=void 0),r===void 0&&(r=void 0);var o=e.call(this,r)||this;return o.index=n,o.message=r,o}return Zae(t,e),t.kind="ArrayIndexOutOfBoundsException",t}(p_),Qae=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gr=function(){function e(){}return e.fill=function(t,n){for(var r=0,o=t.length;rr)throw new Me("fromIndex("+n+") > toIndex("+r+")");if(n<0)throw new E4(n);if(r>t)throw new E4(r)},e.asList=function(){for(var t=[],n=0;n>1,s=r(n,t[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},e.numberComparator=function(t,n){return t-n},e}(),Dn=function(){function e(){}return e.numberOfTrailingZeros=function(t){var n;if(t===0)return 32;var r=31;return(n=t<<16)!==0&&(r-=16,t=n),(n=t<<8)!==0&&(r-=8,t=n),(n=t<<4)!==0&&(r-=4,t=n),(n=t<<2)!==0&&(r-=2,t=n),r-(t<<1>>>31)},e.numberOfLeadingZeros=function(t){if(t===0)return 32;var n=1;return!(t>>>16)&&(n+=16,t<<=16),!(t>>>24)&&(n+=8,t<<=8),!(t>>>28)&&(n+=4,t<<=4),!(t>>>30)&&(n+=2,t<<=2),n-=t>>>31},e.toHexString=function(t){return t.toString(16)},e.toBinaryString=function(t){return String(parseInt(String(t),2))},e.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,t+=t>>>8,63&(t+=t>>>16)},e.truncDivision=function(t,n){return Math.trunc(t/n)},e.parseInt=function(t,n){return n===void 0&&(n=void 0),parseInt(t,n)},e.MIN_VALUE_32_BITS=-2147483648,e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),ri=function(){function e(t,n){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=n??e.makeArray(t))}return e.prototype.getSize=function(){return this.size},e.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},e.prototype.ensureCapacity=function(t){if(t>32*this.bits.length){var n=e.makeArray(t);It.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},e.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(31&t))!=0},e.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},e.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},e.prototype.getNextSet=function(t){var n=this.size;if(t>=n)return n;var r=this.bits,o=Math.floor(t/32),i=r[o];i&=~((1<<(31&t))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=r[o]}var s=32*o+Dn.numberOfTrailingZeros(i);return s>n?n:s},e.prototype.getNextUnset=function(t){var n=this.size;if(t>=n)return n;var r=this.bits,o=Math.floor(t/32),i=~r[o];i&=~((1<<(31&t))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=~r[o]}var s=32*o+Dn.numberOfTrailingZeros(i);return s>n?n:s},e.prototype.setBulk=function(t,n){this.bits[Math.floor(t/32)]=n},e.prototype.setRange=function(t,n){if(nthis.size)throw new Me;if(n!==t){n--;for(var r=Math.floor(t/32),o=Math.floor(n/32),i=this.bits,a=r;a<=o;a++){var s=(2<<(ar?0:31&t));i[a]|=s}}},e.prototype.clear=function(){for(var t=this.bits.length,n=this.bits,r=0;rthis.size)throw new Me;if(n===t)return!0;n--;for(var o=Math.floor(t/32),i=Math.floor(n/32),a=this.bits,s=o;s<=i;s++){var l=(2<<(so?0:31&t))&4294967295;if((a[s]&l)!==(r?l:0))return!1}return!0},e.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},e.prototype.appendBits=function(t,n){if(n<0||n>32)throw new Me("Num bits must be between 0 and 32");this.ensureCapacity(this.size+n);for(var r=n;r>0;r--)this.appendBit((t>>r-1&1)==1)},e.prototype.appendBitArray=function(t){var n=t.size;this.ensureCapacity(this.size+n);for(var r=0;r>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,t[n-i]=a}if(this.size!==32*r){var s=32*r-this.size,l=t[0]>>>s;for(i=1;i>>s}t[r-1]=l}this.bits=t},e.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.size===n.size&&Gr.equals(this.bits,n.bits)},e.prototype.hashCode=function(){return 31*this.size+Gr.hashCode(this.bits)},e.prototype.toString=function(){for(var t="",n=0,r=this.size;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(e){e[e.Cp437=0]="Cp437",e[e.ISO8859_1=1]="ISO8859_1",e[e.ISO8859_2=2]="ISO8859_2",e[e.ISO8859_3=3]="ISO8859_3",e[e.ISO8859_4=4]="ISO8859_4",e[e.ISO8859_5=5]="ISO8859_5",e[e.ISO8859_6=6]="ISO8859_6",e[e.ISO8859_7=7]="ISO8859_7",e[e.ISO8859_8=8]="ISO8859_8",e[e.ISO8859_9=9]="ISO8859_9",e[e.ISO8859_10=10]="ISO8859_10",e[e.ISO8859_11=11]="ISO8859_11",e[e.ISO8859_13=12]="ISO8859_13",e[e.ISO8859_14=13]="ISO8859_14",e[e.ISO8859_15=14]="ISO8859_15",e[e.ISO8859_16=15]="ISO8859_16",e[e.SJIS=16]="SJIS",e[e.Cp1250=17]="Cp1250",e[e.Cp1251=18]="Cp1251",e[e.Cp1252=19]="Cp1252",e[e.Cp1256=20]="Cp1256",e[e.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",e[e.UTF8=22]="UTF8",e[e.ASCII=23]="ASCII",e[e.Big5=24]="Big5",e[e.GB18030=25]="GB18030",e[e.EUC_KR=26]="EUC_KR"})(at||(at={}));var aw,mr=function(){function e(t,n,r){for(var o,i,a=[],s=3;s=900)throw new ae("incorect value");var n=e.VALUES_TO_ECI.get(t);if(n===void 0)throw new ae("incorect value");return n},e.getCharacterSetECIByName=function(t){var n=e.NAME_TO_ECI.get(t);if(n===void 0)throw new ae("incorect value");return n},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.getName()===n.getName()},e.VALUE_IDENTIFIER_TO_ECI=new Map,e.VALUES_TO_ECI=new Map,e.NAME_TO_ECI=new Map,e.Cp437=new e(at.Cp437,Int32Array.from([0,2]),"Cp437"),e.ISO8859_1=new e(at.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),e.ISO8859_2=new e(at.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),e.ISO8859_3=new e(at.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),e.ISO8859_4=new e(at.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),e.ISO8859_5=new e(at.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),e.ISO8859_6=new e(at.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),e.ISO8859_7=new e(at.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),e.ISO8859_8=new e(at.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),e.ISO8859_9=new e(at.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),e.ISO8859_10=new e(at.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),e.ISO8859_11=new e(at.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),e.ISO8859_13=new e(at.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),e.ISO8859_14=new e(at.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),e.ISO8859_15=new e(at.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),e.ISO8859_16=new e(at.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),e.SJIS=new e(at.SJIS,20,"SJIS","Shift_JIS"),e.Cp1250=new e(at.Cp1250,21,"Cp1250","windows-1250"),e.Cp1251=new e(at.Cp1251,22,"Cp1251","windows-1251"),e.Cp1252=new e(at.Cp1252,23,"Cp1252","windows-1252"),e.Cp1256=new e(at.Cp1256,24,"Cp1256","windows-1256"),e.UnicodeBigUnmarked=new e(at.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),e.UTF8=new e(at.UTF8,26,"UTF8","UTF-8"),e.ASCII=new e(at.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),e.Big5=new e(at.Big5,28,"Big5"),e.GB18030=new e(at.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),e.EUC_KR=new e(at.EUC_KR,30,"EUC_KR","EUC-KR"),e}(),tse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),up=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return tse(t,e),t.kind="UnsupportedOperationException",t}(Tr),Ts=function(){function e(){}return e.decode=function(t,n){var r=this.encodingName(n);return this.customDecoder?this.customDecoder(t,r):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},e.shouldDecodeOnFallback=function(t){return!e.isBrowser()&&t==="ISO-8859-1"},e.encode=function(t,n){var r=this.encodingName(n);return this.customEncoder?this.customEncoder(t,r):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)},e.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},e.encodingName=function(t){return typeof t=="string"?t:t.getName()},e.encodingCharacterSet=function(t){return t instanceof mr?t:mr.getCharacterSetECIByName(t)},e.decodeFallback=function(t,n){var r=this.encodingCharacterSet(n);if(e.isDecodeFallbackSupported(r)){for(var o="",i=0,a=t.length;i3&&t[0]===239&&t[1]===187&&t[2]===191,E=0;E0?128&T?s--:a=!1:128&T&&(64&T?(s++,32&T?(s++,16&T?(s++,8&T?a=!1:c++):u++):l++):a=!1)),o&&(T>127&&T<160?o=!1:T>159&&(T<192||T===215||T===247)&&b++),i&&(f>0?T<64||T===127||T>252?i=!1:f--:T===128||T===160||T>239?i=!1:T>160&&T<224?(d++,p=0,++h>m&&(m=h)):T>127?(f++,h=0,++p>_&&(_=p)):(h=0,p=0))}return a&&s>0&&(a=!1),i&&f>0&&(i=!1),a&&(g||l+u+c>0)?e.UTF8:i&&(e.ASSUME_SHIFT_JIS||m>=3||_>=3)?e.SHIFT_JIS:o&&i?m===2&&d===2||10*b>=r?e.SHIFT_JIS:e.ISO88591:o?e.ISO88591:i?e.SHIFT_JIS:a?e.UTF8:e.PLATFORM_DEFAULT_ENCODING},e.format=function(t){for(var n=[],r=1;ra){if(s===-1)s=i-a;else if(i-a!==s)throw new Me("row lengths do not match");a=i,l++}u++}else if(t.substring(u,u+n.length)===n)u+=n.length,o[i]=!0,i++;else{if(t.substring(u,u+r.length)!==r)throw new Me("illegal character encountered: "+t.substring(u));u+=r.length,o[i]=!1,i++}if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new Me("row lengths do not match");l++}for(var c=new e(s,l),f=0;f>>(31&t)&1)!=0},e.prototype.set=function(t,n){var r=n*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295},e.prototype.unset=function(t,n){var r=n*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)},e.prototype.flip=function(t,n){var r=n*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295},e.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new Me("input matrix dimensions do not match");for(var n=new ri(Math.floor(this.width/32)+1),r=this.rowSize,o=this.bits,i=0,a=this.height;ithis.height||i>this.width)throw new Me("The region must fit inside the matrix");for(var s=this.rowSize,l=this.bits,u=n;ul&&(l=u),32*cs){for(d=31;!(f>>>d);)d--;32*c+d>s&&(s=32*c+d)}}}return s=0&&n[r]===0;)r--;if(r<0)return null;for(var o=Math.floor(r/t),i=32*Math.floor(r%t),a=n[r],s=31;!(a>>>s);)s--;return i+=s,Int32Array.from([i,o])},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.getRowSize=function(){return this.rowSize},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&&Gr.equals(this.bits,n.bits)},e.prototype.hashCode=function(){var t=this.width;return t=31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+Gr.hashCode(this.bits)},e.prototype.toString=function(t,n,r){return t===void 0&&(t="X "),n===void 0&&(n=" "),r===void 0&&(r=` +`),this.buildToString(t,n,r)},e.prototype.buildToString=function(t,n,r){for(var o=new mt,i=0,a=this.height;i>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(s);if(i<3)for(l=0;l>t.LUMINANCE_SHIFT]++;var d=t.estimateBlackPoint(a),h=n.getMatrix();for(s=0;sa&&(i=s,a=n[s]),n[s]>o&&(o=n[s]);var l=0,u=0;for(s=0;su&&(l=s,u=p)}if(i>l){var f=i;i=l,l=f}if(l-i<=r/16)throw new Y;var d=l-1,h=-1;for(s=l-1;s>i;s--){var p,m=s-i;(p=m*m*(l-s)*(o-n[s]))>h&&(d=s,h=p)}return d<=t.MINIMUM_DIMENSION&&o>=t.MINIMUM_DIMENSION){var i=n.getMatrix(),a=r>>t.BLOCK_SIZE_POWER;r&t.BLOCK_SIZE_MASK&&a++;var s=o>>t.BLOCK_SIZE_POWER;o&t.BLOCK_SIZE_MASK&&s++;var l=t.calculateBlackPoints(i,a,s,r,o),u=new Fi(r,o);t.calculateThresholdForBlock(i,a,s,r,o,l,u),this.matrix=u}else this.matrix=e.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(n){return new t(n)},t.calculateThresholdForBlock=function(n,r,o,i,a,s,l){for(var u=a-t.BLOCK_SIZE,c=i-t.BLOCK_SIZE,f=0;fu&&(d=u);for(var h=t.cap(f,2,o-3),p=0;pc&&(m=c);for(var _=t.cap(p,2,r-3),b=0,g=-2;g<=2;g++){var E=s[h+g];b+=E[_-2]+E[_-1]+E[_]+E[_+1]+E[_+2]}var T=b/25;t.thresholdBlock(n,m,d,T,i,l)}}},t.cap=function(n,r,o){return no?o:n},t.thresholdBlock=function(n,r,o,i,a,s){for(var l=0,u=o*a+r;ls&&(f=s);for(var d=0;dl&&(h=l);for(var p=0,m=255,_=0,b=0,g=f*i+h;b_&&(_=T)}if(_-m>t.MIN_DYNAMIC_RANGE)for(b++,g+=i;b>2*t.BLOCK_SIZE_POWER;if(_-m<=t.MIN_DYNAMIC_RANGE&&(O=m/2,c>0&&d>0)){var A=(u[c-1][d]+2*u[c][d-1]+u[c-1][d-1])/4;m>10,i[s]=u}return i},t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length0&&o[o.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$u=function(){function e(t,n,r){n===void 0&&(n=500),this.reader=t,this.timeBetweenScansMillis=n,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(e.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),e.prototype.listVideoInputDevices=function(){return Kn(this,void 0,void 0,function(){var t,n,r,o,i,a,s,l,u,c,f,d;return Xn(this,function(h){switch(h.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=h.sent(),n=[];try{for(r=cse(t),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,l=i.label||"Video device "+(n.length+1),u=i.groupId,c={deviceId:s,label:l,kind:a,groupId:u},n.push(c))}catch(p){f={error:p}}finally{try{o&&!o.done&&(d=r.return)&&d.call(r)}finally{if(f)throw f.error}}return[2,n]}})})},e.prototype.getVideoInputDevices=function(){return Kn(this,void 0,void 0,function(){return Xn(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(n){return new use(n.deviceId,n.label)})]}})})},e.prototype.findDeviceById=function(t){return Kn(this,void 0,void 0,function(){var n;return Xn(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===t})]:[2,null]}})})},e.prototype.decodeFromInputVideoDevice=function(t,n){return Kn(this,void 0,void 0,function(){return Xn(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeOnceFromVideoDevice=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return this.reset(),r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},e.prototype.decodeOnceFromConstraints=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},e.prototype.decodeOnceFromStream=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,n)];case 1:return r=o.sent(),[4,this.decodeOnce(r)];case 2:return[2,o.sent()]}})})},e.prototype.decodeFromInputVideoDeviceContinuously=function(t,n,r){return Kn(this,void 0,void 0,function(){return Xn(this,function(o){switch(o.label){case 0:return[4,this.decodeFromVideoDevice(t,n,r)];case 1:return[2,o.sent()]}})})},e.prototype.decodeFromVideoDevice=function(t,n,r){return Kn(this,void 0,void 0,function(){var o;return Xn(this,function(i){switch(i.label){case 0:return o={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},e.prototype.decodeFromConstraints=function(t,n,r){return Kn(this,void 0,void 0,function(){var o;return Xn(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return o=i.sent(),[4,this.decodeFromStream(o,n,r)];case 2:return[2,i.sent()]}})})},e.prototype.decodeFromStream=function(t,n,r){return Kn(this,void 0,void 0,function(){var o;return Xn(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,n)];case 1:return o=i.sent(),[4,this.decodeContinuously(o,r)];case 2:return[2,i.sent()]}})})},e.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},e.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},e.prototype.attachStreamToVideo=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return r=this.prepareVideoElement(n),this.addVideoSource(r,t),this.videoElement=r,this.stream=t,[4,this.playVideoOnLoadAsync(r)];case 1:return o.sent(),[2,r]}})})},e.prototype.playVideoOnLoadAsync=function(t){var n=this;return new Promise(function(r,o){return n.playVideoOnLoad(t,function(){return r()})})},e.prototype.playVideoOnLoad=function(t,n){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",n),this.tryPlayVideo(t)},e.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},e.prototype.tryPlayVideo=function(t){return Kn(this,void 0,void 0,function(){return Xn(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[3,4];case 3:return n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},e.prototype.getMediaElement=function(t,n){var r=document.getElementById(t);if(!r)throw new Yt("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Yt("element with id '"+t+"' must be an "+n+" element");return r},e.prototype.decodeFromImage=function(t,n){if(!t&&!n)throw new Yt("either imageElement with a src set or an url must be provided");return n&&!t?this.decodeFromImageUrl(n):this.decodeFromImageElement(t)},e.prototype.decodeFromVideo=function(t,n){if(!t&&!n)throw new Yt("Either an element with a src set or an URL must be provided");return n&&!t?this.decodeFromVideoUrl(n):this.decodeFromVideoElement(t)},e.prototype.decodeFromVideoContinuously=function(t,n,r){if(t===void 0&&n===void 0)throw new Yt("Either an element with a src set or an URL must be provided");return n&&!t?this.decodeFromVideoUrlContinuously(n,r):this.decodeFromVideoElementContinuously(t,r)},e.prototype.decodeFromImageElement=function(t){if(!t)throw new Yt("An image element must be provided.");this.reset();var n=this.prepareImageElement(t);return this.imageElement=n,this.isImageLoaded(n)?this.decodeOnce(n,!1,!0):this._decodeOnLoadImage(n)},e.prototype.decodeFromVideoElement=function(t){var n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(n)},e.prototype.decodeFromVideoElementContinuously=function(t,n){var r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,n)},e.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new Yt("A video element must be provided.");this.reset();var n=this.prepareVideoElement(t);return this.videoElement=n,n},e.prototype.decodeFromImageUrl=function(t){if(!t)throw new Yt("An URL must be provided.");this.reset();var n=this.prepareImageElement();this.imageElement=n;var r=this._decodeOnLoadImage(n);return n.src=t,r},e.prototype.decodeFromVideoUrl=function(t){if(!t)throw new Yt("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElement(n);return n.src=t,r},e.prototype.decodeFromVideoUrlContinuously=function(t,n){if(!t)throw new Yt("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),o=this.decodeFromVideoElementContinuously(r,n);return r.src=t,o},e.prototype._decodeOnLoadImage=function(t){var n=this;return new Promise(function(r,o){n.imageLoadedListener=function(){return n.decodeOnce(t,!1,!0).then(r,o)},t.addEventListener("load",n.imageLoadedListener)})},e.prototype._decodeOnLoadVideo=function(t){return Kn(this,void 0,void 0,function(){return Xn(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return n.sent(),[4,this.decodeOnce(t)];case 2:return[2,n.sent()]}})})},e.prototype._decodeOnLoadVideoContinuously=function(t,n){return Kn(this,void 0,void 0,function(){return Xn(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return r.sent(),this.decodeContinuously(t,n),[2]}})})},e.prototype.isImageLoaded=function(t){return!!t.complete&&t.naturalWidth!==0},e.prototype.prepareImageElement=function(t){var n;return t===void 0&&((n=document.createElement("img")).width=200,n.height=200),typeof t=="string"&&(n=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(n=t),n},e.prototype.prepareVideoElement=function(t){var n;return t||typeof document>"u"||((n=document.createElement("video")).width=200,n.height=200),typeof t=="string"&&(n=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(n=t),n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},e.prototype.decodeOnce=function(t,n,r){var o=this;n===void 0&&(n=!0),r===void 0&&(r=!0),this._stopAsyncDecode=!1;var i=function(a,s){if(o._stopAsyncDecode)return s(new Y("Video stream has ended before any code could be detected.")),void(o._stopAsyncDecode=void 0);try{a(o.decode(t))}catch(l){if(n&&l instanceof Y||(l instanceof hn||l instanceof ae)&&r)return setTimeout(i,o._timeBetweenDecodingAttempts,a,s);s(l)}};return new Promise(function(a,s){return i(a,s)})},e.prototype.decodeContinuously=function(t,n){var r=this;this._stopContinuousDecode=!1;var o=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var i=r.decode(t);n(i,null),setTimeout(o,r.timeBetweenScansMillis)}catch(a){n(null,a),(a instanceof hn||a instanceof ae||a instanceof Y)&&setTimeout(o,r._timeBetweenDecodingAttempts)}};o()},e.prototype.decode=function(t){var n=this.createBinaryBitmap(t);return this.decodeBitmap(n)},e.prototype.createBinaryBitmap=function(t){var n=this.getCaptureCanvasContext(t);this.drawImageOnCanvas(n,t);var r=this.getCaptureCanvas(t),o=new lse(r),i=new _k(o);return new Sk(i)},e.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var n=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=n}return this.captureCanvasContext},e.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var n=this.createCaptureCanvas(t);this.captureCanvas=n}return this.captureCanvas},e.prototype.drawImageOnCanvas=function(t,n){t.drawImage(n,0,0)},e.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},e.prototype.createCaptureCanvas=function(t){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var n,r,o=document.createElement("canvas");return t!==void 0&&(t instanceof HTMLVideoElement?(n=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),o.style.width=n+"px",o.style.height=r+"px",o.width=n,o.height=r,o},e.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},e.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},e.prototype._destroyVideoElement=function(){this.videoElement&&(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener("ended",this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},e.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},e.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},e.prototype.addVideoSource=function(t,n){try{t.srcObject=n}catch{t.src=URL.createObjectURL(n)}},e.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")},e}(),Ir=function(){function e(t,n,r,o,i,a){r===void 0&&(r=n==null?0:8*n.length),a===void 0&&(a=It.currentTimeMillis()),this.text=t,this.rawBytes=n,this.numBits=r,this.resultPoints=o,this.format=i,this.timestamp=a,this.text=t,this.rawBytes=n,this.numBits=r??(n==null?0:8*n.length),this.resultPoints=o,this.format=i,this.resultMetadata=null,this.timestamp=a??It.currentTimeMillis()}return e.prototype.getText=function(){return this.text},e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.getBarcodeFormat=function(){return this.format},e.prototype.getResultMetadata=function(){return this.resultMetadata},e.prototype.putMetadata=function(t,n){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,n)},e.prototype.putAllMetadata=function(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))},e.prototype.addResultPoints=function(t){var n=this.resultPoints;if(n===null)this.resultPoints=t;else if(t!==null&&t.length>0){var r=new Array(n.length+t.length);It.arraycopy(n,0,r,0,n.length),It.arraycopy(t,0,r,n.length,t.length),this.resultPoints=r}},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.toString=function(){return this.text},e}();(function(e){e[e.AZTEC=0]="AZTEC",e[e.CODABAR=1]="CODABAR",e[e.CODE_39=2]="CODE_39",e[e.CODE_93=3]="CODE_93",e[e.CODE_128=4]="CODE_128",e[e.DATA_MATRIX=5]="DATA_MATRIX",e[e.EAN_8=6]="EAN_8",e[e.EAN_13=7]="EAN_13",e[e.ITF=8]="ITF",e[e.MAXICODE=9]="MAXICODE",e[e.PDF_417=10]="PDF_417",e[e.QR_CODE=11]="QR_CODE",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(aw||(aw={}));var sw,Te=aw;(function(e){e[e.OTHER=0]="OTHER",e[e.ORIENTATION=1]="ORIENTATION",e[e.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",e[e.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",e[e.ISSUE_NUMBER=4]="ISSUE_NUMBER",e[e.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",e[e.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",e[e.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",e[e.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",e[e.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",e[e.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(sw||(sw={}));var Pn,Ln=sw,Cm=function(){function e(t,n,r,o,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=t,this.text=n,this.byteSegments=r,this.ecLevel=o,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=t==null?0:8*t.length}return e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.setNumBits=function(t){this.numBits=t},e.prototype.getText=function(){return this.text},e.prototype.getByteSegments=function(){return this.byteSegments},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getErrorsCorrected=function(){return this.errorsCorrected},e.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},e.prototype.getErasures=function(){return this.erasures},e.prototype.setErasures=function(t){this.erasures=t},e.prototype.getOther=function(){return this.other},e.prototype.setOther=function(t){this.other=t},e.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},e.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},e.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},e}(),Oc=function(){function e(){}return e.prototype.exp=function(t){return this.expTable[t]},e.prototype.log=function(t){if(t===0)throw new Me;return this.logTable[t]},e.addOrSubtract=function(t,n){return t^n},e}(),Zc=function(){function e(t,n){if(n.length===0)throw new Me;this.field=t;var r=n.length;if(r>1&&n[0]===0){for(var o=1;or.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;It.arraycopy(r,0,i,0,a);for(var s=a;s=t.getDegree()&&!o.isZero();){var s=o.getDegree()-t.getDegree(),l=n.multiply(o.getCoefficient(o.getDegree()),a),u=t.multiplyByMonomial(s,l),c=n.buildMonomial(s,l);r=r.addOrSubtract(c),o=o.addOrSubtract(u)}return[r,o]},e.prototype.toString=function(){for(var t="",n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);if(r!==0){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),n===0||r!==1){var o=this.field.log(r);o===0?t+="1":o===1?t+="a":(t+="a^",t+=o)}n!==0&&(n===1?t+="x":(t+="x^",t+=n))}}return t},e}(),fse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ek=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return fse(t,e),t.kind="ArithmeticException",t}(Tr),dse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ha=function(e){function t(n,r,o){var i=e.call(this)||this;i.primitive=n,i.size=r,i.generatorBase=o;for(var a=new Int32Array(r),s=1,l=0;l=r&&(s^=n,s&=r-1);i.expTable=a;var u=new Int32Array(r);for(l=0;l=(r/2|0);){var c=a,f=l;if(l=u,(a=s).isZero())throw new _h("r_{i-1} was zero");s=c;for(var d=i.getZero(),h=a.getCoefficient(a.getDegree()),p=i.inverse(h);s.getDegree()>=a.getDegree()&&!s.isZero();){var m=s.getDegree()-a.getDegree(),_=i.multiply(s.getCoefficient(s.getDegree()),p);d=d.addOrSubtract(i.buildMonomial(m,_)),s=s.addOrSubtract(a.multiplyByMonomial(m,_))}if(u=d.multiply(l).addOrSubtract(f),s.getDegree()>=a.getDegree())throw new Od("Division algorithm failed to reduce polynomial?")}var b=u.getCoefficient(0);if(b===0)throw new _h("sigmaTilde(0) was zero");var g=i.inverse(b);return[u.multiplyScalar(g),s.multiplyScalar(g)]},e.prototype.findErrorLocations=function(t){var n=t.getDegree();if(n===1)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(n),o=0,i=this.field,a=1;a1,d,d+r-1),d+=r-1;else for(var p=r-1;p>=0;--p)f[d++]=(h&1<=8?e.readCode(t,n,8):e.readCode(t,n,r)<<8-r},e.convertBoolArrayToByteArray=function(t){for(var n=new Uint8Array((t.length+7)/8),r=0;r","?","[","]","{","}","CTRL_UL"],e.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],e}(),Ze=function(){function e(){}return e.round=function(t){return t===NaN?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},e.distance=function(t,n,r,o){var i=t-r,a=n-o;return Math.sqrt(i*i+a*a)},e.sum=function(t){for(var n=0,r=0,o=t.length;r!==o;r++)n+=t[r];return n},e}(),lw=function(){function e(){}return e.floatToIntBits=function(t){return t},e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),we=function(){function e(t,n){this.x=t,this.y=n}return e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.equals=function(t){if(t instanceof e){var n=t;return this.x===n.x&&this.y===n.y}return!1},e.prototype.hashCode=function(){return 31*lw.floatToIntBits(this.x)+lw.floatToIntBits(this.y)},e.prototype.toString=function(){return"("+this.x+","+this.y+")"},e.orderBestPatterns=function(t){var n,r,o,i=this.distance(t[0],t[1]),a=this.distance(t[1],t[2]),s=this.distance(t[0],t[2]);if(a>=i&&a>=s?(r=t[0],n=t[1],o=t[2]):s>=a&&s>=i?(r=t[1],n=t[0],o=t[2]):(r=t[2],n=t[0],o=t[1]),this.crossProductZ(n,r,o)<0){var l=n;n=o,o=l}t[0]=n,t[1]=r,t[2]=o},e.distance=function(t,n){return Ze.distance(t.x,t.y,n.x,n.y)},e.crossProductZ=function(t,n,r){var o=n.x,i=n.y;return(r.x-o)*(t.y-i)-(r.y-i)*(t.x-o)},e}(),m_=function(){function e(t,n){this.bits=t,this.points=n}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),mse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yse=function(e){function t(n,r,o,i,a){var s=e.call(this,n,r)||this;return s.compact=o,s.nbDatablocks=i,s.nbLayers=a,s}return mse(t,e),t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(m_),uw=function(){function e(t,n,r,o){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),n==null&&(n=e.INIT_SIZE),r==null&&(r=t.getWidth()/2|0),o==null&&(o=t.getHeight()/2|0);var i=n/2|0;if(this.leftInit=r-i,this.rightInit=r+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Y}return e.prototype.detect=function(){for(var t=this.leftInit,n=this.rightInit,r=this.upInit,o=this.downInit,i=!1,a=!0,s=!1,l=!1,u=!1,c=!1,f=!1,d=this.width,h=this.height;a;){a=!1;for(var p=!0;(p||!l)&&n=d){i=!0;break}for(var m=!0;(m||!u)&&o=h){i=!0;break}for(var _=!0;(_||!c)&&t>=0;)(_=this.containsBlackPoint(r,o,t,!1))?(t--,a=!0,c=!0):c||t--;if(t<0){i=!0;break}for(var b=!0;(b||!f)&&r>=0;)(b=this.containsBlackPoint(t,n,r,!0))?(r--,a=!0,f=!0):f||r--;if(r<0){i=!0;break}a&&(s=!0)}if(!i&&s){for(var g=n-t,E=null,T=1;E===null&&Tr||l<-1||l>o)throw new Y;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),l===-1?(n[a+1]=0,i=!0):l===o&&(n[a+1]=o-1,i=!0)}for(i=!0,a=n.length-2;a>=0&&i;a-=2){if(s=Math.floor(n[a]),l=Math.floor(n[a+1]),s<-1||s>r||l<-1||l>o)throw new Y;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),l===-1?(n[a+1]=0,i=!0):l===o&&(n[a+1]=o-1,i=!0)}},e}(),Ck=function(){function e(t,n,r,o,i,a,s,l,u){this.a11=t,this.a21=n,this.a31=r,this.a12=o,this.a22=i,this.a32=a,this.a13=s,this.a23=l,this.a33=u}return e.quadrilateralToQuadrilateral=function(t,n,r,o,i,a,s,l,u,c,f,d,h,p,m,_){var b=e.quadrilateralToSquare(t,n,r,o,i,a,s,l);return e.squareToQuadrilateral(u,c,f,d,h,p,m,_).times(b)},e.prototype.transformPoints=function(t){for(var n=t.length,r=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,l=this.a23,u=this.a31,c=this.a32,f=this.a33,d=0;d>1&127):(o<<=10,o+=(a>>2&992)+(a>>1&31))}var s=this.getCorrectedParameterData(o,this.compact);this.compact?(this.nbLayers=1+(s>>6),this.nbDataBlocks=1+(63&s)):(this.nbLayers=1+(s>>11),this.nbDataBlocks=1+(2047&s))},e.prototype.getRotation=function(t,n){var r=0;t.forEach(function(i,a,s){r=(r<<3)+((i>>n-2<<1)+(1&i))}),r=((1&r)<<11)+(r>>1);for(var o=0;o<4;o++)if(Dn.bitCount(r^this.EXPECTED_CORNER_BITS[o])<=2)return o;throw new Y},e.prototype.getCorrectedParameterData=function(t,n){var r,o;n?(r=7,o=2):(r=10,o=4);for(var i=r-o,a=new Int32Array(r),s=r-1;s>=0;--s)a[s]=15&t,t>>=4;try{new xm(ha.AZTEC_PARAM).decode(a,i)}catch{throw new Y}var l=0;for(s=0;s2){var f=this.distancePoint(c,s)*this.nbCenterLayers/(this.distancePoint(i,n)*(this.nbCenterLayers+2));if(f<.75||f>1.25||!this.isWhiteOrBlackRectangle(s,l,u,c))break}n=s,r=l,o=u,i=c,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new Y;this.compact=this.nbCenterLayers===5;var d=new we(n.getX()+.5,n.getY()-.5),h=new we(r.getX()+.5,r.getY()+.5),p=new we(o.getX()-.5,o.getY()+.5),m=new we(i.getX()-.5,i.getY()-.5);return this.expandSquare([d,h,p,m],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},e.prototype.getMatrixCenter=function(){var t,n,r,o;try{t=(u=new uw(this.image).detect())[0],n=u[1],r=u[2],o=u[3]}catch{var i=this.image.getWidth()/2,a=this.image.getHeight()/2;t=this.getFirstDifferent(new dr(i+7,a-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new dr(i+7,a+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new dr(i-7,a+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dr(i-7,a-7),!1,-1,-1).toResultPoint()}var s=Ze.round((t.getX()+o.getX()+n.getX()+r.getX())/4),l=Ze.round((t.getY()+o.getY()+n.getY()+r.getY())/4);try{var u;t=(u=new uw(this.image,15,s,l).detect())[0],n=u[1],r=u[2],o=u[3]}catch{t=this.getFirstDifferent(new dr(s+7,l-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new dr(s+7,l+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new dr(s-7,l+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dr(s-7,l-7),!1,-1,-1).toResultPoint()}return s=Ze.round((t.getX()+o.getX()+n.getX()+r.getX())/4),l=Ze.round((t.getY()+o.getY()+n.getY()+r.getY())/4),new dr(s,l)},e.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},e.prototype.sampleGrid=function(t,n,r,o,i){var a=y_.getInstance(),s=this.getDimension(),l=s/2-this.nbCenterLayers,u=s/2+this.nbCenterLayers;return a.sampleGrid(t,s,s,l,l,u,l,u,u,l,u,n.getX(),n.getY(),r.getX(),r.getY(),o.getX(),o.getY(),i.getX(),i.getY())},e.prototype.sampleLine=function(t,n,r){for(var o=0,i=this.distanceResultPoint(t,n),a=i/r,s=t.getX(),l=t.getY(),u=a*(n.getX()-t.getX())/i,c=a*(n.getY()-t.getY())/i,f=0;f.1&&d<.9?0:d<=.1===u?1:-1},e.prototype.getFirstDifferent=function(t,n,r,o){for(var i=t.getX()+r,a=t.getY()+o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r,a+=o;for(i-=r,a-=o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r;for(i-=r;this.isValid(i,a)&&this.image.get(i,a)===n;)a+=o;return new dr(i,a-=o)},e.prototype.expandSquare=function(t,n,r){var o=r/(2*n),i=t[0].getX()-t[2].getX(),a=t[0].getY()-t[2].getY(),s=(t[0].getX()+t[2].getX())/2,l=(t[0].getY()+t[2].getY())/2,u=new we(s+o*i,l+o*a),c=new we(s-o*i,l-o*a);return i=t[1].getX()-t[3].getX(),a=t[1].getY()-t[3].getY(),s=(t[1].getX()+t[3].getX())/2,l=(t[1].getY()+t[3].getY())/2,[u,new we(s+o*i,l+o*a),c,new we(s-o*i,l-o*a)]},e.prototype.isValid=function(t,n){return t>=0&&t0&&n>(s?8:5));r=s?i:15;for(var u=Math.trunc(i/2),c=0;c=i)break;try{a=t.getBlackRow(d,a)}catch{continue}for(var h=function(b){if(b===1&&(a.reverse(),n&&n.get(Et.NEED_RESULT_POINT_CALLBACK)===!0)){var g=new Map;n.forEach(function(O,A){return g.set(A,O)}),g.delete(Et.NEED_RESULT_POINT_CALLBACK),n=g}try{var E=p.decodeRow(d,a,n);if(b===1){E.putMetadata(Ln.ORIENTATION,180);var T=E.getResultPoints();T!==null&&(T[0]=new we(o-T[0].getX()-1,T[0].getY()),T[1]=new we(o-T[1].getX()-1,T[1].getY()))}return{value:E}}catch{}},p=this,m=0;m<2;m++){var _=h(m);if(typeof _=="object")return _.value}}throw new Y},e.recordPattern=function(t,n,r){for(var o=r.length,i=0;i=a)throw new Y;for(var s=!t.get(n),l=0,u=n;u0&&o>=0;)t.get(--n)!==i&&(o--,i=!i);if(o>=0)throw new Y;e.recordPattern(t,n+1,r)},e.patternMatchVariance=function(t,n,r){for(var o=t.length,i=0,a=0,s=0;sd?f-d:d-f;if(h>r)return Number.POSITIVE_INFINITY;u+=h}return u/i},e}(),Sse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),O4=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Sse(t,e),t.findStartPattern=function(n){for(var r=n.getSize(),o=n.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),s=o,l=!1,u=o;u=0&&n.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,f]);s+=a[0]+a[1],(a=a.slice(2,a.length-1))[i-1]=0,a[i]=0,i--}else i++;a[i]=1,l=!l}throw new Y},t.decodeCode=function(n,r,o){Nn.recordPattern(n,o,r);for(var i=t.MAX_AVG_VARIANCE,a=-1,s=0;s=0)return a;throw new Y},t.prototype.decodeRow=function(n,r,o){var i,a=o&&o.get(Et.ASSUME_GS1)===!0,s=t.findStartPattern(r),l=s[2],u=0,c=new Uint8Array(20);switch(c[u++]=l,l){case t.CODE_START_A:i=t.CODE_CODE_A;break;case t.CODE_START_B:i=t.CODE_CODE_B;break;case t.CODE_START_C:i=t.CODE_CODE_C;break;default:throw new ae}for(var f=!1,d=!1,h="",p=s[0],m=s[1],_=Int32Array.from([0,0,0,0,0,0]),b=0,g=0,E=l,T=0,O=!0,A=!1,C=!1;!f;){var y=d;switch(d=!1,b=g,g=t.decodeCode(r,_,m),c[u++]=g,g!==t.CODE_STOP&&(O=!0),g!==t.CODE_STOP&&(E+=++T*g),p=m,m+=_.reduce(function(D,L){return D+L},0),g){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new ae}switch(i){case t.CODE_CODE_A:if(g<64)h+=C===A?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else if(g<96)h+=C===A?String.fromCharCode(g-64):String.fromCharCode(g+64),C=!1;else switch(g!==t.CODE_STOP&&(O=!1),g){case t.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!A&&C?(A=!0,C=!1):A&&C?(A=!1,C=!1):C=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_B;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:f=!0}break;case t.CODE_CODE_B:if(g<96)h+=C===A?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else switch(g!==t.CODE_STOP&&(O=!1),g){case t.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!A&&C?(A=!0,C=!1):A&&C?(A=!1,C=!1):C=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_A;break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:f=!0}break;case t.CODE_CODE_C:if(g<100)g<10&&(h+="0"),h+=g;else switch(g!==t.CODE_STOP&&(O=!1),g){case t.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_STOP:f=!0}}y&&(i=i===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var S=m-p;if(m=r.getNextUnset(m),!r.isRange(m,Math.min(r.getSize(),m+(m-p)/2),!1))throw new Y;if((E-=T*b)%103!==b)throw new hn;var v=h.length;if(v===0)throw new Y;v>0&&O&&(h=i===t.CODE_CODE_C?h.substring(0,v-2):h.substring(0,v-1));for(var x=(s[1]+s[0])/2,I=p+S/2,R=c.length,k=new Uint8Array(R),M=0;M=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},A4=function(e){function t(n,r){n===void 0&&(n=!1),r===void 0&&(r=!1);var o=e.call(this)||this;return o.usingCheckDigit=n,o.extendedMode=r,o.decodeRowResult="",o.counters=new Int32Array(9),o}return _se(t,e),t.prototype.decodeRow=function(n,r,o){var i,a,s,l,u=this.counters;u.fill(0),this.decodeRowResult="";var c,f,d=t.findAsteriskPattern(r,u),h=r.getNextSet(d[1]),p=r.getSize();do{t.recordPattern(r,h,u);var m=t.toNarrowWidePattern(u);if(m<0)throw new Y;c=t.patternToChar(m),this.decodeRowResult+=c,f=h;try{for(var _=(i=void 0,Sg(u)),b=_.next();!b.done;b=_.next())h+=b.value}catch(x){i={error:x}}finally{try{b&&!b.done&&(a=_.return)&&a.call(_)}finally{if(i)throw i.error}}h=r.getNextSet(h)}while(c!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var g,E=0;try{for(var T=Sg(u),O=T.next();!O.done;O=T.next())E+=O.value}catch(x){s={error:x}}finally{try{O&&!O.done&&(l=T.return)&&l.call(T)}finally{if(s)throw s.error}}if(h!==p&&2*(h-f-E)s&&(l=p)}catch(m){r={error:m}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}s=l,i=0;for(var f=0,d=0,h=0;hs&&(d|=1<0;h++){var p;if((p=n[h])>s&&(i--,2*p>=f))return-1}return d}}while(i>3);return-1},t.patternToChar=function(n){for(var r=0;r="A"&&s<="Z"))throw new ae;l=String.fromCharCode(s.charCodeAt(0)+32);break;case"$":if(!(s>="A"&&s<="Z"))throw new ae;l=String.fromCharCode(s.charCodeAt(0)-64);break;case"%":if(s>="A"&&s<="E")l=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")l=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")l=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")l="\0";else if(s==="V")l="@";else if(s==="W")l="`";else{if(s!=="X"&&s!=="Y"&&s!=="Z")throw new ae;l=""}break;case"/":if(s>="A"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)-32);else{if(s!=="Z")throw new ae;l=":"}}o+=l,i++}else o+=a}return o},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(Nn),Ese=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cse=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},P4=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.narrowLineWidth=-1,n}return Ese(t,e),t.prototype.decodeRow=function(n,r,o){var i,a,s=this.decodeStart(r),l=this.decodeEnd(r),u=new mt;t.decodeMiddle(r,s[1],l[0],u);var c=u.toString(),f=null;o!=null&&(f=o.get(Et.ALLOWED_LENGTHS)),f==null&&(f=t.DEFAULT_ALLOWED_LENGTHS);var d=c.length,h=!1,p=0;try{for(var m=Cse(f),_=m.next();!_.done;_=m.next()){var b=_.value;if(d===b){h=!0;break}b>p&&(p=b)}}catch(E){i={error:E}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}if(!h&&d>p&&(h=!0),!h)throw new ae;var g=[new we(s[1],n),new we(l[0],n)];return new Ir(c,null,0,g,Te.ITF,new Date().getTime())},t.decodeMiddle=function(n,r,o,i){var a=new Int32Array(10),s=new Int32Array(5),l=new Int32Array(5);for(a.fill(0),s.fill(0),l.fill(0);r0&&i>=0&&!n.get(i);i--)o--;if(o!==0)throw new Y},t.skipWhiteSpace=function(n){var r=n.getSize(),o=n.getNextSet(0);if(o===r)throw new Y;return o},t.prototype.decodeEnd=function(n){n.reverse();try{var r=t.skipWhiteSpace(n),o=void 0;try{o=t.findGuardPattern(n,r,t.END_PATTERN_REVERSED[0])}catch(a){a instanceof Y&&(o=t.findGuardPattern(n,r,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,o[0]);var i=o[0];return o[0]=n.getSize()-o[1],o[1]=n.getSize()-i,o}finally{n.reverse()}},t.findGuardPattern=function(n,r,o){var i=o.length,a=new Int32Array(i),s=n.getSize(),l=!1,u=0,c=r;a.fill(0);for(var f=r;f=0)return o%10;throw new Y},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(Nn),xse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ou=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.decodeRowStringBuffer="",n}return xse(t,e),t.findStartGuardPattern=function(n){for(var r,o=!1,i=0,a=Int32Array.from([0,0,0]);!o;){a=Int32Array.from([0,0,0]);var s=(r=t.findGuardPattern(n,i,!1,this.START_END_PATTERN,a))[0],l=s-((i=r[1])-s);l>=0&&(o=n.isRange(l,s,!1))}return r},t.checkChecksum=function(n){return t.checkStandardUPCEANChecksum(n)},t.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return t.getStandardUPCEANChecksum(n.substring(0,r-1))===o},t.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}return(1e3-o)%10},t.decodeEnd=function(n,r){return t.findGuardPattern(n,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(n,r,o,i){return this.findGuardPattern(n,r,o,i,new Int32Array(i.length))},t.findGuardPattern=function(n,r,o,i,a){for(var s=n.getSize(),l=0,u=r=o?n.getNextUnset(r):n.getNextSet(r),c=i.length,f=o,d=r;d=0)return s;throw new Y},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(Nn),Ose=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ase=function(){function e(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=e.parseExtensionString(a),l=[new we((r[0]+r[1])/2,t),new we(i,t)],u=new Ir(a,null,0,l,Te.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},e.prototype.decodeMiddle=function(t,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),l=n[1],u=0,c=0;c<5&&l=10&&(u|=1<<4-c),c!==4&&(l=t.getNextSet(l),l=t.getNextUnset(l))}if(r.length!==5)throw new Y;var p=this.determineCheckDigit(u);if(e.extensionChecksum(r.toString())!==p)throw new Y;return l},e.extensionChecksum=function(t){for(var n=t.length,r=0,o=n-2;o>=0;o-=2)r+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);for(r*=3,o=n-1;o>=0;o-=2)r+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},e.prototype.determineCheckDigit=function(t){for(var n=0;n<10;n++)if(t===this.CHECK_DIGIT_ENCODINGS[n])return n;throw new Y},e.parseExtensionString=function(t){if(t.length!==5)return null;var n=e.parseExtension5String(t);return n==null?null:new Map([[Ln.SUGGESTED_PRICE,n]])},e.parseExtension5String=function(t){var n;switch(t.charAt(0)){case"0":n="£";break;case"5":n="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}n="";break;default:n=""}var r=parseInt(t.substring(1)),o=r%100;return n+(r/100).toString()+"."+(o<10?"0"+o:o.toString())},e}(),Pse=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tse=function(){function e(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=e.parseExtensionString(a),l=[new we((r[0]+r[1])/2,t),new we(i,t)],u=new Ir(a,null,0,l,Te.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},e.prototype.decodeMiddle=function(t,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),l=n[1],u=0,c=0;c<2&&l=10&&(u|=1<<1-c),c!==1&&(l=t.getNextSet(l),l=t.getNextUnset(l))}if(r.length!==2)throw new Y;if(parseInt(r.toString())%4!==u)throw new Y;return l},e.parseExtensionString=function(t){return t.length!==2?null:new Map([[Ln.ISSUE_NUMBER,parseInt(t)]])},e}(),Ise=function(){function e(){}return e.decodeRow=function(t,n,r){var o=Ou.findGuardPattern(n,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new Ase().decodeRow(t,n,o)}catch{return new Tse().decodeRow(t,n,o)}},e.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),e}(),Rse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fn=function(e){function t(){var n=e.call(this)||this;n.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var r=10;r<20;r++){for(var o=t.L_PATTERNS[r-10],i=new Int32Array(o.length),a=0;a=r.getSize()||!r.isRange(p,m,!1))throw new Y;var _=c.toString();if(_.length<8)throw new ae;if(!t.checkChecksum(_))throw new hn;var b=(i[1]+i[0])/2,g=(d[1]+d[0])/2,E=this.getBarcodeFormat(),T=[new we(b,n),new we(g,n)],O=new Ir(_,null,0,T,E,new Date().getTime()),A=0;try{var C=Ise.decodeRow(n,r,d[1]);O.putMetadata(Ln.UPC_EAN_EXTENSION,C.getText()),O.putAllMetadata(C.getResultMetadata()),O.addResultPoints(C.getResultPoints()),A=C.getText().length}catch{}var y=o==null?null:o.get(Et.ALLOWED_EAN_EXTENSIONS);if(y!=null){var S=!1;for(var v in y)if(A.toString()===v){S=!0;break}if(!S)throw new Y}return E===Te.EAN_13||Te.UPC_A,O},t.checkChecksum=function(n){return t.checkStandardUPCEANChecksum(n)},t.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return t.getStandardUPCEANChecksum(n.substring(0,r-1))===o},t.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}return(1e3-o)%10},t.decodeEnd=function(n,r){return t.findGuardPattern(n,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(Ou),kse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),T4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},cw=function(e){function t(){var n=e.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return kse(t,e),t.prototype.decodeMiddle=function(n,r,o){var i,a,s,l,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=n.getSize(),f=r[1],d=0,h=0;h<6&&f=10&&(d|=1<<5-h)}for(o=t.determineFirstDigit(o,d),f=fn.findGuardPattern(n,f,!0,fn.MIDDLE_PATTERN,new Int32Array(fn.MIDDLE_PATTERN.length).fill(0))[1],h=0;h<6&&f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},R4=function(e){function t(){var n=e.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return Mse(t,e),t.prototype.decodeMiddle=function(n,r,o){var i,a,s,l,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=n.getSize(),f=r[1],d=0;d<4&&f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},k4=function(e){function t(){var n=e.call(this)||this;return n.decodeMiddleCounters=new Int32Array(4),n}return Nse(t,e),t.prototype.decodeMiddle=function(n,r,o){var i,a,s=this.decodeMiddleCounters.map(function(m){return m});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var l=n.getSize(),u=r[1],c=0,f=0;f<6&&u=10&&(c|=1<<5-f)}return t.determineNumSysAndCheckDigit(new mt(o),c),u},t.prototype.decodeEnd=function(n,r){return t.findGuardPatternWithoutCounters(n,r,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(n){return fn.checkChecksum(t.convertUPCEtoUPCA(n))},t.determineNumSysAndCheckDigit=function(n,r){for(var o=0;o<=1;o++)for(var i=0;i<10;i++)if(r===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[o][i])return n.insert(0,"0"+o),void n.append("0"+i);throw Y.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return Te.UPC_E},t.convertUPCEtoUPCA=function(n){var r=n.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),o=new mt;o.append(n.charAt(0));var i=r[5];switch(i){case 0:case 1:case 2:o.appendChars(r,0,2),o.append(i),o.append("0000"),o.appendChars(r,2,3);break;case 3:o.appendChars(r,0,3),o.append("00000"),o.appendChars(r,3,2);break;case 4:o.appendChars(r,0,4),o.append("00000"),o.append(r[4]);break;default:o.appendChars(r,0,5),o.append("0000"),o.append(i)}return n.length>=8&&o.append(n.charAt(7)),o.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(fn),jse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),M4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_g=function(e){function t(n){var r=e.call(this)||this,o=n==null?null:n.get(Et.POSSIBLE_FORMATS),i=[];return o!=null&&(o.indexOf(Te.EAN_13)>-1?i.push(new cw):o.indexOf(Te.UPC_A)>-1&&i.push(new Lse),o.indexOf(Te.EAN_8)>-1&&i.push(new R4),o.indexOf(Te.UPC_E)>-1&&i.push(new k4)),i.length===0&&(i.push(new cw),i.push(new R4),i.push(new k4)),r.readers=i,r}return jse(t,e),t.prototype.decodeRow=function(n,r,o){var i,a;try{for(var s=M4(this.readers),l=s.next();!l.done;l=s.next()){var u=l.value;try{var c=u.decodeRow(n,r,o),f=c.getBarcodeFormat()===Te.EAN_13&&c.getText().charAt(0)==="0",d=o==null?null:o.get(Et.POSSIBLE_FORMATS),h=d==null||d.includes(Te.UPC_A);if(f&&h){var p=c.getRawBytes(),m=new Ir(c.getText().substring(1),p,p.length,c.getResultPoints(),Te.UPC_A);return m.putAllMetadata(c.getResultMetadata()),m}return c}catch{}}}catch(_){i={error:_}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}throw new Y},t.prototype.reset=function(){var n,r;try{for(var o=M4(this.readers),i=o.next();!i.done;i=o.next())i.value.reset()}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t}(Nn),Fse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$se=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},os=function(e){function t(){var n=e.call(this)||this;return n.decodeFinderCounters=new Int32Array(4),n.dataCharacterCounters=new Int32Array(8),n.oddRoundingErrors=new Array(4),n.evenRoundingErrors=new Array(4),n.oddCounts=new Array(n.dataCharacterCounters.length/2),n.evenCounts=new Array(n.dataCharacterCounters.length/2),n}return Fse(t,e),t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(n,r){for(var o=0;oi&&(i=r[a],o=a);n[o]++},t.decrement=function(n,r){for(var o=0,i=r[0],a=1;a=t.MIN_FINDER_PATTERN_RATIO&&a<=t.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;try{for(var u=$se(n),c=u.next();!c.done;c=u.next()){var f=c.value;f>l&&(l=f),f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fl=function(){function e(){}return e.getRSSvalue=function(t,n,r){var o,i,a=0;try{for(var s=zse(t),l=s.next();!l.done;l=s.next())a+=l.value}catch(b){o={error:b}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var u=0,c=0,f=t.length,d=0;d=f-d-1&&(p-=e.combins(a-h-(f-d),f-d-2)),f-d-1>1){for(var m=0,_=a-h-(f-d-2);_>n;_--)m+=e.combins(a-h-_-1,f-d-3);p-=m*(f-1-d)}else a-h>n&&p--;u+=p}a-=h}return u},e.combins=function(t,n){var r,o;t-n>n?(o=n,r=t-n):(o=t-n,r=n);for(var i=1,a=1,s=t;s>r;s--)i*=s,a<=o&&(i/=a,a++);for(;a<=o;)i/=a,a++;return i},e}(),Use=function(){function e(){}return e.buildBitArray=function(t){var n=2*t.length-1;t[t.length-1].getRightChar()==null&&(n-=1);for(var r=new ri(12*n),o=0,i=t[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<=0;--u)l&1<=0;--u)c&1<10||o<0||o>10)throw new ae;return i.firstDigit=r,i.secondDigit=o,i}return Wse(t,e),t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(g_),Ch=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gse=function(){function e(){}return e.parseFieldsInGeneralPurpose=function(t){var n,r,o,i,a,s,l,u;if(!t)return null;if(t.length<2)throw new Y;var c=t.substring(0,2);try{for(var f=Ch(e.TWO_DIGIT_DATA_LENGTH),d=f.next();!d.done;d=f.next())if((O=d.value)[0]===c)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(2,O[2],t):e.processFixedAI(2,O[1],t)}catch(A){n={error:A}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}if(t.length<3)throw new Y;var h=t.substring(0,3);try{for(var p=Ch(e.THREE_DIGIT_DATA_LENGTH),m=p.next();!m.done;m=p.next())if((O=m.value)[0]===h)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(3,O[2],t):e.processFixedAI(3,O[1],t)}catch(A){o={error:A}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var _=Ch(e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),b=_.next();!b.done;b=_.next())if((O=b.value)[0]===h)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,O[2],t):e.processFixedAI(4,O[1],t)}catch(A){a={error:A}}finally{try{b&&!b.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}if(t.length<4)throw new Y;var g=t.substring(0,4);try{for(var E=Ch(e.FOUR_DIGIT_DATA_LENGTH),T=E.next();!T.done;T=E.next()){var O;if((O=T.value)[0]===g)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,O[2],t):e.processFixedAI(4,O[1],t)}}catch(A){l={error:A}}finally{try{T&&!T.done&&(u=E.return)&&u.call(E)}finally{if(l)throw l.error}}throw new Y},e.processFixedAI=function(t,n,r){if(r.lengththis.information.getSize())return t+4<=this.information.getSize();for(var n=t;nthis.information.getSize()){var n=this.extractNumericValueFromBitArray(t,4);return new Eh(this.information.getSize(),n===0?Eh.FNC1:n-1,Eh.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);return new Eh(t+7,(r-8)/11,(r-8)%11)},e.prototype.extractNumericValueFromBitArray=function(t,n){return e.extractNumericValueFromBitArray(this.information,t,n)},e.extractNumericValueFromBitArray=function(t,n,r){for(var o=0,i=0;ithis.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,5);if(n>=5&&n<16)return!0;if(t+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;var o=this.extractNumericValueFromBitArray(t,8);return o>=232&&o<253},e.prototype.decodeIsoIec646=function(t){var n=this.extractNumericValueFromBitArray(t,5);if(n===15)return new Ao(t+5,Ao.FNC1);if(n>=5&&n<15)return new Ao(t+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(t,7);if(o>=64&&o<90)return new Ao(t+7,""+(o+1));if(o>=90&&o<116)return new Ao(t+7,""+(o+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new ae}return new Ao(t+8,r)},e.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,5);if(n>=5&&n<16)return!0;if(t+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63},e.prototype.decodeAlphanumeric=function(t){var n=this.extractNumericValueFromBitArray(t,5);if(n===15)return new Ao(t+5,Ao.FNC1);if(n>=5&&n<15)return new Ao(t+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(t,6);if(o>=32&&o<58)return new Ao(t+6,""+(o+33));switch(o){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new Od("Decoding invalid alphanumeric value: "+o)}return new Ao(t+6,r)},e.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var n=0;n<5&&n+tthis.information.getSize())return!1;for(var n=t;nthis.information.getSize())return!1;for(var n=0;n<4&&n+t=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fle=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.pairs=new Array(t.MAX_PAIRS),n.rows=new Array,n.startEnd=[2],n}return cle(t,e),t.prototype.decodeRow=function(n,r,o){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(n,r))}catch{}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(n,r))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(n,r){for(var o,i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(r,this.pairs,n))}catch(s){if(s instanceof Y){if(!this.pairs.length)throw new Y;i=!0}}if(this.checkChecksum())return this.pairs;if(o=!!this.rows.length,this.storeRow(n,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0))!=null)return a}throw new Y},t.prototype.checkRowsBoolean=function(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&(this.rows=this.rows.reverse());var r=null;try{r=this.checkRows(new Array,0)}catch(o){console.log(o)}return n&&(this.rows=this.rows.reverse()),r},t.prototype.checkRows=function(n,r){for(var o,i,a=r;as.length)){for(var l=!0,u=0;un){a=s.isEquivalent(this.pairs);break}i=s.isEquivalent(this.pairs),o++}a||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(o,new ule(this.pairs,n,r)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(n,r){var o,i,a,s,l,u;try{for(var c=ea(r),f=c.next();!f.done;f=c.next()){var d=f.value;if(d.getPairs().length!==n.length)try{for(var h=(a=void 0,ea(d.getPairs())),p=h.next();!p.done;p=h.next()){var m=p.value,_=!1;try{for(var b=(l=void 0,ea(n)),g=b.next();!g.done;g=b.next()){var E=g.value;if(D4.equals(m,E)){_=!0;break}}}catch(T){l={error:T}}finally{try{g&&!g.done&&(u=b.return)&&u.call(b)}finally{if(l)throw l.error}}}}catch(T){a={error:T}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}}}catch(T){o={error:T}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}},t.isPartialRow=function(n,r){var o,i,a,s,l,u;try{for(var c=ea(r),f=c.next();!f.done;f=c.next()){var d=f.value,h=!0;try{for(var p=(a=void 0,ea(n)),m=p.next();!m.done;m=p.next()){var _=m.value,b=!1;try{for(var g=(l=void 0,ea(d.getPairs())),E=g.next();!E.done;E=g.next()){var T=E.value;if(_.equals(T)){b=!0;break}}}catch(O){l={error:O}}finally{try{E&&!E.done&&(u=g.return)&&u.call(g)}finally{if(l)throw l.error}}if(!b){h=!1;break}}}catch(O){a={error:O}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}if(h)return!0}}catch(O){o={error:O}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(n){var r=function(s){try{if(s.get(1))return new qse(s);if(!s.get(2))return new Zse(s);switch(cp.extractNumericValueFromBitArray(s,1,4)){case 4:return new tle(s);case 5:return new rle(s)}switch(cp.extractNumericValueFromBitArray(s,1,5)){case 12:return new ile(s);case 13:return new sle(s)}switch(cp.extractNumericValueFromBitArray(s,1,7)){case 56:return new Ji(s,"310","11");case 57:return new Ji(s,"320","11");case 58:return new Ji(s,"310","13");case 59:return new Ji(s,"320","13");case 60:return new Ji(s,"310","15");case 61:return new Ji(s,"320","15");case 62:return new Ji(s,"310","17");case 63:return new Ji(s,"320","17")}}catch(l){throw console.log(l),new Od("unknown decoder: "+s)}}(Use.buildBitArray(n)).parseInformation(),o=n[0].getFinderPattern().getResultPoints(),i=n[n.length-1].getFinderPattern().getResultPoints(),a=[o[0],o[1],i[0],i[1]];return new Ir(r,null,null,a,Te.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var n=this.pairs.get(0),r=n.getLeftChar(),o=n.getRightChar();if(o==null)return!1;for(var i=o.getChecksumPortion(),a=2,s=1;s=0?a=o:this.isEmptyPair(r)?a=0:a=r[r.length-1].getFinderPattern().getStartEnd()[1];var l=r.length%2!=0;this.startFromEven&&(l=!l);for(var u=!1;a=0&&!n.get(l);)l--;l++,i=this.startEnd[0]-l,a=l,s=this.startEnd[1]}else a=this.startEnd[0],i=(s=n.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,c=this.getDecodeFinderCounters();It.arraycopy(c,0,c,1,c.length-1),c[0]=i;try{u=this.parseFinderValue(c,t.FINDER_PATTERNS)}catch{return null}return new xk(u,[a,s],a,s,r)},t.prototype.decodeDataCharacter=function(n,r,o,i){for(var a=this.getDataCharacterCounters(),s=0;s.3)throw new Y;var h=this.getOddCounts(),p=this.getEvenCounts(),m=this.getOddRoundingErrors(),_=this.getEvenRoundingErrors();for(l=0;l8){if(b>8.7)throw new Y;g=8}var E=l/2;1&l?(p[E]=g,_[E]=b-g):(h[E]=g,m[E]=b-g)}this.adjustOddEvenCounts(17);var T=4*r.getValue()+(o?0:2)+(i?0:1)-1,O=0,A=0;for(l=h.length-1;l>=0;l--){if(t.isNotA1left(r,o,i)){var C=t.WEIGHTS[T][2*l];A+=h[l]*C}O+=h[l]}var y=0;for(l=p.length-1;l>=0;l--)t.isNotA1left(r,o,i)&&(C=t.WEIGHTS[T][2*l+1],y+=p[l]*C);var S=A+y;if(1&O||O>13||O<4)throw new Y;var v=(13-O)/2,x=t.SYMBOL_WIDEST[v],I=9-x,R=Fl.getRSSvalue(h,x,!0),k=Fl.getRSSvalue(p,I,!1),M=t.EVEN_TOTAL_SUBSET[v],N=t.GSUM[v];return new x1(R*M+k+N,S)},t.isNotA1left=function(n,r,o){return!(n.getValue()==0&&r&&o)},t.prototype.adjustOddEvenCounts=function(n){var r=Ze.sum(new Int32Array(this.getOddCounts())),o=Ze.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;r>13?a=!0:r<4&&(i=!0);var s=!1,l=!1;o>13?l=!0:o<4&&(s=!0);var u=r+o-n,c=(1&r)==1,f=(1&o)==0;if(u==1)if(c){if(f)throw new Y;a=!0}else{if(!f)throw new Y;l=!0}else if(u==-1)if(c){if(f)throw new Y;i=!0}else{if(!f)throw new Y;s=!0}else{if(u!=0)throw new Y;if(c){if(!f)throw new Y;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},L4=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.possibleLeftPairs=[],n.possibleRightPairs=[],n}return ple(t,e),t.prototype.decodeRow=function(n,r,o){var i,a,s,l,u=this.decodePair(r,!1,n,o);t.addOrTally(this.possibleLeftPairs,u),r.reverse();var c=this.decodePair(r,!0,n,o);t.addOrTally(this.possibleRightPairs,c),r.reverse();try{for(var f=Eg(this.possibleLeftPairs),d=f.next();!d.done;d=f.next()){var h=d.value;if(h.getCount()>1)try{for(var p=(s=void 0,Eg(this.possibleRightPairs)),m=p.next();!m.done;m=p.next()){var _=m.value;if(_.getCount()>1&&t.checkChecksum(h,_))return t.constructResult(h,_)}}catch(b){s={error:b}}finally{try{m&&!m.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}}}catch(b){i={error:b}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}throw new Y},t.addOrTally=function(n,r){var o,i;if(r!=null){var a=!1;try{for(var s=Eg(n),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.getValue()===r.getValue()){u.incrementCount(),a=!0;break}}}catch(c){o={error:c}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}a||n.push(r)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(n,r){for(var o=4537077*n.getValue()+r.getValue(),i=new String(o).toString(),a=new mt,s=13-i.length;s>0;s--)a.append("0");a.append(i);var l=0;for(s=0;s<13;s++){var u=a.charAt(s).charCodeAt(0)-"0".charCodeAt(0);l+=1&s?u:3*u}(l=10-l%10)===10&&(l=0),a.append(l.toString());var c=n.getFinderPattern().getResultPoints(),f=r.getFinderPattern().getResultPoints();return new Ir(a.toString(),null,0,[c[0],c[1],f[0],f[1]],Te.RSS_14,new Date().getTime())},t.checkChecksum=function(n,r){var o=(n.getChecksumPortion()+16*r.getChecksumPortion())%79,i=9*n.getFinderPattern().getValue()+r.getFinderPattern().getValue();return i>72&&i--,i>8&&i--,o===i},t.prototype.decodePair=function(n,r,o,i){try{var a=this.findFinderPattern(n,r),s=this.parseFoundFinderPattern(n,o,r,a),l=i==null?null:i.get(Et.NEED_RESULT_POINT_CALLBACK);if(l!=null){var u=(a[0]+a[1])/2;r&&(u=n.getSize()-1-u),l.foundPossibleResultPoint(new we(u,o))}var c=this.decodeDataCharacter(n,s,!0),f=this.decodeDataCharacter(n,s,!1);return new hle(1597*c.getValue()+f.getValue(),c.getChecksumPortion()+4*f.getChecksumPortion(),s)}catch{return null}},t.prototype.decodeDataCharacter=function(n,r,o){for(var i=this.getDataCharacterCounters(),a=0;a8&&(b=8);var g=Math.floor(s/2);1&s?(h[g]=b,m[g]=_-b):(d[g]=b,p[g]=_-b)}this.adjustOddEvenCounts(o,c);var E=0,T=0;for(s=d.length-1;s>=0;s--)T*=9,T+=d[s],E+=d[s];var O=0,A=0;for(s=h.length-1;s>=0;s--)O*=9,O+=h[s],A+=h[s];var C=T+3*O;if(o){if(1&E||E>12||E<4)throw new Y;var y=(12-E)/2,S=9-(k=t.OUTSIDE_ODD_WIDEST[y]),v=Fl.getRSSvalue(d,k,!1),x=Fl.getRSSvalue(h,S,!0),I=t.OUTSIDE_EVEN_TOTAL_SUBSET[y],R=t.OUTSIDE_GSUM[y];return new x1(v*I+x+R,C)}if(1&A||A>10||A<4)throw new Y;y=(10-A)/2,S=9-(k=t.INSIDE_ODD_WIDEST[y]),v=Fl.getRSSvalue(d,k,!0),x=Fl.getRSSvalue(h,S,!1);var k,M=t.INSIDE_ODD_TOTAL_SUBSET[y];return R=t.INSIDE_GSUM[y],new x1(x*M+v+R,C)},t.prototype.findFinderPattern=function(n,r){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var i=n.getSize(),a=!1,s=0;s=0&&a!==n.get(s);)s--;s++;var l=i[0]-s,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);It.arraycopy(u,0,c,1,u.length-1),c[0]=l;var f=this.parseFinderValue(c,t.FINDER_PATTERNS),d=s,h=i[1];return o&&(d=n.getSize()-1-d,h=n.getSize()-1-h),new xk(f,[s,i[1]],d,h,r)},t.prototype.adjustOddEvenCounts=function(n,r){var o=Ze.sum(new Int32Array(this.getOddCounts())),i=Ze.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,l=!1,u=!1;n?(o>12?s=!0:o<4&&(a=!0),i>12?u=!0:i<4&&(l=!0)):(o>11?s=!0:o<5&&(a=!0),i>10?u=!0:i<4&&(l=!0));var c=o+i-r,f=(1&o)==(n?1:0),d=(1&i)==1;if(c===1)if(f){if(d)throw new Y;s=!0}else{if(!d)throw new Y;u=!0}else if(c===-1)if(f){if(d)throw new Y;a=!0}else{if(!d)throw new Y;l=!0}else{if(c!==0)throw new Y;if(f){if(!d)throw new Y;o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ot=function(){function e(t,n,r){this.ecCodewords=t,this.ecBlocks=[n],r&&this.ecBlocks.push(r)}return e.prototype.getECCodewords=function(){return this.ecCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),Je=function(){function e(t,n){this.count=t,this.dataCodewords=n}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),gle=function(){function e(t,n,r,o,i,a){var s,l;this.versionNumber=t,this.symbolSizeRows=n,this.symbolSizeColumns=r,this.dataRegionSizeRows=o,this.dataRegionSizeColumns=i,this.ecBlocks=a;var u=0,c=a.getECCodewords(),f=a.getECBlocks();try{for(var d=N4(f),h=d.next();!h.done;h=d.next()){var p=h.value;u+=p.getCount()*(p.getDataCodewords()+c)}}catch(m){s={error:m}}finally{try{h&&!h.done&&(l=d.return)&&l.call(d)}finally{if(s)throw s.error}}this.totalCodewords=u}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},e.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},e.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},e.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e.getVersionForDimensions=function(t,n){var r,o;if(1&t||1&n)throw new ae;try{for(var i=N4(e.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===n)return s}}catch(l){r={error:l}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}throw new ae},e.prototype.toString=function(){return""+this.versionNumber},e.buildVersions=function(){return[new e(1,10,10,8,8,new ot(5,new Je(1,3))),new e(2,12,12,10,10,new ot(7,new Je(1,5))),new e(3,14,14,12,12,new ot(10,new Je(1,8))),new e(4,16,16,14,14,new ot(12,new Je(1,12))),new e(5,18,18,16,16,new ot(14,new Je(1,18))),new e(6,20,20,18,18,new ot(18,new Je(1,22))),new e(7,22,22,20,20,new ot(20,new Je(1,30))),new e(8,24,24,22,22,new ot(24,new Je(1,36))),new e(9,26,26,24,24,new ot(28,new Je(1,44))),new e(10,32,32,14,14,new ot(36,new Je(1,62))),new e(11,36,36,16,16,new ot(42,new Je(1,86))),new e(12,40,40,18,18,new ot(48,new Je(1,114))),new e(13,44,44,20,20,new ot(56,new Je(1,144))),new e(14,48,48,22,22,new ot(68,new Je(1,174))),new e(15,52,52,24,24,new ot(42,new Je(2,102))),new e(16,64,64,14,14,new ot(56,new Je(2,140))),new e(17,72,72,16,16,new ot(36,new Je(4,92))),new e(18,80,80,18,18,new ot(48,new Je(4,114))),new e(19,88,88,20,20,new ot(56,new Je(4,144))),new e(20,96,96,22,22,new ot(68,new Je(4,174))),new e(21,104,104,24,24,new ot(56,new Je(6,136))),new e(22,120,120,18,18,new ot(68,new Je(6,175))),new e(23,132,132,20,20,new ot(62,new Je(8,163))),new e(24,144,144,22,22,new ot(62,new Je(8,156),new Je(2,155))),new e(25,8,18,6,16,new ot(7,new Je(1,5))),new e(26,8,32,6,14,new ot(11,new Je(1,10))),new e(27,12,26,10,24,new ot(14,new Je(1,16))),new e(28,12,36,10,16,new ot(18,new Je(1,22))),new e(29,16,36,14,16,new ot(24,new Je(1,32))),new e(30,16,48,14,22,new ot(28,new Je(1,49)))]},e.VERSIONS=e.buildVersions(),e}(),vle=function(){function e(t){var n=t.getHeight();if(n<8||n>144||1&n)throw new ae;this.version=e.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new Fi(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return e.prototype.getVersion=function(){return this.version},e.readVersion=function(t){var n=t.getHeight(),r=t.getWidth();return gle.getVersionForDimensions(n,r)},e.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),n=0,r=4,o=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,l=!1,u=!1,c=!1;do if(r!==i||o!==0||s)if(r!==i-2||o!==0||!(3&a)||l)if(r!==i+4||o!==2||7&a||u)if(r!==i-2||o!==0||(7&a)!=4||c){do r=0&&!this.readMappingMatrix.get(o,r)&&(t[n++]=255&this.readUtah(r,o,i,a)),r-=2,o+=2;while(r>=0&&o=0&&o=0);r+=3,o+=1}else t[n++]=255&this.readCorner4(i,a),r-=2,o+=2,c=!0;else t[n++]=255&this.readCorner3(i,a),r-=2,o+=2,u=!0;else t[n++]=255&this.readCorner2(i,a),r-=2,o+=2,l=!0;else t[n++]=255&this.readCorner1(i,a),r-=2,o+=2,s=!0;while(r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wle=function(){function e(t,n){this.numDataCodewords=t,this.codewords=n}return e.getDataBlocks=function(t,n){var r,o,i,a,s=n.getECBlocks(),l=0,u=s.getECBlocks();try{for(var c=B4(u),f=c.next();!f.done;f=c.next())l+=(_=f.value).getCount()}catch(R){r={error:R}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}var d=new Array(l),h=0;try{for(var p=B4(u),m=p.next();!m.done;m=p.next())for(var _=m.value,b=0;b<_.getCount();b++){var g=_.getDataCodewords(),E=s.getECCodewords()+g;d[h++]=new e(g,new Uint8Array(E))}}catch(R){i={error:R}}finally{try{m&&!m.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}var T=d[0].codewords.length-s.getECCodewords(),O=T-1,A=0;for(b=0;b7?b-1:b;d[x].codewords[I]=t[A++]}if(A!==t.length)throw new Me;return d},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),Pk=function(){function e(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return e.prototype.getBitOffset=function(){return this.bitOffset},e.prototype.getByteOffset=function(){return this.byteOffset},e.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Me(""+t);var n=0,r=this.bitOffset,o=this.byteOffset,i=this.bytes;if(r>0){var a=8-r,s=t>8-s<<(u=a-s);n=(i[o]&l)>>u,t-=s,(r+=s)===8&&(r=0,o++)}if(t>0){for(;t>=8;)n=n<<8|255&i[o],o++,t-=8;if(t>0){var u;l=255>>(u=8-t)<>u,r+=t}}return this.bitOffset=r,this.byteOffset=o,n},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();(function(e){e[e.PAD_ENCODE=0]="PAD_ENCODE",e[e.ASCII_ENCODE=1]="ASCII_ENCODE",e[e.C40_ENCODE=2]="C40_ENCODE",e[e.TEXT_ENCODE=3]="TEXT_ENCODE",e[e.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",e[e.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",e[e.BASE256_ENCODE=6]="BASE256_ENCODE"})(un||(un={}));var zl,ble=function(){function e(){}return e.decode=function(t){var n=new Pk(t),r=new mt,o=new mt,i=new Array,a=un.ASCII_ENCODE;do if(a===un.ASCII_ENCODE)a=this.decodeAsciiSegment(n,r,o);else{switch(a){case un.C40_ENCODE:this.decodeC40Segment(n,r);break;case un.TEXT_ENCODE:this.decodeTextSegment(n,r);break;case un.ANSIX12_ENCODE:this.decodeAnsiX12Segment(n,r);break;case un.EDIFACT_ENCODE:this.decodeEdifactSegment(n,r);break;case un.BASE256_ENCODE:this.decodeBase256Segment(n,r,i);break;default:throw new ae}a=un.ASCII_ENCODE}while(a!==un.PAD_ENCODE&&n.available()>0);return o.length()>0&&r.append(o.toString()),new Cm(t,r.toString(),i.length===0?null:i,null)},e.decodeAsciiSegment=function(t,n,r){var o=!1;do{var i=t.readBits(8);if(i===0)throw new ae;if(i<=128)return o&&(i+=128),n.append(String.fromCharCode(i-1)),un.ASCII_ENCODE;if(i===129)return un.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&n.append("0"),n.append(""+a)}else switch(i){case 230:return un.C40_ENCODE;case 231:return un.BASE256_ENCODE;case 232:n.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:o=!0;break;case 236:n.append("[)>05"),r.insert(0,"");break;case 237:n.append("[)>06"),r.insert(0,"");break;case 238:return un.ANSIX12_ENCODE;case 239:return un.TEXT_ENCODE;case 240:return un.EDIFACT_ENCODE;default:if(i!==254||t.available()!==0)throw new ae}}while(t.available()>0);return un.ASCII_ENCODE},e.decodeC40Segment=function(t,n){var r=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var l=o[s];switch(i){case 0:if(l<3)i=l+1;else{if(!(l0)},e.decodeTextSegment=function(t,n){var r=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var l=o[s];switch(i){case 0:if(l<3)i=l+1;else{if(!(l0)},e.decodeAnsiX12Segment=function(t,n){var r=[];do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),r);for(var i=0;i<3;i++){var a=r[i];switch(a){case 0:n.append("\r");break;case 1:n.append("*");break;case 2:n.append(">");break;case 3:n.append(" ");break;default:if(a<14)n.append(String.fromCharCode(a+44));else{if(!(a<40))throw new ae;n.append(String.fromCharCode(a+51))}}}}while(t.available()>0)},e.parseTwoBytes=function(t,n,r){var o=(t<<8)+n-1,i=Math.floor(o/1600);r[0]=i,o-=1600*i,i=Math.floor(o/40),r[1]=i,r[2]=o-40*i},e.decodeEdifactSegment=function(t,n){do{if(t.available()<=16)return;for(var r=0;r<4;r++){var o=t.readBits(6);if(o===31){var i=8-t.getBitOffset();return void(i!==8&&t.readBits(i))}!(32&o)&&(o|=64),n.append(String.fromCharCode(o))}}while(t.available()>0)},e.decodeBase256Segment=function(t,n,r){var o,i=1+t.getByteOffset(),a=this.unrandomize255State(t.readBits(8),i++);if((o=a===0?t.available()/8|0:a<250?a:250*(a-249)+this.unrandomize255State(t.readBits(8),i++))<0)throw new ae;for(var s=new Uint8Array(o),l=0;l=0?r:r+256},e.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],e.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],e.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],e.TEXT_SHIFT2_SET_CHARS=e.C40_SHIFT2_SET_CHARS,e.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],e}(),Sle=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_le=function(){function e(){this.rsDecoder=new xm(ha.DATA_MATRIX_FIELD_256)}return e.prototype.decode=function(t){var n,r,o=new vle(t),i=o.getVersion(),a=o.readCodewords(),s=wle.getDataBlocks(a,i),l=0;try{for(var u=Sle(s),c=u.next();!c.done;c=u.next())l+=c.value.getNumDataCodewords()}catch(g){n={error:g}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}for(var f=new Uint8Array(l),d=s.length,h=0;hs&&(c=s,f[0]=n,f[1]=r,f[2]=o,f[3]=i),c>l&&(c=l,f[0]=r,f[1]=o,f[2]=i,f[3]=n),c>u&&(f[0]=o,f[1]=i,f[2]=n,f[3]=r),f},e.prototype.detectSolid2=function(t){var n=t[0],r=t[1],o=t[2],i=t[3],a=this.transitionsBetween(n,i),s=e.shiftPoint(r,o,4*(a+1)),l=e.shiftPoint(o,r,4*(a+1));return this.transitionsBetween(s,n)this.transitionsBetween(l,f)+this.transitionsBetween(u,f)?c:f:c:this.isValid(f)?f:null},e.prototype.shiftToModuleCenter=function(t){var n=t[0],r=t[1],o=t[2],i=t[3],a=this.transitionsBetween(n,i)+1,s=this.transitionsBetween(o,i)+1,l=e.shiftPoint(n,r,4*s),u=e.shiftPoint(o,r,4*a);(1&(a=this.transitionsBetween(l,i)+1))==1&&(a+=1),(1&(s=this.transitionsBetween(u,i)+1))==1&&(s+=1);var c,f,d=(n.getX()+r.getX()+o.getX()+i.getX())/4,h=(n.getY()+r.getY()+o.getY()+i.getY())/4;return n=e.moveAway(n,d,h),r=e.moveAway(r,d,h),o=e.moveAway(o,d,h),i=e.moveAway(i,d,h),l=e.shiftPoint(n,r,4*s),l=e.shiftPoint(l,i,4*a),c=e.shiftPoint(r,n,4*s),c=e.shiftPoint(c,o,4*a),u=e.shiftPoint(o,i,4*s),u=e.shiftPoint(u,r,4*a),f=e.shiftPoint(i,o,4*s),[l,c,u,f=e.shiftPoint(f,n,4*a)]},e.prototype.isValid=function(t){return t.getX()>=0&&t.getX()0&&t.getY()Math.abs(i-r);if(s){var l=r;r=o,o=l,l=i,i=a,a=l}for(var u=Math.abs(i-r),c=Math.abs(a-o),f=-u/2,d=o0){if(b===a)break;b+=d,f-=u}}return p},e}(),O1=function(){function e(){this.decoder=new _le}return e.prototype.decode=function(t,n){var r,o;if(n===void 0&&(n=null),n!=null&&n.has(Et.PURE_BARCODE)){var i=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decode(i),o=e.NO_POINTS}else{var a=new Ele(t.getBlackMatrix()).detect();r=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=r.getRawBytes(),l=new Ir(r.getText(),s,8*s.length,o,Te.DATA_MATRIX,It.currentTimeMillis()),u=r.getByteSegments();u!=null&&l.putMetadata(Ln.BYTE_SEGMENTS,u);var c=r.getECLevel();return c!=null&&l.putMetadata(Ln.ERROR_CORRECTION_LEVEL,c),l},e.prototype.reset=function(){},e.extractPureBits=function(t){var n=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(n==null||r==null)throw new Y;var o=this.moduleSize(n,t),i=n[1],a=r[1],s=n[0],l=(r[0]-s+1)/o,u=(a-i+1)/o;if(l<=0||u<=0)throw new Y;var c=o/2;i+=c,s+=c;for(var f=new Fi(l,u),d=0;d=e.FOR_BITS.size)throw new Me;return e.FOR_BITS.get(t)},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.L=new e(zl.L,"L",1),e.M=new e(zl.M,"M",0),e.Q=new e(zl.Q,"Q",3),e.H=new e(zl.H,"H",2),e}(),Ole=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tk=function(){function e(t){this.errorCorrectionLevel=xle.forBits(t>>3&3),this.dataMask=7&t}return e.numBitsDiffering=function(t,n){return Dn.bitCount(t^n)},e.decodeFormatInformation=function(t,n){var r=e.doDecodeFormatInformation(t,n);return r!==null?r:e.doDecodeFormatInformation(t^e.FORMAT_INFO_MASK_QR,n^e.FORMAT_INFO_MASK_QR)},e.doDecodeFormatInformation=function(t,n){var r,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=Ole(e.FORMAT_INFO_DECODE_LOOKUP),l=s.next();!l.done;l=s.next()){var u=l.value,c=u[0];if(c===t||c===n)return new e(u[1]);var f=e.numBitsDiffering(t,c);f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},G=function(){function e(t){for(var n=[],r=1;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},dp=function(){function e(t,n){for(var r,o,i=[],a=2;a40)throw new Me;return e.VERSIONS[t-1]},e.decodeVersionInformation=function(t){for(var n=Number.MAX_SAFE_INTEGER,r=0,o=0;o6&&(n.setRegion(t-11,0,3,6),n.setRegion(0,t-11,6,3)),n},e.prototype.toString=function(){return""+this.versionNumber},e.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),e.VERSIONS=[new e(1,new Int32Array(0),new G(7,new $(1,19)),new G(10,new $(1,16)),new G(13,new $(1,13)),new G(17,new $(1,9))),new e(2,Int32Array.from([6,18]),new G(10,new $(1,34)),new G(16,new $(1,28)),new G(22,new $(1,22)),new G(28,new $(1,16))),new e(3,Int32Array.from([6,22]),new G(15,new $(1,55)),new G(26,new $(1,44)),new G(18,new $(2,17)),new G(22,new $(2,13))),new e(4,Int32Array.from([6,26]),new G(20,new $(1,80)),new G(18,new $(2,32)),new G(26,new $(2,24)),new G(16,new $(4,9))),new e(5,Int32Array.from([6,30]),new G(26,new $(1,108)),new G(24,new $(2,43)),new G(18,new $(2,15),new $(2,16)),new G(22,new $(2,11),new $(2,12))),new e(6,Int32Array.from([6,34]),new G(18,new $(2,68)),new G(16,new $(4,27)),new G(24,new $(4,19)),new G(28,new $(4,15))),new e(7,Int32Array.from([6,22,38]),new G(20,new $(2,78)),new G(18,new $(4,31)),new G(18,new $(2,14),new $(4,15)),new G(26,new $(4,13),new $(1,14))),new e(8,Int32Array.from([6,24,42]),new G(24,new $(2,97)),new G(22,new $(2,38),new $(2,39)),new G(22,new $(4,18),new $(2,19)),new G(26,new $(4,14),new $(2,15))),new e(9,Int32Array.from([6,26,46]),new G(30,new $(2,116)),new G(22,new $(3,36),new $(2,37)),new G(20,new $(4,16),new $(4,17)),new G(24,new $(4,12),new $(4,13))),new e(10,Int32Array.from([6,28,50]),new G(18,new $(2,68),new $(2,69)),new G(26,new $(4,43),new $(1,44)),new G(24,new $(6,19),new $(2,20)),new G(28,new $(6,15),new $(2,16))),new e(11,Int32Array.from([6,30,54]),new G(20,new $(4,81)),new G(30,new $(1,50),new $(4,51)),new G(28,new $(4,22),new $(4,23)),new G(24,new $(3,12),new $(8,13))),new e(12,Int32Array.from([6,32,58]),new G(24,new $(2,92),new $(2,93)),new G(22,new $(6,36),new $(2,37)),new G(26,new $(4,20),new $(6,21)),new G(28,new $(7,14),new $(4,15))),new e(13,Int32Array.from([6,34,62]),new G(26,new $(4,107)),new G(22,new $(8,37),new $(1,38)),new G(24,new $(8,20),new $(4,21)),new G(22,new $(12,11),new $(4,12))),new e(14,Int32Array.from([6,26,46,66]),new G(30,new $(3,115),new $(1,116)),new G(24,new $(4,40),new $(5,41)),new G(20,new $(11,16),new $(5,17)),new G(24,new $(11,12),new $(5,13))),new e(15,Int32Array.from([6,26,48,70]),new G(22,new $(5,87),new $(1,88)),new G(24,new $(5,41),new $(5,42)),new G(30,new $(5,24),new $(7,25)),new G(24,new $(11,12),new $(7,13))),new e(16,Int32Array.from([6,26,50,74]),new G(24,new $(5,98),new $(1,99)),new G(28,new $(7,45),new $(3,46)),new G(24,new $(15,19),new $(2,20)),new G(30,new $(3,15),new $(13,16))),new e(17,Int32Array.from([6,30,54,78]),new G(28,new $(1,107),new $(5,108)),new G(28,new $(10,46),new $(1,47)),new G(28,new $(1,22),new $(15,23)),new G(28,new $(2,14),new $(17,15))),new e(18,Int32Array.from([6,30,56,82]),new G(30,new $(5,120),new $(1,121)),new G(26,new $(9,43),new $(4,44)),new G(28,new $(17,22),new $(1,23)),new G(28,new $(2,14),new $(19,15))),new e(19,Int32Array.from([6,30,58,86]),new G(28,new $(3,113),new $(4,114)),new G(26,new $(3,44),new $(11,45)),new G(26,new $(17,21),new $(4,22)),new G(26,new $(9,13),new $(16,14))),new e(20,Int32Array.from([6,34,62,90]),new G(28,new $(3,107),new $(5,108)),new G(26,new $(3,41),new $(13,42)),new G(30,new $(15,24),new $(5,25)),new G(28,new $(15,15),new $(10,16))),new e(21,Int32Array.from([6,28,50,72,94]),new G(28,new $(4,116),new $(4,117)),new G(26,new $(17,42)),new G(28,new $(17,22),new $(6,23)),new G(30,new $(19,16),new $(6,17))),new e(22,Int32Array.from([6,26,50,74,98]),new G(28,new $(2,111),new $(7,112)),new G(28,new $(17,46)),new G(30,new $(7,24),new $(16,25)),new G(24,new $(34,13))),new e(23,Int32Array.from([6,30,54,78,102]),new G(30,new $(4,121),new $(5,122)),new G(28,new $(4,47),new $(14,48)),new G(30,new $(11,24),new $(14,25)),new G(30,new $(16,15),new $(14,16))),new e(24,Int32Array.from([6,28,54,80,106]),new G(30,new $(6,117),new $(4,118)),new G(28,new $(6,45),new $(14,46)),new G(30,new $(11,24),new $(16,25)),new G(30,new $(30,16),new $(2,17))),new e(25,Int32Array.from([6,32,58,84,110]),new G(26,new $(8,106),new $(4,107)),new G(28,new $(8,47),new $(13,48)),new G(30,new $(7,24),new $(22,25)),new G(30,new $(22,15),new $(13,16))),new e(26,Int32Array.from([6,30,58,86,114]),new G(28,new $(10,114),new $(2,115)),new G(28,new $(19,46),new $(4,47)),new G(28,new $(28,22),new $(6,23)),new G(30,new $(33,16),new $(4,17))),new e(27,Int32Array.from([6,34,62,90,118]),new G(30,new $(8,122),new $(4,123)),new G(28,new $(22,45),new $(3,46)),new G(30,new $(8,23),new $(26,24)),new G(30,new $(12,15),new $(28,16))),new e(28,Int32Array.from([6,26,50,74,98,122]),new G(30,new $(3,117),new $(10,118)),new G(28,new $(3,45),new $(23,46)),new G(30,new $(4,24),new $(31,25)),new G(30,new $(11,15),new $(31,16))),new e(29,Int32Array.from([6,30,54,78,102,126]),new G(30,new $(7,116),new $(7,117)),new G(28,new $(21,45),new $(7,46)),new G(30,new $(1,23),new $(37,24)),new G(30,new $(19,15),new $(26,16))),new e(30,Int32Array.from([6,26,52,78,104,130]),new G(30,new $(5,115),new $(10,116)),new G(28,new $(19,47),new $(10,48)),new G(30,new $(15,24),new $(25,25)),new G(30,new $(23,15),new $(25,16))),new e(31,Int32Array.from([6,30,56,82,108,134]),new G(30,new $(13,115),new $(3,116)),new G(28,new $(2,46),new $(29,47)),new G(30,new $(42,24),new $(1,25)),new G(30,new $(23,15),new $(28,16))),new e(32,Int32Array.from([6,34,60,86,112,138]),new G(30,new $(17,115)),new G(28,new $(10,46),new $(23,47)),new G(30,new $(10,24),new $(35,25)),new G(30,new $(19,15),new $(35,16))),new e(33,Int32Array.from([6,30,58,86,114,142]),new G(30,new $(17,115),new $(1,116)),new G(28,new $(14,46),new $(21,47)),new G(30,new $(29,24),new $(19,25)),new G(30,new $(11,15),new $(46,16))),new e(34,Int32Array.from([6,34,62,90,118,146]),new G(30,new $(13,115),new $(6,116)),new G(28,new $(14,46),new $(23,47)),new G(30,new $(44,24),new $(7,25)),new G(30,new $(59,16),new $(1,17))),new e(35,Int32Array.from([6,30,54,78,102,126,150]),new G(30,new $(12,121),new $(7,122)),new G(28,new $(12,47),new $(26,48)),new G(30,new $(39,24),new $(14,25)),new G(30,new $(22,15),new $(41,16))),new e(36,Int32Array.from([6,24,50,76,102,128,154]),new G(30,new $(6,121),new $(14,122)),new G(28,new $(6,47),new $(34,48)),new G(30,new $(46,24),new $(10,25)),new G(30,new $(2,15),new $(64,16))),new e(37,Int32Array.from([6,28,54,80,106,132,158]),new G(30,new $(17,122),new $(4,123)),new G(28,new $(29,46),new $(14,47)),new G(30,new $(49,24),new $(10,25)),new G(30,new $(24,15),new $(46,16))),new e(38,Int32Array.from([6,32,58,84,110,136,162]),new G(30,new $(4,122),new $(18,123)),new G(28,new $(13,46),new $(32,47)),new G(30,new $(48,24),new $(14,25)),new G(30,new $(42,15),new $(32,16))),new e(39,Int32Array.from([6,26,54,82,110,138,166]),new G(30,new $(20,117),new $(4,118)),new G(28,new $(40,47),new $(7,48)),new G(30,new $(43,24),new $(22,25)),new G(30,new $(10,15),new $(67,16))),new e(40,Int32Array.from([6,30,58,86,114,142,170]),new G(30,new $(19,118),new $(6,119)),new G(28,new $(18,47),new $(31,48)),new G(30,new $(34,24),new $(34,25)),new G(30,new $(20,15),new $(61,16)))],e}();(function(e){e[e.DATA_MASK_000=0]="DATA_MASK_000",e[e.DATA_MASK_001=1]="DATA_MASK_001",e[e.DATA_MASK_010=2]="DATA_MASK_010",e[e.DATA_MASK_011=3]="DATA_MASK_011",e[e.DATA_MASK_100=4]="DATA_MASK_100",e[e.DATA_MASK_101=5]="DATA_MASK_101",e[e.DATA_MASK_110=6]="DATA_MASK_110",e[e.DATA_MASK_111=7]="DATA_MASK_111"})(yn||(yn={}));var so,j4=function(){function e(t,n){this.value=t,this.isMasked=n}return e.prototype.unmaskBitMatrix=function(t,n){for(var r=0;r=0;r--)t=this.copyBit(8,r,t);var o=this.bitMatrix.getHeight(),i=0,a=o-7;for(r=o-1;r>=a;r--)i=this.copyBit(8,r,i);for(n=o-8;n=0;i--)for(var a=t-9;a>=o;a--)r=this.copyBit(a,i,r);var s=dp.decodeVersionInformation(r);if(s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;for(r=0,a=5;a>=0;a--)for(i=t-9;i>=o;i--)r=this.copyBit(a,i,r);if((s=dp.decodeVersionInformation(r))!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;throw new ae},e.prototype.copyBit=function(t,n,r){return(this.isMirror?this.bitMatrix.get(n,t):this.bitMatrix.get(t,n))?r<<1|1:r<<1},e.prototype.readCodewords=function(){var t=this.readFormatInformation(),n=this.readVersion(),r=j4.values.get(t.getDataMask()),o=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,o);for(var i=n.buildFunctionPattern(),a=!0,s=new Uint8Array(n.getTotalCodewords()),l=0,u=0,c=0,f=o-1;f>0;f-=2){f===6&&f--;for(var d=0;d=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ile=function(){function e(t,n){this.numDataCodewords=t,this.codewords=n}return e.getDataBlocks=function(t,n,r){var o,i,a,s;if(t.length!==n.getTotalCodewords())throw new Me;var l=n.getECBlocksForLevel(r),u=0,c=l.getECBlocks();try{for(var f=F4(c),d=f.next();!d.done;d=f.next())u+=(b=d.value).getCount()}catch(I){o={error:I}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var h=new Array(u),p=0;try{for(var m=F4(c),_=m.next();!_.done;_=m.next())for(var b=_.value,g=0;g=0&&h[A].codewords.length!==O;)A--;A++;var C=O-l.getECCodewordsPerBlock(),y=0;for(g=0;gt.available())throw new ae;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=t.readBits(13),s=a/96<<8&4294967295|a%96;s+=s<959?41377:42657,o[i]=s>>8&255,o[i+1]=255&s,i+=2,r--}try{n.append(Ts.decode(o,gn.GB2312))}catch(l){throw new ae(l)}},e.decodeKanjiSegment=function(t,n,r){if(13*r>t.available())throw new ae;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=t.readBits(13),s=a/192<<8&4294967295|a%192;s+=s<7936?33088:49472,o[i]=s>>8,o[i+1]=s,i+=2,r--}try{n.append(Ts.decode(o,gn.SHIFT_JIS))}catch(l){throw new ae(l)}},e.decodeByteSegment=function(t,n,r,o,i,a){if(8*r>t.available())throw new ae;for(var s,l=new Uint8Array(r),u=0;u=e.ALPHANUMERIC_CHARS.length)throw new ae;return e.ALPHANUMERIC_CHARS[t]},e.decodeAlphanumericSegment=function(t,n,r,o){for(var i=n.length();r>1;){if(t.available()<11)throw new ae;var a=t.readBits(11);n.append(e.toAlphaNumericChar(Math.floor(a/45))),n.append(e.toAlphaNumericChar(a%45)),r-=2}if(r===1){if(t.available()<6)throw new ae;n.append(e.toAlphaNumericChar(t.readBits(6)))}if(o)for(var s=i;s=3;){if(t.available()<10)throw new ae;var o=t.readBits(10);if(o>=1e3)throw new ae;n.append(e.toAlphaNumericChar(Math.floor(o/100))),n.append(e.toAlphaNumericChar(Math.floor(o/10)%10)),n.append(e.toAlphaNumericChar(o%10)),r-=3}if(r===2){if(t.available()<7)throw new ae;var i=t.readBits(7);if(i>=100)throw new ae;n.append(e.toAlphaNumericChar(Math.floor(i/10))),n.append(e.toAlphaNumericChar(i%10))}else if(r===1){if(t.available()<4)throw new ae;var a=t.readBits(4);if(a>=10)throw new ae;n.append(e.toAlphaNumericChar(a))}},e.parseECIValue=function(t){var n=t.readBits(8);if(!(128&n))return 127&n;if((192&n)==128)return(63&n)<<8&4294967295|t.readBits(8);if((224&n)==192)return(31&n)<<16&4294967295|t.readBits(16);throw new ae},e.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.GB2312_SUBSET=1,e}(),Ik=function(){function e(t){this.mirrored=t}return e.prototype.isMirrored=function(){return this.mirrored},e.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&t!==null&&!(t.length<3)){var n=t[0];t[0]=t[2],t[2]=n}},e}(),$4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},kle=function(){function e(){this.rsDecoder=new xm(ha.QR_CODE_FIELD_256)}return e.prototype.decodeBooleanArray=function(t,n){return this.decodeBitMatrix(Fi.parseFromBooleanArray(t),n)},e.prototype.decodeBitMatrix=function(t,n){var r=new Tle(t),o=null;try{return this.decodeBitMatrixParser(r,n)}catch(a){o=a}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var i=this.decodeBitMatrixParser(r,n);return i.setOther(new Ik(!0)),i}catch(a){throw o!==null?o:a}},e.prototype.decodeBitMatrixParser=function(t,n){var r,o,i,a,s=t.readVersion(),l=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),c=Ile.getDataBlocks(u,s,l),f=0;try{for(var d=$4(c),h=d.next();!h.done;h=d.next())f+=(g=h.value).getNumDataCodewords()}catch(A){r={error:A}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}var p=new Uint8Array(f),m=0;try{for(var _=$4(c),b=_.next();!b.done;b=_.next()){var g,E=(g=b.value).getCodewords(),T=g.getNumDataCodewords();this.correctErrors(E,T);for(var O=0;O=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Nle=function(){function e(t,n,r,o,i,a,s){this.image=t,this.startX=n,this.startY=r,this.width=o,this.height=i,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return e.prototype.find=function(){for(var t=this.startX,n=this.height,r=t+this.width,o=this.startY+n/2,i=new Int32Array(3),a=this.image,s=0;s=r)return!1;return!0},e.prototype.crossCheckVertical=function(t,n,r,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var l=t;l>=0&&i.get(n,l)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&!i.get(n,l)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=t+1;lr)return NaN;for(;lr)return NaN;var u=s[0]+s[1]+s[2];return 5*Math.abs(u-o)>=2*o?NaN:this.foundPatternCross(s)?e.centerFromEnd(s,l):NaN},e.prototype.handlePossibleCenter=function(t,n,r){var o,i,a=t[0]+t[1]+t[2],s=e.centerFromEnd(t,r),l=this.crossCheckVertical(n,s,2*t[1],a);if(!isNaN(l)){var u=(t[0]+t[1]+t[2])/3;try{for(var c=Lle(this.possibleCenters),f=c.next();!f.done;f=c.next()){var d=f.value;if(d.aboutEquals(u,l,s))return d.combineEstimate(l,s,u)}}catch(p){o={error:p}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}var h=new Dle(s,l,u);this.possibleCenters.push(h),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(h)}return null},e}(),Ble=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jle=function(e){function t(n,r,o,i){var a=e.call(this,n,r)||this;return a.estimatedModuleSize=o,a.count=i,i===void 0&&(a.count=1),a}return Ble(t,e),t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(n,r,o){if(Math.abs(r-this.getY())<=n&&Math.abs(o-this.getX())<=n){var i=Math.abs(n-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(n,r,o){var i=this.count+1;return new t((this.count*this.getX()+r)/i,(this.count*this.getY()+n)/i,(this.count*this.estimatedModuleSize+o)/i,i)},t}(we),Fle=function(){function e(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e}(),uc=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$le=function(){function e(t,n){this.image=t,this.resultPointCallback=n,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=n}return e.prototype.getImage=function(){return this.image},e.prototype.getPossibleCenters=function(){return this.possibleCenters},e.prototype.find=function(t){var n=t!=null&&t.get(Et.TRY_HARDER)!==void 0,r=t!=null&&t.get(Et.PURE_BARCODE)!==void 0,o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*e.MAX_MODULES));(su[2]&&(c+=h-u[2]-s,d=a-1)}f=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,f=3;else u[++f]++;e.foundPatternCross(u)&&this.handlePossibleCenter(u,c,a,r)===!0&&(s=u[0],this.hasSkipped&&(l=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return we.orderBestPatterns(p),new Fle(p)},e.centerFromEnd=function(t,n){return n-t[4]-t[3]-t[2]/2},e.foundPatternCross=function(t){for(var n=0,r=0;r<5;r++){var o=t[r];if(o===0)return!1;n+=o}if(n<7)return!1;var i=n/7,a=i/2;return Math.abs(i-t[0])=a&&n>=a&&s.get(n-a,t-a);)i[2]++,a++;if(t=a&&n>=a&&!s.get(n-a,t-a)&&i[1]<=r;)i[1]++,a++;if(tr)return!1;for(;t>=a&&n>=a&&s.get(n-a,t-a)&&i[0]<=r;)i[0]++,a++;if(i[0]>r)return!1;var l=s.getHeight(),u=s.getWidth();for(a=1;t+a=l||n+a>=u)return!1;for(;t+a=l||n+a>=u||i[3]>=r)return!1;for(;t+a=r)return!1;var c=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(c-o)<2*o&&e.foundPatternCross(i)},e.prototype.crossCheckVertical=function(t,n,r,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),l=t;l>=0&&i.get(n,l);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!i.get(n,l)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&i.get(n,l)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=t+1;l=r)return NaN;for(;l=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=2*o?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,l):NaN},e.prototype.crossCheckHorizontal=function(t,n,r,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),l=t;l>=0&&i.get(l,n);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!i.get(l,n)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&i.get(l,n)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=t+1;l=r)return NaN;for(;l=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=o?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,l):NaN},e.prototype.handlePossibleCenter=function(t,n,r,o){var i=t[0]+t[1]+t[2]+t[3]+t[4],a=e.centerFromEnd(t,r),s=this.crossCheckVertical(n,Math.floor(a),t[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),t[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),t[2],i)))){for(var l=i/7,u=!1,c=this.possibleCenters,f=0,d=c.length;f=e.CENTER_QUORUM){if(r!=null)return this.hasSkipped=!0,Math.floor((Math.abs(r.getX()-a.getX())-Math.abs(r.getY()-a.getY()))/2);r=a}}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return 0},e.prototype.haveMultiplyConfirmedCenters=function(){var t,n,r,o,i=0,a=0,s=this.possibleCenters.length;try{for(var l=uc(this.possibleCenters),u=l.next();!u.done;u=l.next())(p=u.value).getCount()>=e.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}catch(m){t={error:m}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}if(i<3)return!1;var c=a/s,f=0;try{for(var d=uc(this.possibleCenters),h=d.next();!h.done;h=d.next()){var p=h.value;f+=Math.abs(p.getEstimatedModuleSize()-c)}}catch(m){r={error:m}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}return f<=.05*a},e.prototype.selectBestPatterns=function(){var t,n,r,o,i=this.possibleCenters.length;if(i<3)throw new Y;var a,s=this.possibleCenters;if(i>3){var l=0,u=0;try{for(var c=uc(this.possibleCenters),f=c.next();!f.done;f=c.next()){var d=f.value.getEstimatedModuleSize();l+=d,u+=d*d}}catch(E){t={error:E}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}a=l/i;var h=Math.sqrt(u/i-a*a);s.sort(function(E,T){var O=Math.abs(T.getEstimatedModuleSize()-a),A=Math.abs(E.getEstimatedModuleSize()-a);return OA?1:0});for(var p=Math.max(.2*a,h),m=0;m3;m++){var _=s[m];Math.abs(_.getEstimatedModuleSize()-a)>p&&(s.splice(m,1),m--)}}if(s.length>3){l=0;try{for(var b=uc(s),g=b.next();!g.done;g=b.next())l+=g.value.getEstimatedModuleSize()}catch(E){r={error:E}}finally{try{g&&!g.done&&(o=b.return)&&o.call(b)}finally{if(r)throw r.error}}a=l/s.length,s.sort(function(E,T){if(T.getCount()===E.getCount()){var O=Math.abs(T.getEstimatedModuleSize()-a),A=Math.abs(E.getEstimatedModuleSize()-a);return OA?-1:0}return T.getCount()-E.getCount()}),s.splice(3)}return[s[0],s[1],s[2]]},e.CENTER_QUORUM=2,e.MIN_SKIP=3,e.MAX_MODULES=57,e}(),zle=function(){function e(t){this.image=t}return e.prototype.getImage=function(){return this.image},e.prototype.getResultPointCallback=function(){return this.resultPointCallback},e.prototype.detect=function(t){this.resultPointCallback=t==null?null:t.get(Et.NEED_RESULT_POINT_CALLBACK);var n=new $le(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(n)},e.prototype.processFinderPatternInfo=function(t){var n=t.getTopLeft(),r=t.getTopRight(),o=t.getBottomLeft(),i=this.calculateModuleSize(n,r,o);if(i<1)throw new Y("No pattern found in proccess finder.");var a=e.computeDimension(n,r,o,i),s=dp.getProvisionalVersionForDimension(a),l=s.getDimensionForVersion()-7,u=null;if(s.getAlignmentPatternCenters().length>0)for(var c=r.getX()-n.getX()+o.getX(),f=r.getY()-n.getY()+o.getY(),d=1-3/l,h=Math.floor(n.getX()+d*(c-n.getX())),p=Math.floor(n.getY()+d*(f-n.getY())),m=4;m<=16;m<<=1)try{u=this.findAlignmentInRegion(i,h,p,m);break}catch(g){if(!(g instanceof Y))throw g}var _=e.createTransform(n,r,o,u,a),b=e.sampleGrid(this.image,_,a);return new m_(b,u===null?[o,n,r]:[o,n,r,u])},e.createTransform=function(t,n,r,o,i){var a,s,l,u,c=i-3.5;return o!==null?(a=o.getX(),s=o.getY(),u=l=c-3):(a=n.getX()-t.getX()+r.getX(),s=n.getY()-t.getY()+r.getY(),l=c,u=c),Ck.quadrilateralToQuadrilateral(3.5,3.5,c,3.5,l,u,3.5,c,t.getX(),t.getY(),n.getX(),n.getY(),a,s,r.getX(),r.getY())},e.sampleGrid=function(t,n,r){return y_.getInstance().sampleGridWithTransform(t,r,r,n)},e.computeDimension=function(t,n,r,o){var i=Ze.round(we.distance(t,n)/o),a=Ze.round(we.distance(t,r)/o),s=Math.floor((i+a)/2)+7;switch(3&s){case 0:s++;break;case 2:s--;break;case 3:throw new Y("Dimensions could be not found.")}return s},e.prototype.calculateModuleSize=function(t,n,r){return(this.calculateModuleSizeOneWay(t,n)+this.calculateModuleSizeOneWay(t,r))/2},e.prototype.calculateModuleSizeOneWay=function(t,n){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(n.getX()),Math.floor(n.getY())),o=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?o/7:isNaN(o)?r/7:(r+o)/14},e.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,n,r,o){var i=this.sizeOfBlackWhiteBlackRun(t,n,r,o),a=1,s=t-(r-t);s<0?(a=t/(t-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-t)/(s-t),s=this.image.getWidth()-1);var l=Math.floor(n-(o-n)*a);return a=1,l<0?(a=n/(n-l),l=0):l>=this.image.getHeight()&&(a=(this.image.getHeight()-1-n)/(l-n),l=this.image.getHeight()-1),s=Math.floor(t+(s-t)*a),(i+=this.sizeOfBlackWhiteBlackRun(t,n,s,l))-1},e.prototype.sizeOfBlackWhiteBlackRun=function(t,n,r,o){var i=Math.abs(o-n)>Math.abs(r-t);if(i){var a=t;t=n,n=a,a=r,r=o,o=a}for(var s=Math.abs(r-t),l=Math.abs(o-n),u=-s/2,c=t0){if(m===o)break;m+=f,u-=s}}return d===2?Ze.distance(r+c,o,t,n):NaN},e.prototype.findAlignmentInRegion=function(t,n,r,o){var i=Math.floor(o*t),a=Math.max(0,n-i),s=Math.min(this.image.getWidth()-1,n+i);if(s-a<3*t)throw new Y("Alignment top exceeds estimated module size.");var l=Math.max(0,r-i),u=Math.min(this.image.getHeight()-1,r+i);if(u-l<3*t)throw new Y("Alignment bottom exceeds estimated module size.");return new Nle(this.image,a,l,s-a,u-l,t,this.resultPointCallback).find()},e}(),A1=function(){function e(){this.decoder=new kle}return e.prototype.getDecoder=function(){return this.decoder},e.prototype.decode=function(t,n){var r,o;if(n!=null&&n.get(Et.PURE_BARCODE)!==void 0){var i=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decodeBitMatrix(i,n),o=e.NO_POINTS}else{var a=new zle(t.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(a.getBits(),n),o=a.getPoints()}r.getOther()instanceof Ik&&r.getOther().applyMirroredCorrection(o);var s=new Ir(r.getText(),r.getRawBytes(),void 0,o,Te.QR_CODE,void 0),l=r.getByteSegments();l!==null&&s.putMetadata(Ln.BYTE_SEGMENTS,l);var u=r.getECLevel();return u!==null&&s.putMetadata(Ln.ERROR_CORRECTION_LEVEL,u),r.hasStructuredAppend()&&(s.putMetadata(Ln.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata(Ln.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},e.prototype.reset=function(){},e.extractPureBits=function(t){var n=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(n===null||r===null)throw new Y;var o=this.moduleSize(n,t),i=n[1],a=r[1],s=n[0],l=r[0];if(s>=l||i>=a)throw new Y;if(a-i!=l-s&&(l=s+(a-i))>=t.getWidth())throw new Y;var u=Math.round((l-s+1)/o),c=Math.round((a-i+1)/o);if(u<=0||c<=0)throw new Y;if(c!==u)throw new Y;var f=Math.floor(o/2);i+=f;var d=(s+=f)+Math.floor((u-1)*o)-l;if(d>0){if(d>f)throw new Y;s-=d}var h=i+Math.floor((c-1)*o)-a;if(h>0){if(h>f)throw new Y;i-=h}for(var p=new Fi(u,c),m=0;m=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ke=function(){function e(){}return e.prototype.PDF417Common=function(){},e.getBitCountSum=function(t){return Ze.sum(t)},e.toIntArray=function(t){var n,r;if(t==null||!t.length)return e.EMPTY_INT_ARRAY;var o=new Int32Array(t.length),i=0;try{for(var a=Ule(t),s=a.next();!s.done;s=a.next()){var l=s.value;o[i++]=l}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},e.getCodeword=function(t){var n=Gr.binarySearch(e.SYMBOL_TABLE,262143&t);return n<0?-1:(e.CODEWORD_TABLE[n]-1)%e.NUMBER_OF_CODEWORDS},e.NUMBER_OF_CODEWORDS=929,e.MAX_CODEWORDS_IN_BARCODE=e.NUMBER_OF_CODEWORDS-1,e.MIN_ROWS_IN_BARCODE=3,e.MAX_ROWS_IN_BARCODE=90,e.MODULES_IN_CODEWORD=17,e.MODULES_IN_STOP_PATTERN=18,e.BARS_IN_MODULE=8,e.EMPTY_INT_ARRAY=new Int32Array([]),e.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),e.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),e}(),Vle=function(){function e(t,n){this.bits=t,this.points=n}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),Hle=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wle=function(){function e(){}return e.detectMultiple=function(t,n,r){var o=t.getBlackMatrix(),i=e.detect(r,o);return i.length||((o=o.clone()).rotate180(),i=e.detect(r,o)),new Vle(o,i)},e.detect=function(t,n){for(var r,o,i=new Array,a=0,s=0,l=!1;a0;){if((d=e.findGuardPattern(t,i,--o,r,!1,a,u))==null){o++;break}h=d}s[0]=new we(h[0],o),s[1]=new we(h[1],o),l=!0;break}var c=o+1;if(l){for(var f=0,d=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);ce.SKIPPED_ROW_COUNT_MAX)break;f++}}c-=f+1,s[2]=new we(d[0],c),s[3]=new we(d[1],c)}return c-o0&&u++d?f-d:d-f;if(h>r)return 1/0;u+=h}return u/i},e.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),e.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),e.MAX_AVG_VARIANCE=.42,e.MAX_INDIVIDUAL_VARIANCE=.8,e.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),e.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),e.MAX_PIXEL_DRIFT=3,e.MAX_PATTERN_DRIFT=5,e.SKIPPED_ROW_COUNT_MAX=25,e.ROW_STEP=5,e.BARCODE_MIN_HEIGHT=10,e}(),Gle=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vs=function(){function e(t,n){if(n.length===0)throw new Me;this.field=t;var r=n.length;if(r>1&&n[0]===0){for(var o=1;or.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;It.arraycopy(r,0,i,0,a);for(var s=a;s=0;n--){var r=this.getCoefficient(n);r!==0&&(r<0?(t.append(" - "),r=-r):t.length()>0&&t.append(" + "),n!==0&&r===1||t.append(r),n!==0&&(n===1?t.append("x"):(t.append("x^"),t.append(n))))}return t.toString()},e}(),Kle=function(){function e(){}return e.prototype.add=function(t,n){return(t+n)%this.modulus},e.prototype.subtract=function(t,n){return(this.modulus+t-n)%this.modulus},e.prototype.exp=function(t){return this.expTable[t]},e.prototype.log=function(t){if(t===0)throw new Me;return this.logTable[t]},e.prototype.inverse=function(t){if(t===0)throw new Ek;return this.expTable[this.modulus-this.logTable[t]-1]},e.prototype.multiply=function(t,n){return t===0||n===0?0:this.expTable[(this.logTable[t]+this.logTable[n])%(this.modulus-1)]},e.prototype.getSize=function(){return this.modulus},e.prototype.equals=function(t){return t===this},e}(),Xle=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qle=function(e){function t(n,r){var o=e.call(this)||this;o.modulus=n,o.expTable=new Int32Array(n),o.logTable=new Int32Array(n);for(var i=1,a=0;a=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Zle=function(){function e(){this.field=qle.PDF417_GF}return e.prototype.decode=function(t,n,r){for(var o,i,a=new vs(this.field,t),s=new Int32Array(n),l=!1,u=n;u>0;u--){var c=a.evaluateAt(this.field.exp(u));s[n-u]=c,c!==0&&(l=!0)}if(!l)return 0;var f=this.field.getOne();if(r!=null)try{for(var d=Yle(r),h=d.next();!h.done;h=d.next()){var p=h.value,m=this.field.exp(t.length-1-p),_=new vs(this.field,new Int32Array([this.field.subtract(0,m),1]));f=f.multiply(_)}}catch(y){o={error:y}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}var b=new vs(this.field,s),g=this.runEuclideanAlgorithm(this.field.buildMonomial(n,1),b,n),E=g[0],T=g[1],O=this.findErrorLocations(E),A=this.findErrorMagnitudes(T,E,O);for(u=0;u=Math.round(r/2);){var u=i,c=s;if(s=l,(i=a).isZero())throw hn.getChecksumInstance();a=u;for(var f=this.field.getZero(),d=i.getCoefficient(i.getDegree()),h=this.field.inverse(d);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),m=this.field.multiply(a.getCoefficient(a.getDegree()),h);f=f.add(this.field.buildMonomial(p,m)),a=a.subtract(i.multiplyByMonomial(p,m))}l=f.multiply(s).subtract(c).negative()}var _=l.getCoefficient(0);if(_===0)throw hn.getChecksumInstance();var b=this.field.inverse(_);return[l.multiply(b),a.multiply(b)]},e.prototype.findErrorLocations=function(t){for(var n=t.getDegree(),r=new Int32Array(n),o=0,i=1;i0){var l=r?this.topLeft:this.topRight,u=Math.trunc(l.getY()-t);u<0&&(u=0);var c=new we(l.getX(),u);r?o=c:a=c}if(n>0){var f=r?this.bottomLeft:this.bottomRight,d=Math.trunc(f.getY()+n);d>=this.image.getHeight()&&(d=this.image.getHeight()-1);var h=new we(f.getX(),d);r?i=h:s=h}return new e(this.image,o,i,a,s)},e.prototype.getMinX=function(){return this.minX},e.prototype.getMaxX=function(){return this.maxX},e.prototype.getMinY=function(){return this.minY},e.prototype.getMaxY=function(){return this.maxY},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getBottomRight=function(){return this.bottomRight},e}(),Qle=function(){function e(t,n,r,o){this.columnCount=t,this.errorCorrectionLevel=o,this.rowCountUpperPart=n,this.rowCountLowerPart=r,this.rowCount=n+r}return e.prototype.getColumnCount=function(){return this.columnCount},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},e.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},e}(),v_=function(){function e(){this.buffer=""}return e.form=function(t,n){var r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(o,i,a,s,l,u){if(o==="%%")return"%";if(n[++r]!==void 0){o=s?parseInt(s.substr(1)):void 0;var c,f=l?parseInt(l.substr(1)):void 0;switch(u){case"s":c=n[r];break;case"c":c=n[r][0];break;case"f":c=parseFloat(n[r]).toFixed(o);break;case"p":c=parseFloat(n[r]).toPrecision(o);break;case"e":c=parseFloat(n[r]).toExponential(o);break;case"x":c=parseInt(n[r]).toString(f||16);break;case"d":c=parseFloat(parseInt(n[r],f||10).toPrecision(o)).toFixed(0)}c=typeof c=="object"?JSON.stringify(c):(+c).toString(f);for(var d=parseInt(a),h=a&&a[0]+""=="0"?"0":" ";c.length=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Rk=function(){function e(t){this.boundingBox=new fw(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return e.prototype.getCodewordNearby=function(t){var n=this.getCodeword(t);if(n!=null)return n;for(var r=1;r=0&&(n=this.codewords[o])!=null||(o=this.imageRowToCodewordIndex(t)+r)=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tue=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Ac=function(){function e(){this.values=new Map}return e.prototype.setValue=function(t){t=Math.trunc(t);var n=this.values.get(t);n==null&&(n=0),n++,this.values.set(t,n)},e.prototype.getValue=function(){var t,n,r=-1,o=new Array,i=function(u,c){var f=function(){return u},d=function(){return c};d()>r?(r=d(),(o=[]).push(f())):d()===r&&o.push(f())};try{for(var a=eue(this.values.entries()),s=a.next();!s.done;s=a.next()){var l=tue(s.value,2);i(l[0],l[1])}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return Ke.toIntArray(o)},e.prototype.getConfidence=function(t){return this.values.get(t)},e}(),nue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cg=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},z4=function(e){function t(n,r){var o=e.call(this,n)||this;return o._isLeft=r,o}return nue(t,e),t.prototype.setRowNumbers=function(){var n,r;try{for(var o=Cg(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;a!=null&&a.setRowNumberAsRowIndicatorColumn()}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(n){var r=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(r,n);for(var o=this.getBoundingBox(),i=this._isLeft?o.getTopLeft():o.getTopRight(),a=this._isLeft?o.getBottomLeft():o.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),l=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=-1,c=1,f=0,d=s;d=n.getRowCount()||p>d)r[d]=null;else{for(var m=void 0,_=(m=c>2?(c-2)*p:p)>=d,b=1;b<=m&&!_;b++)_=r[d-b]!=null;_?r[d]=null:(u=h.getRowNumber(),f=1)}}},t.prototype.getRowHeights=function(){var n,r,o=this.getBarcodeMetadata();if(o==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(o);var i=new Int32Array(o.getRowCount());try{for(var a=Cg(this.getCodewords()),s=a.next();!s.done;s=a.next()){var l=s.value;if(l!=null){var u=l.getRowNumber();if(u>=i.length)continue;i[u]++}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(n){for(var r=this.getBoundingBox(),o=this._isLeft?r.getTopLeft():r.getTopRight(),i=this._isLeft?r.getBottomLeft():r.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),l=this.getCodewords(),u=-1,c=a;c=n.getRowCount()?l[c]=null:u=f.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var n,r,o=this.getCodewords(),i=new Ac,a=new Ac,s=new Ac,l=new Ac;try{for(var u=Cg(o),c=u.next();!c.done;c=u.next()){var f=c.value;if(f!=null){f.setRowNumberAsRowIndicatorColumn();var d=f.getValue()%30,h=f.getRowNumber();switch(this._isLeft||(h+=2),h%3){case 0:a.setValue(3*d+1);break;case 1:l.setValue(d/3),s.setValue(d%3);break;case 2:i.setValue(d+1)}}}}catch(m){n={error:m}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i.getValue().length===0||a.getValue().length===0||s.getValue().length===0||l.getValue().length===0||i.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]Ke.MAX_ROWS_IN_BARCODE)return null;var p=new Qle(i.getValue()[0],a.getValue()[0],s.getValue()[0],l.getValue()[0]);return this.removeIncorrectCodewords(o,p),p},t.prototype.removeIncorrectCodewords=function(n,r){for(var o=0;or.getRowCount())n[o]=null;else switch(this._isLeft||(s+=2),s%3){case 0:3*a+1!==r.getRowCountUpperPart()&&(n[o]=null);break;case 1:Math.trunc(a/3)===r.getErrorCorrectionLevel()&&a%3===r.getRowCountLowerPart()||(n[o]=null);break;case 2:a+1!==r.getColumnCount()&&(n[o]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+` +`+e.prototype.toString.call(this)},t}(Rk),rue=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},oue=function(){function e(t,n){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=n,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return e.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,n=Ke.MAX_CODEWORDS_IN_BARCODE;do t=n,n=this.adjustRowNumbersAndGetCount();while(n>0&&n0&&i0&&(u[0]=r[n-1],u[4]=s[n-1],u[5]=l[n-1]),n>1&&(u[8]=r[n-2],u[10]=s[n-2],u[11]=l[n-2]),n>=1;r=1&n,e.RATIOS_TABLE[t]||(e.RATIOS_TABLE[t]=new Array(Ke.BARS_IN_MODULE)),e.RATIOS_TABLE[t][Ke.BARS_IN_MODULE-o-1]=Math.fround(i/Ke.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},e.getDecodedValue=function(t){var n=e.getDecodedCodewordValue(e.sampleBitCounts(t));return n!==-1?n:e.getClosestDecodedValue(t)},e.sampleBitCounts=function(t){for(var n=Ze.sum(t),r=new Int32Array(Ke.BARS_IN_MODULE),o=0,i=0,a=0;a1)for(var o=0;o=i)break}lt.length||r<0||n+r>t.length||n+r<0)throw new p_;if(r!==0)for(var o=0;o0&&this.grow(n)},t.prototype.grow=function(n){var r=this.buf.length<<1;if(r-n<0&&(r=n),r<0){if(n<0)throw new due;r=Dn.MAX_VALUE}this.buf=Gr.copyOfUint8Array(this.buf,r)},t.prototype.write=function(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1},t.prototype.writeBytesOffset=function(n,r,o){if(r<0||r>n.length||o<0||r+o-n.length>0)throw new p_;this.ensureCapacity(this.count+o),It.arraycopy(n,r,this.buf,this.count,o),this.count+=o},t.prototype.writeTo=function(n){n.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Gr.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(n){return new String(this.buf).toString()},t.prototype.toString_number=function(n){return new String(this.buf).toString()},t.prototype.close=function(){},t}(cue);function kk(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function ta(e){if(xh===void 0&&(xh=kk()),xh===null)throw new Error("BigInt is not supported!");return xh(e)}(function(e){e[e.ALPHA=0]="ALPHA",e[e.LOWER=1]="LOWER",e[e.MIXED=2]="MIXED",e[e.PUNCT=3]="PUNCT",e[e.ALPHA_SHIFT=4]="ALPHA_SHIFT",e[e.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(ct||(ct={}));var mue=function(){function e(){}return e.decode=function(t,n){var r=new mt(""),o=mr.ISO8859_1;r.enableDecoding(o);for(var i=1,a=t[i++],s=new sue;it[0])throw ae.getFormatInstance();for(var o=new Int32Array(e.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i0){for(var d=0;d<6;++d)a.write(Number(ta(l)>>ta(8*(5-d))));l=0,s=0}}o===n[0]&&f0){for(d=0;d<6;++d)a.write(Number(ta(l)>>ta(8*(5-d))));l=0,s=0}}}return i.append(Ts.decode(a.toByteArray(),r)),o},e.numericCompaction=function(t,n,r){for(var o=0,i=!1,a=new Int32Array(e.MAX_NUMERIC_CODEWORDS);n0&&(r.append(e.decodeBase900toBase10(a,o)),o=0)}return n},e.decodeBase900toBase10=function(t,n){for(var r=ta(0),o=0;o@[\\]_\`~!\r ,: +-.$/"|*()?{}'`,e.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",e.EXP900=kk()?function(){var t=[];t[0]=ta(1);var n=ta(900);t[1]=n;for(var r=2;r<16;r++)t[r]=t[r-1]*n;return t}():[],e.NUMBER_OF_SEQUENCE_CODEWORDS=2,e}(),cc=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yue=function(){function e(){}return e.decode=function(t,n,r,o,i,a,s){for(var l,u=new fw(t,n,r,o,i),c=null,f=null,d=!0;;d=!1){if(n!=null&&(c=e.getRowIndicatorColumn(t,u,n,!0,a,s)),o!=null&&(f=e.getRowIndicatorColumn(t,u,o,!1,a,s)),(l=e.merge(c,f))==null)throw Y.getNotFoundInstance();var h=l.getBoundingBox();if(!d||h==null||!(h.getMinY()u.getMaxY()))break;u=h}l.setBoundingBox(u);var p=l.getBarcodeColumnCount()+1;l.setDetectionResultColumn(0,c),l.setDetectionResultColumn(p,f);for(var m=c!=null,_=1;_<=p;_++){var b=m?_:p-_;if(l.getDetectionResultColumn(b)===void 0){var g=void 0;g=b===0||b===p?new z4(u,b===0):new Rk(u),l.setDetectionResultColumn(b,g);for(var E=-1,T=E,O=u.getMinY();O<=u.getMaxY();O++){if((E=e.getStartColumn(l,b,O,m))<0||E>u.getMaxX()){if(T===-1)continue;E=T}var A=e.detectCodeword(t,u.getMinX(),u.getMaxX(),m,E,O,a,s);A!=null&&(g.setCodeword(O,A),T=E,a=Math.min(a,A.getWidth()),s=Math.max(s,A.getWidth()))}}}return e.createDecoderResult(l)},e.merge=function(t,n){if(t==null&&n==null)return null;var r=e.getBarcodeMetadata(t,n);if(r==null)return null;var o=fw.merge(e.adjustBoundingBox(t),e.adjustBoundingBox(n));return new oue(r,o)},e.adjustBoundingBox=function(t){var n,r;if(t==null)return null;var o=t.getRowHeights();if(o==null)return null;var i=e.getMax(o),a=0;try{for(var s=cc(o),l=s.next();!l.done;l=s.next()){var u=l.value;if(a+=i-u,u>0)break}}catch(h){n={error:h}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var c=t.getCodewords(),f=0;a>0&&c[f]==null;f++)a--;var d=0;for(f=o.length-1;f>=0&&(d+=i-o[f],!(o[f]>0));f--);for(f=c.length-1;d>0&&c[f]==null;f--)d--;return t.getBoundingBox().addMissingRows(a,d,t.isLeft())},e.getMax=function(t){var n,r,o=-1;try{for(var i=cc(t),a=i.next();!a.done;a=i.next()){var s=a.value;o=Math.max(o,s)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},e.getBarcodeMetadata=function(t,n){var r,o;return t==null||(r=t.getBarcodeMetadata())==null?n==null?null:n.getBarcodeMetadata():n==null||(o=n.getBarcodeMetadata())==null?r:r.getColumnCount()!==o.getColumnCount()&&r.getErrorCorrectionLevel()!==o.getErrorCorrectionLevel()&&r.getRowCount()!==o.getRowCount()?null:r},e.getRowIndicatorColumn=function(t,n,r,o,i,a){for(var s=new z4(n,o),l=0;l<2;l++)for(var u=l===0?1:-1,c=Math.trunc(Math.trunc(r.getX())),f=Math.trunc(Math.trunc(r.getY()));f<=n.getMaxY()&&f>=n.getMinY();f+=u){var d=e.detectCodeword(t,0,t.getWidth(),o,c,f,i,a);d!=null&&(s.setCodeword(f,d),c=o?d.getStartX():d.getEndX())}return s},e.adjustCodewordCount=function(t,n){var r=n[0][1],o=r.getValue(),i=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-e.getNumberOfECCodeWords(t.getBarcodeECLevel());if(o.length===0){if(i<1||i>Ke.MAX_CODEWORDS_IN_BARCODE)throw Y.getNotFoundInstance();r.setValue(i)}else o[0]!==i&&r.setValue(i)},e.createDecoderResult=function(t){var n=e.createBarcodeMatrix(t);e.adjustCodewordCount(t,n);for(var r=new Array,o=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),i=[],a=new Array,s=0;s0;){for(var l=0;l=0){if(_>=a.length)continue;a[_][u].setValue(m.getValue())}}}}catch(b){o={error:b}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}u++}}catch(b){n={error:b}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return a},e.isValidBarcodeColumn=function(t,n){return n>=0&&n<=t.getBarcodeColumnCount()+1},e.getStartColumn=function(t,n,r,o){var i,a,s=o?1:-1,l=null;if(e.isValidBarcodeColumn(t,n-s)&&(l=t.getDetectionResultColumn(n-s).getCodeword(r)),l!=null)return o?l.getEndX():l.getStartX();if((l=t.getDetectionResultColumn(n).getCodewordNearby(r))!=null)return o?l.getStartX():l.getEndX();if(e.isValidBarcodeColumn(t,n-s)&&(l=t.getDetectionResultColumn(n-s).getCodewordNearby(r)),l!=null)return o?l.getEndX():l.getStartX();for(var u=0;e.isValidBarcodeColumn(t,n-s);){n-=s;try{for(var c=(i=void 0,cc(t.getDetectionResultColumn(n).getCodewords())),f=c.next();!f.done;f=c.next()){var d=f.value;if(d!=null)return(o?d.getEndX():d.getStartX())+s*u*(d.getEndX()-d.getStartX())}}catch(h){i={error:h}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}u++}return o?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},e.detectCodeword=function(t,n,r,o,i,a,s,l){i=e.adjustCodewordStartColumn(t,n,r,o,i,a);var u,c=e.getModuleBitCount(t,n,r,o,i,a);if(c==null)return null;var f=Ze.sum(c);if(o)u=i+f;else{for(var d=0;d=n)&&u=n:se.CODEWORD_SKEW_SIZE)return i;s+=l}l=-l,o=!o}return s},e.checkCodewordSkew=function(t,n,r){return n-e.CODEWORD_SKEW_SIZE<=t&&t<=r+e.CODEWORD_SKEW_SIZE},e.decodeCodewords=function(t,n,r){if(t.length===0)throw ae.getFormatInstance();var o=1<r/2+e.MAX_ERRORS||r<0||r>e.MAX_EC_CODEWORDS)throw hn.getChecksumInstance();return e.errorCorrection.decode(t,r,n)},e.verifyCodewordCount=function(t,n){if(t.length<4)throw ae.getFormatInstance();var r=t[0];if(r>t.length)throw ae.getFormatInstance();if(r===0){if(!(n>=1;return n},e.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},e.getCodewordBucketNumber_number=function(t){return e.getCodewordBucketNumber(e.getBitCountForCodeword(t))},e.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},e.toString=function(t){for(var n=new v_,r=0;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},P1=function(){function e(){}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r=e.decode(t,n,!1);if(r==null||r.length===0||r[0]==null)throw Y.getNotFoundInstance();return r[0]},e.prototype.decodeMultiple=function(t,n){n===void 0&&(n=null);try{return e.decode(t,n,!0)}catch(r){throw r instanceof ae||r instanceof hn?Y.getNotFoundInstance():r}},e.decode=function(t,n,r){var o,i,a=new Array,s=Wle.detectMultiple(t,n,r);try{for(var l=gue(s.getPoints()),u=l.next();!u.done;u=l.next()){var c=u.value,f=yue.decode(s.getBits(),c[4],c[5],c[6],c[7],e.getMinCodewordWidth(c),e.getMaxCodewordWidth(c)),d=new Ir(f.getText(),f.getRawBytes(),void 0,c,Te.PDF_417);d.putMetadata(Ln.ERROR_CORRECTION_LEVEL,f.getECLevel());var h=f.getOther();h!=null&&d.putMetadata(Ln.PDF417_EXTRA_METADATA,h),a.push(d)}}catch(p){o={error:p}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return a.map(function(p){return p})},e.getMaxWidth=function(t,n){return t==null||n==null?0:Math.trunc(Math.abs(t.getX()-n.getX()))},e.getMinWidth=function(t,n){return t==null||n==null?Dn.MAX_VALUE:Math.trunc(Math.abs(t.getX()-n.getX()))},e.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(e.getMaxWidth(t[0],t[4]),e.getMaxWidth(t[6],t[2])*Ke.MODULES_IN_CODEWORD/Ke.MODULES_IN_STOP_PATTERN),Math.max(e.getMaxWidth(t[1],t[5]),e.getMaxWidth(t[7],t[3])*Ke.MODULES_IN_CODEWORD/Ke.MODULES_IN_STOP_PATTERN)))},e.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(e.getMinWidth(t[0],t[4]),e.getMinWidth(t[6],t[2])*Ke.MODULES_IN_CODEWORD/Ke.MODULES_IN_STOP_PATTERN),Math.min(e.getMinWidth(t[1],t[5]),e.getMinWidth(t[7],t[3])*Ke.MODULES_IN_CODEWORD/Ke.MODULES_IN_STOP_PATTERN)))},e.prototype.reset=function(){},e}(),vue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),V4=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return vue(t,e),t.kind="ReaderException",t}(Tr),H4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mk=function(){function e(){}return e.prototype.decode=function(t,n){return this.setHints(n),this.decodeInternal(t)},e.prototype.decodeWithState=function(t){return this.readers!==null&&this.readers!==void 0||this.setHints(null),this.decodeInternal(t)},e.prototype.setHints=function(t){this.hints=t;var n=t!=null&&t.get(Et.TRY_HARDER)!==void 0,r=t==null?null:t.get(Et.POSSIBLE_FORMATS),o=new Array;if(r!=null){var i=r.some(function(a){return a===Te.UPC_A||a===Te.UPC_E||a===Te.EAN_13||a===Te.EAN_8||a===Te.CODABAR||a===Te.CODE_39||a===Te.CODE_93||a===Te.CODE_128||a===Te.ITF||a===Te.RSS_14||a===Te.RSS_EXPANDED});i&&!n&&o.push(new $l(t)),r.includes(Te.QR_CODE)&&o.push(new A1),r.includes(Te.DATA_MATRIX)&&o.push(new O1),r.includes(Te.AZTEC)&&o.push(new C1),r.includes(Te.PDF_417)&&o.push(new P1),i&&n&&o.push(new $l(t))}o.length===0&&(n||o.push(new $l(t)),o.push(new A1),o.push(new O1),o.push(new C1),o.push(new P1),n&&o.push(new $l(t))),this.readers=o},e.prototype.reset=function(){var t,n;if(this.readers!==null)try{for(var r=H4(this.readers),o=r.next();!o.done;o=r.next())o.value.reset()}catch(i){t={error:i}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.decodeInternal=function(t){var n,r;if(this.readers===null)throw new V4("No readers where selected, nothing can be read.");try{for(var o=H4(this.readers),i=o.next();!i.done;i=o.next()){var a=i.value;try{return a.decode(t,this.hints)}catch(s){if(s instanceof V4)continue}}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}throw new Y("No MultiFormat Readers were able to detect the code.")},e}(),wue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){n===void 0&&(n=null),r===void 0&&(r=500);var o=new Mk;return o.setHints(n),e.call(this,o,r)||this}wue(t,e),t.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)}})($u);var bue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n){return n===void 0&&(n=500),e.call(this,new P1,n)||this}bue(t,e)})($u);var W4,Sue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n){return n===void 0&&(n=500),e.call(this,new A1,n)||this}Sue(t,e)})($u),function(e){e[e.ERROR_CORRECTION=0]="ERROR_CORRECTION",e[e.CHARACTER_SET=1]="CHARACTER_SET",e[e.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",e[e.MIN_SIZE=3]="MIN_SIZE",e[e.MAX_SIZE=4]="MAX_SIZE",e[e.MARGIN=5]="MARGIN",e[e.PDF417_COMPACT=6]="PDF417_COMPACT",e[e.PDF417_COMPACTION=7]="PDF417_COMPACTION",e[e.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",e[e.AZTEC_LAYERS=9]="AZTEC_LAYERS",e[e.QR_VERSION=10]="QR_VERSION"}(W4||(W4={}));var _ue=function(){function e(){}return e.applyMaskPenaltyRule1=function(t){return e.applyMaskPenaltyRule1Internal(t,!0)+e.applyMaskPenaltyRule1Internal(t,!1)},e.applyMaskPenaltyRule2=function(t){for(var n=0,r=t.getArray(),o=t.getWidth(),i=t.getHeight(),a=0;a=5&&(r+=e.N1+(l-5)),l=1,u=f)}l>=5&&(r+=e.N1+(l-5))}return r},e.N1=3,e.N2=3,e.N3=40,e.N4=10,e}(),Eue=function(){function e(){this.maskPattern=-1}return e.prototype.getMode=function(){return this.mode},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getVersion=function(){return this.version},e.prototype.getMaskPattern=function(){return this.maskPattern},e.prototype.getMatrix=function(){return this.matrix},e.prototype.toString=function(){var t=new mt;return t.append(`<< +`),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append(` + ecLevel: `),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append(` + version: `),t.append(this.version?this.version.toString():"null"),t.append(` + maskPattern: `),t.append(this.maskPattern.toString()),this.matrix?(t.append(` + matrix: +`),t.append(this.matrix.toString())):t.append(` + matrix: null +`),t.append(`>> +`),t.toString()},e.prototype.setMode=function(t){this.mode=t},e.prototype.setECLevel=function(t){this.ecLevel=t},e.prototype.setVersion=function(t){this.version=t},e.prototype.setMaskPattern=function(t){this.maskPattern=t},e.prototype.setMatrix=function(t){this.matrix=t},e.isValidMaskPattern=function(t){return t>=0&&t0;){for(a===6&&(a-=1);s>=0&&s=r;)t^=n<=0)for(var l=0;l!==a;l++){var u=o[l];u>=0&&e.isEmpty(n.get(u,s))&&e.embedPositionAdjustmentPattern(u-2,s-2,n)}}},e.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),e.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),e.VERSION_INFO_POLY=7973,e.TYPE_INFO_POLY=1335,e.TYPE_INFO_MASK_PATTERN=21522,e})();(function(){Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),mr.UTF8.getName()})();var xue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r,o,i,a,s,l,u){var c=e.call(this,s,l)||this;if(c.yuvData=n,c.dataWidth=r,c.dataHeight=o,c.left=i,c.top=a,i+s>r||a+l>o)throw new Me("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(s,l),c}xue(t,e),t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length>16&255,m=h>>7&510,_=255&h;f[d]=(p+m+_)/4&255}u.luminances=f}else u.luminances=n;if(i===void 0&&(u.dataWidth=r),a===void 0&&(u.dataHeight=o),s===void 0&&(u.left=0),l===void 0&&(u.top=0),u.left+r>u.dataWidth||u.top+o>u.dataHeight)throw new Me("Crop rectangle does not fit within image data.");return u}Oue(t,e),t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length"},t}(Pue),Iue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r,o){var i=e.call(this,n,0,0)||this;return i.binaryShiftStart=r,i.binaryShiftByteCount=o,i}Iue(t,e),t.prototype.appendTo=function(n,r){for(var o=0;o62?n.appendBits(this.binaryShiftByteCount-31,16):o===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(r[this.binaryShiftStart+o],8)},t.prototype.addBinaryShift=function(n,r){return new t(this,n,r)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}})(Dk);new Dk(null,0,0);var Rue=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(e){var t,n;try{for(var r=Rue(e),o=r.next();!o.done;o=r.next()){var i=o.value;Gr.fill(i,-1)}}catch(a){t={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}e[0][4]=0,e[1][4]=0,e[1][0]=28,e[3][4]=0,e[2][4]=0,e[2][0]=15})(Gr.createInt32Array(6,6)),function(e){var t=gn.getCharCode(" "),n=gn.getCharCode("."),r=gn.getCharCode(",");e[0][t]=1;for(var o=gn.getCharCode("Z"),i=gn.getCharCode("A"),a=i;a<=o;a++)e[0][a]=a-i+2;e[1][t]=1;var s=gn.getCharCode("z"),l=gn.getCharCode("a");for(a=l;a<=s;a++)e[1][a]=a-l+2;e[2][t]=1;var u=gn.getCharCode("9"),c=gn.getCharCode("0");for(a=c;a<=u;a++)e[2][a]=a-c+2;e[2][r]=12,e[2][n]=13;for(var f=["\0"," ","","","","","","","\x07","\b"," ",` +`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""],d=0;d","?","[","]","{","}"];for(d=0;d0&&(e[4][gn.getCharCode(h[d])]=d)}(Gr.createInt32Array(5,256));var kue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mue=function(e){function t(n){var r=e.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=t.makeBufferFromCanvasImageData(n),r}return kue(t,e),t.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var o=r.getImageData(0,0,n.width,n.height);return t.toGrayscaleBuffer(o.data,n.width,n.height)},t.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,l=n.length;a>10,i[s]=u}return i},t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length0&&o[o.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Lue={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},zu=function(){function e(t,n,r){n===void 0&&(n=new Map),r===void 0&&(r={}),this.reader=t,this.hints=n,this.options=Ul(Ul({},Lue),r)}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(t){this.hints.set(Et.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),e.addVideoSource=function(t,n){try{t.srcObject=n}catch{t.src=URL.createObjectURL(n)}},e.mediaStreamSetTorch=function(t,n){return Xt(this,void 0,void 0,function(){return qt(this,function(r){switch(r.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:n?"flash":"off",torch:!!n}]})];case 1:return r.sent(),[2]}})})},e.mediaStreamIsTorchCompatible=function(t){var n,r,o=t.getVideoTracks();try{for(var i=Oh(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(e.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.mediaStreamIsTorchCompatibleTrack=function(t){try{return"torch"in t.getCapabilities()}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},e.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},e.getMediaElement=function(t,n){var r=document.getElementById(t);if(!r)throw new Yt("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Yt("element with id '"+t+"' must be an "+n+" element");return r},e.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t=="string")return e.getMediaElement(t,"video");if(!t&&typeof document<"u"){var n=document.createElement("video");return n.width=200,n.height=200,n}throw new Error("Couldn't get videoElement from videoSource!")},e.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t=="string")return e.getMediaElement(t,"img");if(t===void 0){var n=document.createElement("img");return n.width=200,n.height=200,n}throw new Error("Couldn't get imageElement from imageSource!")},e.prepareVideoElement=function(t){var n=e.createVideoElement(t);return n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},e.isImageLoaded=function(t){return!!t.complete&&t.naturalWidth!==0},e.createBinaryBitmapFromCanvas=function(t){var n=new Mue(t),r=new _k(n);return new Sk(r)},e.drawImageOnCanvas=function(t,n){t.drawImage(n,0,0)},e.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimentions!")},e.createCaptureCanvas=function(t){if(!t)throw new Yt("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement("canvas"),r=e.getMediaElementDimensions(t),o=r.width,i=r.height;return n.style.width=o+"px",n.style.height=i+"px",n.width=o,n.height=i,n},e.tryPlayVideo=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:if(t!=null&&t.ended)return console.error("Trying to play video that has ended."),[2,!1];if(e.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn("It was not possible to play the video.",n),[2,!1];case 4:return[2]}})})},e.createCanvasFromMediaElement=function(t){var n=e.createCaptureCanvas(t),r=n.getContext("2d");if(!r)throw new Error("Couldn't find Canvas 2D Context.");return e.drawImageOnCanvas(r,t),n},e.createBinaryBitmapFromMediaElem=function(t){var n=e.createCanvasFromMediaElement(t);return e.createBinaryBitmapFromCanvas(n)},e.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},e.listVideoInputDevices=function(){return Xt(this,void 0,void 0,function(){var t,n,r,o,i,a,s,l,u,c,f,d;return qt(this,function(h){switch(h.label){case 0:if(!Lk())throw new Error("Can't enumerate devices, navigator is not present.");if(!Due())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=h.sent(),n=[];try{for(r=Oh(t),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,l=i.label||"Video device "+(n.length+1),u=i.groupId,c={deviceId:s,label:l,kind:a,groupId:u},n.push(c))}catch(p){f={error:p}}finally{try{o&&!o.done&&(d=r.return)&&d.call(r)}finally{if(f)throw f.error}}return[2,n]}})})},e.findDeviceById=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:return[4,e.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===t})]:[2]}})})},e.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch{t.src=""}t&&t.removeAttribute("src")}},e.playVideoOnLoadAsync=function(t,n){return Xt(this,void 0,void 0,function(){return qt(this,function(r){switch(r.label){case 0:return[4,e.tryPlayVideo(t)];case 1:return r.sent()?[2,!0]:[2,new Promise(function(o,i){var a=setTimeout(function(){e.isVideoPlaying(t)||(i(!1),t.removeEventListener("canplay",s))},n),s=function(){e.tryPlayVideo(t).then(function(l){clearTimeout(a),t.removeEventListener("canplay",s),o(l)})};t.addEventListener("canplay",s)})]}})})},e.attachStreamToVideo=function(t,n,r){return r===void 0&&(r=5e3),Xt(this,void 0,void 0,function(){var o;return qt(this,function(i){switch(i.label){case 0:return o=e.prepareVideoElement(n),e.addVideoSource(o,t),[4,e.playVideoOnLoadAsync(o,r)];case 1:return i.sent(),[2,o]}})})},e._waitImageLoad=function(t){return new Promise(function(n,r){var o=setTimeout(function(){e.isImageLoaded(t)||(t.removeEventListener("load",i),r())},1e4),i=function(){clearTimeout(o),t.removeEventListener("load",i),n()};t.addEventListener("load",i)})},e.checkCallbackFnOrThrow=function(t){if(!t)throw new Yt("`callbackFn` is a required parameter, you cannot capture results without it.")},e.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(n){return n.stop()}),t=void 0},e.prototype.decode=function(t){var n=e.createCanvasFromMediaElement(t);return this.decodeFromCanvas(n)},e.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},e.prototype.decodeFromCanvas=function(t){var n=e.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(n)},e.prototype.decodeFromImageElement=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:if(!t)throw new Yt("An image element must be provided.");return n=e.prepareImageElement(t),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeFromImageUrl=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:if(!t)throw new Yt("An URL must be provided.");(n=e.prepareImageElement()).src=t,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return e.destroyImageElement(n),[7];case 4:return[2]}})})},e.prototype.decodeFromConstraints=function(t,n,r){return Xt(this,void 0,void 0,function(){var o,i;return qt(this,function(a){switch(a.label){case 0:return e.checkCallbackFnOrThrow(r),[4,navigator.mediaDevices.getUserMedia(t)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,n,r)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),e.disposeMediaStream(o),i;case 5:return[2]}})})},e.prototype.decodeFromStream=function(t,n,r){return Xt(this,void 0,void 0,function(){var o,i,a,s,l,u,c,f,d,h,p=this;return qt(this,function(m){switch(m.label){case 0:return e.checkCallbackFnOrThrow(r),o=this.options.tryPlayVideoTimeout,[4,e.attachStreamToVideo(t,n,o)];case 1:return i=m.sent(),a=function(){var _,b;try{for(var g=Oh(t.getVideoTracks()),E=g.next();!E.done;E=g.next())E.value.stop()}catch(T){_={error:T}}finally{try{E&&!E.done&&(b=g.return)&&b.call(g)}finally{if(_)throw _.error}}t=void 0},s=function(){a(),e.cleanVideoSource(i)},l=this.scan(i,r,s),u=t.getVideoTracks(),c=Ul(Ul({},l),{stop:function(){l.stop()},streamVideoConstraintsApply:function(_,b){return Xt(this,void 0,void 0,function(){var g,E,T,O,A,C;return qt(this,function(y){switch(y.label){case 0:g=b?u.filter(b):u,y.label=1;case 1:y.trys.push([1,6,7,8]),E=Oh(g),T=E.next(),y.label=2;case 2:return T.done?[3,5]:[4,T.value.applyConstraints(_)];case 3:y.sent(),y.label=4;case 4:return T=E.next(),[3,2];case 5:return[3,8];case 6:return O=y.sent(),A={error:O},[3,8];case 7:try{T&&!T.done&&(C=E.return)&&C.call(E)}finally{if(A)throw A.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(_){return u.find(_).getConstraints()},streamVideoSettingsGet:function(_){return u.find(_).getSettings()},streamVideoCapabilitiesGet:function(_){return u.find(_).getCapabilities()}}),e.mediaStreamIsTorchCompatible(t)&&(f=u==null?void 0:u.find(function(_){return e.mediaStreamIsTorchCompatibleTrack(_)}),d=function(_){return Xt(p,void 0,void 0,function(){return qt(this,function(b){switch(b.label){case 0:return[4,e.mediaStreamSetTorch(f,_)];case 1:return b.sent(),[2]}})})},c.switchTorch=d,h=function(){l.stop(),d(!1)},c.stop=h),[2,c]}})})},e.prototype.decodeFromVideoDevice=function(t,n,r){return Xt(this,void 0,void 0,function(){var o;return qt(this,function(i){switch(i.label){case 0:return e.checkCallbackFnOrThrow(r),o={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},e.prototype.decodeFromVideoElement=function(t,n){return Xt(this,void 0,void 0,function(){var r,o;return qt(this,function(i){switch(i.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new Yt("A video element must be provided.");return r=e.prepareVideoElement(t),o=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,o)];case 1:return i.sent(),[2,this.scan(r,n)]}})})},e.prototype.decodeFromVideoUrl=function(t,n){return Xt(this,void 0,void 0,function(){var r,o,i;return qt(this,function(a){switch(a.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new Yt("An URL must be provided.");return(r=e.prepareVideoElement()).src=t,o=function(){e.cleanVideoSource(r)},i=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n,o)]}})})},e.prototype.decodeOnceFromConstraints=function(t,n){return Xt(this,void 0,void 0,function(){var r;return qt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},e.prototype.decodeOnceFromStream=function(t,n){return Xt(this,void 0,void 0,function(){var r,o;return qt(this,function(i){switch(i.label){case 0:return r=!!n,[4,e.attachStreamToVideo(t,n)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return r||e.cleanVideoSource(o),[7];case 5:return[2]}})})},e.prototype.decodeOnceFromVideoDevice=function(t,n){return Xt(this,void 0,void 0,function(){var r;return qt(this,function(o){switch(o.label){case 0:return r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},e.prototype.decodeOnceFromVideoElement=function(t){return Xt(this,void 0,void 0,function(){var n,r;return qt(this,function(o){switch(o.label){case 0:if(!t)throw new Yt("A video element must be provided.");return n=e.prepareVideoElement(t),r=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,r)];case 1:return o.sent(),[4,this.scanOneResult(n)];case 2:return[2,o.sent()]}})})},e.prototype.decodeOnceFromVideoUrl=function(t){return Xt(this,void 0,void 0,function(){var n,r;return qt(this,function(o){switch(o.label){case 0:if(!t)throw new Yt("An URL must be provided.");(n=e.prepareVideoElement()).src=t,r=this.decodeOnceFromVideoElement(n),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,r];case 2:return[2,o.sent()];case 3:return e.cleanVideoSource(n),[7];case 4:return[2]}})})},e.prototype.scanOneResult=function(t,n,r,o){var i=this;return n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),new Promise(function(a,s){i.scan(t,function(l,u,c){if(l)return a(l),void c.stop();if(u){if(u instanceof Y&&n||u instanceof hn&&r||u instanceof ae&&o)return;c.stop(),s(u)}})})},e.prototype.scan=function(t,n,r){var o=this;e.checkCallbackFnOrThrow(n);var i=e.createCaptureCanvas(t),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,l=function(){a=void 0,i=void 0},u=!1,c={stop:function(){u=!0,clearTimeout(s),l(),r&&r()}},f=function(){if(!u)try{e.drawImageOnCanvas(a,t);var d=o.decodeFromCanvas(i);n(d,void 0,c),s=setTimeout(f,o.options.delayBetweenScanSuccess)}catch(h){if(n(void 0,h,c),h instanceof hn||h instanceof ae||h instanceof Y)return void(s=setTimeout(f,o.options.delayBetweenScanAttempts));l(),r&&r(h)}};return f(),c},e.prototype._decodeOnLoadImage=function(t){return Xt(this,void 0,void 0,function(){return qt(this,function(n){switch(n.label){case 0:return e.isImageLoaded(t)?[3,2]:[4,e._waitImageLoad(t)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(t)]}})})},e}(),Nue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new C1,n,r)||this}Nue(t,e)})(zu);var Bue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new $l(n),n,r)||this}Bue(t,e)})(zu);var jue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new O1,n,r)||this}jue(t,e)})(zu);var Fue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){var o=this,i=new Mk;return i.setHints(n),(o=e.call(this,i,n,r)||this).reader=i,o}Fue(t,e),Object.defineProperty(t.prototype,"possibleFormats",{set:function(n){this.hints.set(Et.POSSIBLE_FORMATS,n),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)},t.prototype.setHints=function(n){this.hints=n,this.reader.setHints(this.hints)}})(zu);var $ue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new P1,n,r)||this}$ue(t,e)})(zu);var zue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uue=function(e){function t(n,r){return e.call(this,new A1,n,r)||this}return zue(t,e),t}(zu),Ah=function(e,t,n){var r=typeof e===n;return r||console.warn('[ReactQrReader]: Expected "'.concat(t,'" to be a of type "').concat(n,'".')),r},Vue=function(e){var t=e.scanDelay,n=e.constraints,r=e.onResult,o=e.videoId,i=P.useRef(null);P.useEffect(function(){var a=new Uue(null,{delayBetweenScanAttempts:t});return!function(){var s=typeof navigator<"u"&&!!navigator.mediaDevices;return s||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),s}()&&Ah(r,"onResult","function")&&r(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),a),Ah(n,"constraints","object")&&a.decodeFromConstraints({video:n},o,function(s,l){Ah(r,"onResult","function")&&r(s,l,a)}).then(function(s){return i.current=s}).catch(function(s){Ah(r,"onResult","function")&&r(null,s,a)}),function(){var s;(s=i.current)===null||s===void 0||s.stop()}},[])},us=function(){return us=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{var v,x;return[S.keystore,S.keypairIsLoaded,S.keypair,((v=S==null?void 0:S.keypair)==null?void 0:v.publicKey)||"",((x=S==null?void 0:S.keypair)==null?void 0:x.privateKey)||""]}),[i,a]=P.useState(!1),[s,l]=P.useState(!1),[u,c]=P.useState(""),[f,d]=P.useState(""),[h,p]=P.useState(!1);P.useEffect(()=>{c(r)},[r]),P.useEffect(()=>{d(o)},[o]),P.useEffect(()=>{e==="nos2x"&&l(!1)},[e]);const m=(s||e==="localstore")&&e!=="nos2x",_=Vi(),[b,g]=P.useState(!1),E=()=>{const S=Iie();Z.getState().setKeyStore({keystore:"localstore",publicKey:S.publicKey,privateKey:S.privateKey})},T=async S=>{if(g(!0),window.nostr)try{const v=await window.nostr.getPublicKey();Z.getState().setKeyStore({keystore:"nos2x",publicKey:v,privateKey:""}),g(!1)}catch(v){console.error("Error loading public key:",v),g(!1)}else{console.log(`Nostr extention not ready, retry ${S}`);const v=S?S+1:1;if(v>2){_({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),g(!1);return}setTimeout(()=>T(v),1e3)}},O=S=>{if(Qoe(S)){const v=S.split(":"),x=Cd(v[1]);if(!x){_({title:"Invalid QR code",description:"QR code is not a valid nostr url.",status:"error",duration:5e3,isClosable:!0});return}const I=x.prefix;if(I!=="npub"&&I!=="nsec"){_({title:"Invalid QR code",description:"QR code is not a valid public or private key.",status:"error",duration:5e3,isClosable:!0});return}let R;for(const k of x.tlvItems)k.type===0&&(R=k.value);if(!R){_({title:"Invalid QR code",description:"QR code is not a valid public or private key.",status:"error",duration:5e3,isClosable:!0});return}if(I==="npub"){if(console.log("Setting public key from QR code",R),u===R)return;c(R),Z.getState().setKeyStore({keystore:"localstore",publicKey:R,privateKey:""}),_({title:"Public key loaded",description:"Public key loaded from QR code.",status:"success",duration:5e3,isClosable:!0})}else if(I==="nsec"){if(console.log("Setting private key from QR code",R),f===R)return;d(R);const k=Rie(R);Z.getState().setKeyStore({keystore:"localstore",publicKey:k,privateKey:R}),_({title:"Keys loaded",description:"Private and public key loaded from QR code.",status:"success",duration:5e3,isClosable:!0})}else console.log("Invalid prefix",I);p(!1);return}else{_({title:"Invalid QR code",description:"QR code is not a valid nostr url.",status:"error",duration:5e3,isClosable:!0});return}},A=()=>{if(u.length!==64){_({title:"Invalid public key",description:"Public key must be 64 characters long.",status:"error",duration:5e3,isClosable:!0});return}if(f!==""&&f.length!==64){_({title:"Invalid private key",description:"Private key must be 64 characters long.",status:"error",duration:5e3,isClosable:!0});return}u&&f&&(Z.getState().setKeyStore({keystore:"localstore",publicKey:u,privateKey:f}),l(!1))},C=()=>{Z.getState().resetKeyStore(),d(""),c(""),l(!1)},y=()=>{p(!h)};return w.jsxs(ve,{children:[w.jsx(jo,{size:"lg",children:"Account"}),t?w.jsxs(me,{fontWeight:"bold",children:["Keypair loaded from ",e,"."]}):w.jsxs(w.Fragment,{children:[w.jsx(me,{fontWeight:"bold",marginBottom:2,children:"Keypair is not loaded."}),w.jsx(me,{marginBottom:2,children:"If you generate a new keypair, it will be stored in the browser local store (insecure). Alternatively get nos2x for Chrome, or nos2x-fox for Firefox, and store your keys in the extention (less insecure)."})]}),h&&w.jsxs(w.Fragment,{children:[w.jsxs(ve,{marginBottom:2,children:[w.jsx(me,{marginBottom:2,children:"Take a picture of your public or private key."}),w.jsx(be,{onClick:y,children:"Close QR Reader"})]}),w.jsx(dw,{onResult:(S,v)=>{S&&O(S.toString()),v&&console.info(v)},constraints:{facingMode:"environment"}})]}),w.jsx(pt,{marginTop:4,children:!h&&(!e||e==="none")?w.jsxs(w.Fragment,{children:[w.jsx(be,{onClick:E,children:"New keypair"}),w.jsx(be,{onClick:()=>l(!0),children:"Enter keypair"}),w.jsx(be,{onClick:y,children:"Scan from QR"}),w.jsx(be,{isLoading:b,onClick:()=>T(),children:"Load from nos2x"})]}):w.jsx(be,{onClick:C,children:"Reset"})}),n&&w.jsxs(ve,{mt:4,children:[w.jsxs(Jn,{marginBottom:4,children:[w.jsx(In,{children:"Public key:"}),w.jsx(Ht,{type:"text",value:u,onChange:S=>c(S.target.value),isReadOnly:!0})]}),m&&w.jsxs(Jn,{marginBottom:4,children:[w.jsx(In,{children:"Private key:"}),w.jsxs(pt,{spacing:2,children:[w.jsx(Ht,{type:i?"text":"password",value:f,onChange:S=>d(S.target.value),isReadOnly:!s}),w.jsx(be,{size:"sm",onClick:()=>a(!i),children:i?"Hide":"Show"})]})]}),s&&w.jsx(be,{onClick:()=>A(),children:"Save"})]})]})}function Wue(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var T1=Wue(P),Gue=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},K4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Kue(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return T1.createElement("svg",Gue({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),T1.createElement("path",{d:"M2,21L23,12L2,3V10L17,12L2,14V21Z"}))},Xue=T1.memo?T1.memo(K4):K4,que=Xue;const Yue=Qe(que);function Zue(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var I1=Zue(P),Que=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},X4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Jue(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return I1.createElement("svg",Que({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),I1.createElement("path",{d:"M4,9H20V11H4V9M4,13H14V15H4V13Z"}))},ece=I1.memo?I1.memo(X4):X4,tce=ece;const nce=Qe(tce);function rce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var R1=rce(P),oce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},q4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=ice(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return R1.createElement("svg",oce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),R1.createElement("path",{d:"M4,5H20V7H4V5M4,9H20V11H4V9M4,13H20V15H4V13M4,17H14V19H4V17Z"}))},ace=R1.memo?R1.memo(q4):q4,sce=ace;const lce=Qe(sce);function uce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var k1=uce(P),cce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Y4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=fce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return k1.createElement("svg",cce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),k1.createElement("path",{d:"M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z"}))},dce=k1.memo?k1.memo(Y4):Y4,hce=dce;const Nk=Qe(hce);function pce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var M1=pce(P),mce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Z4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=yce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return M1.createElement("svg",mce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),M1.createElement("path",{d:"M12,6C8.6,6 5.5,7.1 3,9L1.2,6.6C4.2,4.3 8,3 12,3C16,3 19.8,4.3 22.8,6.6L21,9C18.5,7.1 15.4,6 12,6M13,19C13,17.7 13.4,16.4 14.2,15.4C13.5,15.2 12.8,15 12,15C10.7,15 9.4,15.5 8.4,16.2L12,21L13,19.6C13,19.4 13,19.2 13,19M16.8,13.4C17.1,13.3 17.5,13.2 17.9,13.1L19.2,11.4C17.2,9.9 14.7,9 12,9C9.3,9 6.8,9.9 4.8,11.4L6.6,13.8C8.1,12.7 10,12 12,12C13.8,12 15.4,12.5 16.8,13.4M16.5,22.6L17.2,19.8L15,17.9L17.9,17.7L19,15L20.1,17.6L23,17.8L20.8,19.7L21.5,22.5L19,21.1L16.5,22.6Z"}))},gce=M1.memo?M1.memo(Z4):Z4,vce=gce;const wce=Qe(vce);function bce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var D1=bce(P),Sce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Q4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=_ce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return D1.createElement("svg",Sce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),D1.createElement("path",{d:"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z"}))},Ece=D1.memo?D1.memo(Q4):Q4,Cce=Ece;const Bk=Qe(Cce);function Uu(e,t){return e.length<=t?e:e?e.substring(0,t)+"...":"..."}function xce(e,t,n,r){switch(e){case"NewShortTextNote":return{event:Kie({text:t})};case"NewLongFormContent":return{event:Xie({text:t})};case"NewShortTextNoteResponse":return r.inResponseTo?{event:qie({text:t,inResponseTo:r.inResponseTo})}:{error:"Response requires inResponseTo"};case"NewRecommendRelay":return{event:Qie({relayUrl:n})};case"NewQuoteRepost":return r.inResponseTo?{event:ak({inResponseTo:r.inResponseTo,relayUrl:n})}:{error:"Quote repost requires inResponseTo"};default:return{error:"Invalid event type"}}}function Oce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var L1=Oce(P),Ace=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},J4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Pce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return L1.createElement("svg",Ace({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),L1.createElement("path",{d:"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}))},Tce=L1.memo?L1.memo(J4):J4,Ice=Tce;const Qc=Qe(Ice);function Rce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var N1=Rce(P),kce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},e8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Mce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return N1.createElement("svg",kce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),N1.createElement("path",{d:"M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4Z"}))},Dce=N1.memo?N1.memo(e8):e8,Lce=Dce;const jk=Qe(Lce);function Nce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var B1=Nce(P),Bce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},t8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=jce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return B1.createElement("svg",Bce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),B1.createElement("path",{d:"M23,18V17.5A2.5,2.5 0 0,0 20.5,15A2.5,2.5 0 0,0 18,17.5V18A1,1 0 0,0 17,19V23A1,1 0 0,0 18,24H23A1,1 0 0,0 24,23V19A1,1 0 0,0 23,18M22,18H19V17.5A1.5,1.5 0 0,1 20.5,16A1.5,1.5 0 0,1 22,17.5V18M23,12L2,21V14L17,12L2,10V3L23,12Z"}))},Fce=B1.memo?B1.memo(t8):t8,$ce=Fce;const zce=Qe($ce);function Uce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var j1=Uce(P),Vce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},n8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Hce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return j1.createElement("svg",Vce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),j1.createElement("path",{d:"M2 3V10L17 12L2 14V21L23 12M22 15.5L18.5 19L16.5 17L15 18.5L18.5 22L23.5 17Z"}))},Wce=j1.memo?j1.memo(n8):n8,Gce=Wce;const Kce=Qe(Gce);function Fk({relays:e,onChange:t}){const n=(r,o)=>{t(r,o?"remove":"add")};return w.jsx(ve,{p:2,children:e.length===0?w.jsx(me,{children:"No relays found."}):e.map(r=>w.jsxs(pt,{mb:1,children:[w.jsx(Ge,{as:r.data.isReady?jk:Qc,color:r.data.isReady?"green.500":"red.500"}),w.jsx(me,{children:r.data.url}),w.jsx(Xs,{}),w.jsx(Ge,{as:r.data.write?Kce:zce,color:r.data.write?"green.500":"red.500"}),w.jsx(NI,{isChecked:r.isAssigned,onChange:()=>n(r.data.url,r.isAssigned),isDisabled:r.data.write===!1})]},r.data.url))})}const $k=e=>{const[t,n]=Z(I=>[I.connected&&I.keystore!=="none",I.keypairIsLoaded]),[r,o]=P.useState(!1),[i,a]=P.useState([]),[s,l]=Z(I=>[I.keystore,I.keypair]),u=t||n?void 0:"Login and connect to send events.",[c,f]=P.useState(e.kind||"NewShortTextNote"),[d,h]=P.useState(""),p=[{label:"NewShortTextNote",icon:w.jsx(Ge,{as:nce}),disabled:e.isResponse||!1},{label:"NewLongFormContent",icon:w.jsx(Ge,{as:lce}),disabled:e.isResponse||!1},{label:"NewShortTextNoteResponse",icon:w.jsx(Ge,{as:Nk}),disabled:c!=="NewShortTextNoteResponse"},{label:"NewRecommendRelay",icon:w.jsx(Ge,{as:wce}),disabled:e.isResponse||!1},{label:"NewQuoteRepost",icon:w.jsx(Ge,{as:Bk}),disabled:c!=="NewQuoteRepost"}],m=Vi(),{isOpen:_,onOpen:b,onClose:g}=Wn(),[E,T]=P.useState([]),O=E.filter(I=>I.isAssigned).length,A=(I,R)=>{T(E.map(k=>k.data.url===I?{...k,isAssigned:R==="add"}:k))};P.useEffect(()=>{const I=e.relayUrls?e.relayUrls:void 0,R=I&&I.length>0?I[0]:"";Z.getState().getRelays().then(k=>{k&&T(k.map(M=>R===M.url&&M.write||M.isReady&&M.write?{data:M,isAssigned:!0}:{data:M,isAssigned:!1}))})},[]);const C=I=>{if(I.content==="")return{error:"Event content is required"};if(s&&s==="none")return{error:"Keystore is required"};if(!l)return{error:"Keypair is required"}},y=()=>{h(""),f("NewShortTextNote"),a([])},S=I=>{a([I]),m({title:"Error",description:I,status:"error",duration:5e3,isClosable:!0})},v=I=>{m({title:"Success",description:I,status:"success",duration:5e3,isClosable:!0})},x=async()=>{o(!0),a([]);const I=E.map(N=>N.data.url);if(I.length===0){S("Select at least one relay"),o(!1);return}const R=xce(c,d,I[0],e);if(R.error){S(R.error),o(!1);return}const k=R.event,M=C(k);if(M!=null&&M.error){S(M.error),o(!1);return}try{const N=await Z.getState().signAndSendEvent({event:k,relayUrls:I});N&&(v(`Event sent: ${Uu(k.content,20)}`),y(),o(!1),e.sendCallback&&e.sendCallback(N))}catch(N){let D="";N instanceof Error?D=N.message:D=N?N.toString():"Unknown error",S(D),o(!1);return}};return w.jsxs(ve,{width:"100%",children:[w.jsxs(Jn,{marginBottom:4,children:[w.jsx(In,{children:"Content"}),w.jsx(Ht,{type:"text",as:c==="NewLongFormContent"?QS:Ht,value:d,onChange:I=>h(I.target.value),placeholder:"Enter event content"})]}),w.jsx(pt,{marginBottom:4,children:p.map(I=>w.jsx(um,{variant:"outline","aria-label":I.label,icon:I.icon,onClick:()=>f(I.label),isActive:c===I.label,isDisabled:I.disabled},I.label))}),i.map((I,R)=>w.jsx(ve,{color:"red.500",children:I},R)),u&&w.jsx(ve,{color:"red.500",paddingBottom:2,children:u}),_&&w.jsx(Fk,{relays:E,onChange:A}),w.jsxs(ud,{children:[w.jsx(be,{type:"submit",variant:"solid",onClick:x,leftIcon:w.jsx(Ge,{as:Yue}),isDisabled:!t||O===0,isLoading:r,children:"Send"}),w.jsxs(be,{variant:"outline",onClick:_?g:b,children:["Select relays (",O,")"]})]})]})};function r8(e){const{isOpen:t,onOpen:n,onClose:r}=Wn(),o=()=>{r()};return w.jsxs(w.Fragment,{children:[w.jsx(be,{size:(e==null?void 0:e.buttonSize)||"md",onClick:n,children:"Post message"}),w.jsxs($r,{isOpen:t,onClose:r,children:[w.jsx(Vr,{}),w.jsxs(zr,{children:[w.jsx(Ur,{children:"Broadcast to the Network"}),w.jsx(Wr,{}),w.jsx(Hr,{children:w.jsx($k,{sendCallback:o})}),w.jsx(yd,{children:w.jsx(be,{colorScheme:"blue",mr:3,onClick:r,children:"Close"})})]})]})]})}const Xce=Object.keys(ar).map(e=>({name:e,value:ar[e]})),qce=e=>{const t=Xce.find(n=>n.value===e);return t?t.name:"Unknown"},Yce=e=>e.map(qce).join(", ");function Zce(){const[e,t]=P.useState([]),[n,r]=P.useState(null),{isOpen:o,onOpen:i,onClose:a}=Wn(),s=async()=>{const c=await Z.getState().getSubscriptions();c&&t(c)};P.useEffect(()=>{(async()=>{await s()})();const f=setInterval(s,3e3);return()=>clearInterval(f)},[]);const l=w.jsxs($r,{isOpen:o,onClose:a,size:"xl",children:[" ",w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",w.jsx(Ur,{children:"Filters"}),w.jsx(Wr,{}),w.jsxs(Hr,{overflowY:"auto",children:[" ",w.jsx("pre",{children:n})]})]})]}),u=c=>{var d;const f=c.options&&c.options.view?c.options.view:"";return w.jsxs(ka,{children:[w.jsx(Nt,{children:c.type}),w.jsx(Nt,{children:w.jsx(l1,{label:c.relayUrl,children:c.relayUrl.substring(6)})}),w.jsx(Nt,{children:w.jsx(me,{fontSize:"sm",children:c.filters&&c.filters.kinds&&Yce(c.filters.kinds)})}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(JSON.stringify(c.filters,null,2)),i()},children:"Show"})}),w.jsx(Nt,{children:w.jsx(l1,{label:f,children:Uu(f,5)})}),w.jsx(Nt,{children:(d=c.options)==null?void 0:d.timeoutIn}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>Z.getState().unsubscribe([c.id]),children:"Unsubscribe"})})]},c.id)};return w.jsxs(ve,{children:[w.jsxs(wd,{variant:"simple",marginBottom:4,children:[w.jsx(pm,{children:w.jsxs(ka,{children:[w.jsx(Bt,{children:"Type"}),w.jsx(Bt,{children:"Relay"}),w.jsx(Bt,{children:"Kind"}),w.jsx(Bt,{children:"Filter"}),w.jsx(Bt,{children:"View"}),w.jsx(Bt,{children:"Timeout"}),w.jsx(Bt,{children:"Action"})]})}),w.jsx(mm,{children:e.map(c=>u(c))})]}),l]})}function Qce(){const[e,t]=P.useState([]),[n,r]=P.useState(null),[o,i]=P.useState(!1),{isOpen:a,onOpen:s,onClose:l}=Wn(),u=async()=>{await Z.getState().getRelays().then(p=>{p&&t(p)})};P.useEffect(()=>{u();const p=setInterval(u,2e3);return()=>clearInterval(p)},[]);const c=async p=>{i(!0);const m=!p.read;await Z.getState().updateRelay(p.url,{read:m}),await u(),i(!1)},f=async p=>{i(!0);const m=!p.write;await Z.getState().updateRelay(p.url,{write:m}),await u(),i(!1)},d=w.jsxs($r,{isOpen:a,onClose:l,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:"Relay"}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:n&&n.info&&w.jsx("pre",{children:w.jsx("code",{children:JSON.stringify(n.info,null,2)})})})]})]}),h=p=>w.jsxs(ka,{children:[w.jsx(Nt,{children:w.jsx(Ge,{as:p.isReady?jk:Qc,color:p.isReady?"green.500":"red.500"})}),w.jsx(Nt,{children:p.url}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(p),s()},children:"Show"})}),w.jsx(Nt,{children:w.jsx(W2,{isChecked:p.read,onChange:()=>c(p),isDisabled:o})}),w.jsx(Nt,{children:w.jsx(W2,{isChecked:p.write,onChange:()=>f(p),isDisabled:o})}),w.jsx(Nt,{children:p.error})]},p.url);return w.jsxs(ve,{children:[w.jsxs(wd,{variant:"simple",marginBottom:4,children:[w.jsx(pm,{children:w.jsxs(ka,{children:[w.jsx(Bt,{children:"Ready"}),w.jsx(Bt,{children:"Url"}),w.jsx(Bt,{children:"Info"}),w.jsx(Bt,{children:"Read"}),w.jsx(Bt,{children:"Write"}),w.jsx(Bt,{children:"Error"})]})}),w.jsx(mm,{children:e.map(p=>h(p))})]}),d]})}function Jce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var F1=Jce(P),efe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},o8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=tfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return F1.createElement("svg",efe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),F1.createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z"}))},nfe=F1.memo?F1.memo(o8):o8,rfe=nfe;const xg=Qe(rfe);function ofe(){const[e,t]=P.useState([]),[n,r]=P.useState(null),{isOpen:o,onOpen:i,onClose:a}=Wn(),s=async()=>{await Z.getState().getQueueItems().then(d=>{d&&t(d)})};P.useEffect(()=>{s();const d=setInterval(s,3e3);return()=>clearInterval(d)},[]);const l=d=>!!d.error,u=d=>d.error?d.error:"",c=w.jsxs($r,{isOpen:o,onClose:a,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:"Queue Item Detail"}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:n&&w.jsx("pre",{children:w.jsx("code",{children:JSON.stringify(n,null,2)})})})]})]}),f=d=>w.jsxs(ka,{children:[w.jsx(Nt,{children:d.relayUrl}),w.jsx(Nt,{children:w.jsx(l1,{label:d.event.id,children:Uu(d.event.id,5)})}),w.jsx(Nt,{children:w.jsxs(pt,{children:[d.pow?w.jsx(me,{children:d.pow}):w.jsx(me,{children:"0"}),w.jsx(me,{children:"/"}),w.jsx(Ge,{as:d.powDone?xg:Qc})]})}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(d),i()},children:"Show"})}),w.jsx(Nt,{children:w.jsx(Ge,{as:d.send?xg:Qc,marginRight:1})}),w.jsxs(Nt,{children:[w.jsx(Ge,{as:d.accepted?xg:Qc}),l(d)&&w.jsx(me,{color:"red.500",children:u(d)})]})]},`${d.event.id}_${d.relayUrl}`);return w.jsxs(ve,{children:[w.jsxs(wd,{variant:"simple",marginBottom:4,children:[w.jsx(pm,{children:w.jsxs(ka,{children:[w.jsx(Bt,{children:"Relay"}),w.jsx(Bt,{children:"Event ID"}),w.jsx(Bt,{children:"POW / Done"}),w.jsx(Bt,{children:"Info"}),w.jsx(Bt,{children:"Send"}),w.jsx(Bt,{children:"Accepted"})]})}),w.jsx(mm,{children:e.map(d=>({item:d}&&f(d)))})]}),c]})}function ife(){const{colorMode:e,toggleColorMode:t}=X0(),[n,r]=P.useState(0),[o]=Z(M=>[M.relayEvents]),[i,a]=P.useState(0),[s,l]=P.useState(0),[u,c]=P.useState(0),[f,d]=P.useState(0),[h,p]=P.useState(0),m=Vi(),_=async()=>{if(Z.getState().status==="loading")return;const M=await Z.getState().countUsers();M&&r(M);const N=await Z.getState().getSubscriptions({isActive:!0});N&&c(N.length);const D=await Z.getState().getRelays();D&&d(D.length);const L=await Z.getState().getQueueItems();L&&p(L.length);const j=await Z.getState().getAllUsersBlocked();j&&a(j.length)};P.useEffect(()=>{const M=setInterval(async()=>await _(),2e3);return()=>clearInterval(M)},[]);const b=async(M,N)=>{!M||!N||await Z.getState().relayAuth(M,N)};P.useEffect(()=>{const M=o.length;if(M>0){const N=M-s;if(N>0){l(M);const D=o.slice(-N);for(const L of D){let j="",F="",B=!0;if(L.data[0]===pl.NOTICE)j=L.data[1],F=`${L.meta.url}`;else if(L.data[0]===pl.OK)B=L.data[2],j=B?"Event accepted":"Event rejected",F=`${L.meta.url}`;else{if(L.data[0]===pl.EOSE)return;if(L.data[0]===pl.COUNT)j="Received count",F=`${L.meta.url} #${L.data[1]}: ${JSON.stringify(L.data[2])} events`;else if(L.data[0]===pl.AUTH){j="Authentication requested",F=`${L.meta.url}`;const U=Z.getState().keystore;!U||U==="none"?F+=" but no account is available to sign the challenge.":b(L.meta.url,L.data[1])}}F!==""&&m({title:j,position:"top-right",description:F,status:B?"info":"error",duration:5e3,isClosable:!0})}}}},[o]);const{isOpen:g,onOpen:E,onClose:T}=Wn(),O=w.jsxs($r,{isOpen:g,onClose:T,size:"xl",children:[" ",w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",w.jsx(Ur,{children:w.jsx(jo,{size:"lg",children:"Subscriptions"})}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:w.jsx(Zce,{})})]})]}),{isOpen:A,onOpen:C,onClose:y}=Wn(),S=w.jsxs($r,{isOpen:A,onClose:y,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:w.jsx(jo,{size:"lg",children:"Relays"})}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:w.jsx(Qce,{})})]})]}),{isOpen:v,onOpen:x,onClose:I}=Wn(),R=w.jsxs($r,{isOpen:v,onClose:I,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:w.jsx(jo,{size:"lg",children:"Queue"})}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:w.jsx(ofe,{})})]})]}),[k]=yJ("(max-width: 600px)");return w.jsxs(ve,{position:"fixed",bottom:0,left:0,right:0,p:3,backgroundColor:"background",children:[k?w.jsxs(pt,{spacing:4,children:[w.jsxs(be,{variant:"outline",size:"sm",onClick:t,children:["Toggle ",e==="light"?"Dark":"Light"]}),w.jsx(r8,{buttonSize:"sm"}),w.jsxs(VS,{children:[w.jsx(WS,{as:be,size:"sm",children:"Actions"}),w.jsxs(HS,{children:[w.jsx(Qo,{children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Users:"}),w.jsx(me,{fontSize:"sm",children:n})]})}),w.jsx(Qo,{children:w.jsx(vn,{as:h1,to:"/blocked",children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Blocked Users:"}),w.jsx(me,{fontSize:"sm",children:i})]})})}),w.jsx(Qo,{children:w.jsx(vn,{onClick:A?y:C,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Relays:"}),w.jsx(me,{fontSize:"sm",children:f})]})})}),w.jsx(Qo,{children:w.jsx(vn,{onClick:v?I:x,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Queue:"}),w.jsx(me,{fontSize:"sm",children:h})]})})}),w.jsx(Qo,{children:w.jsx(vn,{onClick:g?T:E,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Subscriptions:"}),w.jsx(me,{fontSize:"sm",children:u})]})})}),w.jsx(Qo,{children:w.jsx(vn,{href:"https://github.com/franzos/nostr-ts",children:w.jsxs(me,{children:["NostrOP source (v","0.0.4",")"]})})})]})]})]}):w.jsx(pt,{spacing:4,children:w.jsxs(w.Fragment,{children:[w.jsxs(be,{variant:"outline",size:"sm",onClick:t,children:["Toggle ",e==="light"?"Dark":"Light"]}),w.jsx(r8,{buttonSize:"sm"}),w.jsx(Xs,{}),w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Users:"}),w.jsx(me,{fontSize:"sm",children:n})]}),w.jsx(vn,{as:h1,to:"/blocked",children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Blocked Users:"}),w.jsx(me,{fontSize:"sm",children:i})]})}),w.jsx(vn,{onClick:A?y:C,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Relays:"}),w.jsx(me,{fontSize:"sm",children:f})]})}),w.jsx(vn,{onClick:v?I:x,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Queue:"}),w.jsx(me,{fontSize:"sm",children:h})]})}),w.jsx(vn,{onClick:g?T:E,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Subscriptions:"}),w.jsx(me,{fontSize:"sm",children:u})]})}),w.jsx(vn,{href:"https://github.com/franzos/nostr-ts",children:w.jsxs(me,{fontSize:"xs",children:["NostrOP v","0.0.4"]})})]})}),O,S,R]})}function fc({label:e,value:t,to:n,leftIcon:r}){return w.jsx(vn,{as:h1,to:n,w:"100%",padding:2,borderRadius:5,bg:"blackAlpha.50",border:"1px solid",borderColor:"whiteAlpha.100",_hover:{backgroundColor:"blackAlpha.400"},_activeLink:{backgroundColor:"blackAlpha.300"},children:w.jsxs(pt,{children:[r,w.jsx(me,{fontSize:"md",fontWeight:"bold",children:e}),t&&w.jsx(me,{fontSize:"md",children:t})]})})}function afe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var $1=afe(P),sfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},i8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=lfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return $1.createElement("svg",sfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),$1.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M3,13V18L3,20H10V18H5V13H3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M14,15H20V19H14V15Z"}))},ufe=$1.memo?$1.memo(i8):i8,cfe=ufe;const ffe=Qe(cfe);function dfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var z1=dfe(P),hfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},a8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=pfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return z1.createElement("svg",hfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),z1.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3.88,13.46L2.46,14.88L4.59,17L2.46,19.12L3.88,20.54L6,18.41L8.12,20.54L9.54,19.12L7.41,17L9.54,14.88L8.12,13.46L6,15.59L3.88,13.46M14,15H20V19H14V15Z"}))},mfe=z1.memo?z1.memo(a8):a8,yfe=mfe;const gfe=Qe(yfe);function vfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var U1=vfe(P),wfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},s8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=bfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return U1.createElement("svg",wfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),U1.createElement("path",{d:"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"}))},Sfe=U1.memo?U1.memo(s8):s8,_fe=Sfe;const Efe=Qe(_fe);function Cfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var V1=Cfe(P),xfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},l8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ofe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return V1.createElement("svg",xfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),V1.createElement("path",{d:"M11 10V12H9V14H7V12H5.8C5.4 13.2 4.3 14 3 14C1.3 14 0 12.7 0 11S1.3 8 3 8C4.3 8 5.4 8.8 5.8 10H11M3 10C2.4 10 2 10.4 2 11S2.4 12 3 12 4 11.6 4 11 3.6 10 3 10M16 14C18.7 14 24 15.3 24 18V20H8V18C8 15.3 13.3 14 16 14M16 12C13.8 12 12 10.2 12 8S13.8 4 16 4 20 5.8 20 8 18.2 12 16 12Z"}))},Afe=V1.memo?V1.memo(l8):l8,Pfe=Afe;const Tfe=Qe(Pfe);function Ife(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var H1=Ife(P),Rfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},u8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=kfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return H1.createElement("svg",Rfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),H1.createElement("path",{d:"M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"}))},Mfe=H1.memo?H1.memo(u8):u8,Dfe=Mfe;const zk=Qe(Dfe);function Lfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var W1=Lfe(P),Nfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},c8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Bfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return W1.createElement("svg",Nfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),W1.createElement("path",{d:"M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z"}))},jfe=W1.memo?W1.memo(c8):c8,Ffe=jfe;const Uk=Qe(Ffe);function $fe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var G1=$fe(P),zfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},f8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ufe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return G1.createElement("svg",zfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),G1.createElement("path",{d:"M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.09 20.21,11.09 20.42,11.3L21.7,12.58C21.91,12.79 21.91,13.14 21.7,13.35M12,18.94L18.06,12.88L20.11,14.93L14.06,21H12V18.94M12,14C7.58,14 4,15.79 4,18V20H10V18.11L14,14.11C13.34,14.03 12.67,14 12,14M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4Z"}))},Vfe=G1.memo?G1.memo(f8):f8,Hfe=Vfe;const Wfe=Qe(Hfe);function hp(e){return Object.entries(e).map(([t,{read:n,write:r}])=>({url:t,read:n,write:r}))}function Gfe({isOpen:e,onClose:t}){const[n,r]=P.useState(hp(ow)),[o,i]=P.useState(""),[a,s]=P.useState(!1),[l,u]=P.useState(!1),c=Vi(),f=async p=>{if(s(!0),window.nostr&&window.nostr.getRelays)try{const m=await window.nostr.getRelays();r(hp(m)),s(!1)}catch(m){console.error("Error loading relays:",m);let _="Unknown error";m instanceof Error&&(_=m.message),c({title:"Error loading relays",description:_,status:"error",duration:5e3,isClosable:!0}),s(!1)}else{console.log(`Nostr extention not ready, retry ${p}`);const m=p?p+1:1;if(m>2){c({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),s(!1);return}setTimeout(()=>f(m),1e3)}},d=()=>{r(hp(ow))};P.useEffect(()=>{const p=localStorage.getItem("nostr-client:relays");p&&r(JSON.parse(p))},[]);const h=async()=>{u(!0),localStorage.setItem("nostr-client:relays",JSON.stringify(n)),await Z.getState().connect(n),u(!1),t()};return w.jsxs($r,{isOpen:e,onClose:t,children:[w.jsx(Vr,{}),w.jsxs(zr,{children:[w.jsx(Ur,{children:"Connect to Relay(s)"}),w.jsx(Wr,{}),w.jsxs(Hr,{children:[w.jsxs(me,{children:["You can find a list of relays in the nostr-ts repository",w.jsx(vn,{marginLeft:1,href:"https://github.com/franzos/nostr-ts/blob/master/discovered-relays.json",isExternal:!0,color:"blue.500",children:"github.com/franzos/nostr-ts"}),",",w.jsx(vn,{marginLeft:1,marginRight:1,href:"https://nostr.info/relays/",isExternal:!0,color:"blue.500",children:"nostr.info"}),"and elsewhere."]}),w.jsx(As,{spacing:3,width:"100%",children:n&&n.map(p=>w.jsxs(B2,{width:"100%",alignItems:"center",py:2,children:[w.jsx(me,{flex:"1",marginLeft:"2",children:p.url}),w.jsx(be,{ml:"auto",onClick:()=>{const m=n.filter(_=>_.url!==p.url);r(m)},children:"Remove"})]},p.url))}),w.jsxs(B2,{direction:"row",alignItems:"center",pt:4,children:[w.jsx(Ht,{flex:"1",value:o,onChange:p=>i(p.target.value),placeholder:"Enter new relay URL"}),w.jsx(be,{ml:2,onClick:()=>{o.trim()!==""&&(r([...n,{url:o,read:!0,write:!0}]),i(""))},children:"Add"})]}),w.jsxs(ud,{children:[w.jsx(be,{isLoading:a,onClick:()=>f(),size:"xs",marginTop:2,children:"Load from nos2x"}),w.jsx(be,{isLoading:a,onClick:d,size:"xs",marginTop:2,children:"Reset"})]})]}),w.jsx(yd,{children:w.jsx(be,{variant:"outline",isDisabled:n.length===0,isLoading:l,onClick:h,children:"Connect"})})]})]})}const Vk="/nostr-ts/assets/logo-2c2a6c00.svg";function Kfe(){const[e,t,n]=Z(f=>{var d;return[f.connected,f.keystore,((d=f.keypair)==null?void 0:d.publicKey)||""]}),[r,o]=P.useState(0),{isOpen:i,onOpen:a,onClose:s}=Wn(),l=async()=>{if(!Z.getState().connected)return;const f=await Z.getState().getAllUsersFollowing();f&&o(f.length)},u=async()=>{await Z.getState().connect(hp(ow))};P.useEffect(()=>{const f=setInterval(l,1e3);return u(),()=>clearInterval(f)},[]);const c=w.jsxs(As,{align:"start",spacing:5,children:[w.jsx(fc,{label:"Home",to:"/",leftIcon:w.jsx(Ge,{as:Efe,marginRight:1})}),e&&w.jsxs(w.Fragment,{children:[w.jsx(fc,{label:"Following",value:r,to:"/following",leftIcon:w.jsx(Ge,{as:zk,marginRight:1})}),w.jsx(fc,{label:"Lists",to:"/lists",leftIcon:w.jsx(Ge,{as:Uk,marginRight:1})}),n&&n!==""&&w.jsx(fc,{label:"Profile",to:"/profile",leftIcon:w.jsx(Ge,{as:Wfe,marginRight:1})})]}),w.jsx(fc,{label:"Account",value:t,to:"/account",leftIcon:w.jsx(Ge,{as:Tfe,marginRight:1})}),e?w.jsxs(be,{w:"100%",variant:"outline",onClick:Z.getState().disconnect,children:[w.jsx(Ge,{as:gfe,marginRight:1}),"Disconnect"]}):w.jsx(be,{w:"100%",variant:"solid",onClick:a,leftIcon:w.jsx(Ge,{as:ffe}),children:"Connect to relay(s)"})]});return w.jsxs(w.Fragment,{children:[w.jsxs(I5,{maxW:"8xl",p:5,marginBottom:14,children:[w.jsxs(As,{spacing:5,align:"stretch",children:[w.jsx(As,{spacing:1,align:"start",children:w.jsx(Bu,{height:"30px",src:Vk})}),w.jsxs(ju,{templateColumns:["1fr","1fr 4fr"],gap:20,children:[c,w.jsx(ve,{children:w.jsx(xre,{})})]})]}),Gfe({isOpen:i,onOpen:a,onClose:s})]}),w.jsx(ife,{})]})}function Xfe({data:e,isOpen:t,onClose:n}){const r=`/e/${GR(d_.NoteIDs,[{type:0,value:e.event.id}])}`,o=e.eventRelayUrls?e.eventRelayUrls[0]:"Unknown (from local DB)";return w.jsxs($r,{isOpen:t,onClose:n,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:"Event"}),w.jsx(Wr,{}),w.jsxs(Hr,{overflowY:"auto",children:[w.jsxs(me,{children:["Link:"," ",w.jsx(vn,{as:Ff,to:r,children:r})]}),w.jsxs(me,{children:["Relay: ",o]}),w.jsx(ve,{m:4,children:w.jsx("pre",{children:w.jsx("code",{children:JSON.stringify(e.event,null,2)})})})]})]})]})}function qfe({note:e,index:t}){const o=P.useRef(""),i=P.useRef([]),[a]=Z(f=>[f.connected]),[s]=Z(f=>[f.events[e]?f.events[e][0]:null]),[l,u]=P.useState(!1),c=async(f=0)=>{if(f>20){u(!0);return}await Z.getState().getEvent(o.current,{view:e,retryCount:f,relayUrls:i.current})||setTimeout(()=>c(f+1),1e3)};return P.useEffect(()=>{try{const f=Cd(e);for(const d of f.tlvItems)d.type===0?o.current=d.value:d.type===1&&i.current.push(d.value)}catch(f){console.error(f);return}e&&a&&(!t||t<=2)&&c()},[e,t,a]),w.jsx(ve,{p:1,m:1,children:s?w.jsx(Dm,{data:s,level:0}):l?w.jsxs(me,{fontSize:"sm",color:"gray.500",children:["Couldn't find ",e,"."]}):w.jsxs(me,{fontSize:"sm",color:"gray.500",children:["Loading ... ",e]})})}function Yfe({npub:e}){const[t]=Z(f=>[f.status]),n=P.useRef(null),[r,o]=P.useState(""),[i,a]=P.useState(""),[s,l]=P.useState(!1),u=f=>{const d=f.user.data;return d&&d.display_name?`@${d.display_name}`:""},c=async(f,d=0)=>{if(d>20){l(!1);return}const h=await Z.getState().getUser(f);h?(o(u(h)),l(!1)):(d===2&&await Z.getState().requestInformation({idsOrKeys:[f],source:"users"},{timeoutIn:1e4}),setTimeout(()=>c(f,d+1),1e3))};return P.useEffect(()=>{if(!(!e||!["online","offline"].includes(t)))try{const d=Cd(e).tlvItems.find(h=>h.type===0);d&&(n.current=d.value,a(`/p/${e}`),l(!0),c(n.current))}catch(f){console.error("Error decoding bech32:",f)}},[t,e]),w.jsx(w.Fragment,{children:e?w.jsx(vn,{as:h1,to:i,color:"gray.500",children:r===""||s?Uu(e,10):r}):w.jsx(w.Fragment,{children:"..."})})}function Zfe({text:e}){if(!e)return null;const t=/(https?:\/\/[^\s]+)/g,n=/(?:nostr:)?(note[0-9a-zA-Z]+|nevent[0-9a-zA-Z]+)/g,r=/(?:nostr:)?(npub[0-9a-zA-Z]+|nprofile[0-9a-zA-Z]+)/g,o=/#[a-zA-Z0-9]+/g,i=e.split(/(https?:\/\/[^\s]+|(?:nostr:)?note[0-9a-zA-Z]+|(?:nostr:)?npub[0-9a-zA-Z]+|(?:nostr:)?nprofile[0-9a-zA-Z]+|(?:nostr:)?nevent[0-9a-zA-Z]+|#[a-zA-Z0-9]+)/g);return w.jsx(w.Fragment,{children:i.map((a,s)=>{if(t.test(a))return w.jsx(vn,{color:"gray.500",href:a,target:"_blank",rel:"noopener noreferrer",children:Uu(a,40)},s);if(n.test(a)){const l=a.split(":").pop();return l&&w.jsx(qfe,{note:l,index:s},s)}if(r.test(a)){const l=a.split(":").pop();return w.jsx(Yfe,{npub:l},s)}return o.test(a)?w.jsx(vn,{as:Ff,to:`/t/${encodeURIComponent(a.slice(1))}`,color:"gray.500",children:a},s):a})})}function Qfe({content:e}){return w.jsx(w.Fragment,{children:e&&e!==""&&w.jsx(ve,{overflowWrap:"break-word",wordBreak:"break-word",pl:2,pr:2,pt:1,pb:1,background:"blackAlpha.100",borderRadius:4,style:{overflowWrap:"anywhere"},children:w.jsx(Zfe,{text:e})})})}const w_=({text:e})=>{const t=e||"Just a sec ... Searching the Matrix.";return w.jsxs(ve,{textAlign:"center",children:[w.jsx(me,{children:t}),w.jsx(sm,{p:4,mt:2})]})};function Jfe({data:e,isOpen:t,sendCallback:n,level:r}){const o=`event-${e.event.id}_replies`,[i,a]=P.useState(!1),[s]=Z(u=>[u.events[`event-${e.event.id}_replies`]]),l=async()=>{a(!0);try{await Z.getState().getEventReplies(e.event.id,o,!0)}catch(u){console.error(u)}if(s&&s.length>0){await Z.getState().requestInformation({source:"events:related",idsOrKeys:[...s.map(c=>c.event.id)]},{timeoutIn:2e4,view:o,isLive:!0});let u=s.map(c=>c.event.pubkey);u=[...new Set(u)],await Z.getState().requestInformation({source:"users",idsOrKeys:[...u]},{timeoutIn:1e4,view:o,isLive:!0})}a(!1)};return P.useEffect(()=>{t&&l()},[t]),w.jsxs(w.Fragment,{children:[t&&w.jsx(ve,{padding:4,marginBottom:2,marginTop:2,background:"background",borderRadius:4,children:w.jsx($k,{isResponse:!0,inResponseTo:e.event,relayUrls:e.eventRelayUrls,kind:"NewShortTextNoteResponse",sendCallback:n})}),s&&t&&s.map(u=>{const c=u.user?u.user:{pubkey:u.event.pubkey};return w.jsx(ve,{marginLeft:10,mb:1,children:w.jsx(Dm,{data:u,level:r+1})},`${u.event.id}_${c.pubkey}_replies`)}),i&&t&&w.jsx(w_,{text:"Just a sec ... Loading replies."})]})}const ede=({contentWarning:e,setShowNSFWContent:t})=>w.jsxs(be,{size:"sm",width:"100%",overflowWrap:"break-word",wordBreak:"break-all",onClick:()=>t(!0),children:["Show content"," ",e&&e!==""?`(${e})`:"(NSFW)"]});function tde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var K1=tde(P),nde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},d8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=rde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return K1.createElement("svg",nde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),K1.createElement("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"}))},ode=K1.memo?K1.memo(d8):d8,ide=ode;const ade=Qe(ide);function sde(e){return e?Object.keys(e).filter(t=>t!=="+"&&t!=="-").reduce((t,n)=>(t[n]=e[n],t),{}):{}}const lde=e=>{const t=new Date,n=new Date(e*1e3),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3),i=Math.floor(o/60),a=Math.floor(i/60);return o<60?`${o} seconds ago`:i<60?`${i} minutes ago`:a<24?`${a} hours ago`:`${n.toLocaleDateString()} ${n.toLocaleTimeString()}`};function ude(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var X1=ude(P),cde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},h8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=fde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return X1.createElement("svg",cde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),X1.createElement("path",{d:"M17.06 11.57C17.65 10.88 18 10 18 9C18 7.14 16.73 5.57 15 5.13V3H13V5H11V3H9V5H6V7H8V17H6V19H9V21H11V19H13V21H15V19C17.21 19 19 17.21 19 15C19 13.55 18.22 12.27 17.06 11.57M10 7H14C15.1 7 16 7.9 16 9S15.1 11 14 11H10V7M15 17H10V13H15C16.1 13 17 13.9 17 15S16.1 17 15 17Z"}))},dde=X1.memo?X1.memo(h8):h8,hde=dde;const pde=Qe(hde);function mde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var q1=mde(P),yde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},p8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=gde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return q1.createElement("svg",yde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),q1.createElement("path",{d:"M19,15H23V3H19M15,3H6C5.17,3 4.46,3.5 4.16,4.22L1.14,11.27C1.05,11.5 1,11.74 1,12V14A2,2 0 0,0 3,16H9.31L8.36,20.57C8.34,20.67 8.33,20.77 8.33,20.88C8.33,21.3 8.5,21.67 8.77,21.94L9.83,23L16.41,16.41C16.78,16.05 17,15.55 17,15V5C17,3.89 16.1,3 15,3Z"}))},vde=q1.memo?q1.memo(p8):p8,wde=vde;const bde=Qe(wde);function Sde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Y1=Sde(P),_de=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},m8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ede(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return Y1.createElement("svg",_de({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Y1.createElement("path",{d:"M23,10C23,8.89 22.1,8 21,8H14.68L15.64,3.43C15.66,3.33 15.67,3.22 15.67,3.11C15.67,2.7 15.5,2.32 15.23,2.05L14.17,1L7.59,7.58C7.22,7.95 7,8.45 7,9V19A2,2 0 0,0 9,21H18C18.83,21 19.54,20.5 19.84,19.78L22.86,12.73C22.95,12.5 23,12.26 23,12V10M1,21H5V9H1V21Z"}))},Cde=Y1.memo?Y1.memo(m8):m8,xde=Cde;const Ode=Qe(xde);function Ade({isReady:e,level:t,repliesCount:n,reactionsCount:r,repostCount:o,zapReceiptCount:i,zapReceiptAmount:a,isReplyOpen:s,onReplyOpen:l,onReplyClose:u,onAction:c}){return w.jsxs(pt,{children:[w.jsx(be,{size:"xs",variant:"outline",color:"gray.500",colorScheme:"blue",leftIcon:w.jsx(Ge,{as:Nk}),onClick:()=>s?u():l(),isDisabled:!e||t>=2,children:n}),w.jsx(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Upvote",leftIcon:w.jsx(Ge,{as:Ode}),onClick:()=>c("reaction","+"),isDisabled:!e,children:(r==null?void 0:r["+"])||0}),w.jsx(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Downvote",leftIcon:w.jsx(Ge,{as:bde}),onClick:()=>c("reaction","-"),isDisabled:!e,children:(r==null?void 0:r["-"])||0}),w.jsx(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Repost",leftIcon:w.jsx(Ge,{as:Bk}),onClick:()=>c("quote"),isDisabled:!e,children:o}),w.jsxs(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"ZAP",leftIcon:w.jsx(Ge,{as:pde}),onClick:()=>c("zap"),isDisabled:!e,children:[i," (",a,")"]})]})}const Pde=({isReady:e,createdAt:t,level:n,repliesCount:r,reactionsCount:o,repostCount:i,zapReceiptCount:a,zapReceiptAmount:s,isReplyOpen:l,onReplyOpen:u,onReplyClose:c,isInfoModalOpen:f,onInfoModalOpen:d,onInfoModalClose:h,onAction:p})=>{const m=sde(o);return w.jsx(rZ,{p:1,pl:2,pr:2,children:w.jsxs(As,{align:"stretch",children:[w.jsx(ve,{overflowWrap:"break-word",wordBreak:"break-word",children:m&&Object.keys(m).map(_=>w.jsxs(be,{size:"xs",variant:"outline","aria-label":"Repost",isDisabled:!0,m:.5,children:[_," ",m[_]]},_))}),w.jsx(ve,{children:w.jsxs(pt,{children:[w.jsx(Ade,{isReady:e,level:n,repliesCount:r,reactionsCount:o,repostCount:i,zapReceiptCount:a,zapReceiptAmount:s,isReplyOpen:l,onReplyOpen:u,onReplyClose:c,onAction:p}),w.jsx(Xs,{}),w.jsx(me,{fontSize:12,color:"gray.500",children:lde(t)}),w.jsx(um,{"aria-label":"Event info",size:"xs",variant:"outline",color:"gray.500",icon:w.jsx(Ge,{as:ade}),onClick:()=>f?h():d()})]})})]})})};var Hk={},Wk={},dt={},Tde=function(t,n,r){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},i.type=n.type||"text/javascript",i.charset=n.charset||"utf8",i.async="async"in n?!!n.async:!0,i.src=t,n.attrs&&Ide(i,n.attrs),n.text&&(i.text=""+n.text);var a="onload"in i?y8:Rde;a(i,r),i.onload||y8(i,r),o.appendChild(i)};function Ide(e,t){for(var n in t)e.setAttribute(n,t[n])}function y8(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function Rde(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var kde=function(t){return Mde(t)&&!Dde(t)};function Mde(e){return!!e&&typeof e=="object"}function Dde(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Bde(e)}var Lde=typeof Symbol=="function"&&Symbol.for,Nde=Lde?Symbol.for("react.element"):60103;function Bde(e){return e.$$typeof===Nde}function jde(e){return Array.isArray(e)?[]:{}}function Uf(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Au(jde(e),e,t):e}function Fde(e,t,n){return e.concat(t).map(function(r){return Uf(r,n)})}function $de(e,t){if(!t.customMerge)return Au;var n=t.customMerge(e);return typeof n=="function"?n:Au}function zde(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function g8(e){return Object.keys(e).concat(zde(e))}function Gk(e,t){try{return t in e}catch{return!1}}function Ude(e,t){return Gk(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function Vde(e,t,n){var r={};return n.isMergeableObject(e)&&g8(e).forEach(function(o){r[o]=Uf(e[o],n)}),g8(t).forEach(function(o){Ude(e,o)||(Gk(e,o)&&n.isMergeableObject(t[o])?r[o]=$de(o,n)(e[o],t[o],n):r[o]=Uf(t[o],n))}),r}function Au(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Fde,n.isMergeableObject=n.isMergeableObject||kde,n.cloneUnlessOtherwiseSpecified=Uf;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):Vde(e,t,n):Uf(t,n)}Au.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Au(r,o,n)},{})};var Hde=Au,Kk=Hde;Object.defineProperty(dt,"__esModule",{value:!0});dt.parseStartTime=nhe;dt.parseEndTime=rhe;dt.randomString=ohe;dt.queryString=ihe;dt.getSDK=ahe;dt.getConfig=she;dt.omit=lhe;dt.callPlayer=uhe;dt.isMediaStream=che;dt.isBlobUrl=fhe;dt.supportsWebKitPresentationMode=dhe;var Wde=Xk(Tde),Gde=Xk(Kk);function Xk(e){return e&&e.__esModule?e:{default:e}}function Kde(e,t){return Zde(e)||Yde(e,t)||qde(e,t)||Xde()}function Xde(){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 qde(e,t){if(e){if(typeof e=="string")return v8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v8(e,t)}}function v8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(o)throw i}}return n}}function Zde(e){if(Array.isArray(e))return e}var Qde=/[?&#](?:start|t)=([0-9hms]+)/,Jde=/[?&#]end=([0-9hms]+)/,hw=/(\d+)(h|m|s)/g,ehe=/^\d+$/;function qk(e,t){if(!(e instanceof Array)){var n=e.match(t);if(n){var r=n[1];if(r.match(hw))return the(r);if(ehe.test(r))return parseInt(r)}}}function the(e){for(var t=0,n=hw.exec(e);n!==null;){var r=n,o=Kde(r,3),i=o[1],a=o[2];a==="h"&&(t+=parseInt(i,10)*60*60),a==="m"&&(t+=parseInt(i,10)*60),a==="s"&&(t+=parseInt(i,10)),n=hw.exec(e)}return t}function nhe(e){return qk(e,Qde)}function rhe(e){return qk(e,Jde)}function ohe(){return Math.random().toString(36).substr(2,5)}function ihe(e){return Object.keys(e).map(function(t){return"".concat(t,"=").concat(e[t])}).join("&")}function Og(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}var fl={};function ahe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Wde.default,i=Og(t);return i&&r(i)?Promise.resolve(i):new Promise(function(a,s){if(fl[e]){fl[e].push({resolve:a,reject:s});return}fl[e]=[{resolve:a,reject:s}];var l=function(f){fl[e].forEach(function(d){return d.resolve(f)})};if(n){var u=window[n];window[n]=function(){u&&u(),l(Og(t))}}o(e,function(c){c?(fl[e].forEach(function(f){return f.reject(c)}),fl[e]=null):n||l(Og(t))})})}function she(e,t){return(0,Gde.default)(t.config,e.config)}function lhe(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?r-1:0),i=1;i0&&arguments[0]!==void 0?arguments[0]:document.createElement("video"),t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.canPlay=xe.FLV_EXTENSIONS=xe.DASH_EXTENSIONS=xe.HLS_EXTENSIONS=xe.VIDEO_EXTENSIONS=xe.AUDIO_EXTENSIONS=xe.MATCH_URL_KALTURA=xe.MATCH_URL_VIDYARD=xe.MATCH_URL_MIXCLOUD=xe.MATCH_URL_DAILYMOTION=xe.MATCH_URL_TWITCH_CHANNEL=xe.MATCH_URL_TWITCH_VIDEO=xe.MATCH_URL_WISTIA=xe.MATCH_URL_STREAMABLE=xe.MATCH_URL_FACEBOOK_WATCH=xe.MATCH_URL_FACEBOOK=xe.MATCH_URL_VIMEO=xe.MATCH_URL_SOUNDCLOUD=xe.MATCH_URL_YOUTUBE=void 0;var w8=dt;function hhe(e,t){var n;if(typeof Symbol>"u"||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=phe(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){n=e[Symbol.iterator]()},n:function(){var u=n.next();return i=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function phe(e,t){if(e){if(typeof e=="string")return b8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b8(e,t)}}function b8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nL.length)&&(j=L.length);for(var F=0,B=new Array(j);F"u"||!(Symbol.iterator in Object(L)))){var F=[],B=!0,U=!1,K=void 0;try{for(var W=L[Symbol.iterator](),Q;!(B=(Q=W.next()).done)&&(F.push(Q.value),!(j&&F.length===j));B=!0);}catch(X){U=!0,K=X}finally{try{!B&&W.return!=null&&W.return()}finally{if(U)throw K}}return F}}function p(L){if(Array.isArray(L))return L}function m(L,j){if(!(L instanceof j))throw new TypeError("Cannot call a class as a function")}function _(L,j){for(var F=0;F"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function y(L){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},y(L)}function S(L,j,F){return j in L?Object.defineProperty(L,j,{value:F,enumerable:!0,configurable:!0,writable:!0}):L[j]=F,L}var v="https://www.youtube.com/iframe_api",x="YT",I="onYouTubeIframeAPIReady",R=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,k=/user\/([a-zA-Z0-9_-]+)\/?/,M=/youtube-nocookie\.com/,N="https://www.youtube-nocookie.com",D=function(L){g(F,L);var j=T(F);function F(){var B;m(this,F);for(var U=arguments.length,K=new Array(U),W=0;W1&&arguments[1]!==void 0?arguments[1]:!1;this.callPlayer("seekTo",U),!K&&!this.props.playing&&this.pause()}},{key:"setVolume",value:function(U){this.callPlayer("setVolume",U*100)}},{key:"setPlaybackRate",value:function(U){this.callPlayer("setPlaybackRate",U)}},{key:"setLoop",value:function(U){this.callPlayer("setLoop",U)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var U=this.props.display,K={width:"100%",height:"100%",display:U};return n.default.createElement("div",{style:K},n.default.createElement("div",{ref:this.ref}))}}]),F}(n.Component);e.default=D,S(D,"displayName","YouTube"),S(D,"canPlay",o.canPlay.youtube)}(Ag)),Ag}var Pg={},_8;function vhe(){return _8||(_8=1,function(e){function t(C){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(S){return typeof S}:t=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},t(C)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return i=function(){return C},C}function a(C){if(C&&C.__esModule)return C;if(C===null||t(C)!=="object"&&typeof C!="function")return{default:C};var y=i();if(y&&y.has(C))return y.get(C);var S={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in C)if(Object.prototype.hasOwnProperty.call(C,x)){var I=v?Object.getOwnPropertyDescriptor(C,x):null;I&&(I.get||I.set)?Object.defineProperty(S,x,I):S[x]=C[x]}return S.default=C,y&&y.set(C,S),S}function s(C,y){var S=Object.keys(C);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(C);y&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(C,x).enumerable})),S.push.apply(S,v)}return S}function l(C){for(var y=1;y"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(C){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},g(C)}function E(C,y,S){return y in C?Object.defineProperty(C,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):C[y]=S,C}var T="https://w.soundcloud.com/player/api.js",O="SC",A=function(C){d(S,C);var y=p(S);function S(){var v;u(this,S);for(var x=arguments.length,I=new Array(x),R=0;R1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seekTo",x*1e3),I||this.pause()}},{key:"setVolume",value:function(x){this.callPlayer("setVolume",x*100)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var x=this.props.display,I={width:"100%",height:"100%",display:x};return n.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:I,frameBorder:0,allow:"autoplay"})}}]),S}(n.Component);e.default=A,E(A,"displayName","SoundCloud"),E(A,"canPlay",o.canPlay.soundcloud),E(A,"loopOnEnded",!0)}(Pg)),Pg}var Tg={},E8;function whe(){return E8||(E8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(y,S){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);S&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var T="https://player.vimeo.com/api/player.js",O="Vimeo",A=function(S){return S.replace("/manage/videos","")},C=function(y){d(v,y);var S=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"setMuted",value:function(I){this.callPlayer("setMuted",I)}},{key:"setLoop",value:function(I){this.callPlayer("setLoop",I)}},{key:"setPlaybackRate",value:function(I){this.callPlayer("setPlaybackRate",I)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var I=this.props.display,R={width:"100%",height:"100%",overflow:"hidden",display:I};return n.default.createElement("div",{key:this.props.url,ref:this.ref,style:R})}}]),v}(n.Component);e.default=C,E(C,"displayName","Vimeo"),E(C,"canPlay",o.canPlay.vimeo),E(C,"forceLoad",!0)}(Tg)),Tg}var Ig={},C8;function bhe(){return C8||(C8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(){return s=Object.assign||function(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(y){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},b(y)}function g(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var E="https://connect.facebook.net/en_US/sdk.js",T="FB",O="fbAsyncInit",A="facebook-player-",C=function(y){f(v,y);var S=h(v);function v(){var x;l(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I=this.props.config.attributes,R={width:"100%",height:"100%"};return n.default.createElement("div",s({style:R,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"},I))}}]),v}(n.Component);e.default=C,g(C,"displayName","Facebook"),g(C,"canPlay",o.canPlay.facebook),g(C,"loopOnEnded",!0)}(Ig)),Ig}var Rg={},x8;function She(){return x8||(x8=1,function(e){function t(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(C){return typeof C}:t=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t(O)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return i=function(){return O},O}function a(O){if(O&&O.__esModule)return O;if(O===null||t(O)!=="object"&&typeof O!="function")return{default:O};var A=i();if(A&&A.has(O))return A.get(O);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in O)if(Object.prototype.hasOwnProperty.call(O,S)){var v=y?Object.getOwnPropertyDescriptor(O,S):null;v&&(v.get||v.set)?Object.defineProperty(C,S,v):C[S]=O[S]}return C.default=O,A&&A.set(O,C),C}function s(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function l(O,A){for(var C=0;C"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _(O){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},_(O)}function b(O,A,C){return A in O?Object.defineProperty(O,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[A]=C,O}var g="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs",T=function(O){c(C,O);var A=d(C);function C(){var y;s(this,C);for(var S=arguments.length,v=new Array(S),x=0;x1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",S),v||this.pause()}},{key:"setVolume",value:function(S){this.callPlayer("setVolume",S*100)}},{key:"setLoop",value:function(S){this.callPlayer("setLoop",S)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var S=this.props.url.match(o.MATCH_URL_STREAMABLE)[1],v={width:"100%",height:"100%"};return n.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat(S),frameBorder:"0",scrolling:"no",style:v,allow:"encrypted-media; autoplay; fullscreen;"})}}]),C}(n.Component);e.default=T,b(T,"displayName","Streamable"),b(T,"canPlay",o.canPlay.streamable)}(Rg)),Rg}var kg={},O8;function _he(){return O8||(O8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(y,S){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);S&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var T="https://fast.wistia.com/assets/external/E-v1.js",O="Wistia",A="wistia-player-",C=function(y){d(v,y);var S=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("time",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("volume",I)}},{key:"setPlaybackRate",value:function(I){this.callPlayer("playbackRate",I)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I=this.props.url,R=I&&I.match(o.MATCH_URL_WISTIA)[1],k="wistia_embed wistia_async_".concat(R),M={width:"100%",height:"100%"};return n.default.createElement("div",{id:this.playerID,key:R,className:k,style:M})}}]),v}(n.Component);e.default=C,E(C,"displayName","Wistia"),E(C,"canPlay",o.canPlay.wistia),E(C,"loopOnEnded",!0)}(kg)),kg}var Mg={},A8;function Ehe(){return A8||(A8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(y,S){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);S&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var T="https://player.twitch.tv/js/embed/v1.js",O="Twitch",A="twitch-player-",C=function(y){d(v,y);var S=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I={width:"100%",height:"100%"};return n.default.createElement("div",{style:I,id:this.playerID})}}]),v}(n.Component);e.default=C,E(C,"displayName","Twitch"),E(C,"canPlay",o.canPlay.twitch),E(C,"loopOnEnded",!0)}(Mg)),Mg}var Dg={},P8;function Che(){return P8||(P8=1,function(e){function t(k){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(N){return typeof N}:t=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},t(k)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var k=new WeakMap;return i=function(){return k},k}function a(k){if(k&&k.__esModule)return k;if(k===null||t(k)!=="object"&&typeof k!="function")return{default:k};var M=i();if(M&&M.has(k))return M.get(k);var N={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in k)if(Object.prototype.hasOwnProperty.call(k,L)){var j=D?Object.getOwnPropertyDescriptor(k,L):null;j&&(j.get||j.set)?Object.defineProperty(N,L,j):N[L]=k[L]}return N.default=k,M&&M.set(k,N),N}function s(k,M){var N=Object.keys(k);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(k);M&&(D=D.filter(function(L){return Object.getOwnPropertyDescriptor(k,L).enumerable})),N.push.apply(N,D)}return N}function l(k){for(var M=1;Mk.length)&&(M=k.length);for(var N=0,D=new Array(M);N"u"||!(Symbol.iterator in Object(k)))){var N=[],D=!0,L=!1,j=void 0;try{for(var F=k[Symbol.iterator](),B;!(D=(B=F.next()).done)&&(N.push(B.value),!(M&&N.length===M));D=!0);}catch(U){L=!0,j=U}finally{try{!D&&F.return!=null&&F.return()}finally{if(L)throw j}}return N}}function p(k){if(Array.isArray(k))return k}function m(k,M){if(!(k instanceof M))throw new TypeError("Cannot call a class as a function")}function _(k,M){for(var N=0;N"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function y(k){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(N){return N.__proto__||Object.getPrototypeOf(N)},y(k)}function S(k,M,N){return M in k?Object.defineProperty(k,M,{value:N,enumerable:!0,configurable:!0,writable:!0}):k[M]=N,k}var v="https://api.dmcdn.net/all.js",x="DM",I="dmAsyncInit",R=function(k){g(N,k);var M=T(N);function N(){var D;m(this,N);for(var L=arguments.length,j=new Array(L),F=0;F1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",L),j||this.pause()}},{key:"setVolume",value:function(L){this.callPlayer("setVolume",L)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var L=this.props.display,j={width:"100%",height:"100%",display:L};return n.default.createElement("div",{style:j},n.default.createElement("div",{ref:this.ref}))}}]),N}(n.Component);e.default=R,S(R,"displayName","DailyMotion"),S(R,"canPlay",o.canPlay.dailymotion),S(R,"loopOnEnded",!0)}(Dg)),Dg}var Lg={},T8;function xhe(){return T8||(T8=1,function(e){function t(C){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(S){return typeof S}:t=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},t(C)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return i=function(){return C},C}function a(C){if(C&&C.__esModule)return C;if(C===null||t(C)!=="object"&&typeof C!="function")return{default:C};var y=i();if(y&&y.has(C))return y.get(C);var S={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in C)if(Object.prototype.hasOwnProperty.call(C,x)){var I=v?Object.getOwnPropertyDescriptor(C,x):null;I&&(I.get||I.set)?Object.defineProperty(S,x,I):S[x]=C[x]}return S.default=C,y&&y.set(C,S),S}function s(C,y){var S=Object.keys(C);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(C);y&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(C,x).enumerable})),S.push.apply(S,v)}return S}function l(C){for(var y=1;y"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(C){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},g(C)}function E(C,y,S){return y in C?Object.defineProperty(C,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):C[y]=S,C}var T="https://widget.mixcloud.com/media/js/widgetApi.js",O="Mixcloud",A=function(C){d(S,C);var y=p(S);function S(){var v;u(this,S);for(var x=arguments.length,I=new Array(x),R=0;R1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",x),I||this.pause()}},{key:"setVolume",value:function(x){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var x=this.props,I=x.url,R=x.config,k=I.match(o.MATCH_URL_MIXCLOUD)[1],M={width:"100%",height:"100%"},N=(0,r.queryString)(l(l({},R.options),{},{feed:"/".concat(k,"/")}));return n.default.createElement("iframe",{key:k,ref:this.ref,style:M,src:"https://www.mixcloud.com/widget/iframe/?".concat(N),frameBorder:"0",allow:"autoplay"})}}]),S}(n.Component);e.default=A,E(A,"displayName","Mixcloud"),E(A,"canPlay",o.canPlay.mixcloud),E(A,"loopOnEnded",!0)}(Lg)),Lg}var Ng={},I8;function Ohe(){return I8||(I8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(y,S){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);S&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var T="https://play.vidyard.com/embed/v4.js",O="VidyardV4",A="onVidyardAPI",C=function(y){d(v,y);var S=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"setPlaybackRate",value:function(I){this.callPlayer("setPlaybackSpeed",I)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.callPlayer("currentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I=this.props.display,R={width:"100%",height:"100%",display:I};return n.default.createElement("div",{style:R},n.default.createElement("div",{ref:this.ref}))}}]),v}(n.Component);e.default=C,E(C,"displayName","Vidyard"),E(C,"canPlay",o.canPlay.vidyard)}(Ng)),Ng}var Bg={},R8;function Ahe(){return R8||(R8=1,function(e){function t(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(C){return typeof C}:t=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t(O)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return i=function(){return O},O}function a(O){if(O&&O.__esModule)return O;if(O===null||t(O)!=="object"&&typeof O!="function")return{default:O};var A=i();if(A&&A.has(O))return A.get(O);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in O)if(Object.prototype.hasOwnProperty.call(O,S)){var v=y?Object.getOwnPropertyDescriptor(O,S):null;v&&(v.get||v.set)?Object.defineProperty(C,S,v):C[S]=O[S]}return C.default=O,A&&A.set(O,C),C}function s(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function l(O,A){for(var C=0;C"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _(O){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},_(O)}function b(O,A,C){return A in O?Object.defineProperty(O,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[A]=C,O}var g="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs",T=function(O){c(C,O);var A=d(C);function C(){var y;s(this,C);for(var S=arguments.length,v=new Array(S),x=0;x1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",S),v||this.pause()}},{key:"setVolume",value:function(S){this.callPlayer("setVolume",S)}},{key:"setLoop",value:function(S){this.callPlayer("setLoop",S)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var S={width:"100%",height:"100%"};return n.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:S,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}]),C}(n.Component);e.default=T,b(T,"displayName","Kaltura"),b(T,"canPlay",o.canPlay.kaltura)}(Bg)),Bg}var jg={},k8;function Phe(){return k8||(k8=1,function(e){function t(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(j){return typeof j}:t=function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},t(D)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return i=function(){return D},D}function a(D){if(D&&D.__esModule)return D;if(D===null||t(D)!=="object"&&typeof D!="function")return{default:D};var L=i();if(L&&L.has(D))return L.get(D);var j={},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var B in D)if(Object.prototype.hasOwnProperty.call(D,B)){var U=F?Object.getOwnPropertyDescriptor(D,B):null;U&&(U.get||U.set)?Object.defineProperty(j,B,U):j[B]=D[B]}return j.default=D,L&&L.set(D,j),j}function s(){return s=Object.assign||function(D){for(var L=1;L"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(D){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(j){return j.__proto__||Object.getPrototypeOf(j)},b(D)}function g(D,L,j){return L in D?Object.defineProperty(D,L,{value:j,enumerable:!0,configurable:!0,writable:!0}):D[L]=j,D}var E=typeof navigator<"u",T=E&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,O=E&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||T)&&!window.MSStream,A=E&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,C="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",y="Hls",S="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",v="dashjs",x="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",I="flvjs",R=/www\.dropbox\.com\/.+/,k=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,M="https://videodelivery.net/{id}/manifest/video.m3u8",N=function(D){f(j,D);var L=h(j);function j(){var F;l(this,j);for(var B=arguments.length,U=new Array(B),K=0;K1&&arguments[1]!==void 0?arguments[1]:!0;this.player.currentTime=B,U||this.pause()}},{key:"setVolume",value:function(B){this.player.volume=B}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,r.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,r.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(B){try{this.player.playbackRate=B}catch(U){this.props.onError(U)}}},{key:"getDuration",value:function(){if(!this.player)return null;var B=this.player,U=B.duration,K=B.seekable;return U===1/0&&K.length>0?K.end(K.length-1):U}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var B=this.player.buffered;if(B.length===0)return 0;var U=B.end(B.length-1),K=this.getDuration();return U>K?K:U}},{key:"getSource",value:function(B){var U=this.shouldUseHLS(B),K=this.shouldUseDASH(B),W=this.shouldUseFLV(B);if(!(B instanceof Array||(0,r.isMediaStream)(B)||U||K||W))return R.test(B)?B.replace("www.dropbox.com","dl.dropboxusercontent.com"):B}},{key:"render",value:function(){var B=this.props,U=B.url,K=B.playing,W=B.loop,Q=B.controls,X=B.muted,J=B.config,te=B.width,le=B.height,ge=this.shouldUseAudio(this.props),se=ge?"audio":"video",ue={width:te==="auto"?te:"100%",height:le==="auto"?le:"100%"};return n.default.createElement(se,s({ref:this.ref,src:this.getSource(U),style:ue,preload:"auto",autoPlay:K||void 0,controls:Q,muted:X,loop:W},J.attributes),U instanceof Array&&U.map(this.renderSourceElement),J.tracks.map(this.renderTrack))}}]),j}(n.Component);e.default=N,g(N,"displayName","FilePlayer"),g(N,"canPlay",o.canPlay.file)}(jg)),jg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=P,n=dt,r=xe;function o(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(c){return typeof c}:o=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(l)}function i(){if(typeof WeakMap!="function")return null;var l=new WeakMap;return i=function(){return l},l}function a(l){if(l&&l.__esModule)return l;if(l===null||o(l)!=="object"&&typeof l!="function")return{default:l};var u=i();if(u&&u.has(l))return u.get(l);var c={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in l)if(Object.prototype.hasOwnProperty.call(l,d)){var h=f?Object.getOwnPropertyDescriptor(l,d):null;h&&(h.get||h.set)?Object.defineProperty(c,d,h):c[d]=l[d]}return c.default=l,u&&u.set(l,c),c}var s=[{key:"youtube",name:"YouTube",canPlay:r.canPlay.youtube,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(ghe())})})},{key:"soundcloud",name:"SoundCloud",canPlay:r.canPlay.soundcloud,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(vhe())})})},{key:"vimeo",name:"Vimeo",canPlay:r.canPlay.vimeo,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(whe())})})},{key:"facebook",name:"Facebook",canPlay:r.canPlay.facebook,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(bhe())})})},{key:"streamable",name:"Streamable",canPlay:r.canPlay.streamable,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(She())})})},{key:"wistia",name:"Wistia",canPlay:r.canPlay.wistia,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(_he())})})},{key:"twitch",name:"Twitch",canPlay:r.canPlay.twitch,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Ehe())})})},{key:"dailymotion",name:"DailyMotion",canPlay:r.canPlay.dailymotion,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Che())})})},{key:"mixcloud",name:"Mixcloud",canPlay:r.canPlay.mixcloud,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(xhe())})})},{key:"vidyard",name:"Vidyard",canPlay:r.canPlay.vidyard,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Ohe())})})},{key:"kaltura",name:"Kaltura",canPlay:r.canPlay.kaltura,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Ahe())})})},{key:"file",name:"FilePlayer",canPlay:r.canPlay.file,canEnablePIP:function(u){return r.canPlay.file(u)&&(document.pictureInPictureEnabled||(0,n.supportsWebKitPresentationMode)())&&!r.AUDIO_EXTENSIONS.test(u)},lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Phe())})})}];e.default=s})(Wk);var Om={},M8=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function The(e,t){return!!(e===t||M8(e)&&M8(t))}function Ihe(e,t){if(e.length!==t.length)return!1;for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(C){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},E(C)}function T(C,y,S){return y in C?Object.defineProperty(C,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):C[y]=S,C}var O=5e3,A=function(C){h(S,C);var y=m(S);function S(){var v;c(this,S);for(var x=arguments.length,I=new Array(x),R=0;R0&&x<1;if(M){var N=this.player.getDuration();if(!N){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(N*x,R);return}this.player.seekTo(x,R)}},{key:"render",value:function(){var x=this.props.activePlayer;return x?n.default.createElement(x,u({},this.props,{onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError})):null}}]),S}(n.Component);e.default=A,T(A,"displayName","Player"),T(A,"propTypes",o.propTypes),T(A,"defaultProps",o.defaultProps)})(c7);var $g={},L8;function Bhe(){return L8||(L8=1,function(e){function t(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(C){return typeof C}:t=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t(O)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(P);function r(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return r=function(){return O},O}function o(O){if(O&&O.__esModule)return O;if(O===null||t(O)!=="object"&&typeof O!="function")return{default:O};var A=r();if(A&&A.has(O))return A.get(O);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in O)if(Object.prototype.hasOwnProperty.call(O,S)){var v=y?Object.getOwnPropertyDescriptor(O,S):null;v&&(v.get||v.set)?Object.defineProperty(C,S,v):C[S]=O[S]}return C.default=O,A&&A.set(O,C),C}function i(O,A){var C=Object.keys(O);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(O);A&&(y=y.filter(function(S){return Object.getOwnPropertyDescriptor(O,S).enumerable})),C.push.apply(C,y)}return C}function a(O){for(var A=1;A"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _(O){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},_(O)}function b(O,A,C){return A in O?Object.defineProperty(O,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[A]=C,O}var g="64px",E={},T=function(O){c(C,O);var A=d(C);function C(){var y;s(this,C);for(var S=arguments.length,v=new Array(S),x=0;xe.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Q1(e){return Q1=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Q1(e)}function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f7(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return f7=function(){return e},e}function d7(e){if(e&&e.__esModule)return e;if(e===null||Jc(e)!=="object"&&typeof e!="function")return{default:e};var t=f7();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}var Zhe=(0,cs.lazy)(function(){return Promise.resolve().then(function(){return d7(Bhe())})}),Qhe=typeof window<"u"&&window.document,Jhe=typeof fo<"u"&&fo.window&&fo.window.document,epe=Object.keys(Pc.propTypes),tpe=Qhe||Jhe?cs.Suspense:function(){return null},hc=[],npe=function(t,n){var r,o;return o=r=function(i){Khe(s,i);var a=Xhe(s);function s(){var l;Whe(this,s);for(var u=arguments.length,c=new Array(u),f=0;f0&&arguments[0]!==void 0?arguments[0]:"player";return l.player?l.player.getInternalPlayer(d):null}),Vt(Un(l),"seekTo",function(d,h,p){if(!l.player)return null;l.player.seekTo(d,h,p)}),Vt(Un(l),"handleReady",function(){l.props.onReady(Un(l))}),Vt(Un(l),"getActivePlayer",(0,zg.default)(function(d){for(var h=0,p=[].concat(hc,Ug(t));h=t||C<0||f&&y>=i}function b(){var A=Vg();if(_(A))return g(A);s=setTimeout(b,m(A))}function g(A){return s=void 0,d&&r?h(A):(r=o=void 0,a)}function E(){s!==void 0&&clearTimeout(s),u=0,r=l=o=s=void 0}function T(){return s===void 0?a:g(Vg())}function O(){var A=Vg(),C=_(A);if(r=arguments,o=this,l=A,C){if(s===void 0)return p(l);if(f)return s=setTimeout(b,t),h(l)}return s===void 0&&(s=setTimeout(b,t)),a}return O.cancel=E,O.flush=T,O}function gw(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function vpe(e){return!!e&&typeof e=="object"}function wpe(e){return typeof e=="symbol"||vpe(e)&&ppe.call(e)==ope}function U8(e){if(typeof e=="number")return e;if(wpe(e))return z8;if(gw(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=gw(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ipe,"");var n=spe.test(e);return n||lpe.test(e)?upe(e.slice(2),n?2:8):ape.test(e)?z8:+e}var bpe=gpe,y7={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],o=0;o0?1:0):0};ce.lazySlidesOnLeft=v7;var w7=function(t){return t.centerMode?Math.floor((t.slidesToShow-1)/2)+1+(parseInt(t.centerPadding)>0?1:0):t.slidesToShow};ce.lazySlidesOnRight=w7;var J1=function(t){return t&&t.offsetWidth||0};ce.getWidth=J1;var O_=function(t){return t&&t.offsetHeight||0};ce.getHeight=O_;var A_=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r,o,i,a;return r=t.startX-t.curX,o=t.startY-t.curY,i=Math.atan2(o,r),a=Math.round(i*180/Math.PI),a<0&&(a=360-Math.abs(a)),a<=45&&a>=0||a<=360&&a>=315?"left":a>=135&&a<=225?"right":n===!0?a>=35&&a<=135?"up":"down":"vertical"};ce.getSwipeDirection=A_;var P_=function(t){var n=!0;return t.infinite||(t.centerMode&&t.currentSlide>=t.slideCount-1||t.slideCount<=t.slidesToShow||t.currentSlide>=t.slideCount-t.slidesToShow)&&(n=!1),n};ce.canGoNext=P_;var xpe=function(t,n){var r={};return n.forEach(function(o){return r[o]=t[o]}),r};ce.extractObject=xpe;var Ope=function(t){var n=Spe.default.Children.count(t.children),r=t.listRef,o=Math.ceil(J1(r)),i=t.trackRef&&t.trackRef.node,a=Math.ceil(J1(i)),s;if(t.vertical)s=o;else{var l=t.centerMode&&parseInt(t.centerPadding)*2;typeof t.centerPadding=="string"&&t.centerPadding.slice(-1)==="%"&&(l*=o/100),s=Math.ceil((o-l)/t.slidesToShow)}var u=r&&O_(r.querySelector('[data-index="0"]')),c=u*t.slidesToShow,f=t.currentSlide===void 0?t.initialSlide:t.currentSlide;t.rtl&&t.currentSlide===void 0&&(f=n-1-t.initialSlide);var d=t.lazyLoadedList||[],h=E_(Ot(Ot({},t),{},{currentSlide:f,lazyLoadedList:d}));d=d.concat(h);var p={slideCount:n,slideWidth:s,listWidth:o,trackWidth:a,currentSlide:f,slideHeight:u,listHeight:c,lazyLoadedList:d};return t.autoplaying===null&&t.autoplay&&(p.autoplaying="playing"),p};ce.initializedState=Ope;var Ape=function(t){var n=t.waitForAnimate,r=t.animating,o=t.fade,i=t.infinite,a=t.index,s=t.slideCount,l=t.lazyLoad,u=t.currentSlide,c=t.centerMode,f=t.slidesToScroll,d=t.slidesToShow,h=t.useCSS,p=t.lazyLoadedList;if(n&&r)return{};var m=a,_,b,g,E={},T={},O=i?a:g7(a,0,s-1);if(o){if(!i&&(a<0||a>=s))return{};a<0?m=a+s:a>=s&&(m=a-s),l&&p.indexOf(m)<0&&(p=p.concat(m)),E={animating:!0,currentSlide:m,lazyLoadedList:p,targetSlide:m},T={animating:!1,targetSlide:m}}else _=m,m<0?(_=m+s,i?s%f!==0&&(_=s-s%f):_=0):!P_(t)&&m>u?m=_=u:c&&m>=s?(m=i?s:s-1,_=i?0:s-1):m>=s&&(_=m-s,i?s%f!==0&&(_=0):_=s-d),!i&&m+d>=s&&(_=s-d),b=Hf(Ot(Ot({},t),{},{slideIndex:m})),g=Hf(Ot(Ot({},t),{},{slideIndex:_})),i||(b===g&&(m=_),b=g),l&&(p=p.concat(E_(Ot(Ot({},t),{},{currentSlide:m})))),h?(E={animating:!0,currentSlide:_,trackStyle:T_(Ot(Ot({},t),{},{left:b})),lazyLoadedList:p,targetSlide:O},T={animating:!1,currentSlide:_,trackStyle:Vf(Ot(Ot({},t),{},{left:g})),swipeLeft:null,targetSlide:O}):E={currentSlide:_,trackStyle:Vf(Ot(Ot({},t),{},{left:g})),lazyLoadedList:p,targetSlide:O};return{state:E,nextState:T}};ce.slideHandler=Ape;var Ppe=function(t,n){var r,o,i,a,s,l=t.slidesToScroll,u=t.slidesToShow,c=t.slideCount,f=t.currentSlide,d=t.targetSlide,h=t.lazyLoad,p=t.infinite;if(a=c%l!==0,r=a?0:(c-f)%l,n.message==="previous")i=r===0?l:u-r,s=f-i,h&&!p&&(o=f-i,s=o===-1?c-1:o),p||(s=d-l);else if(n.message==="next")i=r===0?l:r,s=f+i,h&&!p&&(s=(f+l)%c+r),p||(s=d+l);else if(n.message==="dots")s=n.index*n.slidesToScroll;else if(n.message==="children"){if(s=n.index,p){var m=E7(Ot(Ot({},t),{},{targetSlide:s}));s>n.currentSlide&&m==="left"?s=s-c:s10)return{scrolling:!0};s&&(g.swipeLength=S);var v=(l?-1:1)*(g.curX>g.startX?1:-1);s&&(v=g.curY>g.startY?1:-1);var x=Math.ceil(m/_),I=A_(n.touchObject,s),R=g.swipeLength;return b||(u===0&&(I==="right"||I==="down")||u+1>=x&&(I==="left"||I==="up")||!P_(n)&&(I==="left"||I==="up"))&&(R=g.swipeLength*c,f===!1&&d&&(d(I),C.edgeDragged=!0)),!h&&E&&(E(I),C.swiped=!0),i?A=y+R*(T/O)*v:l?A=y-R*v:A=y+R*v,s&&(A=y+R*v),C=Ot(Ot({},C),{},{touchObject:g,swipeLeft:A,trackStyle:Vf(Ot(Ot({},n),{},{left:A}))}),Math.abs(g.curX-g.startX)10&&(C.swiping=!0,Is(t)),C}};ce.swipeMove=Rpe;var kpe=function(t,n){var r=n.dragging,o=n.swipe,i=n.touchObject,a=n.listWidth,s=n.touchThreshold,l=n.verticalSwiping,u=n.listHeight,c=n.swipeToSlide,f=n.scrolling,d=n.onSwipe,h=n.targetSlide,p=n.currentSlide,m=n.infinite;if(!r)return o&&Is(t),{};var _=l?u/s:a/s,b=A_(i,l),g={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(f||!i.swipeLength)return g;if(i.swipeLength>_){Is(t),d&&d(b);var E,T,O=m?p:h;switch(b){case"left":case"up":T=O+ww(n),E=c?vw(n,T):T,g.currentDirection=0;break;case"right":case"down":T=O-ww(n),E=c?vw(n,T):T,g.currentDirection=1;break;default:E=O}g.triggerSlideHandler=E}else{var A=Hf(n);g.trackStyle=T_(Ot(Ot({},n),{},{left:A}))}return g};ce.swipeEnd=kpe;var b7=function(t){for(var n=t.infinite?t.slideCount*2:t.slideCount,r=t.infinite?t.slidesToShow*-1:0,o=t.infinite?t.slidesToShow*-1:0,i=[];rr[r.length-1])n=r[r.length-1];else for(var i in r){if(nt.swipeLeft*-1)return r=l,!1}else if(l.offsetLeft-n+J1(l)/2>t.swipeLeft*-1)return r=l,!1;return!0}),!r)return 0;var a=t.rtl===!0?t.slideCount-t.currentSlide:t.currentSlide,s=Math.abs(r.dataset.index-a)||1;return s}else return t.slidesToScroll};ce.getSlideCount=ww;var Im=function(t,n){return n.reduce(function(r,o){return r&&t.hasOwnProperty(o)},!0)?null:console.error("Keys Missing:",t)};ce.checkSpecKeys=Im;var Vf=function(t){Im(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var n,r,o=t.slideCount+2*t.slidesToShow;t.vertical?r=o*t.slideHeight:n=_7(t)*t.slideWidth;var i={opacity:1,transition:"",WebkitTransition:""};if(t.useTransform){var a=t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",s=t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",l=t.vertical?"translateY("+t.left+"px)":"translateX("+t.left+"px)";i=Ot(Ot({},i),{},{WebkitTransform:a,transform:s,msTransform:l})}else t.vertical?i.top=t.left:i.left=t.left;return t.fade&&(i={opacity:1}),n&&(i.width=n),r&&(i.height=r),window&&!window.addEventListener&&window.attachEvent&&(t.vertical?i.marginTop=t.left+"px":i.marginLeft=t.left+"px"),i};ce.getTrackCSS=Vf;var T_=function(t){Im(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var n=Vf(t);return t.useTransform?(n.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,n.transition="transform "+t.speed+"ms "+t.cssEase):t.vertical?n.transition="top "+t.speed+"ms "+t.cssEase:n.transition="left "+t.speed+"ms "+t.cssEase,n};ce.getTrackAnimateCSS=T_;var Hf=function(t){if(t.unslick)return 0;Im(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var n=t.slideIndex,r=t.trackRef,o=t.infinite,i=t.centerMode,a=t.slideCount,s=t.slidesToShow,l=t.slidesToScroll,u=t.slideWidth,c=t.listWidth,f=t.variableWidth,d=t.slideHeight,h=t.fade,p=t.vertical,m=0,_,b,g=0;if(h||t.slideCount===1)return 0;var E=0;if(o?(E=-ef(t),a%l!==0&&n+l>a&&(E=-(n>a?s-(n-a):a%l)),i&&(E+=parseInt(s/2))):(a%l!==0&&n+l>a&&(E=s-a%l),i&&(E=parseInt(s/2))),m=E*u,g=E*d,p?_=n*d*-1+g:_=n*u*-1+m,f===!0){var T,O=r&&r.node;if(T=n+ef(t),b=O&&O.childNodes[T],_=b?b.offsetLeft*-1:0,i===!0){T=o?n+ef(t):n,b=O&&O.children[T],_=0;for(var A=0;At.currentSlide?t.targetSlide>t.currentSlide+C7(t)?"left":"right":t.targetSlide0&&(a+=1),o&&n%2===0&&(a+=1),a}return o?0:n-1};ce.slidesOnRight=C7;var x7=function(t){var n=t.slidesToShow,r=t.centerMode,o=t.rtl,i=t.centerPadding;if(r){var a=(n-1)/2+1;return parseInt(i)>0&&(a+=1),!o&&n%2===0&&(a+=1),a}return o?n-1:0};ce.slidesOnLeft=x7;var Mpe=function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)};ce.canUseDOM=Mpe;var Rm={};function bw(e){"@babel/helpers - typeof";return bw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bw(e)}Object.defineProperty(Rm,"__esModule",{value:!0});Rm.Track=void 0;var aa=O7(P),Hg=O7(Tm),Wg=ce;function O7(e){return e&&e.__esModule?e:{default:e}}function Sw(){return Sw=Object.assign||function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e0(e){return e0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},e0(e)}function W8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t=t.slideCount,t.centerMode?(i=Math.floor(t.slidesToShow/2),r=(a-t.currentSlide)%t.slideCount===0,a>t.currentSlide-i-1&&a<=t.currentSlide+i&&(n=!0)):n=t.currentSlide<=a&&a=t.slideCount?s=t.targetSlide-t.slideCount:s=t.targetSlide;var l=a===s;return{"slick-slide":!0,"slick-active":n,"slick-center":r,"slick-cloned":o,"slick-current":l}},$pe=function(t){var n={};return(t.variableWidth===void 0||t.variableWidth===!1)&&(n.width=t.slideWidth),t.fade&&(n.position="relative",t.vertical?n.top=-t.index*parseInt(t.slideHeight):n.left=-t.index*parseInt(t.slideWidth),n.opacity=t.currentSlide===t.index?1:0,t.useCSS&&(n.transition="opacity "+t.speed+"ms "+t.cssEase+", visibility "+t.speed+"ms "+t.cssEase)),n},Kg=function(t,n){return t.key||n},zpe=function(t){var n,r=[],o=[],i=[],a=aa.default.Children.count(t.children),s=(0,Wg.lazyStartIndex)(t),l=(0,Wg.lazyEndIndex)(t);return aa.default.Children.forEach(t.children,function(u,c){var f,d={message:"children",index:c,slidesToScroll:t.slidesToScroll,currentSlide:t.currentSlide};!t.lazyLoad||t.lazyLoad&&t.lazyLoadedList.indexOf(c)>=0?f=u:f=aa.default.createElement("div",null);var h=$pe(hr(hr({},t),{},{index:c})),p=f.props.className||"",m=Gg(hr(hr({},t),{},{index:c}));if(r.push(aa.default.cloneElement(f,{key:"original"+Kg(f,c),"data-index":c,className:(0,Hg.default)(m,p),tabIndex:"-1","aria-hidden":!m["slick-active"],style:hr(hr({outline:"none"},f.props.style||{}),h),onClick:function(g){f.props&&f.props.onClick&&f.props.onClick(g),t.focusOnSelect&&t.focusOnSelect(d)}})),t.infinite&&t.fade===!1){var _=a-c;_<=(0,Wg.getPreClones)(t)&&a!==t.slidesToShow&&(n=-_,n>=s&&(f=u),m=Gg(hr(hr({},t),{},{index:n})),o.push(aa.default.cloneElement(f,{key:"precloned"+Kg(f,n),"data-index":n,tabIndex:"-1",className:(0,Hg.default)(m,p),"aria-hidden":!m["slick-active"],style:hr(hr({},f.props.style||{}),h),onClick:function(g){f.props&&f.props.onClick&&f.props.onClick(g),t.focusOnSelect&&t.focusOnSelect(d)}}))),a!==t.slidesToShow&&(n=a+c,n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function t0(e){return t0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},t0(e)}var Jpe=function(t){var n;return t.infinite?n=Math.ceil(t.slideCount/t.slidesToScroll):n=Math.ceil((t.slideCount-t.slidesToShow)/t.slidesToScroll)+1,n},e1e=function(e){Xpe(n,e);var t=qpe(n);function n(){return Gpe(this,n),t.apply(this,arguments)}return Kpe(n,[{key:"clickHandler",value:function(o,i){i.preventDefault(),this.props.clickHandler(o)}},{key:"render",value:function(){for(var o=this.props,i=o.onMouseEnter,a=o.onMouseOver,s=o.onMouseLeave,l=o.infinite,u=o.slidesToScroll,c=o.slidesToShow,f=o.slideCount,d=o.currentSlide,h=Jpe({slideCount:f,slidesToScroll:u,slidesToShow:c,infinite:l}),p={onMouseEnter:i,onMouseOver:a,onMouseLeave:s},m=[],_=0;_=T&&d<=g:d===T}),A={message:"dots",index:_,slidesToScroll:u,currentSlide:d},C=this.clickHandler.bind(this,A);m=m.concat(Ph.default.createElement("li",{key:_,className:O},Ph.default.cloneElement(this.props.customPaging(_),{onClick:C})))}return Ph.default.cloneElement(this.props.appendDots(m),Hpe({className:this.props.dotsClass},p))}}]),n}(Ph.default.PureComponent);km.Dots=e1e;var Pu={};function Aw(e){"@babel/helpers - typeof";return Aw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Aw(e)}Object.defineProperty(Pu,"__esModule",{value:!0});Pu.PrevArrow=Pu.NextArrow=void 0;var au=T7(P),P7=T7(Tm),t1e=ce;function T7(e){return e&&e.__esModule?e:{default:e}}function n0(){return n0=Object.assign||function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function o0(e){return o0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},o0(e)}var a1e=function(e){k7(n,e);var t=M7(n);function n(){return I7(this,n),t.apply(this,arguments)}return R7(n,[{key:"clickHandler",value:function(o,i){i&&i.preventDefault(),this.props.clickHandler(o,i)}},{key:"render",value:function(){var o={"slick-arrow":!0,"slick-prev":!0},i=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(this.props.currentSlide===0||this.props.slideCount<=this.props.slidesToShow)&&(o["slick-disabled"]=!0,i=null);var a={key:"0","data-role":"none",className:(0,P7.default)(o),style:{display:"block"},onClick:i},s={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},l;return this.props.prevArrow?l=au.default.cloneElement(this.props.prevArrow,r0(r0({},a),s)):l=au.default.createElement("button",n0({key:"0",type:"button"},a)," ","Previous"),l}}]),n}(au.default.PureComponent);Pu.PrevArrow=a1e;var s1e=function(e){k7(n,e);var t=M7(n);function n(){return I7(this,n),t.apply(this,arguments)}return R7(n,[{key:"clickHandler",value:function(o,i){i&&i.preventDefault(),this.props.clickHandler(o,i)}},{key:"render",value:function(){var o={"slick-arrow":!0,"slick-next":!0},i=this.clickHandler.bind(this,{message:"next"});(0,t1e.canGoNext)(this.props)||(o["slick-disabled"]=!0,i=null);var a={key:"1","data-role":"none",className:(0,P7.default)(o),style:{display:"block"},onClick:i},s={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},l;return this.props.nextArrow?l=au.default.cloneElement(this.props.nextArrow,r0(r0({},a),s)):l=au.default.createElement("button",n0({key:"1",type:"button"},a)," ","Next"),l}}]),n}(au.default.PureComponent);Pu.NextArrow=s1e;var D7=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!Tw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),h1e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Tw||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=d1e.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),L7=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof Tu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new _1e(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Tu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new E1e(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),B7=typeof WeakMap<"u"?new WeakMap:new D7,j7=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=p1e.getInstance(),r=new C1e(t,n,this);B7.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){j7.prototype[e]=function(){var t;return(t=B7.get(this))[e].apply(t,arguments)}});var x1e=function(){return typeof i0.ResizeObserver<"u"?i0.ResizeObserver:j7}();const O1e=Object.freeze(Object.defineProperty({__proto__:null,default:x1e},Symbol.toStringTag,{value:"Module"})),A1e=M6(O1e);Object.defineProperty(Pm,"__esModule",{value:!0});Pm.InnerSlider=void 0;var Qn=Ad(P),P1e=Ad(m7),T1e=Ad(bpe),I1e=Ad(Tm),Mt=ce,R1e=Rm,k1e=km,Q8=Pu,M1e=Ad(A1e);function Ad(e){return e&&e.__esModule?e:{default:e}}function s0(e){"@babel/helpers - typeof";return s0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s0(e)}function l0(){return l0=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function L1e(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function J8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ae(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u0(e){return u0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},u0(e)}function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U1e=function(e){j1e(n,e);var t=F1e(n);function n(r){var o;N1e(this,n),o=t.call(this,r),Fe(je(o),"listRefHandler",function(a){return o.list=a}),Fe(je(o),"trackRefHandler",function(a){return o.track=a}),Fe(je(o),"adaptHeight",function(){if(o.props.adaptiveHeight&&o.list){var a=o.list.querySelector('[data-index="'.concat(o.state.currentSlide,'"]'));o.list.style.height=(0,Mt.getHeight)(a)+"px"}}),Fe(je(o),"componentDidMount",function(){if(o.props.onInit&&o.props.onInit(),o.props.lazyLoad){var a=(0,Mt.getOnDemandLazySlides)(Ae(Ae({},o.props),o.state));a.length>0&&(o.setState(function(l){return{lazyLoadedList:l.lazyLoadedList.concat(a)}}),o.props.onLazyLoad&&o.props.onLazyLoad(a))}var s=Ae({listRef:o.list,trackRef:o.track},o.props);o.updateState(s,!0,function(){o.adaptHeight(),o.props.autoplay&&o.autoPlay("update")}),o.props.lazyLoad==="progressive"&&(o.lazyLoadTimer=setInterval(o.progressiveLazyLoad,1e3)),o.ro=new M1e.default(function(){o.state.animating?(o.onWindowResized(!1),o.callbackTimers.push(setTimeout(function(){return o.onWindowResized()},o.props.speed))):o.onWindowResized()}),o.ro.observe(o.list),document.querySelectorAll&&Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"),function(l){l.onfocus=o.props.pauseOnFocus?o.onSlideFocus:null,l.onblur=o.props.pauseOnFocus?o.onSlideBlur:null}),window.addEventListener?window.addEventListener("resize",o.onWindowResized):window.attachEvent("onresize",o.onWindowResized)}),Fe(je(o),"componentWillUnmount",function(){o.animationEndCallback&&clearTimeout(o.animationEndCallback),o.lazyLoadTimer&&clearInterval(o.lazyLoadTimer),o.callbackTimers.length&&(o.callbackTimers.forEach(function(a){return clearTimeout(a)}),o.callbackTimers=[]),window.addEventListener?window.removeEventListener("resize",o.onWindowResized):window.detachEvent("onresize",o.onWindowResized),o.autoplayTimer&&clearInterval(o.autoplayTimer),o.ro.disconnect()}),Fe(je(o),"componentDidUpdate",function(a){if(o.checkImagesLoad(),o.props.onReInit&&o.props.onReInit(),o.props.lazyLoad){var s=(0,Mt.getOnDemandLazySlides)(Ae(Ae({},o.props),o.state));s.length>0&&(o.setState(function(c){return{lazyLoadedList:c.lazyLoadedList.concat(s)}}),o.props.onLazyLoad&&o.props.onLazyLoad(s))}o.adaptHeight();var l=Ae(Ae({listRef:o.list,trackRef:o.track},o.props),o.state),u=o.didPropsChange(a);u&&o.updateState(l,u,function(){o.state.currentSlide>=Qn.default.Children.count(o.props.children)&&o.changeSlide({message:"index",index:Qn.default.Children.count(o.props.children)-o.props.slidesToShow,currentSlide:o.state.currentSlide}),o.props.autoplay?o.autoPlay("update"):o.pause("paused")})}),Fe(je(o),"onWindowResized",function(a){o.debouncedResize&&o.debouncedResize.cancel(),o.debouncedResize=(0,T1e.default)(function(){return o.resizeWindow(a)},50),o.debouncedResize()}),Fe(je(o),"resizeWindow",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=!!(o.track&&o.track.node);if(s){var l=Ae(Ae({listRef:o.list,trackRef:o.track},o.props),o.state);o.updateState(l,a,function(){o.props.autoplay?o.autoPlay("update"):o.pause("paused")}),o.setState({animating:!1}),clearTimeout(o.animationEndCallback),delete o.animationEndCallback}}),Fe(je(o),"updateState",function(a,s,l){var u=(0,Mt.initializedState)(a);a=Ae(Ae(Ae({},a),u),{},{slideIndex:u.currentSlide});var c=(0,Mt.getTrackLeft)(a);a=Ae(Ae({},a),{},{left:c});var f=(0,Mt.getTrackCSS)(a);(s||Qn.default.Children.count(o.props.children)!==Qn.default.Children.count(a.children))&&(u.trackStyle=f),o.setState(u,l)}),Fe(je(o),"ssrInit",function(){if(o.props.variableWidth){var a=0,s=0,l=[],u=(0,Mt.getPreClones)(Ae(Ae(Ae({},o.props),o.state),{},{slideCount:o.props.children.length})),c=(0,Mt.getPostClones)(Ae(Ae(Ae({},o.props),o.state),{},{slideCount:o.props.children.length}));o.props.children.forEach(function(C){l.push(C.props.style.width),a+=C.props.style.width});for(var f=0;f=s&&o.onWindowResized()};if(!u.onclick)u.onclick=function(){return u.parentNode.focus()};else{var f=u.onclick;u.onclick=function(){f(),u.parentNode.focus()}}u.onload||(o.props.lazyLoad?u.onload=function(){o.adaptHeight(),o.callbackTimers.push(setTimeout(o.onWindowResized,o.props.speed))}:(u.onload=c,u.onerror=function(){c(),o.props.onLazyLoadError&&o.props.onLazyLoadError()}))})}),Fe(je(o),"progressiveLazyLoad",function(){for(var a=[],s=Ae(Ae({},o.props),o.state),l=o.state.currentSlide;l=-(0,Mt.getPreClones)(s);u--)if(o.state.lazyLoadedList.indexOf(u)<0){a.push(u);break}a.length>0?(o.setState(function(c){return{lazyLoadedList:c.lazyLoadedList.concat(a)}}),o.props.onLazyLoad&&o.props.onLazyLoad(a)):o.lazyLoadTimer&&(clearInterval(o.lazyLoadTimer),delete o.lazyLoadTimer)}),Fe(je(o),"slideHandler",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=o.props,u=l.asNavFor,c=l.beforeChange,f=l.onLazyLoad,d=l.speed,h=l.afterChange,p=o.state.currentSlide,m=(0,Mt.slideHandler)(Ae(Ae(Ae({index:a},o.props),o.state),{},{trackRef:o.track,useCSS:o.props.useCSS&&!s})),_=m.state,b=m.nextState;if(_){c&&c(p,_.currentSlide);var g=_.lazyLoadedList.filter(function(E){return o.state.lazyLoadedList.indexOf(E)<0});f&&g.length>0&&f(g),!o.props.waitForAnimate&&o.animationEndCallback&&(clearTimeout(o.animationEndCallback),h&&h(p),delete o.animationEndCallback),o.setState(_,function(){u&&o.asNavForIndex!==a&&(o.asNavForIndex=a,u.innerSlider.slideHandler(a)),b&&(o.animationEndCallback=setTimeout(function(){var E=b.animating,T=D1e(b,["animating"]);o.setState(T,function(){o.callbackTimers.push(setTimeout(function(){return o.setState({animating:E})},10)),h&&h(_.currentSlide),delete o.animationEndCallback})},d))})}}),Fe(je(o),"changeSlide",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=Ae(Ae({},o.props),o.state),u=(0,Mt.changeSlide)(l,a);if(!(u!==0&&!u)&&(s===!0?o.slideHandler(u,s):o.slideHandler(u),o.props.autoplay&&o.autoPlay("update"),o.props.focusOnSelect)){var c=o.list.querySelectorAll(".slick-current");c[0]&&c[0].focus()}}),Fe(je(o),"clickHandler",function(a){o.clickable===!1&&(a.stopPropagation(),a.preventDefault()),o.clickable=!0}),Fe(je(o),"keyHandler",function(a){var s=(0,Mt.keyHandler)(a,o.props.accessibility,o.props.rtl);s!==""&&o.changeSlide({message:s})}),Fe(je(o),"selectHandler",function(a){o.changeSlide(a)}),Fe(je(o),"disableBodyScroll",function(){var a=function(l){l=l||window.event,l.preventDefault&&l.preventDefault(),l.returnValue=!1};window.ontouchmove=a}),Fe(je(o),"enableBodyScroll",function(){window.ontouchmove=null}),Fe(je(o),"swipeStart",function(a){o.props.verticalSwiping&&o.disableBodyScroll();var s=(0,Mt.swipeStart)(a,o.props.swipe,o.props.draggable);s!==""&&o.setState(s)}),Fe(je(o),"swipeMove",function(a){var s=(0,Mt.swipeMove)(a,Ae(Ae(Ae({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));s&&(s.swiping&&(o.clickable=!1),o.setState(s))}),Fe(je(o),"swipeEnd",function(a){var s=(0,Mt.swipeEnd)(a,Ae(Ae(Ae({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));if(s){var l=s.triggerSlideHandler;delete s.triggerSlideHandler,o.setState(s),l!==void 0&&(o.slideHandler(l),o.props.verticalSwiping&&o.enableBodyScroll())}}),Fe(je(o),"touchEnd",function(a){o.swipeEnd(a),o.clickable=!0}),Fe(je(o),"slickPrev",function(){o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"previous"})},0))}),Fe(je(o),"slickNext",function(){o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"next"})},0))}),Fe(je(o),"slickGoTo",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(a=Number(a),isNaN(a))return"";o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"index",index:a,currentSlide:o.state.currentSlide},s)},0))}),Fe(je(o),"play",function(){var a;if(o.props.rtl)a=o.state.currentSlide-o.props.slidesToScroll;else if((0,Mt.canGoNext)(Ae(Ae({},o.props),o.state)))a=o.state.currentSlide+o.props.slidesToScroll;else return!1;o.slideHandler(a)}),Fe(je(o),"autoPlay",function(a){o.autoplayTimer&&clearInterval(o.autoplayTimer);var s=o.state.autoplaying;if(a==="update"){if(s==="hovered"||s==="focused"||s==="paused")return}else if(a==="leave"){if(s==="paused"||s==="focused")return}else if(a==="blur"&&(s==="paused"||s==="hovered"))return;o.autoplayTimer=setInterval(o.play,o.props.autoplaySpeed+50),o.setState({autoplaying:"playing"})}),Fe(je(o),"pause",function(a){o.autoplayTimer&&(clearInterval(o.autoplayTimer),o.autoplayTimer=null);var s=o.state.autoplaying;a==="paused"?o.setState({autoplaying:"paused"}):a==="focused"?(s==="hovered"||s==="playing")&&o.setState({autoplaying:"focused"}):s==="playing"&&o.setState({autoplaying:"hovered"})}),Fe(je(o),"onDotsOver",function(){return o.props.autoplay&&o.pause("hovered")}),Fe(je(o),"onDotsLeave",function(){return o.props.autoplay&&o.state.autoplaying==="hovered"&&o.autoPlay("leave")}),Fe(je(o),"onTrackOver",function(){return o.props.autoplay&&o.pause("hovered")}),Fe(je(o),"onTrackLeave",function(){return o.props.autoplay&&o.state.autoplaying==="hovered"&&o.autoPlay("leave")}),Fe(je(o),"onSlideFocus",function(){return o.props.autoplay&&o.pause("focused")}),Fe(je(o),"onSlideBlur",function(){return o.props.autoplay&&o.state.autoplaying==="focused"&&o.autoPlay("blur")}),Fe(je(o),"render",function(){var a=(0,I1e.default)("slick-slider",o.props.className,{"slick-vertical":o.props.vertical,"slick-initialized":!0}),s=Ae(Ae({},o.props),o.state),l=(0,Mt.extractObject)(s,["fade","cssEase","speed","infinite","centerMode","focusOnSelect","currentSlide","lazyLoad","lazyLoadedList","rtl","slideWidth","slideHeight","listHeight","vertical","slidesToShow","slidesToScroll","slideCount","trackStyle","variableWidth","unslick","centerPadding","targetSlide","useCSS"]),u=o.props.pauseOnHover;l=Ae(Ae({},l),{},{onMouseEnter:u?o.onTrackOver:null,onMouseLeave:u?o.onTrackLeave:null,onMouseOver:u?o.onTrackOver:null,focusOnSelect:o.props.focusOnSelect&&o.clickable?o.selectHandler:null});var c;if(o.props.dots===!0&&o.state.slideCount>=o.props.slidesToShow){var f=(0,Mt.extractObject)(s,["dotsClass","slideCount","slidesToShow","currentSlide","slidesToScroll","clickHandler","children","customPaging","infinite","appendDots"]),d=o.props.pauseOnDotsHover;f=Ae(Ae({},f),{},{clickHandler:o.changeSlide,onMouseEnter:d?o.onDotsLeave:null,onMouseOver:d?o.onDotsOver:null,onMouseLeave:d?o.onDotsLeave:null}),c=Qn.default.createElement(k1e.Dots,f)}var h,p,m=(0,Mt.extractObject)(s,["infinite","centerMode","currentSlide","slideCount","slidesToShow","prevArrow","nextArrow"]);m.clickHandler=o.changeSlide,o.props.arrows&&(h=Qn.default.createElement(Q8.PrevArrow,m),p=Qn.default.createElement(Q8.NextArrow,m));var _=null;o.props.vertical&&(_={height:o.state.listHeight});var b=null;o.props.vertical===!1?o.props.centerMode===!0&&(b={padding:"0px "+o.props.centerPadding}):o.props.centerMode===!0&&(b={padding:o.props.centerPadding+" 0px"});var g=Ae(Ae({},_),b),E=o.props.touchMove,T={className:"slick-list",style:g,onClick:o.clickHandler,onMouseDown:E?o.swipeStart:null,onMouseMove:o.state.dragging&&E?o.swipeMove:null,onMouseUp:E?o.swipeEnd:null,onMouseLeave:o.state.dragging&&E?o.swipeEnd:null,onTouchStart:E?o.swipeStart:null,onTouchMove:o.state.dragging&&E?o.swipeMove:null,onTouchEnd:E?o.touchEnd:null,onTouchCancel:o.state.dragging&&E?o.swipeEnd:null,onKeyDown:o.props.accessibility?o.keyHandler:null},O={className:a,dir:"ltr",style:o.props.style};return o.props.unslick&&(T={className:"slick-list"},O={className:a}),Qn.default.createElement("div",O,o.props.unslick?"":h,Qn.default.createElement("div",l0({ref:o.listRefHandler},T),Qn.default.createElement(R1e.Track,l0({ref:o.trackRefHandler},l),o.props.children)),o.props.unslick?"":p,o.props.unslick?"":c)}),o.list=null,o.track=null,o.state=Ae(Ae({},P1e.default),{},{currentSlide:o.props.initialSlide,slideCount:Qn.default.Children.count(o.props.children)}),o.callbackTimers=[],o.clickable=!0,o.debouncedResize=null;var i=o.ssrInit();return o.state=Ae(Ae({},o.state),i),o}return B1e(n,[{key:"didPropsChange",value:function(o){for(var i=!1,a=0,s=Object.keys(this.props);a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function T(y){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},T(y)}function O(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var A=(0,a.canUseDOM)()&&Q1e(),C=function(y){p(v,y);var S=_(v);function v(x){var I;return f(this,v),I=S.call(this,x),O(g(I),"innerSliderRefHandler",function(R){return I.innerSlider=R}),O(g(I),"slickPrev",function(){return I.innerSlider.slickPrev()}),O(g(I),"slickNext",function(){return I.innerSlider.slickNext()}),O(g(I),"slickGoTo",function(R){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return I.innerSlider.slickGoTo(R,k)}),O(g(I),"slickPause",function(){return I.innerSlider.pause("paused")}),O(g(I),"slickPlay",function(){return I.innerSlider.autoPlay("play")}),I.state={breakpoint:null},I._responsiveMediaHandlers=[],I}return h(v,[{key:"media",value:function(I,R){A.register(I,R),this._responsiveMediaHandlers.push({query:I,handler:R})}},{key:"componentDidMount",value:function(){var I=this;if(this.props.responsive){var R=this.props.responsive.map(function(M){return M.breakpoint});R.sort(function(M,N){return M-N}),R.forEach(function(M,N){var D;N===0?D=(0,o.default)({minWidth:0,maxWidth:M}):D=(0,o.default)({minWidth:R[N-1]+1,maxWidth:M}),(0,a.canUseDOM)()&&I.media(D,function(){I.setState({breakpoint:M})})});var k=(0,o.default)({minWidth:R.slice(-1)[0]});(0,a.canUseDOM)()&&this.media(k,function(){I.setState({breakpoint:null})})}}},{key:"componentWillUnmount",value:function(){this._responsiveMediaHandlers.forEach(function(I){A.unregister(I.query,I.handler)})}},{key:"render",value:function(){var I=this,R,k;this.state.breakpoint?(k=this.props.responsive.filter(function(W){return W.breakpoint===I.state.breakpoint}),R=k[0].settings==="unslick"?"unslick":c(c(c({},i.default),this.props),k[0].settings)):R=c(c({},i.default),this.props),R.centerMode&&(R.slidesToScroll>1,R.slidesToScroll=1),R.fade&&(R.slidesToShow>1,R.slidesToScroll>1,R.slidesToShow=1,R.slidesToScroll=1);var M=n.default.Children.toArray(this.props.children);M=M.filter(function(W){return typeof W=="string"?!!W.trim():!!W}),R.variableWidth&&(R.rows>1||R.slidesPerRow>1)&&(console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"),R.variableWidth=!1);for(var N=[],D=null,L=0;L=M.length));U+=1)B.push(n.default.cloneElement(M[U],{key:100*L+10*F+U,tabIndex:-1,style:{width:"".concat(100/R.slidesPerRow,"%"),display:"inline-block"}}));j.push(n.default.createElement("div",{key:10*L+F},B))}R.variableWidth?N.push(n.default.createElement("div",{key:L,style:{width:D}},j)):N.push(n.default.createElement("div",{key:L},j))}if(R==="unslick"){var K="regular slider "+(this.props.className||"");return n.default.createElement("div",{className:K},M)}else N.length<=R.slidesToShow&&(R.unslick=!0);return n.default.createElement(r.InnerSlider,l({style:this.props.style,ref:this.innerSliderRefHandler},R),N)}}]),v}(n.default.Component);e.default=C})(p7);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(p7);function n(o){return o&&o.__esModule?o:{default:o}}var r=t.default;e.default=r})(h7);const J1e=Qe(h7);function e0e({images:e}){const t={dots:!0,infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1,adaptiveHeight:!0};return w.jsx(J1e,{...t,children:e.map((n,r)=>w.jsx(ve,{children:w.jsx(Bu,{src:n})},r))})}const t0e=({src:e,alt:t})=>w.jsx(Bu,{width:"100%",src:e,fallback:w.jsx(ve,{width:"100%",textAlign:"center",children:w.jsx(me,{children:"Image failed to load."})}),fallbackStrategy:"onError",alt:t}),n0e=({images:e})=>w.jsx(w.Fragment,{children:(e==null?void 0:e.length)===1?w.jsx(t0e,{src:e[0]}):w.jsx(e0e,{images:e})}),r0e=e=>{const[t,n]=P.useState(!1),r=new URL(e.url).hostname,o=$8.canPlay(e.url);return w.jsx(w.Fragment,{children:t?w.jsx(T5,{ratio:16/9,children:w.jsx($8,{url:e.url,controls:!0,width:"100%",height:"100%",fallback:w.jsx(ve,{width:"100%",textAlign:"center",children:w.jsx(me,{children:"Video failed to load."})}),fallbackStrategy:"onError"})}):w.jsx(be,{size:"sm",width:"100%",overflowWrap:"break-word",wordBreak:"break-all",onClick:()=>n(!0),isDisabled:!o,children:o?`Load video from ${r}`:"Cannot play this video."})})},o0e=({videos:e})=>w.jsx(w.Fragment,{children:e.map((t,n)=>w.jsx(r0e,{url:t},n))});function i0e({images:e,videos:t}){return w.jsxs(w.Fragment,{children:[e&&w.jsx(n0e,{images:e}),t&&w.jsx(o0e,{videos:t})]})}function a0e(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var c0=a0e(P),s0e=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},s6=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=l0e(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return c0.createElement("svg",s0e({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),c0.createElement("path",{d:"M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z"}))},u0e=c0.memo?c0.memo(s6):s6,c0e=u0e;const f0e=Qe(c0e);function d0e(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var f0=d0e(P),h0e=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},l6=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=p0e(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return f0.createElement("svg",h0e({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),f0.createElement("path",{d:"M10.5,12A1.5,1.5 0 0,1 12,10.5A1.5,1.5 0 0,1 13.5,12A1.5,1.5 0 0,1 12,13.5A1.5,1.5 0 0,1 10.5,12M10.5,16.5A1.5,1.5 0 0,1 12,15A1.5,1.5 0 0,1 13.5,16.5A1.5,1.5 0 0,1 12,18A1.5,1.5 0 0,1 10.5,16.5M10.5,7.5A1.5,1.5 0 0,1 12,6A1.5,1.5 0 0,1 13.5,7.5A1.5,1.5 0 0,1 12,9A1.5,1.5 0 0,1 10.5,7.5M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z"}))},m0e=f0.memo?f0.memo(l6):l6,y0e=m0e;const g0e=Qe(y0e);function v0e({pubkey:e,isOpen:t,onClose:n}){const[r,o]=P.useState([]),i=Vi(),a=async()=>{const l=await Z.getState().getAllLists(),u=(l==null?void 0:l.map(d=>({id:d.id,title:d.title,isAssigned:!1})))||[],c=await Z.getState().getListsWithUser(e),f=u.map(d=>({...d,isAssigned:!!(c!=null&&c.find(h=>h.id===d.id))}));o(f)};P.useEffect(()=>{t&&a()},[t]);const s=async(l,u)=>{try{u?(await Z.getState().removeUserFromList(l,e),i({title:"User removed from list",status:"success",duration:9e3,isClosable:!0})):(await Z.getState().addUserToList(l,e),i({title:"User added to list",status:"success",duration:9e3,isClosable:!0})),o(c=>c.map(f=>f.id===l?{...f,isAssigned:!u}:f))}catch(c){i({title:"Operation failed",description:c.message||"Something went wrong",status:"error",duration:9e3,isClosable:!0})}};return w.jsxs($r,{isOpen:t,onClose:n,children:[w.jsx(Vr,{}),w.jsxs(zr,{children:[w.jsx(Ur,{children:"Add or Remove from List"}),w.jsx(Wr,{}),w.jsx(Hr,{children:r.length===0?w.jsx(me,{children:"No lists found. Create one first."}):r.map(l=>w.jsxs(pt,{children:[w.jsx(me,{children:l.title}),w.jsx(be,{onClick:()=>s(l.id,l.isAssigned),children:l.isAssigned?"Remove from List":"Add to List"})]},l.id))}),w.jsx(yd,{children:w.jsx(be,{colorScheme:"blue",mr:3,onClick:n,children:"Close"})})]})]})}var z7={exports:{}};(function(e,t){(function(n,r){e.exports=r(P)})(fo,function(n){return function(r){var o={};function i(a){if(o[a])return o[a].exports;var s=o[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=o,i.d=function(a,s,l){i.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:l})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,s){if(1&s&&(a=i(a)),8&s||4&s&&typeof a=="object"&&a&&a.__esModule)return a;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:a}),2&s&&typeof a!="string")for(var u in a)i.d(l,u,(function(c){return a[c]}).bind(null,u));return l},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="/",i(i.s=1)}([function(r,o){r.exports=n},function(r,o,i){r.exports=i(2)},function(r,o,i){function a(S,v,x){return v in S?Object.defineProperty(S,v,{value:x,enumerable:!0,configurable:!0,writable:!0}):S[v]=x,S}function s(S,v){var x=Object.keys(S);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(S);v&&(I=I.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),x.push.apply(x,I)}return x}function l(S,v){if(S==null)return{};var x,I,R=function(M,N){if(M==null)return{};var D,L,j={},F=Object.keys(M);for(L=0;L=0||(j[D]=M[D]);return j}(S,v);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(S);for(I=0;I=0||Object.prototype.propertyIsEnumerable.call(S,x)&&(R[x]=S[x])}return R}i.r(o);var u=i(0),c=i.n(u),f=function(S){for(var v=0,x=0;x=128?"#000000":"#FFFFFF"),backgroundColor:m(M+13,R,N),wrapperTranslateX:j,wrapperTranslateY:B,wrapperRotate:p(M,360),wrapperScale:1+p(M,3)/10,isMouthOpen:h(M,2),isCircle:h(M,1),eyeSpread:p(M,5),mouthSpread:p(M,3),faceRotate:p(M,10,3),faceTranslateX:j>6?j/2:p(M,8,1),faceTranslateY:B>6?B/2:p(M,7,2)}}(S.name,S.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 36 36",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:S.size,height:S.size},S.title&&u.createElement("title",null,S.name),u.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},u.createElement("rect",{width:36,height:36,rx:S.square?void 0:72,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:36,height:36,fill:v.backgroundColor}),u.createElement("rect",{x:"0",y:"0",width:36,height:36,transform:"translate("+v.wrapperTranslateX+" "+v.wrapperTranslateY+") rotate("+v.wrapperRotate+" 18 18) scale("+v.wrapperScale+")",fill:v.wrapperColor,rx:v.isCircle?36:6}),u.createElement("g",{transform:"translate("+v.faceTranslateX+" "+v.faceTranslateY+") rotate("+v.faceRotate+" 18 18)"},v.isMouthOpen?u.createElement("path",{d:"M15 "+(19+v.mouthSpread)+"c2 1 4 1 6 0",stroke:v.faceColor,fill:"none",strokeLinecap:"round"}):u.createElement("path",{d:"M13,"+(19+v.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:v.faceColor}),u.createElement("rect",{x:14-v.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:v.faceColor}),u.createElement("rect",{x:20+v.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:v.faceColor}))))},T=function(S){var v=function(R,k){var M=f(R),N=k&&k.length;return Array.from({length:4},function(D,L){return m(M+L,k,N)})}(S.name,S.colors),x=S.name.replace(/\s/g,""),I=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:S.size,height:S.size},S.title&&u.createElement("title",null,S.name),u.createElement("mask",{id:I,maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:S.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(I,")")},u.createElement("path",{fill:"url(#gradient_paint0_linear_"+x+")",d:"M0 0h80v40H0z"}),u.createElement("path",{fill:"url(#gradient_paint1_linear_"+x+")",d:"M0 40h80v40H0z"})),u.createElement("defs",null,u.createElement("linearGradient",{id:"gradient_paint0_linear_"+x,x1:40,y1:0,x2:40,y2:40,gradientUnits:"userSpaceOnUse"},u.createElement("stop",{stopColor:v[0]}),u.createElement("stop",{offset:1,stopColor:v[1]})),u.createElement("linearGradient",{id:"gradient_paint1_linear_"+x,x1:40,y1:40,x2:40,y2:80,gradientUnits:"userSpaceOnUse"},u.createElement("stop",{stopColor:v[2]}),u.createElement("stop",{offset:1,stopColor:v[3]}))))},O=function(S){var v=function(I,R){var k=f(I),M=R&&R.length;return Array.from({length:3},function(N,D){return{color:m(k+D,R,M),translateX:p(k*(D+1),8,1),translateY:p(k*(D+1),8,2),scale:1.2+p(k*(D+1),4)/10,rotate:p(k*(D+1),360,1)}})}(S.name,S.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:S.size,height:S.size},S.title&&u.createElement("title",null,S.name),u.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:S.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:80,height:80,fill:v[0].color}),u.createElement("path",{filter:"url(#prefix__filter0_f)",d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:v[1].color,transform:"translate("+v[1].translateX+" "+v[1].translateY+") rotate("+v[1].rotate+" 40 40) scale("+v[2].scale+")"}),u.createElement("path",{filter:"url(#prefix__filter0_f)",style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:v[2].color,transform:"translate("+v[2].translateX+" "+v[2].translateY+") rotate("+v[2].rotate+" 40 40) scale("+v[2].scale+")"})),u.createElement("defs",null,u.createElement("filter",{id:"prefix__filter0_f",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},u.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),u.createElement("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),u.createElement("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"}))))},A=["pixel","bauhaus","ring","beam","sunset","marble"],C={geometric:"beam",abstract:"bauhaus"},y=function(S){var v=S.variant,x=v===void 0?"marble":v,I=S.colors,R=I===void 0?["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]:I,k=S.name,M=k===void 0?"Clara Barton":k,N=S.square,D=N!==void 0&&N,L=S.title,j=L!==void 0&&L,F=S.size,B=function(U){for(var K=1;Kt.some(n=>e instanceof n);let u6,c6;function _0e(){return u6||(u6=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function E0e(){return c6||(c6=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const U7=new WeakMap,Rw=new WeakMap,V7=new WeakMap,Jg=new WeakMap,I_=new WeakMap;function C0e(e){const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{n(tf(e.result)),o()},a=()=>{r(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&U7.set(n,e)}).catch(()=>{}),I_.set(t,e),t}function x0e(e){if(Rw.has(e))return;const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",a),e.removeEventListener("abort",a)},i=()=>{n(),o()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",i),e.addEventListener("error",a),e.addEventListener("abort",a)});Rw.set(e,t)}let kw={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Rw.get(e);if(t==="objectStoreNames")return e.objectStoreNames||V7.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return tf(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function O0e(e){kw=e(kw)}function A0e(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(ev(this),t,...n);return V7.set(r,t.sort?t.sort():[t]),tf(r)}:E0e().includes(e)?function(...t){return e.apply(ev(this),t),tf(U7.get(this))}:function(...t){return tf(e.apply(ev(this),t))}}function P0e(e){return typeof e=="function"?A0e(e):(e instanceof IDBTransaction&&x0e(e),S0e(e,_0e())?new Proxy(e,kw):e)}function tf(e){if(e instanceof IDBRequest)return C0e(e);if(Jg.has(e))return Jg.get(e);const t=P0e(e);return t!==e&&(Jg.set(e,t),I_.set(t,e)),t}const ev=e=>I_.get(e),T0e=["get","getKey","getAll","getAllKeys","count"],I0e=["put","add","delete","clear"],tv=new Map;function f6(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(tv.get(t))return tv.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=I0e.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||T0e.includes(n)))return;const i=async function(a,...s){const l=this.transaction(a,o?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(s.shift())),(await Promise.all([u[n](...s),o&&l.done]))[0]};return tv.set(t,i),i}O0e(e=>({...e,get:(t,n,r)=>f6(t,n)||e.get(t,n,r),has:(t,n)=>!!f6(t,n)||e.has(t,n)}));async function nv(e,t){try{let n=await Promise.race([fetch(e,{headers:t}),new Promise((o,i)=>setTimeout(()=>i(new Error("Timeout")),5e3))]);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){throw new Error(`Error making request: ${n}`)}}var R0e=class extends rae{constructor(e){super(e)}async getZapCallbackInfo(e){const t=await nv(e);if(!Mie(t))throw new Error("Lnurl endpoint does not allow Nostr payments. Expected to find 'allowsNostr' in response.");return this.lightningZapInfo=t,console.log("LnurlEndpointResponse",this.lightningZapInfo),this.lightningZapInfo}async getLightningInvoice(e,t){const n=await nv(t);if(n&&n.status==="ERROR")throw new Error(`Error getting lightning invoice: ${n.reason}`);if(!Die(e,n))throw new Error("Lnurl invoice response is invalid or does not match your request.");return console.log("LnurlInvoiceResponse",n),n}async makeZapRequest(e,t){const n=this.getLud16Or06Url();if(n)try{this.hasZapInfo()||await this.getZapCallbackInfo(n.url);const r={...e,recipientPubkey:this.pubkey,lnurl:n.type==="lud16"?nk(this.getLud16()):this.getLud06()},o=Jie(r,this.lightningZapInfo.callback,t);return{...await this.getLightningInvoice(r,o.invoiceUrl),event:o.event}}catch(r){throw new Error(`Error making zap request: ${r}`)}else throw new Error("No lud16 or lud06 url found")}async makeNIP05Request(){const e=this.getNip05Url();if(e)try{return await nv(e)}catch(t){throw new Error(`Error making NIP05 request: ${t}`)}else throw new Error("No nip05 url found")}},k0e=Object.defineProperty,d0=Object.getOwnPropertySymbols,H7=Object.prototype.hasOwnProperty,W7=Object.prototype.propertyIsEnumerable,d6=(e,t,n)=>t in e?k0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M0e=(e,t)=>{for(var n in t||(t={}))H7.call(t,n)&&d6(e,n,t[n]);if(d0)for(var n of d0(t))W7.call(t,n)&&d6(e,n,t[n]);return e},D0e=(e,t)=>{var n={};for(var r in e)H7.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&d0)for(var r of d0(e))t.indexOf(r)<0&&W7.call(e,r)&&(n[r]=e[r]);return n};/** + * @license QR Code generator library (TypeScript) + * Copyright (c) Project Nayuki. + * SPDX-License-Identifier: MIT + */var Vs;(e=>{const t=class{constructor(l,u,c,f){if(this.version=l,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],lt.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let d=[];for(let p=0;p7)throw new RangeError("Invalid value");let p,m;for(p=c;;p++){const E=t.getNumDataCodewords(p,u)*8,T=s.getTotalBits(l,p);if(T<=E){m=T;break}if(p>=f)throw new RangeError("Data too long")}for(const E of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])h&&m<=t.getNumDataCodewords(p,E)*8&&(u=E);let _=[];for(const E of l){r(E.mode.modeBits,4,_),r(E.numChars,E.mode.numCharCountBits(p),_);for(const T of E.getData())_.push(T)}i(_.length==m);const b=t.getNumDataCodewords(p,u)*8;i(_.length<=b),r(0,Math.min(4,b-_.length),_),r(0,(8-_.length%8)%8,_),i(_.length%8==0);for(let E=236;_.lengthg[T>>>3]|=E<<7-(T&7)),new t(p,u,g,d)}getModule(l,u){return 0<=l&&l>>9)*1335;const f=(u<<10|c)^21522;i(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,o(f,d));this.setFunctionModule(8,7,o(f,6)),this.setFunctionModule(8,8,o(f,7)),this.setFunctionModule(7,8,o(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,o(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,o(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,o(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;const u=this.version<<12|l;i(u>>>18==0);for(let c=0;c<18;c++){const f=o(u,c),d=this.size-11+c%3,h=Math.floor(c/3);this.setFunctionModule(d,h,f),this.setFunctionModule(h,d,f)}}drawFinderPattern(l,u){for(let c=-4;c<=4;c++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(c)),h=l+f,p=u+c;0<=h&&h{(E!=m-d||O>=p)&&g.push(T[E])});return i(g.length==h),g}drawCodewords(l){if(l.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let f=0;f>>3],7-(u&7)),u++)}}i(u==l.length*8)}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let u=0;u5&&l++):(this.finderPenaltyAddHistory(p,m),h||(l+=this.finderPenaltyCountPatterns(m)*t.PENALTY_N3),h=this.modules[d][_],p=1);l+=this.finderPenaltyTerminateAndCount(h,p,m)*t.PENALTY_N3}for(let d=0;d5&&l++):(this.finderPenaltyAddHistory(p,m),h||(l+=this.finderPenaltyCountPatterns(m)*t.PENALTY_N3),h=this.modules[_][d],p=1);l+=this.finderPenaltyTerminateAndCount(h,p,m)*t.PENALTY_N3}for(let d=0;dh+(p?1:0),u);const c=this.size*this.size,f=Math.ceil(Math.abs(u*20-c*10)/c)-1;return i(0<=f&&f<=9),l+=f*t.PENALTY_N4,i(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return[];{const l=Math.floor(this.version/7)+2,u=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2;let c=[6];for(let f=this.size-7;c.lengtht.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*l+128)*l+64;if(l>=2){const c=Math.floor(l/7)+2;u-=(25*c-10)*c-55,l>=7&&(u-=36)}return i(208<=u&&u<=29648),u}static getNumDataCodewords(l,u){return Math.floor(t.getNumRawDataModules(l)/8)-t.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l]*t.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let u=[];for(let f=0;f0);for(const f of l){const d=f^c.shift();c.push(0),u.forEach((h,p)=>c[p]^=t.reedSolomonMultiply(h,d))}return c}static reedSolomonMultiply(l,u){if(l>>>8||u>>>8)throw new RangeError("Byte out of range");let c=0;for(let f=7;f>=0;f--)c=c<<1^(c>>>7)*285,c^=(u>>>f&1)*l;return i(c>>>8==0),c}finderPenaltyCountPatterns(l){const u=l[1];i(u<=this.size*3);const c=u>0&&l[2]==u&&l[3]==u*3&&l[4]==u&&l[5]==u;return(c&&l[0]>=u*4&&l[6]>=u?1:0)+(c&&l[6]>=u*4&&l[0]>=u?1:0)}finderPenaltyTerminateAndCount(l,u,c){return l&&(this.finderPenaltyAddHistory(u,c),u=0),u+=this.size,this.finderPenaltyAddHistory(u,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,u){u[0]==0&&(l+=this.size),u.pop(),u.unshift(l)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(l,u,c){if(u<0||u>31||l>>>u)throw new RangeError("Value out of range");for(let f=u-1;f>=0;f--)c.push(l>>>f&1)}function o(l,u){return(l>>>u&1)!=0}function i(l){if(!l)throw new Error("Assertion error")}const a=class{constructor(l,u,c){if(this.mode=l,this.numChars=u,this.bitData=c,u<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(l){let u=[];for(const c of l)r(c,8,u);return new a(a.Mode.BYTE,l.length,u)}static makeNumeric(l){if(!a.isNumeric(l))throw new RangeError("String contains non-numeric characters");let u=[];for(let c=0;c=1<{(t=>{const n=class{constructor(o,i){this.ordinal=o,this.formatBits=i}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Vs||(Vs={}));(e=>{(t=>{const n=class{constructor(o,i){this.modeBits=o,this.numBitsCharCount=i}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Vs||(Vs={}));var Tc=Vs;/** + * @license qrcode.react + * Copyright (c) Paul O'Shannessy + * SPDX-License-Identifier: ISC + */var L0e={L:Tc.QrCode.Ecc.LOW,M:Tc.QrCode.Ecc.MEDIUM,Q:Tc.QrCode.Ecc.QUARTILE,H:Tc.QrCode.Ecc.HIGH},N0e=128,B0e="L",j0e="#FFFFFF",F0e="#000000",$0e=!1,G7=4,z0e=.1;function U0e(e,t=0){const n=[];return e.forEach(function(r,o){let i=null;r.forEach(function(a,s){if(!a&&i!==null){n.push(`M${i+t} ${o+t}h${s-i}v1H${i+t}z`),i=null;return}if(s===r.length-1){if(!a)return;i===null?n.push(`M${s+t},${o+t} h1v1H${s+t}z`):n.push(`M${i+t},${o+t} h${s+1-i}v1H${i+t}z`);return}a&&i===null&&(i=s)})}),n.join("")}function V0e(e,t){return e.slice().map((n,r)=>r=t.y+t.h?n:n.map((o,i)=>i=t.x+t.w?o:!1))}function H0e(e,t,n,r){if(r==null)return null;const o=n?G7:0,i=e.length+o*2,a=Math.floor(t*z0e),s=i/t,l=(r.width||a)*s,u=(r.height||a)*s,c=r.x==null?e.length/2-l/2:r.x*s,f=r.y==null?e.length/2-u/2:r.y*s;let d=null;if(r.excavate){let h=Math.floor(c),p=Math.floor(f),m=Math.ceil(l+c-h),_=Math.ceil(u+f-p);d={x:h,y:p,w:m,h:_}}return{x:c,y:f,h:u,w:l,excavation:d}}(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();function W0e(e){const t=e,{value:n,size:r=N0e,level:o=B0e,bgColor:i=j0e,fgColor:a=F0e,includeMargin:s=$0e,imageSettings:l}=t,u=D0e(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Tc.QrCode.encodeText(n,L0e[o]).getModules();const f=s?G7:0,d=c.length+f*2,h=H0e(c,r,s,l);let p=null;l!=null&&h!=null&&(h.excavation!=null&&(c=V0e(c,h.excavation)),p=ee.createElement("image",{xlinkHref:l.src,height:h.h,width:h.w,x:h.x+f,y:h.y+f,preserveAspectRatio:"none"}));const m=U0e(c,f);return ee.createElement("svg",M0e({height:r,width:r,viewBox:`0 0 ${d} ${d}`},u),ee.createElement("path",{fill:i,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),ee.createElement("path",{fill:a,d:m,shapeRendering:"crispEdges"}),p)}const G0e=({user:e,relatedEvent:t,onConfirmPayment:n,relayUrl:r})=>{const[o,i]=P.useState(void 0),[a,s]=P.useState(!1),[l,u]=P.useState(!1),[c,f]=P.useState(0),[d,h]=P.useState(""),[p,m]=P.useState(""),_=Vi(),[b,g]=P.useState(void 0),E=async()=>{var N;if(!o)return;if(c<=0){_({title:"Error",description:"Please enter a valid amount",status:"error",duration:9e3,isClosable:!0});return}u(!0);const y=o;if(!y)return;const S=y==null?void 0:y.getLud16Or06Url();if(!S)return;if(!(y!=null&&y.hasZapInfo()))try{await(y==null?void 0:y.getZapCallbackInfo(S.url))}catch(D){console.error(D),_({title:"Error",description:`Could not get zap callback info: ${D.message}`,status:"error",duration:9e3,isClosable:!0}),u(!1);return}const v=S.type==="lud16"?nk(y.getLud16()):y.getLud06(),x={amount:c,relayUrls:r?[r]:[],recipientPubkey:y==null?void 0:y.pubkey,lnurl:v},I=sk(x),R=await Z.getState().signEvent(I),k=tk({callback:(N=y==null?void 0:y.lightningZapInfo)==null?void 0:N.callback,amount:x.amount,event:R.toURI(),lnurl:x.lnurl});let M;try{M=await y.getLightningInvoice(x,k)}catch(D){console.error(D),_({title:"Error",description:`Could not get lightning invoice: ${D.message}`,status:"error",duration:9e3,isClosable:!0}),u(!1);return}M&&M.pr&&g({pr:M.pr,event:R}),u(!1)},T=async()=>{if(!b)return;if(d===""||p===""){_({title:"Error",description:"Please fill in all fields",status:"error",duration:9e3,isClosable:!0});return}u(!0);const S=b.event.newZapReceipt({bolt11:d,description:p});t&&S.addEventTag({eventId:t.id}),await Z.getState().signAndSendEvent({event:S}),u(!1),_({title:"Success",description:"Payment confirmed. Keep stracking!",status:"success",duration:9e3,isClosable:!0}),n()};P.useEffect(()=>{const y=new R0e(e),S=y.getLud16Or06Url()!==void 0;i(y),s(S)},[e]);const O=w.jsx(w.Fragment,{children:!a&&w.jsx(me,{fontWeight:"bold",children:"The user does not have a supported ligning address."})}),A=w.jsx(w.Fragment,{children:a&&!b&&w.jsxs(As,{children:[w.jsx(me,{mb:2,children:"Request a ligning invoice, pay it with your ligtning wallet, and enter the bolt11 invoice receipt from your wallet in the next step."}),w.jsxs(C5,{children:[w.jsx(MS,{children:"Sats"}),w.jsx(Ht,{type:"number",value:c,onChange:y=>f(parseInt(y.target.value))})]}),w.jsx(be,{onClick:E,isLoading:l,width:"100%",children:"Get ₿ LN invoice"})]})}),C=w.jsx(w.Fragment,{children:b&&w.jsxs(w.Fragment,{children:[w.jsx(me,{mb:2,textAlign:"center",children:"Scan or copy the invoice to your lightning wallet."}),w.jsx(ve,{mb:2,width:"100%",children:w.jsx(W0e,{value:b.pr,width:"100%"})}),w.jsx(Ht,{type:"text",value:b.pr,onChange:()=>h(b.pr),mb:2}),w.jsx(In,{htmlFor:"bolt11",mt:2,children:"Bolt11"}),w.jsx(me,{mb:2,children:"Copy the bolt11 invoice receipt from your lightning wallet."}),w.jsx(Ht,{type:"text",value:d,onChange:y=>h(y.target.value),placeholder:"lnbc..."}),w.jsx(In,{htmlFor:"description",mt:2,children:"Description"}),w.jsx(Ht,{type:"text",value:p,onChange:y=>m(y.target.value),placeholder:"Keep stracking ...",mb:2}),w.jsx(be,{onClick:T,isLoading:l,children:"Confirm payment"})]})});return w.jsxs(ve,{children:[O,A,C]})},K7=({user:e,relatedEvent:t,isOpen:n,onClose:r})=>w.jsxs($r,{isOpen:n,onClose:r,children:[w.jsx(Vr,{}),w.jsxs(zr,{maxWidth:300,children:[w.jsx(Ur,{children:"Send sats (WIP)"}),w.jsx(Wr,{}),w.jsx(Hr,{children:w.jsx(G0e,{user:e,relatedEvent:t,onConfirmPayment:r})}),w.jsx(yd,{children:w.jsx(be,{variant:"outline",onClick:r,children:"Close"})})]})]});function $a({user:{pubkey:e,data:t},opts:{showAbout:n,showBanner:r,showFollowing:o,showBlock:i,showLud:a,relayUrls:s,isBlocked:l}}){const u=t&&t.name?t.name:"Anonymous",c=t&&t.display_name?t.display_name:u,f=t&&t.picture?t.picture:"",d=t&&t.banner?t.banner:void 0,h=t&&t.about?t.about:void 0,p=t&&t.lud06?t.lud06:void 0,m=t&&t.lud16?t.lud16:void 0,_=c===u,[b,g]=P.useState(""),[E,T]=P.useState(!1);P.useEffect(()=>{const I=GR(d_.PublicKeys,[{type:0,value:e}]);g(`/p/${I}`)},[e]);const O=async()=>{const I=await Z.getState().followingUser(e);T(I)},{isOpen:A,onOpen:C,onClose:y}=Wn(),{isOpen:S,onClose:v}=Wn(),x=({lud:I,name:R})=>w.jsxs(KS,{children:[w.jsx(GS,{children:w.jsx(be,{size:"xs",variant:"outline",color:"gray.500",children:R})}),w.jsxs(ZS,{children:[w.jsx(XS,{}),w.jsx(YS,{}),w.jsx(qS,{children:I&&w.jsx(me,{fontSize:12,children:I})})]})]});return w.jsxs(w.Fragment,{children:[r&&d&&w.jsx(ve,{marginBottom:2,children:w.jsx(Bu,{src:d,alt:"banner"})}),w.jsxs(pt,{children:[w.jsx(ve,{children:w.jsx(Ff,{to:b,children:f===""?w.jsx(b0e,{size:24,name:e,variant:"marble",colors:["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]}):w.jsx(r1,{size:"xs",src:f})})}),w.jsx(ve,{overflowWrap:"anywhere",maxWidth:80,children:w.jsx(Ff,{to:b,children:w.jsx(me,{size:"sm",children:c})})}),w.jsx(ve,{overflowWrap:"anywhere",maxWidth:80,children:w.jsx(me,{fontSize:10,children:!_&&u})}),a&&w.jsxs(w.Fragment,{children:[p&&w.jsx(x,{lud:p,name:"LUD06"}),m&&w.jsx(x,{lud:m,name:"LUD16"})]}),w.jsx(Xs,{}),w.jsxs(VS,{isLazy:!0,onOpen:O,children:[w.jsx(WS,{as:um,size:"xs",icon:w.jsx(Ge,{as:g0e}),children:"Actions"}),w.jsxs(HS,{children:[i&&w.jsx(Qo,{icon:w.jsx(Ge,{as:f0e}),onClick:()=>l?Z.getState().unblockUser(e):Z.getState().blockUser({pubkey:e,relayUrls:s}),children:l?"Unblock":"Block"}),w.jsx(Qo,{icon:w.jsx(Ge,{as:Uk}),onClick:C,children:"Lists"}),o&&w.jsx(Qo,{icon:w.jsx(Ge,{as:zk}),onClick:()=>E?Z.getState().unfollowUser(e):Z.getState().followUser({pubkey:e,relayUrls:s}),children:E?"Unfollow":"Follow"})]})]})]}),w.jsx(ve,{overflowWrap:"anywhere",mt:2,children:n&&h&&w.jsx(me,{fontSize:"sm",children:h})}),w.jsx(v0e,{pubkey:e,isOpen:A,onClose:y}),w.jsx(K7,{user:{pubkey:e,data:t},isOpen:S,onClose:v})]})}function Dm({data:e,level:t}){const[n]=Z(x=>[(x.status==="offline"||x.status==="online")&&x.keystore!=="none"]),[r,o]=P.useState(e.user?e.user:{pubkey:e.event.pubkey}),i=ZR(e.event.content),a=KR(e.event);let s;i!=null&&i.text&&!a?s=!0:a&&(s=!1);const l={isLoaded:!0,contentWarning:a,images:i.images,videos:i.videos,nurls:i.nurls,text:i.text},[u,c]=P.useState(s),f={showFollowing:!0,showBlock:!0,showLud:!0,relayUrls:e.eventRelayUrls},{isOpen:d,onOpen:h,onClose:p}=Wn(),{isOpen:m,onOpen:_,onClose:b}=Wn(),{isOpen:g,onOpen:E,onClose:T}=Wn(),O=Vi();P.useEffect(()=>{if(t===0){const x=e.user?e.user:{pubkey:e.event.pubkey};o(x)}},[e.user]),P.useEffect(()=>{const x=async()=>{const I=await Z.getState().getUser(e.event.pubkey);I&&o(I.user)};t>0&&x()},[e.event.pubkey]);const A=async()=>{if(!e.eventRelayUrls)return;const I=(await Z.getState().getRelays()||[]).find(R=>e.eventRelayUrls.includes(R.url));if(I&&I.write)return I},C=async x=>{console.log("replyCallback",x)},y=x=>{let I="";x instanceof Error?I=x.message:I="Unknown error",O({title:"Error",description:I,status:"error",duration:5e3,isClosable:!0})},S=x=>{O({title:"Success",description:`Event ${Uu(x,5)} submitted`,status:"success",duration:5e3,isClosable:!0})},v=async(x,I)=>{const R=await A();let k;switch(x){case"quote":k=ak({inResponseTo:e.event,relayUrl:R?R.url:void 0});break;case"reaction":if(!I)throw new Error("Reaction is required");k=Yie({text:I,inResponseTo:{id:e.event.id,pubkey:e.event.pubkey},relayUrl:R?R.url:void 0});break;case"zap":E();return;default:return}try{const M=await Z.getState().signAndSendEvent({event:k,relayUrls:R?[R.url]:void 0});M&&(S(M),setTimeout(()=>{Z.getState().requestInformation({source:"events",idsOrKeys:[M]},{timeoutIn:1e4})},1e3))}catch(M){y(M);return}};return w.jsxs(w.Fragment,{children:[w.jsxs(iZ,{children:[w.jsxs(oZ,{p:0,children:[u?w.jsx(i0e,{images:l.images,videos:l.videos}):w.jsx(ede,{contentWarning:l.contentWarning,setShowNSFWContent:c}),w.jsx(ve,{p:1,pl:2,children:w.jsx($a,{user:r,opts:f})})]}),u&&w.jsx(nZ,{p:0,children:w.jsx(sR,{isLoaded:l.isLoaded,children:w.jsx(Qfe,{content:l.text})})}),w.jsx(Pde,{isReady:n,level:t,createdAt:e.event.created_at,repliesCount:e.repliesCount,reactionsCount:e.reactionsCount,repostCount:e.repostsCount,zapReceiptCount:e.zapReceiptCount,zapReceiptAmount:e.zapReceiptAmount,isReplyOpen:m,onReplyOpen:_,onReplyClose:b,isInfoModalOpen:d,onInfoModalOpen:h,onInfoModalClose:p,onAction:v})]}),m&&w.jsx(Jfe,{data:e,isOpen:m,sendCallback:C,level:t}),w.jsx(Xfe,{data:e,isOpen:d,onClose:p}),w.jsx(K7,{user:r,relatedEvent:e.event,isOpen:g,onClose:T})]})}const Lm=0,za=1,Vu=2,X7=4;function q7(e,t){return n=>e(t(n))}function K0e(e,t){return t(e)}function Y7(e,t){return n=>e(t,n)}function h6(e,t){return()=>e(t)}function Nm(e,t){return t(e),e}function kt(...e){return e}function X0e(e){e()}function p6(e){return()=>e}function q0e(...e){return()=>{e.map(X0e)}}function R_(e){return e!==void 0}function Hu(){}function ft(e,t){return e(za,t)}function Be(e,t){e(Lm,t)}function k_(e){e(Vu)}function Nr(e){return e(X7)}function Se(e,t){return ft(e,Y7(t,Lm))}function $i(e,t){const n=e(za,r=>{n(),t(r)});return n}function Xe(){const e=[];return(t,n)=>{switch(t){case Vu:e.splice(0,e.length);return;case za:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case Lm:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function fe(e){let t=e;const n=Xe();return(r,o)=>{switch(r){case za:o(t);break;case Lm:t=o;break;case X7:return t}return n(r,o)}}function Y0e(e){let t,n;const r=()=>t&&t();return function(o,i){switch(o){case za:return i?n===i?void 0:(r(),n=i,t=ft(e,i),t):(r(),Hu);case Vu:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Kr(e){return Nm(Xe(),t=>Se(e,t))}function rr(e,t){return Nm(fe(t),n=>Se(e,n))}function Z0e(...e){return t=>e.reduceRight(K0e,t)}function re(e,...t){const n=Z0e(...t);return(r,o)=>{switch(r){case za:return ft(e,n(o));case Vu:k_(e);return}}}function Z7(e,t){return e===t}function Pt(e=Z7){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Le(e){return t=>n=>{e(n)&&t(n)}}function ye(e){return t=>q7(t,e)}function bi(e){return t=>()=>t(e)}function oi(e,t){return n=>r=>n(t=e(t,r))}function Iu(e){return t=>n=>{e>0?e--:t(n)}}function pa(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function m6(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function $e(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);ft(i,l=>{const u=n;n=n|s,t[a]=l,u!==o&&n===o&&r&&(r(),r=null)})}),i=>a=>{const s=()=>i([a].concat(t));n===o?s():r=s}}function y6(...e){return function(t,n){switch(t){case za:return q0e(...e.map(r=>ft(r,n)));case Vu:return;default:throw new Error(`unrecognized action ${t}`)}}}function De(e,t=Z7){return re(e,Pt(t))}function Sn(...e){const t=Xe(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);ft(i,l=>{n[a]=l,r=r|s,r===o&&Be(t,n)})}),function(i,a){switch(i){case za:return r===o&&a(n),ft(t,a);case Vu:return k_(t);default:throw new Error(`unrecognized action ${i}`)}}}function ut(e,t=[],{singleton:n}={singleton:!0}){return{id:Q0e(),constructor:e,dependencies:t,singleton:n}}const Q0e=()=>Symbol();function J0e(e){const t=new Map,n=({id:r,constructor:o,dependencies:i,singleton:a})=>{if(a&&t.has(r))return t.get(r);const s=o(i.map(l=>n(l)));return a&&t.set(r,s),s};return n(e)}function eme(e,t){const n={},r={};let o=0;const i=e.length;for(;o(_[b]=g=>{const E=m[t.methods[b]];Be(E,g)},_),{})}function c(m){return a.reduce((_,b)=>(_[b]=Y0e(m[t.events[b]]),_),{})}return{Component:ee.forwardRef((m,_)=>{const{children:b,...g}=m,[E]=ee.useState(()=>Nm(J0e(e),O=>l(O,g))),[T]=ee.useState(h6(c,E));return Th(()=>{for(const O of a)O in g&&ft(T[O],g[O]);return()=>{Object.values(T).map(k_)}},[g,T,E]),Th(()=>{l(E,g)}),ee.useImperativeHandle(_,p6(u(E))),ee.createElement(s.Provider,{value:E},n?ee.createElement(n,eme([...r,...o,...a],g),b):b)}),usePublisher:m=>ee.useCallback(Y7(Be,ee.useContext(s)[m]),[m]),useEmitterValue:m=>{const b=ee.useContext(s)[m],[g,E]=ee.useState(h6(Nr,b));return Th(()=>ft(b,T=>{T!==g&&E(p6(T))}),[b,g]),g},useEmitter:(m,_)=>{const g=ee.useContext(s)[m];Th(()=>ft(g,_),[_,g])}}}const tme=typeof document<"u"?ee.useLayoutEffect:ee.useEffect,nme=tme;var Xr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Xr||{});const rme={0:"debug",1:"log",2:"warn",3:"error"},ome=()=>typeof globalThis>"u"?window:globalThis,Ua=ut(()=>{const e=fe(3);return{log:fe((n,r,o=1)=>{var i;const a=(i=ome().VIRTUOSO_LOG_LEVEL)!=null?i:Nr(e);o>=a&&console[rme[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function M_(e,t=!0){const n=ee.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=ee.useMemo(()=>new ResizeObserver(i=>{const a=i[0].target;a.offsetParent!==null&&e(a)}),[e]);r=i=>{i&&t?(o.observe(i),n.current=i):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function Qs(e,t=!0){return M_(e,t).callbackRef}function ime(e,t,n,r,o,i,a){const s=ee.useCallback(l=>{const u=ame(l.children,t,"offsetHeight",o);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const f=c.lastElementChild.dataset.viewportType==="window",d=a?a.scrollTop:f?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,h=a?a.scrollHeight:f?document.documentElement.scrollHeight:c.scrollHeight,p=a?a.offsetHeight:f?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(d,0),scrollHeight:h,viewportHeight:p}),i==null||i(sme("row-gap",getComputedStyle(l).rowGap,o)),u!==null&&e(u)},[e,t,o,i,a,r]);return M_(s,n)}function ame(e,t,n,r){const o=e.length;if(o===0)return null;const i=[];for(let a=0;a{const d=f.target,h=d===window||d===document,p=h?window.pageYOffset||document.documentElement.scrollTop:d.scrollTop,m=h?document.documentElement.scrollHeight:d.scrollHeight,_=h?window.innerHeight:d.offsetHeight,b=()=>{e({scrollTop:Math.max(p,0),scrollHeight:m,viewportHeight:_})};f.suppressFlushSync?b():tB.flushSync(b),a.current!==null&&(p===a.current||p<=0||p===m-_)&&(a.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);ee.useEffect(()=>{const f=o||i.current;return r(o||i.current),l({target:f,suppressFlushSync:!0}),f.addEventListener("scroll",l,{passive:!0}),()=>{r(null),f.removeEventListener("scroll",l)}},[i,l,n,r,o]);function u(f){const d=i.current;if(!d||"offsetHeight"in d&&d.offsetHeight===0)return;const h=f.behavior==="smooth";let p,m,_;d===window?(m=Math.max(Ma(document.documentElement,"height"),document.documentElement.scrollHeight),p=window.innerHeight,_=document.documentElement.scrollTop):(m=d.scrollHeight,p=Ma(d,"height"),_=d.scrollTop);const b=m-p;if(f.top=Math.ceil(Math.max(Math.min(b,f.top),0)),J7(p,m)||f.top===_){e({scrollTop:_,scrollHeight:m,viewportHeight:p}),h&&t(!0);return}h?(a.current=f.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,a.current=null,t(!0)},1e3)):a.current=null,d.scrollTo(f)}function c(f){i.current.scrollBy(f)}return{scrollerRef:i,scrollByCallback:c,scrollToCallback:u}}const cr=ut(()=>{const e=Xe(),t=Xe(),n=fe(0),r=Xe(),o=fe(0),i=Xe(),a=Xe(),s=fe(0),l=fe(0),u=fe(0),c=fe(0),f=Xe(),d=Xe(),h=fe(!1);return Se(re(e,ye(({scrollTop:p})=>p)),t),Se(re(e,ye(({scrollHeight:p})=>p)),a),Se(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:i,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:a,smoothScrollTargetReached:r,scrollTo:f,scrollBy:d,statefulScrollTop:o,deviation:n,scrollingInProgress:h}},[],{singleton:!0}),Wf={lvl:0};function t9(e,t,n,r=Wf,o=Wf){return{k:e,v:t,lvl:n,l:r,r:o}}function yt(e){return e===Wf}function su(){return Wf}function Mw(e,t){if(yt(e))return Wf;const{k:n,l:r,r:o}=e;if(t===n){if(yt(r))return o;if(yt(o))return r;{const[i,a]=n9(r);return pp(dn(e,{k:i,v:a,l:r9(r)}))}}else return tt&&(s=s.concat(Dw(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Dw(a,t,n))),s}function ws(e){return yt(e)?[]:[...ws(e.l),{k:e.k,v:e.v},...ws(e.r)]}function n9(e){return yt(e.r)?[e.k,e.v]:n9(e.r)}function r9(e){return yt(e.r)?e.l:pp(dn(e,{r:r9(e.r)}))}function dn(e,t){return t9(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function rv(e){return yt(e)||e.lvl>e.r.lvl}function g6(e){return Lw(i9(e))}function pp(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(rv(t))return i9(dn(e,{lvl:r-1}));if(!yt(t)&&!yt(t.r))return dn(t.r,{l:dn(t,{r:t.r.l}),r:dn(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(rv(e))return Lw(dn(e,{lvl:r-1}));if(!yt(n)&&!yt(n.l)){const o=n.l,i=rv(o)?n.lvl-1:n.lvl;return dn(o,{l:dn(e,{r:o.l,lvl:r-1}),r:Lw(dn(n,{l:o.r,lvl:i})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function Bm(e,t,n){if(yt(e))return[];const r=Uo(e,t)[0];return lme(Dw(e,r,n))}function o9(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const i=[];for(let a=1;a({index:t,value:n}))}function Lw(e){const{r:t,lvl:n}=e;return!yt(t)&&!yt(t.r)&&t.lvl===n&&t.r.lvl===n?dn(t,{l:dn(e,{r:t.l}),lvl:n+1}):e}function i9(e){const{l:t}=e;return!yt(t)&&t.lvl===e.lvl?dn(t,{r:dn(e,{l:t.r})}):e}function h0(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const i=Math.floor((r+o)/2),a=e[i],s=n(a,t);if(s===0)return i;if(s===-1){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function a9(e,t,n){return e[h0(e,t,n)]}function ume(e,t,n,r){const o=h0(e,t,r),i=h0(e,n,r,o);return e.slice(o,i+1)}const D_=ut(()=>({recalcInProgress:fe(!1)}),[],{singleton:!0});function cme(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function v6(e,t){let n=0,r=0;for(;n=c||o===d)&&(e=Mw(e,c)):(u=d!==o,l=!0),f>a&&a>=c&&d!==o&&(e=Dr(e,a+1,d));u&&(e=Dr(e,i,o))}return[e,n]}function dme(){return{offsetTree:[],sizeTree:su(),groupOffsetTree:su(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function L_({index:e},t){return t===e?0:t0&&(t=Math.max(t,a9(e,r,L_).offset)),o9(ume(e,t,n,hme),pme)}function Nw(e,t,n,r){let o=e,i=0,a=0,s=0,l=0;if(t!==0){l=h0(o,t-1,L_),s=o[l].offset;const c=Uo(n,t-1);i=c[0],a=c[1],o.length&&o[l].size===Uo(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:u,value:c}of Bm(n,t,1/0)){const f=u-i,d=f*a+s+f*r;o.push({offset:d,size:c,index:u}),i=u,s=d,a=c}return{offsetTree:o,lastIndex:i,lastOffset:s,lastSize:a}}function yme(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Xr.DEBUG);const i=e.sizeTree;let a=i,s=0;if(n.length>0&&yt(i)&&t.length===2){const d=t[0].size,h=t[1].size;a=n.reduce((p,m)=>Dr(Dr(p,m,d),m+1,h),a)}else[a,s]=fme(a,t);if(a===i)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:f}=Nw(e.offsetTree,s,a,o);return{sizeTree:a,offsetTree:l,lastIndex:u,lastOffset:f,lastSize:c,groupOffsetTree:n.reduce((d,h)=>Dr(d,h,Kf(h,l,o)),su()),groupIndices:n}}function Kf(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:i}=a9(t,e,L_),a=e-o,s=i*a+(a-1)*n+r;return s>0?s+n:s}function gme(e){return typeof e.groupIndex<"u"}function s9(e,t,n){if(gme(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=l9(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function l9(e,t){if(!jm(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function jm(e){return!yt(e.groupOffsetTree)}function vme(e){return ws(e).map(({k:t,v:n},r,o)=>{const i=o[r+1],a=i?i.k-1:1/0;return{startIndex:t,endIndex:a,size:n}})}const wme={offsetHeight:"height",offsetWidth:"width"},mi=ut(([{log:e},{recalcInProgress:t}])=>{const n=Xe(),r=Xe(),o=rr(r,0),i=Xe(),a=Xe(),s=fe(0),l=fe([]),u=fe(void 0),c=fe(void 0),f=fe((O,A)=>Ma(O,wme[A])),d=fe(void 0),h=fe(0),p=dme(),m=rr(re(n,$e(l,e,h),oi(yme,p),Pt()),p),_=rr(re(l,Pt(),oi((O,A)=>({prev:O.current,current:A}),{prev:[],current:[]}),ye(({prev:O})=>O)),[]);Se(re(l,Le(O=>O.length>0),$e(m,h),ye(([O,A,C])=>{const y=O.reduce((S,v,x)=>Dr(S,v,Kf(v,A.offsetTree,C)||x),su());return{...A,groupIndices:O,groupOffsetTree:y}})),m),Se(re(r,$e(m),Le(([O,{lastIndex:A}])=>O[{startIndex:O,endIndex:A,size:C}])),n),Se(u,c);const b=rr(re(u,ye(O=>O===void 0)),!0);Se(re(c,Le(O=>O!==void 0&&yt(Nr(m).sizeTree)),ye(O=>[{startIndex:0,endIndex:0,size:O}])),n);const g=Kr(re(n,$e(m),oi(({sizes:O},[A,C])=>({changed:C!==O,sizes:C}),{changed:!1,sizes:p}),ye(O=>O.changed)));ft(re(s,oi((O,A)=>({diff:O.prev-A,prev:A}),{diff:0,prev:0}),ye(O=>O.diff)),O=>{const{groupIndices:A}=Nr(m);if(O>0)Be(t,!0),Be(i,O+v6(O,A));else if(O<0){const C=Nr(_);C.length>0&&(O-=v6(-O,C)),Be(a,O)}}),ft(re(s,$e(e)),([O,A])=>{O<0&&A("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},Xr.ERROR)});const E=Kr(i);Se(re(i,$e(m),ye(([O,A])=>{const C=A.groupIndices.length>0,y=[],S=A.lastSize;if(C){const v=Gf(A.sizeTree,0);let x=0,I=0;for(;x{let L=M.ranges;return M.prevSize!==0&&(L=[...M.ranges,{startIndex:M.prevIndex,endIndex:N+O-1,size:M.prevSize}]),{ranges:L,prevIndex:N+O,prevSize:D}},{ranges:y,prevIndex:O,prevSize:0}).ranges}return ws(A.sizeTree).reduce((v,{k:x,v:I})=>({ranges:[...v.ranges,{startIndex:v.prevIndex,endIndex:x+O-1,size:v.prevSize}],prevIndex:x+O,prevSize:I}),{ranges:[],prevIndex:0,prevSize:S}).ranges})),n);const T=Kr(re(a,$e(m,h),ye(([O,{offsetTree:A},C])=>{const y=-O;return Kf(y,A,C)})));return Se(re(a,$e(m,h),ye(([O,A,C])=>{if(A.groupIndices.length>0){if(yt(A.sizeTree))return A;let S=su();const v=Nr(_);let x=0,I=0,R=0;for(;x<-O;){R=v[I];const M=v[I+1]-R-1;I++,x+=M+1}if(S=ws(A.sizeTree).reduce((M,{k:N,v:D})=>Dr(M,Math.max(0,N+O),D),S),x!==-O){const M=Gf(A.sizeTree,R);S=Dr(S,0,M);const N=Uo(A.sizeTree,-O+1)[1];S=Dr(S,1,N)}return{...A,sizeTree:S,...Nw(A.offsetTree,0,S,C)}}else{const S=ws(A.sizeTree).reduce((v,{k:x,v:I})=>Dr(v,Math.max(0,x+O),I),su());return{...A,sizeTree:S,...Nw(A.offsetTree,0,S,C)}}})),m),{data:d,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:i,shiftWith:a,shiftWithOffset:T,beforeUnshiftWith:E,firstItemIndex:s,gap:h,sizes:m,listRefresh:g,statefulTotalCount:o,trackItemSizes:b,itemSize:f}},kt(Ua,D_),{singleton:!0}),bme=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function u9(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!bme)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const Pd=ut(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:i,scrollTo:a,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:f},{log:d}])=>{const h=Xe(),p=fe(0);let m=null,_=null,b=null;function g(){m&&(m(),m=null),b&&(b(),b=null),_&&(clearTimeout(_),_=null),Be(o,!1)}return Se(re(h,$e(e,i,t,p,l,u,d),$e(r,c,f),ye(([[E,T,O,A,C,y,S,v],x,I,R])=>{const k=u9(E),{align:M,behavior:N,offset:D}=k,L=A-1,j=s9(k,T,L);let F=Kf(j,T.offsetTree,x)+y;M==="end"?(F+=I+Uo(T.sizeTree,j)[1]-O+R,j===L&&(F+=S)):M==="center"?F+=(I+Uo(T.sizeTree,j)[1]-O+R)/2:F-=C,D&&(F+=D);const B=U=>{g(),U?(v("retrying to scroll to",{location:E},Xr.DEBUG),Be(h,E)):v("list did not change, scroll successful",{},Xr.DEBUG)};if(g(),N==="smooth"){let U=!1;b=ft(n,K=>{U=U||K}),m=$i(s,()=>{B(U)})}else m=$i(re(n,Sme(150)),B);return _=setTimeout(()=>{g()},1200),Be(o,!0),v("scrolling from index to",{index:j,top:F,behavior:N},Xr.DEBUG),{top:F,behavior:N}})),a),{scrollToIndex:h,topListHeight:p}},kt(mi,cr,Ua),{singleton:!0});function Sme(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const Xf="up",nf="down",_me="none",Eme={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Cme=0,Td=ut(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:i}])=>{const a=fe(!1),s=fe(!0),l=Xe(),u=Xe(),c=fe(4),f=fe(Cme),d=rr(re(y6(re(De(t),Iu(1),bi(!0)),re(De(t),Iu(1),bi(!1),m6(100))),Pt()),!1),h=rr(re(y6(re(i,bi(!0)),re(i,bi(!1),m6(200))),Pt()),!1);Se(re(Sn(De(t),De(f)),ye(([g,E])=>g<=E),Pt()),s),Se(re(s,pa(50)),u);const p=Kr(re(Sn(e,De(n),De(r),De(o),De(c)),oi((g,[{scrollTop:E,scrollHeight:T},O,A,C,y])=>{const S=E+O-T>-y,v={viewportHeight:O,scrollTop:E,scrollHeight:T};if(S){let I,R;return E>g.state.scrollTop?(I="SCROLLED_DOWN",R=g.state.scrollTop-E):(I="SIZE_DECREASED",R=g.state.scrollTop-E||g.scrollTopDelta),{atBottom:!0,state:v,atBottomBecause:I,scrollTopDelta:R}}let x;return v.scrollHeight>g.state.scrollHeight?x="SIZE_INCREASED":Og&&g.atBottom===E.atBottom))),m=rr(re(e,oi((g,{scrollTop:E,scrollHeight:T,viewportHeight:O})=>{if(J7(g.scrollHeight,T))return{scrollTop:E,scrollHeight:T,jump:0,changed:!1};{const A=T-(E+O)<1;return g.scrollTop!==E&&A?{scrollHeight:T,scrollTop:E,jump:g.scrollTop-E,changed:!0}:{scrollHeight:T,scrollTop:E,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Le(g=>g.changed),ye(g=>g.jump)),0);Se(re(p,ye(g=>g.atBottom)),a),Se(re(a,pa(50)),l);const _=fe(nf);Se(re(e,ye(({scrollTop:g})=>g),Pt(),oi((g,E)=>Nr(h)?{direction:g.direction,prevScrollTop:E}:{direction:Eg.direction)),_),Se(re(e,pa(50),bi(_me)),_);const b=fe(0);return Se(re(d,Le(g=>!g),bi(0)),b),Se(re(t,pa(100),$e(d),Le(([g,E])=>!!E),oi(([g,E],[T])=>[E,T],[0,0]),ye(([g,E])=>E-g)),b),{isScrolling:d,isAtTop:s,isAtBottom:a,atBottomState:p,atTopStateChange:u,atBottomStateChange:l,scrollDirection:_,atBottomThreshold:c,atTopThreshold:f,scrollVelocity:b,lastJumpDueToItemResize:m}},kt(cr)),Va=ut(([{log:e}])=>{const t=fe(!1),n=Kr(re(t,Le(r=>r),Pt()));return ft(t,r=>{r&&Nr(e)("props updated",{},Xr.DEBUG)}),{propsReady:t,didMount:n}},kt(Ua),{singleton:!0});function N_(e,t){e==0?t():requestAnimationFrame(()=>N_(e-1,t))}function B_(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Id=ut(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o},{didMount:i}])=>{const a=fe(!0),s=fe(0),l=fe(!1);return Se(re(i,$e(s),Le(([u,c])=>!!c),bi(!1)),a),ft(re(Sn(t,i),$e(a,e,n,l),Le(([[,u],c,{sizeTree:f},d,h])=>u&&(!yt(f)||R_(d))&&!c&&!h),$e(s)),([,u])=>{Be(l,!0),N_(3,()=>{$i(r,()=>Be(a,!0)),Be(o,u)})}),{scrolledToInitialItem:a,initialTopMostItemIndex:s}},kt(mi,cr,Pd,Va),{singleton:!0});function w6(e){return e?e==="smooth"?"smooth":"auto":!1}const xme=(e,t)=>typeof e=="function"?w6(e(t)):t&&w6(e),Ome=ut(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:i},{propsReady:a,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=fe(!1),f=Xe();let d=null;function h(m){Be(o,{index:"LAST",align:"end",behavior:m})}ft(re(Sn(re(De(e),Iu(1)),s),$e(De(c),n,i,u),ye(([[m,_],b,g,E,T])=>{let O=_&&E,A="auto";return O&&(A=xme(b,g||T),O=O&&!!A),{totalCount:m,shouldFollow:O,followOutputBehavior:A}}),Le(({shouldFollow:m})=>m)),({totalCount:m,followOutputBehavior:_})=>{d&&(d(),d=null),d=$i(t,()=>{Nr(l)("following output to ",{totalCount:m},Xr.DEBUG),h(_),d=null})});function p(m){const _=$i(r,b=>{m&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!d&&(Nr(l)("scrolling to bottom due to increased size",{},Xr.DEBUG),h("auto"))});setTimeout(_,100)}return ft(re(Sn(De(c),e,a),Le(([m,,_])=>m&&_),oi(({value:m},[,_])=>({refreshed:m===_,value:_}),{refreshed:!1,value:0}),Le(({refreshed:m})=>m),$e(c,e)),([,m])=>{p(m!==!1)}),ft(f,()=>{p(Nr(c)!==!1)}),ft(Sn(De(c),r),([m,_])=>{m&&!_.atBottom&&_.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&h("auto")}),{followOutput:c,autoscrollToBottom:f}},kt(mi,Td,Pd,Id,Va,Ua,cr));function Ame(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const c9=ut(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const i=Xe(),a=Xe(),s=Kr(re(i,ye(Ame)));return Se(re(s,ye(l=>l.totalCount)),e),Se(re(s,ye(l=>l.groupIndices)),t),Se(re(Sn(r,n,o),Le(([l,u])=>jm(u)),ye(([l,u,c])=>Uo(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),Pt(),ye(l=>[l])),a),{groupCounts:i,topItemsIndexes:a}},kt(mi,cr));function qf(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function f9(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const p0="top",m0="bottom",b6="none";function S6(e,t,n){return typeof e=="number"?n===Xf&&t===p0||n===nf&&t===m0?e:0:n===Xf?t===p0?e.main:e.reverse:t===m0?e.main:e.reverse}function _6(e,t){return typeof e=="number"?e:e[t]||0}const j_=ut(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const i=Xe(),a=fe(0),s=fe(0),l=fe(0),u=rr(re(Sn(De(e),De(t),De(r),De(i,qf),De(l),De(a),De(o),De(n),De(s)),ye(([c,f,d,[h,p],m,_,b,g,E])=>{const T=c-g,O=_+b,A=Math.max(d-T,0);let C=b6;const y=_6(E,p0),S=_6(E,m0);return h-=g,h+=d+b,p+=d+b,p-=g,h>c+O-y&&(C=Xf),pc!=null),Pt(qf)),[0,0]);return{listBoundary:i,overscan:l,topListHeight:a,increaseViewportBy:s,visibleRange:u}},kt(cr),{singleton:!0});function Pme(e,t,n){if(jm(t)){const r=l9(e,t);return[{index:Uo(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const ov={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function E6(e,t,n){if(e.length===0)return[];if(!jm(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,o=e[e.length-1].index,i=[],a=Bm(t.groupOffsetTree,r,o);let s,l=0;for(const u of e){(!s||s.end0){u=e[0].offset;const m=e[e.length-1];c=m.offset+m.size}const f=n-l,d=s+f*a+(f-1)*r,h=u,p=d-c;return{items:E6(e,o,i),topItems:E6(t,o,i),topListHeight:t.reduce((m,_)=>_.size+m,0),offsetTop:u,offsetBottom:p,top:h,bottom:c,totalCount:n,firstItemIndex:i}}function d9(e,t,n,r,o,i){let a=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-a>=e)break;a++}const s=e+a,l=B_(t,s),u=Array.from({length:s}).map((c,f)=>({index:f+l,size:0,offset:0,data:i[f+l]}));return mp(u,[],s,o,n,r)}const Js=ut(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},i,{visibleRange:a,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:f},d,{didMount:h},{recalcInProgress:p}])=>{const m=fe([]),_=fe(0),b=Xe();Se(i.topItemsIndexes,m);const g=rr(re(Sn(h,p,De(a,qf),De(t),De(e),De(c),u,De(m),De(r),De(o),n),Le(([A,C,,y,,,,,,,S])=>{const v=S&&S.length!==y;return A&&!C&&!v}),ye(([,,[A,C],y,S,v,x,I,R,k,M])=>{const N=S,{sizeTree:D,offsetTree:L}=N,j=Nr(_);if(y===0)return{...ov,totalCount:y};if(A===0&&C===0)return j===0?{...ov,totalCount:y}:d9(j,v,S,R,k,M||[]);if(yt(D))return j>0?null:mp(Pme(B_(v,y),N,M),[],y,k,N,R);const F=[];if(I.length>0){const Q=I[0],X=I[I.length-1];let J=0;for(const te of Bm(D,Q,X)){const le=te.value,ge=Math.max(te.start,Q),se=Math.min(te.end,X);for(let ue=ge;ue<=se;ue++)F.push({index:ue,size:le,offset:J,data:M&&M[ue]}),J+=le}}if(!x)return mp([],F,y,k,N,R);const B=I.length>0?I[I.length-1]+1:0,U=mme(L,A,C,B);if(U.length===0)return null;const K=y-1,W=Nm([],Q=>{for(const X of U){const J=X.value;let te=J.offset,le=X.start;const ge=J.size;if(J.offset=C);ue++)Q.push({index:ue,size:ge,offset:te,data:M&&M[ue]}),te+=ge+k}});return mp(W,F,y,k,N,R)}),Le(A=>A!==null),Pt()),ov);Se(re(n,Le(R_),ye(A=>A==null?void 0:A.length)),t),Se(re(g,ye(A=>A.topListHeight)),f),Se(f,l),Se(re(g,ye(A=>[A.top,A.bottom])),s),Se(re(g,ye(A=>A.items)),b);const E=Kr(re(g,Le(({items:A})=>A.length>0),$e(t,n),Le(([{items:A},C])=>A[A.length-1].originalIndex===C-1),ye(([,A,C])=>[A-1,C]),Pt(qf),ye(([A])=>A))),T=Kr(re(g,pa(200),Le(({items:A,topItems:C})=>A.length>0&&A[0].originalIndex===C.length),ye(({items:A})=>A[0].index),Pt())),O=Kr(re(g,Le(({items:A})=>A.length>0),ye(({items:A})=>{let C=0,y=A.length-1;for(;A[C].type==="group"&&CC;)y--;return{startIndex:A[C].index,endIndex:A[y].index}}),Pt(f9)));return{listState:g,topItemsIndexes:m,endReached:E,startReached:T,rangeChanged:O,itemsRendered:b,initialItemCount:_,...d}},kt(mi,c9,j_,Id,Pd,Td,Va,D_),{singleton:!0}),Tme=ut(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{initialItemCount:i,listState:a},{didMount:s}])=>(Se(re(s,$e(i),Le(([,l])=>l!==0),$e(o,e,t,r,n),ye(([[,l],u,c,f,d,h=[]])=>d9(l,u,c,f,d,h))),a),{}),kt(mi,Id,Js,Va),{singleton:!0}),h9=ut(([{scrollVelocity:e}])=>{const t=fe(!1),n=Xe(),r=fe(!1);return Se(re(e,$e(r,t,n),Le(([o,i])=>!!i),ye(([o,i,a,s])=>{const{exit:l,enter:u}=i;if(a){if(l(o,s))return!1}else if(u(o,s))return!0;return a}),Pt()),t),ft(re(Sn(t,e,n),$e(r)),([[o,i,a],s])=>o&&s&&s.change&&s.change(i,a)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},kt(Td),{singleton:!0}),Ime=ut(([{topItemsIndexes:e}])=>{const t=fe(0);return Se(re(t,Le(n=>n>0),ye(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},kt(Js)),p9=ut(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const i=Xe(),a=rr(re(Sn(e,r,t,n,o),ye(([s,l,u,c,f])=>s+l+u+c+f.offsetBottom+f.bottom)),0);return Se(De(a),i),{totalListHeight:a,totalListHeightChanged:i}},kt(cr,Js),{singleton:!0});function m9(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Rme=m9(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),kme=ut(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:i,scrollDirection:a,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:f,gap:d},{log:h},{recalcInProgress:p}])=>{const m=Kr(re(l,$e(s),oi(([,b,g,E],[{items:T,totalCount:O,bottom:A,offsetBottom:C},y])=>{const S=A+C;let v=0;return g===O&&b.length>0&&T.length>0&&(T[0].originalIndex===0&&b[0].originalIndex===0||(v=S-E,v!==0&&(v+=y))),[v,T,O,S]},[0,[],0,0]),Le(([b])=>b!==0),$e(t,a,r,i,h,p),Le(([,b,g,E,,,T])=>!T&&!E&&b!==0&&g===Xf),ye(([[b],,,,,g])=>(g("Upward scrolling compensation",{amount:b},Xr.DEBUG),b))));function _(b){b>0?(Be(e,{top:-b,behavior:"auto"}),Be(n,0)):(Be(n,0),Be(e,{top:-b,behavior:"auto"}))}return ft(re(m,$e(n,o)),([b,g,E])=>{E&&Rme()?Be(n,g-b):_(-b)}),ft(re(Sn(rr(o,!1),n,p),Le(([b,g,E])=>!b&&!E&&g!==0),ye(([b,g])=>g),pa(1)),_),Se(re(c,ye(b=>({top:-b}))),e),ft(re(u,$e(f,d),ye(([b,{lastSize:g,groupIndices:E,sizeTree:T},O])=>{function A(C){return C*(g+O)}if(E.length===0)return A(b);{let C=0;const y=Gf(T,0);let S=0,v=0;for(;Sb&&(C-=y,x=b-S+1),S+=x,C+=A(x),v++}return C}})),b=>{Be(n,b),requestAnimationFrame(()=>{Be(e,{top:b}),requestAnimationFrame(()=>{Be(n,0),Be(p,!1)})})}),{deviation:n}},kt(cr,Td,Js,mi,Ua,D_)),Mme=ut(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=fe(0);return ft(re(e,$e(r),Le(([,o])=>o!==0),ye(([,o])=>({top:o}))),o=>{$i(re(n,Iu(1),Le(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{Be(t,o)})})}),{initialScrollTop:r}},kt(Va,cr,Js),{singleton:!0}),Dme=ut(([{viewportHeight:e},{totalListHeight:t}])=>{const n=fe(!1),r=rr(re(Sn(n,e,t),Le(([o])=>o),ye(([,o,i])=>Math.max(0,o-i)),pa(0),Pt()),0);return{alignToBottom:n,paddingTopAddition:r}},kt(cr,p9),{singleton:!0}),F_=ut(([{scrollTo:e,scrollContainerState:t}])=>{const n=Xe(),r=Xe(),o=Xe(),i=fe(!1),a=fe(void 0);return Se(re(Sn(n,r),ye(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),Se(re(e,$e(r),ye(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),o),{useWindowScroll:i,customScrollParent:a,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},kt(cr)),Lme=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:i,...a}})=>er?{...a,behavior:o,align:i??"end"}:null,Nme=ut(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:i,fixedHeaderHeight:a,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=Xe();return Se(re(c,$e(e,o,t,i,a,s,r),$e(n),ye(([[f,d,h,p,m,_,b,g],E])=>{const{done:T,behavior:O,align:A,calculateViewLocation:C=Lme,...y}=f,S=s9(f,d,p-1),v=Kf(S,d.offsetTree,E)+m+_,x=v+Uo(d.sizeTree,S)[1],I=g+_,R=g+h-b,k=C({itemTop:v,itemBottom:x,viewportTop:I,viewportBottom:R,locationParams:{behavior:O,align:A,...y}});return k?T&&$i(re(l,Le(M=>M===!1),Iu(Nr(l)?1:2)),T):T&&T(),k}),Le(f=>f!==null)),u),{scrollIntoView:c}},kt(mi,cr,Pd,Js,Ua),{singleton:!0}),Bme=ut(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:s}])=>{const l=Xe(),u=fe(void 0),c=fe(null),f=fe(null);return Se(a,c),Se(s,f),ft(re(l,$e(e,n,i,c,f)),([d,h,p,m,_,b])=>{const g=vme(h.sizeTree);m&&_!==null&&b!==null&&(p=_.scrollTop-b.offsetTop),d({ranges:g,scrollTop:p})}),Se(re(u,Le(R_),ye(jme)),r),Se(re(o,$e(u),Le(([,d])=>d!==void 0),Pt(),ye(([,d])=>d.ranges)),t),{getState:l,restoreStateFrom:u}},kt(mi,cr,Id,Va,F_));function jme(e){return{offset:e.scrollTop,index:0,align:"start"}}const Fme=ut(([e,t,n,r,o,i,a,s,l,u])=>({...e,...t,...n,...r,...o,...i,...a,...s,...l,...u}),kt(j_,Tme,Va,h9,p9,Mme,Dme,F_,Nme,Ua)),$me=ut(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:i,data:a,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:f},{initialTopMostItemIndex:d,scrolledToInitialItem:h},p,m,_,{listState:b,topItemsIndexes:g,...E},{scrollToIndex:T},O,{topItemCount:A},{groupCounts:C},y])=>(Se(E.rangeChanged,y.scrollSeekRangeChanged),Se(re(y.windowViewportRect,ye(S=>S.visibleHeight)),p.viewportHeight),{totalCount:e,data:a,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:d,scrolledToInitialItem:h,topItemsIndexes:g,topItemCount:A,groupCounts:C,fixedItemHeight:n,defaultItemHeight:r,gap:c,..._,statefulTotalCount:u,listState:b,scrollToIndex:T,trackItemSizes:o,itemSize:i,groupIndices:l,...E,...y,...p,sizes:f,...m}),kt(mi,Id,cr,Bme,Ome,Js,Pd,kme,Ime,c9,Fme)),iv="-webkit-sticky",C6="sticky",y9=m9(()=>{if(typeof document>"u")return C6;const e=document.createElement("div");return e.style.position=iv,e.style.position===iv?iv:C6});function g9(e,t){const n=ee.useRef(null),r=ee.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,f;if(t){const d=t.getBoundingClientRect(),h=l.top-d.top;c=d.height-Math.max(0,h),f=h+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),f=l.top+window.pageYOffset;n.current={offsetTop:f,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:o,ref:i}=M_(r),a=ee.useCallback(()=>{r(i.current)},[r,i]);return ee.useEffect(()=>{if(t){t.addEventListener("scroll",a);const s=new ResizeObserver(a);return s.observe(t),()=>{t.removeEventListener("scroll",a),s.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),o}const v9=ee.createContext(void 0),w9=ee.createContext(void 0);function b9(e){return e}const zme=ut(()=>{const e=fe(l=>`Item ${l}`),t=fe(null),n=fe(l=>`Group ${l}`),r=fe({}),o=fe(b9),i=fe("div"),a=fe(Hu),s=(l,u=null)=>rr(re(r,ye(c=>c[l]),Pt()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:i,scrollerRef:a,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),Ume=ut(([e,t])=>({...e,...t}),kt($me,zme)),Vme=({height:e})=>ee.createElement("div",{style:{height:e}}),Hme={position:y9(),zIndex:1,overflowAnchor:"none"},Wme={overflowAnchor:"none"},x6=ee.memo(function({showTopList:t=!1}){const n=We("listState"),r=yo("sizeRanges"),o=We("useWindowScroll"),i=We("customScrollParent"),a=yo("windowScrollContainerState"),s=yo("scrollContainerState"),l=i||o?a:s,u=We("itemContent"),c=We("context"),f=We("groupContent"),d=We("trackItemSizes"),h=We("itemSize"),p=We("log"),m=yo("gap"),{callbackRef:_}=ime(r,h,d,t?Hu:l,p,m,i),[b,g]=ee.useState(0);$_("deviation",k=>{b!==k&&g(k)});const E=We("EmptyPlaceholder"),T=We("ScrollSeekPlaceholder")||Vme,O=We("ListComponent"),A=We("ItemComponent"),C=We("GroupComponent"),y=We("computeItemKey"),S=We("isSeeking"),v=We("groupIndices").length>0,x=We("paddingTopAddition"),I=We("scrolledToInitialItem"),R=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+x,paddingBottom:n.offsetBottom,marginTop:b,...I?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&E?ee.createElement(E,gr(E,c)):ee.createElement(O,{...gr(O,c),ref:_,style:R,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(k=>{const M=k.originalIndex,N=y(M+n.firstItemIndex,k.data,c);return S?ee.createElement(T,{...gr(T,c),key:N,index:k.index,height:k.size,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?ee.createElement(C,{...gr(C,c),key:N,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,style:Hme},f(k.index,c)):ee.createElement(A,{...gr(A,c),key:N,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,"data-item-group-index":k.groupIndex,item:k.data,style:Wme},v?u(k.index,k.groupIndex,k.data,c):u(k.index,k.data,c))}))}),Gme={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Fm={width:"100%",height:"100%",position:"absolute",top:0},Kme={width:"100%",position:y9(),top:0,zIndex:1};function gr(e,t){if(typeof e!="string")return{context:t}}const Xme=ee.memo(function(){const t=We("HeaderComponent"),n=yo("headerHeight"),r=We("headerFooterTag"),o=Qs(a=>n(Ma(a,"height"))),i=We("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null}),qme=ee.memo(function(){const t=We("FooterComponent"),n=yo("footerHeight"),r=We("headerFooterTag"),o=Qs(a=>n(Ma(a,"height"))),i=We("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null});function S9({usePublisher:e,useEmitter:t,useEmitterValue:n}){return ee.memo(function({style:i,children:a,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),f=n("scrollerRef"),d=n("context"),{scrollerRef:h,scrollByCallback:p,scrollToCallback:m}=e9(l,c,u,f);return t("scrollTo",m),t("scrollBy",p),ee.createElement(u,{ref:h,style:{...Gme,...i},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...gr(u,d)},a)})}function _9({usePublisher:e,useEmitter:t,useEmitterValue:n}){return ee.memo(function({style:i,children:a,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),f=n("totalListHeight"),d=n("deviation"),h=n("customScrollParent"),p=n("context"),{scrollerRef:m,scrollByCallback:_,scrollToCallback:b}=e9(l,c,u,Hu,h);return nme(()=>(m.current=h||window,()=>{m.current=null}),[m,h]),t("windowScrollTo",b),t("scrollBy",_),ee.createElement(u,{style:{position:"relative",...i,...f!==0?{height:f+d}:{}},"data-virtuoso-scroller":!0,...s,...gr(u,p)},a)})}const Yme=({children:e})=>{const t=ee.useContext(v9),n=yo("viewportHeight"),r=yo("fixedItemHeight"),o=Qs(q7(n,i=>Ma(i,"height")));return ee.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),ee.createElement("div",{style:Fm,ref:o,"data-viewport-type":"element"},e)},Zme=({children:e})=>{const t=ee.useContext(v9),n=yo("windowViewportRect"),r=yo("fixedItemHeight"),o=We("customScrollParent"),i=g9(n,o);return ee.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),ee.createElement("div",{ref:i,style:Fm,"data-viewport-type":"window"},e)},Qme=({children:e})=>{const t=We("TopItemListComponent"),n=We("headerHeight"),r={...Kme,marginTop:`${n}px`},o=We("context");return ee.createElement(t||"div",{style:r,context:o},e)},Jme=ee.memo(function(t){const n=We("useWindowScroll"),r=We("topItemsIndexes").length>0,o=We("customScrollParent"),i=o||n?nye:tye,a=o||n?Zme:Yme;return ee.createElement(i,{...t},r&&ee.createElement(Qme,null,ee.createElement(x6,{showTopList:!0})),ee.createElement(a,null,ee.createElement(Xme,null),ee.createElement(x6,null),ee.createElement(qme,null)))}),{Component:eye,usePublisher:yo,useEmitterValue:We,useEmitter:$_}=Q7(Ume,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Jme),tye=S9({usePublisher:yo,useEmitterValue:We,useEmitter:$_}),nye=_9({usePublisher:yo,useEmitterValue:We,useEmitter:$_}),rye=eye,O6={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},oye={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:A6,ceil:P6,floor:y0,min:av,max:rf}=Math;function iye(e){return{...oye,items:e}}function T6(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const i=n===null?null:n[o+e];return{index:o+e,data:i}})}function aye(e,t){return e&&e.column===t.column&&e.row===t.row}function Ih(e,t){return e&&e.width===t.width&&e.height===t.height}const sye=ut(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:i,scrollTo:a,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},f,d,{propsReady:h,didMount:p},{windowViewportRect:m,useWindowScroll:_,customScrollParent:b,windowScrollContainerState:g,windowScrollTo:E},T])=>{const O=fe(0),A=fe(0),C=fe(O6),y=fe({height:0,width:0}),S=fe({height:0,width:0}),v=Xe(),x=Xe(),I=fe(0),R=fe(null),k=fe({row:0,column:0}),M=Xe(),N=Xe(),D=fe(!1),L=fe(0),j=fe(!0),F=fe(!1);ft(re(p,$e(L),Le(([X,J])=>!!J)),()=>{Be(j,!1),Be(A,0)}),ft(re(Sn(p,j,S,y,L,F),Le(([X,J,te,le,,ge])=>X&&!J&&te.height!==0&&le.height!==0&&!ge)),([,,,,X])=>{Be(F,!0),N_(1,()=>{Be(v,X)}),$i(re(r),()=>{Be(n,[0,0]),Be(j,!0)})}),Se(re(N,Le(X=>X!=null&&X.scrollTop>0),bi(0)),A),ft(re(p,$e(N),Le(([,X])=>X!=null)),([,X])=>{X&&(Be(y,X.viewport),Be(S,X==null?void 0:X.item),Be(k,X.gap),X.scrollTop>0&&(Be(D,!0),$i(re(r,Iu(1)),J=>{Be(D,!1)}),Be(a,{top:X.scrollTop})))}),Se(re(y,ye(({height:X})=>X)),o),Se(re(Sn(De(y,Ih),De(S,Ih),De(k,(X,J)=>X&&X.column===J.column&&X.row===J.row),De(r)),ye(([X,J,te,le])=>({viewport:X,item:J,gap:te,scrollTop:le}))),M),Se(re(Sn(De(O),t,De(k,aye),De(S,Ih),De(y,Ih),De(R),De(A),De(D),De(j),De(L)),Le(([,,,,,,,X])=>!X),ye(([X,[J,te],le,ge,se,ue,Ie,,gt,ie])=>{const{row:Ce,column:Ne}=le,{height:ze,width:fr}=ge,{width:Kt}=se;if(Ie===0&&(X===0||Kt===0))return O6;if(fr===0){const el=B_(ie,X),kd=el===0?Math.max(Ie-1,0):el;return iye(T6(el,kd,ue))}const Cn=E9(Kt,fr,Ne);let xn,zt;gt?J===0&&te===0&&Ie>0?(xn=0,zt=Ie-1):(xn=Cn*y0((J+Ce)/(ze+Ce)),zt=Cn*P6((te+Ce)/(ze+Ce))-1,zt=av(X-1,rf(zt,Cn-1)),xn=av(zt,rf(0,xn))):(xn=0,zt=-1);const Co=T6(xn,zt,ue),{top:Vo,bottom:Ha}=I6(se,le,ge,Co),Wa=P6(X/Cn),Rd=Wa*ze+(Wa-1)*Ce-Ha;return{items:Co,offsetTop:Vo,offsetBottom:Rd,top:Vo,bottom:Ha,itemHeight:ze,itemWidth:fr}})),C),Se(re(R,Le(X=>X!==null),ye(X=>X.length)),O),Se(re(Sn(y,S,C,k),Le(([X,J,{items:te}])=>te.length>0&&J.height!==0&&X.height!==0),ye(([X,J,{items:te},le])=>{const{top:ge,bottom:se}=I6(X,le,J,te);return[ge,se]}),Pt(qf)),n);const B=fe(!1);Se(re(r,$e(B),ye(([X,J])=>J||X!==0)),B);const U=Kr(re(De(C),Le(({items:X})=>X.length>0),$e(O,B),Le(([{items:X},J,te])=>te&&X[X.length-1].index===J-1),ye(([,X])=>X-1),Pt())),K=Kr(re(De(C),Le(({items:X})=>X.length>0&&X[0].index===0),bi(0),Pt())),W=Kr(re(De(C),$e(D),Le(([{items:X},J])=>X.length>0&&!J),ye(([{items:X}])=>({startIndex:X[0].index,endIndex:X[X.length-1].index})),Pt(f9),pa(0)));Se(W,d.scrollSeekRangeChanged),Se(re(v,$e(y,S,O,k),ye(([X,J,te,le,ge])=>{const se=u9(X),{align:ue,behavior:Ie,offset:gt}=se;let ie=se.index;ie==="LAST"&&(ie=le-1),ie=rf(0,ie,av(le-1,ie));let Ce=Bw(J,ge,te,ie);return ue==="end"?Ce=A6(Ce-J.height+te.height):ue==="center"&&(Ce=A6(Ce-J.height/2+te.height/2)),gt&&(Ce+=gt),{top:Ce,behavior:Ie}})),a);const Q=rr(re(C,ye(X=>X.offsetBottom+X.bottom)),0);return Se(re(m,ye(X=>({width:X.visibleWidth,height:X.visibleHeight}))),y),{data:R,totalCount:O,viewportDimensions:y,itemDimensions:S,scrollTop:r,scrollHeight:x,overscan:e,scrollBy:i,scrollTo:a,scrollToIndex:v,smoothScrollTargetReached:s,windowViewportRect:m,windowScrollTo:E,useWindowScroll:_,customScrollParent:b,windowScrollContainerState:g,deviation:I,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:A,gap:k,restoreStateFrom:N,...d,initialTopMostItemIndex:L,gridState:C,totalListHeight:Q,...f,startReached:K,endReached:U,rangeChanged:W,stateChanged:M,propsReady:h,stateRestoreInProgress:D,...T}},kt(j_,cr,Td,h9,Va,F_,Ua));function I6(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const i=Bw(e,t,n,r[0].index),a=Bw(e,t,n,r[r.length-1].index)+o;return{top:i,bottom:a}}function Bw(e,t,n,r){const o=E9(e.width,n.width,t.column),i=y0(r/o),a=i*n.height+rf(0,i-1)*t.row;return a>0?a+t.row:a}function E9(e,t,n){return rf(1,y0((e+n)/(y0(t)+n)))}const lye=ut(()=>{const e=fe(u=>`Item ${u}`),t=fe({}),n=fe(null),r=fe("virtuoso-grid-item"),o=fe("virtuoso-grid-list"),i=fe(b9),a=fe("div"),s=fe(Hu),l=(u,c=null)=>rr(re(t,ye(f=>f[u]),Pt()),c);return{context:n,itemContent:e,components:t,computeItemKey:i,itemClassName:r,listClassName:o,headerFooterTag:a,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),uye=ut(([e,t])=>({...e,...t}),kt(sye,lye)),cye=ee.memo(function(){const t=Dt("gridState"),n=Dt("listClassName"),r=Dt("itemClassName"),o=Dt("itemContent"),i=Dt("computeItemKey"),a=Dt("isSeeking"),s=Fo("scrollHeight"),l=Dt("ItemComponent"),u=Dt("ListComponent"),c=Dt("ScrollSeekPlaceholder"),f=Dt("context"),d=Fo("itemDimensions"),h=Fo("gap"),p=Dt("log"),m=Dt("stateRestoreInProgress"),_=Qs(b=>{const g=b.parentElement.parentElement.scrollHeight;s(g);const E=b.firstChild;if(E){const{width:T,height:O}=E.getBoundingClientRect();d({width:T,height:O})}h({row:R6("row-gap",getComputedStyle(b).rowGap,p),column:R6("column-gap",getComputedStyle(b).columnGap,p)})});return m?null:ee.createElement(u,{ref:_,className:n,...gr(u,f),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(b=>{const g=i(b.index,b.data,f);return a?ee.createElement(c,{key:g,...gr(c,f),index:b.index,height:t.itemHeight,width:t.itemWidth}):ee.createElement(l,{...gr(l,f),className:r,"data-index":b.index,key:g},o(b.index,b.data,f))}))}),fye=ee.memo(function(){const t=Dt("HeaderComponent"),n=Fo("headerHeight"),r=Dt("headerFooterTag"),o=Qs(a=>n(Ma(a,"height"))),i=Dt("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null}),dye=ee.memo(function(){const t=Dt("FooterComponent"),n=Fo("footerHeight"),r=Dt("headerFooterTag"),o=Qs(a=>n(Ma(a,"height"))),i=Dt("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null}),hye=({children:e})=>{const t=ee.useContext(w9),n=Fo("itemDimensions"),r=Fo("viewportDimensions"),o=Qs(i=>{r(i.getBoundingClientRect())});return ee.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),ee.createElement("div",{style:Fm,ref:o},e)},pye=({children:e})=>{const t=ee.useContext(w9),n=Fo("windowViewportRect"),r=Fo("itemDimensions"),o=Dt("customScrollParent"),i=g9(n,o);return ee.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),ee.createElement("div",{ref:i,style:Fm},e)},mye=ee.memo(function({...t}){const n=Dt("useWindowScroll"),r=Dt("customScrollParent"),o=r||n?gye:yye,i=r||n?pye:hye;return ee.createElement(o,{...t},ee.createElement(i,null,ee.createElement(fye,null),ee.createElement(cye,null),ee.createElement(dye,null)))}),{Component:jye,usePublisher:Fo,useEmitterValue:Dt,useEmitter:C9}=Q7(uye,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},mye),yye=S9({usePublisher:Fo,useEmitterValue:Dt,useEmitter:C9}),gye=_9({usePublisher:Fo,useEmitterValue:Dt,useEmitter:C9});function R6(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Xr.WARN),t==="normal"?0:parseInt(t??"0",10)}function z_({view:e,changingView:t}){const[n,r]=Z(s=>{var l;return[s.events[e]||[],((l=s.eventsNewer[e])==null?void 0:l.length)||0]}),o=P.useRef(Date.now()),i=async()=>{if(o.current>Date.now()-2e3||t===!0)return;o.current=Date.now();const s=Z.getState().nextQuery;s&&s.next&&s.next.reqCount&&s.next.reqCount>2&&Z.getState().events[e]&&Z.getState().events[e].length<10?await Z.getState().getEvents({token:s.token,query:{...s.next,filters:{...s.next.filters,until:Math.round(Date.now()/1e3),since:Math.round(Date.now()/1e3)-30*24*60*60}}},"replace"):await Z.getState().getEvents()};P.useEffect(()=>{Z.getState().nextQuery&&i()},[]);const a=()=>{Z.getState().mergeNewerEvents(e)};return w.jsxs(w.Fragment,{children:[r>0&&w.jsxs(be,{onClick:a,variant:"outline",colorScheme:"blue",size:"sm",mb:2,width:"100%",children:[r," new events"]}),w.jsx(rye,{useWindowScroll:!0,data:n,itemContent:(s,l)=>w.jsx(ve,{mb:2,children:w.jsx(Dm,{data:l,level:0},s)}),endReached:()=>{i()}})]})}function vye({showFollowing:e,showMentions:t,changeFeed:n}){const[r,o]=P.useState([]),[i,a]=P.useState("global"),s=async()=>{const c=await Z.getState().getAllLists();c&&o(c.map(f=>({id:f.id,title:f.title})))},l=()=>{o([])},u=c=>{a(c),n(c)};return P.useEffect(()=>(setTimeout(()=>{s()},100),l),[]),w.jsx(aR,{onChange:u,value:i,children:w.jsxs(fm,{direction:"row",children:[w.jsx(xc,{value:"global",children:"Global"}),e&&w.jsx(xc,{value:"following",children:"Following"}),t&&w.jsx(xc,{value:"mentions",children:"Mentions"}),r&&r.length>0&&r.map(c=>w.jsx(xc,{value:c.id,children:c.title},c.id))]})})}function sv(e){return new Fa({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT],until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-1728e5)/1e3),limit:e||15})}function jw(e,t){const n=new Fa({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT],authors:e,until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-6048e5)/1e3),limit:t||15});return t&&(n.limit=t),n}function wye(e,t){const n=new Fa({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT],"#t":e,until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-6048e5)/1e3),limit:t||15});return t&&(n.limit=t),n}function bye(e,t){const n=new Fa({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT,ar.REPOST],"#p":e});return t&&(n.limit=t),n}function Sye(){const[e,t,n]=Z(c=>[c.status,c.keypairIsLoaded,c.keypair]),r=P.useRef(!1),o=P.useRef(sv()),[i,a]=P.useState("global"),s=P.useRef(!1),l=async()=>{r.current||(r.current=!0,o.current=sv(),a("global"),await Z.getState().getEvents({token:i,query:{direction:"OLDER",filters:o.current,stickyInterval:!0,isLive:!0}}),r.current=!0)};P.useEffect(()=>(["online","offline"].includes(Z.getState().status)&&l(),()=>{Z.getState().unsubscribeByToken(i)}),[]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&l()},[e]);const u=async c=>{if(s.current=!0,await Z.getState().unsubscribeByToken(i),a(c),c==="global")o.current=sv();else if(c==="following"){const f=await Z.getState().getAllUsersFollowing();f&&(o.current=jw(f==null?void 0:f.map(d=>d.user.pubkey)))}else if(c==="mentions")o.current=bye([n.publicKey]);else{const f=await Z.getState().getList(c);if(f&&f.userPubkeys)o.current=jw(f.userPubkeys);else{console.error("List not found."),s.current=!1;return}}await Z.getState().getEvents({token:c,query:{filters:o.current,stickyInterval:!0,isLive:!0}}),s.current=!1};return w.jsxs(ve,{children:[w.jsx(ve,{p:2,children:w.jsx(vye,{showFollowing:!0,showMentions:t,changeFeed:u})}),w.jsx(z_,{changingView:s.current,view:i})]})}function _ye(){const[e,t]=P.useState([]),[n,r]=P.useState(0),[o,i]=P.useState(!1),[a,s]=P.useState(!1),l=P.useRef(0),u=async()=>{await Z.getState().getPopularUsers().then(h=>{h&&h.length>0?(r(100),clearInterval(l.current),t(h)):n>90?(s(!0),clearInterval(l.current),i(!1)):r(p=>p+5)})},c=async()=>{t([]),r(0),l.current=setInterval(async()=>{await u()},2e3)};P.useEffect(()=>(c(),()=>{l.current&&clearInterval(l.current)}),[]);const f=async()=>{i(!0),await Z.getState().calculatePopular(),await c(),i(!1)},d=w.jsx(w.Fragment,{children:a?w.jsx(me,{fontSize:"sm",mb:2,children:"Looks like there are no events to work with yet. Try again after browsing a little longer."}):w.jsx(w.Fragment,{children:w.jsx(oR,{size:"xs",mb:2,hasStripe:!0,value:n})})});return w.jsxs(ve,{children:[w.jsxs(pt,{spacing:2,mb:4,children:[w.jsx(jo,{as:"h2",size:"md",marginBottom:4,children:"Hot right now"}),w.jsx(Xs,{}),!o&&n===100?w.jsx(be,{onClick:f,size:"xs",marginBottom:2,children:"Refresh"}):w.jsx(be,{onClick:c,size:"xs",disabled:!0,marginBottom:2,children:"Calculating ..."})]}),e.length>0?e.map((h,p)=>w.jsx($a,{user:h.user,opts:{showAbout:!1,showBanner:!1,showFollowing:!0,showBlock:!1,relayUrls:[],isBlocked:!1}},p)):d]})}function Eye(){const[e]=Z(t=>[t.connected]);return w.jsxs(ju,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsxs(ve,{children:[w.jsx(Sye,{}),!e&&w.jsx(Bu,{src:Vk})]}),w.jsx(ve,{display:"flex",flexDirection:"column",children:w.jsx(ve,{mt:4,children:w.jsx(_ye,{})})})]})}function Cye(){const[e,t]=Z(f=>[f.keypair.publicKey,f.status]),[n,r]=P.useState([]),[o,i]=P.useState(0),[a,s]=P.useState(!1);P.useEffect(()=>{l();const f=setInterval(l,3e3);return()=>clearInterval(f)},[]),P.useEffect(()=>{a&&setTimeout(()=>{s(!1)},3e3)},[a]);const l=async()=>{await Z.getState().getAllUsersFollowing().then(f=>{f&&f.length>0&&r(f)}),e&&await Z.getState().lastContactsUpdate(e).then(f=>{f&&i(f)})},u=async()=>{s(!0),await Z.getState().subscribe({type:Ed.REQ,filters:new Fa({kinds:[ar.CONTACTS],authors:[e]}),options:{timeoutIn:1e4}})},c=async()=>{s(!0);const f=nae({contacts:n.map(d=>({key:d.user.pubkey,relayUrls:d.relayUrls}))});await Z.getState().signAndSendEvent({event:f})};return w.jsxs(ve,{children:[w.jsx(jo,{size:"lg",children:"Following"}),n.length>0?w.jsxs(w.Fragment,{children:[w.jsx(me,{maxWidth:"800px",children:"You may decide not to publish the people you follow, but you won't be able to access this list from other devices, and it will be lost if you clear your browser data. Note: Load overwrites local data."}),w.jsxs(pt,{mt:2,mb:2,children:[w.jsxs(ud,{children:[w.jsx(be,{onClick:u,isDisabled:!e||t!=="online",isLoading:a,children:"Load"}),w.jsx(be,{onClick:c,isDisabled:!e||t!=="online",isLoading:a,children:"Publish"})]}),w.jsxs(me,{children:["Last published:"," ",o?new Date(o*1e3).toLocaleString():"never"]})]}),n.map(f=>w.jsx(ve,{mb:"3",children:w.jsx($a,{user:f.user,opts:{showFollowing:!0,relayUrls:f.relayUrls}},f.user.pubkey)},f.user.pubkey))]}):w.jsxs(w.Fragment,{children:[w.jsx(me,{children:"Follow users to easily access their content. By default, this list is not public."}),w.jsx(ve,{pb:2,pt:2,children:w.jsx(be,{onClick:u,isDisabled:!e||t!=="online",isLoading:a,children:"Load followers"})}),w.jsx(me,{fontWeight:"bold",children:"You are not following anyone."})]})]})}function xye(){const[e]=Z(m=>[m.status]),t=P.useRef(void 0),n=P.useRef(null),r=P.useRef(null),[o,i]=P.useState(null),[a,s]=P.useState(!1),{npub:l}=t_(),u=`profile-${l}`,c=()=>t.current===l,f=async(m,_=0)=>{s(!0),await Z.getState().getUser(m).then(b=>{b?(i(b),s(!1),r.current&&clearTimeout(r.current)):r.current=setTimeout(async()=>{if(console.log(`Retrying to load user ${m} ...`),_===2)await Z.getState().requestInformation({idsOrKeys:[m],source:"users"},{timeoutIn:1e4});else if(_>20){s(!1),r.current&&clearTimeout(r.current);return}await f(m,_+1)},1e3)})},d=async m=>{await Z.getState().count(m)},h=async()=>{if(l)try{const m=Cd(l);let _;for(const b of m.tlvItems)if(b.type===0){_=b.value;break}if(!_)return;n.current=_,i(null),await f(_),await d(_)}catch(m){console.log(m);return}},p=async m=>{t.current=l,await Z.getState().getEvents({token:u,query:{direction:"OLDER",filters:jw([m]),stickyInterval:!0,isLive:!0}})};return P.useEffect(()=>()=>{r.current&&clearTimeout(r.current),Z.getState().unsubscribeByToken(u)},[]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&h()},[e,l]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&n.current&&!c()&&p(n.current)},[e,n.current]),w.jsxs(ju,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsxs(ve,{children:[w.jsxs(ve,{mb:4,children:[a&&w.jsx(w_,{text:"Just a sec ... Searching the Matrix for the user."}),o&&w.jsx($a,{user:o.user,opts:{showAbout:!0,showBanner:!0,showFollowing:!0,relayUrls:o.relayUrls,showBlock:!0}})]}),w.jsx(z_,{view:u})]}),w.jsx(ve,{display:"flex",flexDirection:"column"})]})}function Oye({props:e}){const[t,n]=P.useState({name:"",display_name:"",picture:"",banner:"",nip05:"",website:"",about:"",image:"",lud16:"",lud06:""}),[r,o]=P.useState(""),[i,a]=P.useState(!1),s=P.useRef(!1),l=Vi(),{isOpen:u,onOpen:c,onClose:f}=Wn(),[d,h]=P.useState([]),p=d.filter(E=>E.isAssigned).length,m=(E,T)=>{h(d.map(O=>O.data.url===E?{...O,isAssigned:T==="add"}:O))};P.useEffect(()=>{e.metadata&&!s.current&&n(Object.assign(t,e.metadata))},[e.metadata]),P.useEffect(()=>{Z.getState().getRelays().then(E=>{E&&h(E.map(T=>T.isReady&&T.write?{data:T,isAssigned:!0}:{data:T,isAssigned:!1}))})},[]);const _=E=>{l({title:"Error",description:E,status:"error",duration:5e3,isClosable:!0})},b=async()=>{a(!0);const E=d.map(A=>A.data.url);if(E.length===0){_("Select at least one relay"),a(!1);return}const T={};for(const[A,C]of Object.entries(t))C&&C!==""&&(T[A]=C);const O=Zie({userMetadata:T,mastodonUrl:r});if(Object.keys(T).length===0){l({title:"No changes",description:"No changes to update.",status:"info",duration:5e3,isClosable:!0}),a(!1);return}try{await Z.getState().signAndSendEvent({event:O,relayUrls:E}),a(!1),await Z.getState().subscribe({type:Ed.REQ,filters:new Fa({authors:[e.pubkey],kinds:[ar.METADATA]}),options:{timeoutIn:1e4,view:"user-profile"}})}catch(A){console.error(A),a(!1)}},g=E=>{const{name:T,value:O}=E.target;n(A=>({...A,[T]:O})),s.current=!0};return w.jsxs(ve,{marginBottom:10,children:[w.jsxs(Jn,{id:"name",mb:4,children:[w.jsx(In,{children:"Name"}),w.jsx(Ht,{name:"name",value:t.name,onChange:g})]}),w.jsxs(Jn,{id:"display_name",mb:4,children:[w.jsx(In,{children:"Display Name"}),w.jsx(Ht,{name:"display_name",value:t.display_name||"",onChange:g})]}),w.jsxs(Jn,{id:"website",mb:4,children:[w.jsx(In,{children:"Website"}),w.jsx(Ht,{name:"website",value:t.website||"",onChange:g})]}),w.jsxs(Jn,{id:"about",mb:4,children:[w.jsx(In,{children:"About"}),w.jsx(QS,{name:"about",value:t.about||"",onChange:g})]}),w.jsxs(Jn,{id:"picture",mb:4,children:[w.jsx(In,{children:"Picture URL"}),w.jsx(Ht,{name:"picture",value:t.picture||"",onChange:g}),w.jsx(rs,{children:"URL for your profile picture."})]}),w.jsxs(Jn,{id:"banner",mb:4,children:[w.jsx(In,{children:"Banner URL"}),w.jsx(Ht,{name:"banner",value:t.banner||"",onChange:g}),w.jsx(rs,{children:"URL for your profile banner."})]}),w.jsxs(Jn,{id:"image",mb:4,children:[w.jsx(In,{children:"Image URL"}),w.jsx(Ht,{name:"image",value:t.image||"",onChange:g}),w.jsx(rs,{children:"URL for an additional image."})]}),w.jsxs(Jn,{id:"nip05",mb:4,children:[w.jsx(In,{children:"NIP05"}),w.jsx(Ht,{name:"nip05",value:t.nip05||"",onChange:g}),w.jsx(rs,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),w.jsxs(Jn,{id:"lud16",mb:4,children:[w.jsx(In,{children:"LUD16"}),w.jsx(Ht,{name:"lud16",value:t.lud16||"",onChange:g}),w.jsx(rs,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),w.jsxs(Jn,{id:"lud06",mb:4,children:[w.jsx(In,{children:"LUD06"}),w.jsx(Ht,{name:"lud06",value:t.lud06||"",onChange:g}),w.jsx(rs,{children:"bech32 encoded lnurl"})]}),w.jsxs(Jn,{id:"mastodonUrl",mb:4,children:[w.jsx(In,{children:"Mastodon URL"}),w.jsx(Ht,{name:"mastodonUrl",value:r,onChange:E=>o(E.target.value)})]}),u&&w.jsx(Fk,{relays:d,onChange:m}),w.jsxs(ud,{children:[w.jsx(be,{colorScheme:"blue",type:"submit",isLoading:i,onClick:b,children:"Send update"}),w.jsxs(be,{variant:"outline",onClick:u?f:c,children:["Select relays (",p,")"]}),w.jsx(be,{isDisabled:!s.current||p===0,onClick:()=>s.current=!1,children:"Reset"})]})]})}function Aye(){const[e,t]=Z(u=>{var c;return[((c=u.keypair)==null?void 0:c.publicKey)||"",u.connected]}),[n,r]=P.useState(null),[o,i]=P.useState([]),a=Vi(),s=async()=>{if(!e||e==="")return;const u=await Z.getState().getUser(e);u&&(r(u.user),i(u.relayUrls))},l=async()=>{if(!e||e===""){a({title:"Not found",description:"No user data found yet. Did you publish your profile to one of the connected relays?",status:"error",duration:5e3,isClosable:!0});return}await Z.getState().subscribe({type:Ed.REQ,filters:new Fa({authors:[e],kinds:[ar.METADATA]}),options:{timeoutIn:1e4,view:"user-profile"}}),a({title:"Refreshing ...",description:"Requesting information from the network.",status:"info",duration:5e3,isClosable:!0})};return P.useEffect(()=>{const u=setInterval(()=>{s()},1e3);return()=>{clearInterval(u)}},[]),w.jsxs(ve,{children:[n?w.jsx($a,{user:n,opts:{relayUrls:o}}):w.jsxs(w.Fragment,{children:[w.jsx(me,{children:'"No user data found yet. Did you publish your profile to one of the connected relays?".'}),t&&w.jsx(be,{onClick:l,children:"Try again"})]}),w.jsx(jo,{as:"h2",size:"lg",mb:4,mt:4,children:"Update your profile"}),w.jsx(Oye,{props:{pubkey:e,metadata:n==null?void 0:n.data}})]})}function Pye(){const[e,t]=P.useState([]),n=async()=>{await Z.getState().getAllUsersBlocked().then(r=>{r&&t(r)})};return P.useEffect(()=>{n();const r=setInterval(n,2e3);return()=>clearInterval(r)},[]),w.jsxs(ve,{children:[w.jsx(jo,{size:"lg",children:"Blocked"}),e.length>0?w.jsx(w.Fragment,{children:e.map(r=>w.jsx(ve,{mb:"3",children:w.jsx($a,{user:r.user,opts:{showFollowing:!1,showBlock:!0,relayUrls:r.relayUrls,isBlocked:!0}},r.user.pubkey)},r.user.pubkey))}):w.jsxs(w.Fragment,{children:[w.jsx(me,{children:"Block users to ignore their events. The information is stored in your browser and not shared with relays."}),w.jsx(me,{fontWeight:"bold",children:"You have not blocked anyone."})]})]})}function Tye({user:e,opts:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:a,avatarSize:s}}){const l=e.data&&e.data.picture?e.data.picture:"";return w.jsx(w.Fragment,{children:w.jsxs(KS,{children:[w.jsx(GS,{children:a?w.jsxs(ve,{position:"relative",children:[w.jsx(r1,{size:s,src:l}),w.jsx(ve,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(255, 255, 255, 0.5)",borderRadius:10}),w.jsx(me,{position:"absolute",right:"0",bottom:"0",backgroundColor:"white",height:15,width:15,textAlign:"center",borderRadius:10,fontSize:12,children:a})]}):w.jsx(r1,{size:s,src:l})}),w.jsxs(ZS,{children:[w.jsx(XS,{}),w.jsx(YS,{}),w.jsx(nR,{children:i}),w.jsx(qS,{children:w.jsx($a,{user:e,opts:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:a,avatarSize:s}})})]})]})})}function Iye(){const[e,t]=P.useState([]),[n,r]=P.useState(null),[o,i]=P.useState(""),[a,s]=P.useState(!1),{isOpen:l,onOpen:u,onClose:c}=Wn(),f=async()=>{await Z.getState().getAllLists().then(g=>{g&&t(g)})};P.useEffect(()=>{f();const g=setInterval(f,2e3);return()=>clearInterval(g)},[]);const d=async()=>{s(!0),await Z.getState().createList({title:o}),i(""),s(!1)},h=async g=>{s(!0),await Z.getState().deleteList(g),s(!1),await f()},p=async g=>{n&&(s(!0),await Z.getState().removeUserFromList(n.id,g),await f(),n.users&&r({...n,users:n.users.filter(E=>E.user.pubkey!==g)}),s(!1))},m=g=>w.jsx(ve,{children:(g==null?void 0:g.users)&&g.users.map(E=>w.jsx(Tye,{user:E.user,opts:{avatarSize:"sm",relayUrls:E.relayUrls}},E.user.pubkey))}),_=w.jsxs($r,{isOpen:l,onClose:c,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:"List"}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:(n==null?void 0:n.users)&&n.users.map(g=>w.jsx(ve,{p:1,children:w.jsxs(pt,{children:[w.jsx($a,{user:g.user,opts:{avatarSize:"sm",relayUrls:g.relayUrls}},g.user.pubkey),w.jsx(Xs,{}),w.jsx(be,{size:"sm",onClick:()=>p(g.user.pubkey),isLoading:a,children:"Remove"})]})},g.user.pubkey))})]})]}),b=g=>w.jsxs(ka,{children:[w.jsx(Nt,{children:g.title}),w.jsx(Nt,{children:m(g)}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(g),u()},children:"Edit"})}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>h(g.id),isLoading:a,children:"Delete"})})]},g.id);return w.jsxs(ve,{children:[w.jsx(jo,{size:"lg",children:"Lists"}),w.jsx(me,{children:"Lists make it easy to organize users."}),w.jsx(ve,{mt:2,mb:2,children:w.jsxs(pt,{children:[w.jsx(Ht,{value:o,onChange:g=>i(g.target.value),placeholder:"Friends"}),w.jsx(be,{size:"sm",onClick:d,isLoading:a,children:"Create list"})]})}),w.jsxs(wd,{variant:"simple",marginBottom:4,children:[w.jsx(pm,{children:w.jsxs(ka,{children:[w.jsx(Bt,{children:"Title"}),w.jsx(Bt,{children:"Users"}),w.jsx(Bt,{}),w.jsx(Bt,{})]})}),w.jsx(mm,{children:e.map(g=>b(g))})]}),_]})}function Rye(){const[e]=Z(d=>[d.connected]),t=P.useRef(!1),n=P.useRef(""),r=P.useRef([]),o=P.useRef(null),[i,a]=P.useState(!1),{note:s}=t_(),l=`event-${s}`,[u]=Z(d=>[d.events[l]?d.events[l][0]:null]),c=async(d=0)=>{await Z.getState().getEvent(n.current,{view:l,retryCount:d,relayUrls:r.current}).then(h=>{h||(console.log("Could not get event. Retrying..."),o.current=setTimeout(async()=>{if(d>20){a(!0),o.current&&clearTimeout(o.current);return}await c(d+1)},1e3))})},f=async d=>{if(!(!Z.getState().connected||t.current)){t.current=!0;try{const h=Cd(d);for(const p of h.tlvItems)if(p.type===0){n.current=p.value;break}else p.type===1&&r.current.push(p.value)}catch(h){console.log(h);return}await c()}};return P.useEffect(()=>(s&&f(s),()=>{o.current&&clearTimeout(o.current),Z.getState().unsubscribeByToken(l)}),[]),P.useEffect(()=>{e&&s&&f(s)},[e]),w.jsxs(ju,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsx(ve,{children:u?w.jsx(ve,{mb:4,children:w.jsx(Dm,{data:u,level:0})}):w.jsx(w.Fragment,{children:i?w.jsx(jo,{as:"h2",size:"md",marginBottom:4,children:"It looks like the event is not available on any of the connected relays."}):w.jsx(w_,{text:"Just a sec ... Searching the Matrix for the event."})})}),w.jsx(ve,{display:"flex",flexDirection:"column"})]})}function kye(){const[e]=Z(s=>[s.status]),t=P.useRef(void 0),n=P.useRef(null),{tag:r}=t_(),o=`view-${r}`,i=()=>t.current===r,a=async s=>{t.current=r,await Z.getState().getEvents({token:o,query:{direction:"OLDER",filters:wye([s]),stickyInterval:!0,isLive:!0}})};return P.useEffect(()=>()=>{n.current&&clearTimeout(n.current),Z.getState().unsubscribeByToken(o)},[]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&r&&!i()&&a(r)},[e,r]),w.jsxs(ju,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsx(ve,{children:w.jsx(z_,{view:o})}),w.jsx(ve,{display:"flex",flexDirection:"column"})]})}const Mye={initialColorMode:"dark",useSystemColorMode:!0},k6=lW({config:Mye,breakpoints:{sm:"500px"}}),Dye=async()=>{await Z.getState().init({maxEvents:bk})};Dye();K2.createRoot(document.getElementById("root")).render(w.jsxs(ee.StrictMode,{children:[w.jsx(pB,{initialColorMode:k6.config.initialColorMode}),w.jsx(AY,{theme:k6,children:w.jsx(Mre,{basename:"/nostr-ts/",children:w.jsx(Are,{children:w.jsxs(Po,{element:w.jsx(Kfe,{}),children:[w.jsx(Po,{path:"/",element:w.jsx(Eye,{})}),w.jsx(Po,{path:"/account",element:w.jsx(Hue,{})}),w.jsx(Po,{path:"/profile",element:w.jsx(Aye,{})}),w.jsx(Po,{path:"/following",element:w.jsx(Cye,{})}),w.jsx(Po,{path:"/blocked",element:w.jsx(Pye,{})}),w.jsx(Po,{path:"/lists",element:w.jsx(Iye,{})}),w.jsx(Po,{path:"/p/:npub",element:w.jsx(xye,{})}),w.jsx(Po,{path:"/e/:note",element:w.jsx(Rye,{})}),w.jsx(Po,{path:"/t/:tag",element:w.jsx(kye,{})})]})})})})]})); diff --git a/assets/index-d9df9ff8.js b/assets/index-d9df9ff8.js deleted file mode 100644 index 7ee7146..0000000 --- a/assets/index-d9df9ff8.js +++ /dev/null @@ -1,454 +0,0 @@ -function X3(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Or=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mO(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var vO={exports:{}},Fh={},yO={exports:{}},Me={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Nc=Symbol.for("react.element"),Z3=Symbol.for("react.portal"),Q3=Symbol.for("react.fragment"),J3=Symbol.for("react.strict_mode"),eD=Symbol.for("react.profiler"),tD=Symbol.for("react.provider"),nD=Symbol.for("react.context"),rD=Symbol.for("react.forward_ref"),oD=Symbol.for("react.suspense"),iD=Symbol.for("react.memo"),aD=Symbol.for("react.lazy"),lx=Symbol.iterator;function sD(e){return e===null||typeof e!="object"?null:(e=lx&&e[lx]||e["@@iterator"],typeof e=="function"?e:null)}var gO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bO=Object.assign,wO={};function _l(e,t,n){this.props=e,this.context=t,this.refs=wO,this.updater=n||gO}_l.prototype.isReactComponent={};_l.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_l.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function SO(){}SO.prototype=_l.prototype;function Yb(e,t,n){this.props=e,this.context=t,this.refs=wO,this.updater=n||gO}var Xb=Yb.prototype=new SO;Xb.constructor=Yb;bO(Xb,_l.prototype);Xb.isPureReactComponent=!0;var ux=Array.isArray,xO=Object.prototype.hasOwnProperty,Zb={current:null},EO={key:!0,ref:!0,__self:!0,__source:!0};function CO(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)xO.call(t,r)&&!EO.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(10?sn(Ol,--Gn):0,il--,zt===10&&(il=1,Vh--),zt}function nr(){return zt=Gn2||Yu(zt)>3?"":" "}function ID(e,t){for(;--t&&nr()&&!(zt<48||zt>102||zt>57&&zt<65||zt>70&&zt<97););return Bc(e,pd()+(t<6&&go()==32&&nr()==32))}function _g(e){for(;nr();)switch(zt){case e:return Gn;case 34:case 39:e!==34&&e!==39&&_g(zt);break;case 40:e===41&&_g(e);break;case 92:nr();break}return Gn}function AD(e,t){for(;nr()&&e+zt!==47+10;)if(e+zt===42+42&&go()===47)break;return"/*"+Bc(t,Gn-1)+"*"+Uh(e===47?e:nr())}function LD(e){for(;!Yu(go());)nr();return Bc(e,Gn)}function jD(e){return IO(md("",null,null,null,[""],e=RO(e),0,[0],e))}function md(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,f=a,d=0,g=0,w=0,y=1,k=1,S=1,b=0,C="",R=o,_=i,O=r,E=C;k;)switch(w=b,b=nr()){case 40:if(w!=108&&sn(E,f-1)==58){Pg(E+=qe(hd(b),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:E+=hd(b);break;case 9:case 10:case 13:case 32:E+=RD(w);break;case 92:E+=ID(pd()-1,7);continue;case 47:switch(go()){case 42:case 47:Pf(MD(AD(nr(),pd()),t,n),l);break;default:E+="/"}break;case 123*y:s[u++]=uo(E)*S;case 125*y:case 59:case 0:switch(b){case 0:case 125:k=0;case 59+c:S==-1&&(E=qe(E,/\f/g,"")),g>0&&uo(E)-f&&Pf(g>32?dx(E+";",r,n,f-1):dx(qe(E," ","")+";",r,n,f-2),l);break;case 59:E+=";";default:if(Pf(O=fx(E,t,n,u,c,o,s,C,R=[],_=[],f),i),b===123)if(c===0)md(E,t,O,O,R,i,f,s,_);else switch(d===99&&sn(E,3)===110?100:d){case 100:case 108:case 109:case 115:md(e,O,O,r&&Pf(fx(e,O,O,0,0,o,s,C,o,R=[],f),_),o,_,f,s,r?R:_);break;default:md(E,O,O,O,[""],_,0,s,_)}}u=c=g=0,y=S=1,C=E="",f=a;break;case 58:f=1+uo(E),g=w;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&TD()==125)continue}switch(E+=Uh(b),b*y){case 38:S=c>0?1:(E+="\f",-1);break;case 44:s[u++]=(uo(E)-1)*S,S=1;break;case 64:go()===45&&(E+=hd(nr())),d=go(),c=f=uo(C=E+=LD(pd())),b++;break;case 45:w===45&&uo(E)==2&&(y=0)}}return i}function fx(e,t,n,r,o,i,a,s,l,u,c){for(var f=o-1,d=o===0?i:[""],g=t1(d),w=0,y=0,k=0;w0?d[S]+" "+b:qe(b,/&\f/g,d[S])))&&(l[k++]=C);return Hh(e,t,n,o===0?Jb:s,l,u,c)}function MD(e,t,n){return Hh(e,t,n,PO,Uh(OD()),Gu(e,2,-2),0)}function dx(e,t,n,r){return Hh(e,t,n,e1,Gu(e,0,r),Gu(e,r+1,-1),r)}function Bs(e,t){for(var n="",r=t1(e),o=0;o6)switch(sn(e,t+1)){case 109:if(sn(e,t+4)!==45)break;case 102:return qe(e,/(.+:)(.+)-([^]+)/,"$1"+We+"$2-$3$1"+qd+(sn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Pg(e,"stretch")?LO(qe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(sn(e,t+1)!==115)break;case 6444:switch(sn(e,uo(e)-3-(~Pg(e,"!important")&&10))){case 107:return qe(e,":",":"+We)+e;case 101:return qe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+We+(sn(e,14)===45?"inline-":"")+"box$3$1"+We+"$2$3$1"+pn+"$2box$3")+e}break;case 5936:switch(sn(e,t+11)){case 114:return We+e+pn+qe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return We+e+pn+qe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return We+e+pn+qe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return We+e+pn+e+e}return e}var HD=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case e1:t.return=LO(t.value,t.length);break;case _O:return Bs([Vl(t,{value:qe(t.value,"@","@"+We)})],o);case Jb:if(t.length)return _D(t.props,function(i){switch(PD(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Bs([Vl(t,{props:[qe(i,/:(read-\w+)/,":"+qd+"$1")]})],o);case"::placeholder":return Bs([Vl(t,{props:[qe(i,/:(plac\w+)/,":"+We+"input-$1")]}),Vl(t,{props:[qe(i,/:(plac\w+)/,":"+qd+"$1")]}),Vl(t,{props:[qe(i,/:(plac\w+)/,pn+"input-$1")]})],o)}return""})}},WD=[HD],qD=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var k=y.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var o=t.stylisPlugins||WD,i={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(y){for(var k=y.getAttribute("data-emotion").split(" "),S=1;S=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var o5={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i5=/[A-Z]|^ms/g,a5=/_EMO_([^_]+?)_([^]*?)_EMO_/g,BO=function(t){return t.charCodeAt(1)===45},mx=function(t){return t!=null&&typeof t!="boolean"},gv=AO(function(e){return BO(e)?e:e.replace(i5,"-$&").toLowerCase()}),vx=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(a5,function(r,o,i){return co={name:o,styles:i,next:co},o})}return o5[t]!==1&&!BO(t)&&typeof n=="number"&&n!==0?n+"px":n};function Xu(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return co={name:n.name,styles:n.styles,next:co},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)co={name:r.name,styles:r.styles,next:co},r=r.next;var o=n.styles+";";return o}return s5(e,t,n)}case"function":{if(e!==void 0){var i=co,a=n(e);return co=i,Xu(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function s5(e,t,n){var r="";if(Array.isArray(n))for(var o=0;om.jsx(tm,{styles:WO}),m5=({scope:e=""})=>m.jsx(tm,{styles:HO` - html { - line-height: 1.5; - -webkit-text-size-adjust: 100%; - font-family: system-ui, sans-serif; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - -moz-osx-font-smoothing: grayscale; - touch-action: manipulation; - } - - body { - position: relative; - min-height: 100%; - margin: 0; - font-feature-settings: "kern"; - } - - ${e} :where(*, *::before, *::after) { - border-width: 0; - border-style: solid; - box-sizing: border-box; - word-wrap: break-word; - } - - main { - display: block; - } - - ${e} hr { - border-top-width: 1px; - box-sizing: content-box; - height: 0; - overflow: visible; - } - - ${e} :where(pre, code, kbd,samp) { - font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; - font-size: 1em; - } - - ${e} a { - background-color: transparent; - color: inherit; - text-decoration: inherit; - } - - ${e} abbr[title] { - border-bottom: none; - text-decoration: underline; - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; - } - - ${e} :where(b, strong) { - font-weight: bold; - } - - ${e} small { - font-size: 80%; - } - - ${e} :where(sub,sup) { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; - } - - ${e} sub { - bottom: -0.25em; - } - - ${e} sup { - top: -0.5em; - } - - ${e} img { - border-style: none; - } - - ${e} :where(button, input, optgroup, select, textarea) { - font-family: inherit; - font-size: 100%; - line-height: 1.15; - margin: 0; - } - - ${e} :where(button, input) { - overflow: visible; - } - - ${e} :where(button, select) { - text-transform: none; - } - - ${e} :where( - button::-moz-focus-inner, - [type="button"]::-moz-focus-inner, - [type="reset"]::-moz-focus-inner, - [type="submit"]::-moz-focus-inner - ) { - border-style: none; - padding: 0; - } - - ${e} fieldset { - padding: 0.35em 0.75em 0.625em; - } - - ${e} legend { - box-sizing: border-box; - color: inherit; - display: table; - max-width: 100%; - padding: 0; - white-space: normal; - } - - ${e} progress { - vertical-align: baseline; - } - - ${e} textarea { - overflow: auto; - } - - ${e} :where([type="checkbox"], [type="radio"]) { - box-sizing: border-box; - padding: 0; - } - - ${e} input[type="number"]::-webkit-inner-spin-button, - ${e} input[type="number"]::-webkit-outer-spin-button { - -webkit-appearance: none !important; - } - - ${e} input[type="number"] { - -moz-appearance: textfield; - } - - ${e} input[type="search"] { - -webkit-appearance: textfield; - outline-offset: -2px; - } - - ${e} input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none !important; - } - - ${e} ::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit; - } - - ${e} details { - display: block; - } - - ${e} summary { - display: list-item; - } - - template { - display: none; - } - - [hidden] { - display: none !important; - } - - ${e} :where( - blockquote, - dl, - dd, - h1, - h2, - h3, - h4, - h5, - h6, - hr, - figure, - p, - pre - ) { - margin: 0; - } - - ${e} button { - background: transparent; - padding: 0; - } - - ${e} fieldset { - margin: 0; - padding: 0; - } - - ${e} :where(ol, ul) { - margin: 0; - padding: 0; - } - - ${e} textarea { - resize: vertical; - } - - ${e} :where(button, [role="button"]) { - cursor: pointer; - } - - ${e} button::-moz-focus-inner { - border: 0 !important; - } - - ${e} table { - border-collapse: collapse; - } - - ${e} :where(h1, h2, h3, h4, h5, h6) { - font-size: inherit; - font-weight: inherit; - } - - ${e} :where(button, input, optgroup, select, textarea) { - padding: 0; - line-height: inherit; - color: inherit; - } - - ${e} :where(img, svg, video, canvas, audio, iframe, embed, object) { - display: block; - } - - ${e} :where(img, video) { - max-width: 100%; - height: auto; - } - - [data-js-focus-visible] - :focus:not([data-focus-visible-added]):not( - [data-focus-visible-disabled] - ) { - outline: none; - box-shadow: none; - } - - ${e} select::-ms-expand { - display: none; - } - - ${WO} - `});function v5(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function $t(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i,defaultValue:a}=e,s=P.createContext(a);s.displayName=t;function l(){var u;const c=P.useContext(s);if(!c&&n){const f=new Error(i??v5(r,o));throw f.name="ContextError",(u=Error.captureStackTrace)==null||u.call(Error,f,l),f}return c}return[s.Provider,l,s]}var[y5,g5]=$t({strict:!1,name:"PortalManagerContext"});function qO(e){const{children:t,zIndex:n}=e;return m.jsx(y5,{value:{zIndex:n},children:t})}qO.displayName="PortalManager";var bo=globalThis!=null&&globalThis.document?P.useLayoutEffect:P.useEffect,KO={exports:{}},yr={},GO={exports:{}},YO={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(M,z){var N=M.length;M.push(z);e:for(;0>>1,F=M[D];if(0>>1;Do(Y,N))qo(X,Y)?(M[D]=X,M[q]=N,D=q):(M[D]=Y,M[H]=N,D=H);else if(qo(X,N))M[D]=X,M[q]=N,D=q;else break e}}return z}function o(M,z){var N=M.sortIndex-z.sortIndex;return N!==0?N:M.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,d=3,g=!1,w=!1,y=!1,k=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(M){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=M)r(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(u)}}function R(M){if(y=!1,C(M),!w)if(n(l)!==null)w=!0,$(_);else{var z=n(u);z!==null&&j(R,z.startTime-M)}}function _(M,z){w=!1,y&&(y=!1,S(p),p=-1),g=!0;var N=d;try{for(C(z),f=n(l);f!==null&&(!(f.expirationTime>z)||M&&!x());){var D=f.callback;if(typeof D=="function"){f.callback=null,d=f.priorityLevel;var F=D(f.expirationTime<=z);z=e.unstable_now(),typeof F=="function"?f.callback=F:f===n(l)&&r(l),C(z)}else r(l);f=n(l)}if(f!==null)var W=!0;else{var H=n(u);H!==null&&j(R,H.startTime-z),W=!1}return W}finally{f=null,d=N,g=!1}}var O=!1,E=null,p=-1,v=5,h=-1;function x(){return!(e.unstable_now()-hM||125D?(M.sortIndex=N,t(u,M),n(l)===null&&M===n(u)&&(y?(S(p),p=-1):y=!0,j(R,N-D))):(M.sortIndex=F,t(l,M),w||g||(w=!0,$(_))),M},e.unstable_shouldYield=x,e.unstable_wrapCallback=function(M){var z=d;return function(){var N=d;d=z;try{return M.apply(this,arguments)}finally{d=N}}}})(YO);GO.exports=YO;var b5=GO.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var XO=P,pr=b5;function te(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Og=Object.prototype.hasOwnProperty,w5=/^[: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]*$/,bx={},wx={};function S5(e){return Og.call(wx,e)?!0:Og.call(bx,e)?!1:w5.test(e)?wx[e]=!0:(bx[e]=!0,!1)}function x5(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E5(e,t,n,r){if(t===null||typeof t>"u"||x5(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ln(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){cn[e]=new Ln(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];cn[t]=new Ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){cn[e]=new Ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){cn[e]=new Ln(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){cn[e]=new Ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){cn[e]=new Ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){cn[e]=new Ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){cn[e]=new Ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){cn[e]=new Ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var a1=/[\-:]([a-z])/g;function s1(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(a1,s1);cn[t]=new Ln(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(a1,s1);cn[t]=new Ln(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(a1,s1);cn[t]=new Ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){cn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!1,!1)});cn.xlinkHref=new Ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){cn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function l1(e,t,n,r){var o=cn.hasOwnProperty(t)?cn[t]:null;(o!==null?o.type!==0:r||!(2s||o[a]!==i[s]){var l=` -`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{wv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?su(e):""}function C5(e){switch(e.tag){case 5:return su(e.type);case 16:return su("Lazy");case 13:return su("Suspense");case 19:return su("SuspenseList");case 0:case 2:case 15:return e=Sv(e.type,!1),e;case 11:return e=Sv(e.type.render,!1),e;case 1:return e=Sv(e.type,!0),e;default:return""}}function Ag(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 gs:return"Fragment";case ys:return"Portal";case Tg:return"Profiler";case u1:return"StrictMode";case Rg:return"Suspense";case Ig:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case JO:return(e.displayName||"Context")+".Consumer";case QO:return(e._context.displayName||"Context")+".Provider";case c1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case f1:return t=e.displayName||null,t!==null?t:Ag(e.type)||"Memo";case pi:t=e._payload,e=e._init;try{return Ag(e(t))}catch{}}return null}function k5(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ag(t);case 8:return t===u1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Di(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tT(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function P5(e){var t=tT(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Of(e){e._valueTracker||(e._valueTracker=P5(e))}function nT(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tT(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Kd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Lg(e,t){var n=t.checked;return Ct({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Di(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rT(e,t){t=t.checked,t!=null&&l1(e,"checked",t,!1)}function jg(e,t){rT(e,t);var n=Di(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mg(e,t.type,Di(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ex(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Mg(e,t,n){(t!=="number"||Kd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var lu=Array.isArray;function Fs(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Tf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ju(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Su={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_5=["Webkit","ms","Moz","O"];Object.keys(Su).forEach(function(e){_5.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Su[t]=Su[e]})});function sT(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Su.hasOwnProperty(e)&&Su[e]?(""+t).trim():t+"px"}function lT(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=sT(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var O5=Ct({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 zg(e,t){if(t){if(O5[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function Ng(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Bg=null;function d1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fg=null,Us=null,Vs=null;function Px(e){if(e=Vc(e)){if(typeof Fg!="function")throw Error(te(280));var t=e.stateNode;t&&(t=am(t),Fg(e.stateNode,e.type,t))}}function uT(e){Us?Vs?Vs.push(e):Vs=[e]:Us=e}function cT(){if(Us){var e=Us,t=Vs;if(Vs=Us=null,Px(e),t)for(e=0;e>>=0,e===0?32:31-(N5(e)/B5|0)|0}var Rf=64,If=4194304;function uu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Zd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=uu(s):(i&=a,i!==0&&(r=uu(i)))}else a=n&~o,a!==0?r=uu(a):i!==0&&(r=uu(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Fc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xr(t),e[t]=n}function H5(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Eu),Mx=String.fromCharCode(32),$x=!1;function RT(e,t){switch(e){case"keyup":return g4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bs=!1;function w4(e,t){switch(e){case"compositionend":return IT(t);case"keypress":return t.which!==32?null:($x=!0,Mx);case"textInput":return e=t.data,e===Mx&&$x?null:e;default:return null}}function S4(e,t){if(bs)return e==="compositionend"||!w1&&RT(e,t)?(e=OT(),yd=y1=wi=null,bs=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bx(n)}}function MT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?MT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $T(){for(var e=window,t=Kd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kd(e.document)}return t}function S1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function R4(e){var t=$T(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&MT(n.ownerDocument.documentElement,n)){if(r!==null&&S1(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Fx(n,i);var a=Fx(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ws=null,Kg=null,ku=null,Gg=!1;function Ux(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gg||ws==null||ws!==Kd(r)||(r=ws,"selectionStart"in r&&S1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ku&&ic(ku,r)||(ku=r,r=ep(Kg,"onSelect"),0Es||(e.current=e0[Es],e0[Es]=null,Es--)}function ot(e,t){Es++,e0[Es]=e.current,e.current=t}var zi={},gn=Hi(zi),Fn=Hi(!1),ja=zi;function sl(e,t){var n=e.type.contextTypes;if(!n)return zi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Un(e){return e=e.childContextTypes,e!=null}function np(){lt(Fn),lt(gn)}function Yx(e,t,n){if(gn.current!==zi)throw Error(te(168));ot(gn,t),ot(Fn,n)}function WT(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(te(108,k5(e)||"Unknown",o));return Ct({},n,r)}function rp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zi,ja=gn.current,ot(gn,e),ot(Fn,Fn.current),!0}function Xx(e,t,n){var r=e.stateNode;if(!r)throw Error(te(169));n?(e=WT(e,t,ja),r.__reactInternalMemoizedMergedChildContext=e,lt(Fn),lt(gn),ot(gn,e)):lt(Fn),ot(Fn,n)}var Lo=null,sm=!1,Mv=!1;function qT(e){Lo===null?Lo=[e]:Lo.push(e)}function U4(e){sm=!0,qT(e)}function Wi(){if(!Mv&&Lo!==null){Mv=!0;var e=0,t=Ye;try{var n=Lo;for(Ye=1;e>=a,o-=a,zo=1<<32-Xr(t)+o|n<p?(v=E,E=null):v=E.sibling;var h=d(S,E,C[p],R);if(h===null){E===null&&(E=v);break}e&&E&&h.alternate===null&&t(S,E),b=i(h,b,p),O===null?_=h:O.sibling=h,O=h,E=v}if(p===C.length)return n(S,E),dt&&ia(S,p),_;if(E===null){for(;pp?(v=E,E=null):v=E.sibling;var x=d(S,E,h.value,R);if(x===null){E===null&&(E=v);break}e&&E&&x.alternate===null&&t(S,E),b=i(x,b,p),O===null?_=x:O.sibling=x,O=x,E=v}if(h.done)return n(S,E),dt&&ia(S,p),_;if(E===null){for(;!h.done;p++,h=C.next())h=f(S,h.value,R),h!==null&&(b=i(h,b,p),O===null?_=h:O.sibling=h,O=h);return dt&&ia(S,p),_}for(E=r(S,E);!h.done;p++,h=C.next())h=g(E,S,p,h.value,R),h!==null&&(e&&h.alternate!==null&&E.delete(h.key===null?p:h.key),b=i(h,b,p),O===null?_=h:O.sibling=h,O=h);return e&&E.forEach(function(T){return t(S,T)}),dt&&ia(S,p),_}function k(S,b,C,R){if(typeof C=="object"&&C!==null&&C.type===gs&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case _f:e:{for(var _=C.key,O=b;O!==null;){if(O.key===_){if(_=C.type,_===gs){if(O.tag===7){n(S,O.sibling),b=o(O,C.props.children),b.return=S,S=b;break e}}else if(O.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===pi&&rE(_)===O.type){n(S,O.sibling),b=o(O,C.props),b.ref=Yl(S,O,C),b.return=S,S=b;break e}n(S,O);break}else t(S,O);O=O.sibling}C.type===gs?(b=Ca(C.props.children,S.mode,R,C.key),b.return=S,S=b):(R=kd(C.type,C.key,C.props,null,S.mode,R),R.ref=Yl(S,b,C),R.return=S,S=R)}return a(S);case ys:e:{for(O=C.key;b!==null;){if(b.key===O)if(b.tag===4&&b.stateNode.containerInfo===C.containerInfo&&b.stateNode.implementation===C.implementation){n(S,b.sibling),b=o(b,C.children||[]),b.return=S,S=b;break e}else{n(S,b);break}else t(S,b);b=b.sibling}b=Vv(C,S.mode,R),b.return=S,S=b}return a(S);case pi:return O=C._init,k(S,b,O(C._payload),R)}if(lu(C))return w(S,b,C,R);if(Hl(C))return y(S,b,C,R);zf(S,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,b!==null&&b.tag===6?(n(S,b.sibling),b=o(b,C),b.return=S,S=b):(n(S,b),b=Uv(C,S.mode,R),b.return=S,S=b),a(S)):n(S,b)}return k}var ul=e2(!0),t2=e2(!1),Hc={},So=Hi(Hc),uc=Hi(Hc),cc=Hi(Hc);function ya(e){if(e===Hc)throw Error(te(174));return e}function R1(e,t){switch(ot(cc,t),ot(uc,e),ot(So,Hc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Dg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Dg(t,e)}lt(So),ot(So,t)}function cl(){lt(So),lt(uc),lt(cc)}function n2(e){ya(cc.current);var t=ya(So.current),n=Dg(t,e.type);t!==n&&(ot(uc,e),ot(So,n))}function I1(e){uc.current===e&&(lt(So),lt(uc))}var bt=Hi(0);function up(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var $v=[];function A1(){for(var e=0;e<$v.length;e++)$v[e]._workInProgressVersionPrimary=null;$v.length=0}var wd=ei.ReactCurrentDispatcher,Dv=ei.ReactCurrentBatchConfig,$a=0,Et=null,Vt=null,Gt=null,cp=!1,Pu=!1,fc=0,H4=0;function fn(){throw Error(te(321))}function L1(e,t){if(t===null)return!1;for(var n=0;nn?n:4,e(!0);var r=Dv.transition;Dv.transition={};try{e(!1),t()}finally{Ye=n,Dv.transition=r}}function g2(){return $r().memoizedState}function q4(e,t,n){var r=Ri(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},b2(e))w2(t,n);else if(n=XT(e,t,n,r),n!==null){var o=On();Zr(n,e,r,o),S2(n,t,r)}}function K4(e,t,n){var r=Ri(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(b2(e))w2(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,eo(s,a)){var l=t.interleaved;l===null?(o.next=o,O1(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=XT(e,t,o,r),n!==null&&(o=On(),Zr(n,e,r,o),S2(n,t,r))}}function b2(e){var t=e.alternate;return e===Et||t!==null&&t===Et}function w2(e,t){Pu=cp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function S2(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,h1(e,n)}}var fp={readContext:Mr,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useInsertionEffect:fn,useLayoutEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useMutableSource:fn,useSyncExternalStore:fn,useId:fn,unstable_isNewReconciler:!1},G4={readContext:Mr,useCallback:function(e,t){return ao().memoizedState=[e,t===void 0?null:t],e},useContext:Mr,useEffect:iE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Sd(4194308,4,p2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Sd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Sd(4,2,e,t)},useMemo:function(e,t){var n=ao();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ao();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=q4.bind(null,Et,e),[r.memoizedState,e]},useRef:function(e){var t=ao();return e={current:e},t.memoizedState=e},useState:oE,useDebugValue:D1,useDeferredValue:function(e){return ao().memoizedState=e},useTransition:function(){var e=oE(!1),t=e[0];return e=W4.bind(null,e[1]),ao().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Et,o=ao();if(dt){if(n===void 0)throw Error(te(407));n=n()}else{if(n=t(),Zt===null)throw Error(te(349));$a&30||i2(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,iE(s2.bind(null,r,i,e),[e]),r.flags|=2048,pc(9,a2.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ao(),t=Zt.identifierPrefix;if(dt){var n=No,r=zo;n=(r&~(1<<32-Xr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=fc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[ho]=t,e[lc]=r,R2(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ng(n,r),n){case"dialog":at("cancel",e),at("close",e),o=r;break;case"iframe":case"object":case"embed":at("load",e),o=r;break;case"video":case"audio":for(o=0;odl&&(t.flags|=128,r=!0,Xl(i,!1),t.lanes=4194304)}else{if(!r)if(e=up(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!dt)return dn(t),null}else 2*At()-i.renderingStartTime>dl&&n!==1073741824&&(t.flags|=128,r=!0,Xl(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=At(),t.sibling=null,n=bt.current,ot(bt,r?n&1|2:n&1),t):(dn(t),null);case 22:case 23:return V1(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qn&1073741824&&(dn(t),t.subtreeFlags&6&&(t.flags|=8192)):dn(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function nz(e,t){switch(E1(t),t.tag){case 1:return Un(t.type)&&np(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cl(),lt(Fn),lt(gn),A1(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return I1(t),null;case 13:if(lt(bt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return lt(bt),null;case 4:return cl(),null;case 10:return _1(t.type._context),null;case 22:case 23:return V1(),null;case 24:return null;default:return null}}var Bf=!1,vn=!1,rz=typeof WeakSet=="function"?WeakSet:Set,ce=null;function _s(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Tt(e,t,r)}else n.current=null}function d0(e,t,n){try{n()}catch(r){Tt(e,t,r)}}var hE=!1;function oz(e,t){if(Yg=Qd,e=$T(),S1(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var g;f!==n||o!==0&&f.nodeType!==3||(s=a+o),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(g=f.firstChild)!==null;)d=f,f=g;for(;;){if(f===e)break t;if(d===n&&++u===o&&(s=a),d===i&&++c===r&&(l=a),(g=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=g}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xg={focusedElem:e,selectionRange:n},Qd=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var y=w.memoizedProps,k=w.memoizedState,S=t.stateNode,b=S.getSnapshotBeforeUpdate(t.elementType===t.type?y:Hr(t.type,y),k);S.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var C=t.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(R){Tt(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return w=hE,hE=!1,w}function _u(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&d0(t,n,i)}o=o.next}while(o!==r)}}function cm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function p0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function L2(e){var t=e.alternate;t!==null&&(e.alternate=null,L2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ho],delete t[lc],delete t[Jg],delete t[B4],delete t[F4])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function j2(e){return e.tag===5||e.tag===3||e.tag===4}function mE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||j2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function h0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tp));else if(r!==4&&(e=e.child,e!==null))for(h0(e,t,n),e=e.sibling;e!==null;)h0(e,t,n),e=e.sibling}function m0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(m0(e,t,n),e=e.sibling;e!==null;)m0(e,t,n),e=e.sibling}var rn=null,Wr=!1;function ai(e,t,n){for(n=n.child;n!==null;)M2(e,t,n),n=n.sibling}function M2(e,t,n){if(wo&&typeof wo.onCommitFiberUnmount=="function")try{wo.onCommitFiberUnmount(nm,n)}catch{}switch(n.tag){case 5:vn||_s(n,t);case 6:var r=rn,o=Wr;rn=null,ai(e,t,n),rn=r,Wr=o,rn!==null&&(Wr?(e=rn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rn.removeChild(n.stateNode));break;case 18:rn!==null&&(Wr?(e=rn,n=n.stateNode,e.nodeType===8?jv(e.parentNode,n):e.nodeType===1&&jv(e,n),rc(e)):jv(rn,n.stateNode));break;case 4:r=rn,o=Wr,rn=n.stateNode.containerInfo,Wr=!0,ai(e,t,n),rn=r,Wr=o;break;case 0:case 11:case 14:case 15:if(!vn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&d0(n,t,a),o=o.next}while(o!==r)}ai(e,t,n);break;case 1:if(!vn&&(_s(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Tt(n,t,s)}ai(e,t,n);break;case 21:ai(e,t,n);break;case 22:n.mode&1?(vn=(r=vn)||n.memoizedState!==null,ai(e,t,n),vn=r):ai(e,t,n);break;default:ai(e,t,n)}}function vE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new rz),t.forEach(function(r){var o=pz.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Fr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=At()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*az(r/1960))-r,10e?16:e,Si===null)var r=!1;else{if(e=Si,Si=null,hp=0,Fe&6)throw Error(te(331));var o=Fe;for(Fe|=4,ce=e.current;ce!==null;){var i=ce,a=i.child;if(ce.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lAt()-F1?Ea(e,0):B1|=n),Vn(e,t)}function V2(e,t){t===0&&(e.mode&1?(t=If,If<<=1,!(If&130023424)&&(If=4194304)):t=1);var n=On();e=Go(e,t),e!==null&&(Fc(e,t,n),Vn(e,n))}function dz(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),V2(e,n)}function pz(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(t),V2(e,n)}var H2;H2=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fn.current)Bn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Bn=!1,ez(e,t,n);Bn=!!(e.flags&131072)}else Bn=!1,dt&&t.flags&1048576&&KT(t,ip,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;xd(e,t),e=t.pendingProps;var o=sl(t,gn.current);Ws(t,n),o=j1(null,t,r,e,o,n);var i=M1();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Un(r)?(i=!0,rp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,T1(t),o.updater=lm,t.stateNode=o,o._reactInternals=t,i0(t,r,e,n),t=l0(null,t,r,!0,i,n)):(t.tag=0,dt&&i&&x1(t),kn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(xd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=mz(r),e=Hr(r,e),o){case 0:t=s0(null,t,r,e,n);break e;case 1:t=fE(null,t,r,e,n);break e;case 11:t=uE(null,t,r,e,n);break e;case 14:t=cE(null,t,r,Hr(r.type,e),n);break e}throw Error(te(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Hr(r,o),s0(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Hr(r,o),fE(e,t,r,o,n);case 3:e:{if(_2(t),e===null)throw Error(te(387));r=t.pendingProps,i=t.memoizedState,o=i.element,ZT(e,t),lp(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=fl(Error(te(423)),t),t=dE(e,t,r,n,o);break e}else if(r!==o){o=fl(Error(te(424)),t),t=dE(e,t,r,n,o);break e}else for(er=_i(t.stateNode.containerInfo.firstChild),rr=t,dt=!0,qr=null,n=t2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ll(),r===o){t=Yo(e,t,n);break e}kn(e,t,r,n)}t=t.child}return t;case 5:return n2(t),e===null&&n0(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Zg(r,o)?a=null:i!==null&&Zg(r,i)&&(t.flags|=32),P2(e,t),kn(e,t,a,n),t.child;case 6:return e===null&&n0(t),null;case 13:return O2(e,t,n);case 4:return R1(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ul(t,null,r,n):kn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Hr(r,o),uE(e,t,r,o,n);case 7:return kn(e,t,t.pendingProps,n),t.child;case 8:return kn(e,t,t.pendingProps.children,n),t.child;case 12:return kn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,ot(ap,r._currentValue),r._currentValue=a,i!==null)if(eo(i.value,a)){if(i.children===o.children&&!Fn.current){t=Yo(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Uo(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),r0(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(te(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),r0(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}kn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ws(t,n),o=Mr(o),r=r(o),t.flags|=1,kn(e,t,r,n),t.child;case 14:return r=t.type,o=Hr(r,t.pendingProps),o=Hr(r.type,o),cE(e,t,r,o,n);case 15:return C2(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Hr(r,o),xd(e,t),t.tag=1,Un(r)?(e=!0,rp(t)):e=!1,Ws(t,n),JT(t,r,o),i0(t,r,o,n),l0(null,t,r,!0,e,n);case 19:return T2(e,t,n);case 22:return k2(e,t,n)}throw Error(te(156,t.tag))};function W2(e,t){return yT(e,t)}function hz(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(e,t,n,r){return new hz(e,t,n,r)}function W1(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mz(e){if(typeof e=="function")return W1(e)?1:0;if(e!=null){if(e=e.$$typeof,e===c1)return 11;if(e===f1)return 14}return 2}function Ii(e,t){var n=e.alternate;return n===null?(n=Tr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function kd(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")W1(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case gs:return Ca(n.children,o,i,t);case u1:a=8,o|=8;break;case Tg:return e=Tr(12,n,t,o|2),e.elementType=Tg,e.lanes=i,e;case Rg:return e=Tr(13,n,t,o),e.elementType=Rg,e.lanes=i,e;case Ig:return e=Tr(19,n,t,o),e.elementType=Ig,e.lanes=i,e;case eT:return dm(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case QO:a=10;break e;case JO:a=9;break e;case c1:a=11;break e;case f1:a=14;break e;case pi:a=16,r=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=Tr(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Ca(e,t,n,r){return e=Tr(7,e,r,t),e.lanes=n,e}function dm(e,t,n,r){return e=Tr(22,e,r,t),e.elementType=eT,e.lanes=n,e.stateNode={isHidden:!1},e}function Uv(e,t,n){return e=Tr(6,e,null,t),e.lanes=n,e}function Vv(e,t,n){return t=Tr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vz(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ev(0),this.expirationTimes=Ev(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ev(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function q1(e,t,n,r,o,i,a,s,l){return e=new vz(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Tr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},T1(i),e}function yz(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y2)}catch(e){console.error(e)}}Y2(),KO.exports=yr;var ym=KO.exports;const xz=Ve(ym);var[X2,Ez]=$t({strict:!1,name:"PortalContext"}),X1="chakra-portal",Cz=".chakra-portal",kz=e=>m.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),Pz=e=>{const{appendToParentPortal:t,children:n}=e,[r,o]=P.useState(null),i=P.useRef(null),[,a]=P.useState({});P.useEffect(()=>a({}),[]);const s=Ez(),l=g5();bo(()=>{if(!r)return;const c=r.ownerDocument,f=t?s??c.body:c.body;if(!f)return;i.current=c.createElement("div"),i.current.className=X1,f.appendChild(i.current),a({});const d=i.current;return()=>{f.contains(d)&&f.removeChild(d)}},[r]);const u=l!=null&&l.zIndex?m.jsx(kz,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return i.current?ym.createPortal(m.jsx(X2,{value:i.current,children:u}),i.current):m.jsx("span",{ref:c=>{c&&o(c)}})},_z=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,o=n.current,i=o??(typeof window<"u"?document.body:void 0),a=P.useMemo(()=>{const l=o==null?void 0:o.ownerDocument.createElement("div");return l&&(l.className=X1),l},[o]),[,s]=P.useState({});return bo(()=>s({}),[]),bo(()=>{if(!(!a||!i))return i.appendChild(a),()=>{i.removeChild(a)}},[a,i]),i&&a?ym.createPortal(m.jsx(X2,{value:r?a:null,children:t}),a):null};function Il(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?m.jsx(_z,{containerRef:n,...r}):m.jsx(Pz,{...r})}Il.className=X1;Il.selector=Cz;Il.displayName="Portal";function Wc(){const e=P.useContext(Zu);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}var Z1=P.createContext({});Z1.displayName="ColorModeContext";function gm(){const e=P.useContext(Z1);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var Vf={light:"chakra-ui-light",dark:"chakra-ui-dark"};function Oz(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const o=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,o==null||o()},setClassName(r){document.body.classList.add(r?Vf.dark:Vf.light),document.body.classList.remove(r?Vf.light:Vf.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var o;return((o=n.query().matches)!=null?o:r==="dark")?"dark":"light"},addListener(r){const o=n.query(),i=a=>{r(a.matches?"dark":"light")};return typeof o.addListener=="function"?o.addListener(i):o.addEventListener("change",i),()=>{typeof o.removeListener=="function"?o.removeListener(i):o.removeEventListener("change",i)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Tz="chakra-ui-color-mode";function Rz(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var Iz=Rz(Tz),CE=()=>{};function kE(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function Z2(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:o,disableTransitionOnChange:i}={},colorModeManager:a=Iz}=e,s=o==="dark"?"dark":"light",[l,u]=P.useState(()=>kE(a,s)),[c,f]=P.useState(()=>kE(a)),{getSystemTheme:d,setClassName:g,setDataset:w,addListener:y}=P.useMemo(()=>Oz({preventTransition:i}),[i]),k=o==="system"&&!l?c:l,S=P.useCallback(R=>{const _=R==="system"?d():R;u(_),g(_==="dark"),w(_),a.set(_)},[a,d,g,w]);bo(()=>{o==="system"&&f(d())},[]),P.useEffect(()=>{const R=a.get();if(R){S(R);return}if(o==="system"){S("system");return}S(s)},[a,s,o,S]);const b=P.useCallback(()=>{S(k==="dark"?"light":"dark")},[k,S]);P.useEffect(()=>{if(r)return y(S)},[r,y,S]);const C=P.useMemo(()=>({colorMode:t??k,toggleColorMode:t?CE:b,setColorMode:t?CE:S,forced:t!==void 0}),[k,b,S,t]);return m.jsx(Z1.Provider,{value:C,children:n})}Z2.displayName="ColorModeProvider";var Az=new Set(["dark","light","system"]);function Lz(e){let t=e;return Az.has(t)||(t="light"),t}function jz(e={}){const{initialColorMode:t="light",type:n="localStorage",storageKey:r="chakra-ui-color-mode"}=e,o=Lz(t),i=n==="cookie",a=`(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${o}",r="${r}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})(); - `,s=`(function(){try{var a=function(c){var v="(prefers-color-scheme: dark)",h=window.matchMedia(v).matches?"dark":"light",r=c==="system"?h:c,o=document.documentElement,s=document.body,l="chakra-ui-light",d="chakra-ui-dark",i=r==="dark";return s.classList.add(i?d:l),s.classList.remove(i?l:d),o.style.colorScheme=r,o.dataset.theme=r,r},n=a,m="${o}",e="${r}",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})(); - `;return`!${i?a:s}`.trim()}function Mz(e={}){const{nonce:t}=e;return m.jsx("script",{id:"chakra-script",nonce:t,dangerouslySetInnerHTML:{__html:jz(e)}})}function Q2(){const e=gm(),t=Wc();return{...e,theme:t}}function $z(e,t,n){var r,o;if(t==null)return t;const i=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(o=(r=i(t))!=null?r:i(n))!=null?o:n}function Dz(e,t,n){var r,o;if(t==null)return t;const i=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(o=(r=i(t))!=null?r:i(n))!=null?o:n}function zz(e,t,n){const r=Wc();return Nz(e,t,n)(r)}function Nz(e,t,n){const r=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n];return i=>{const a=o.filter(Boolean),s=r.map((l,u)=>{var c,f;if(e==="breakpoints")return $z(i,l,(c=a[u])!=null?c:l);const d=`${e}.${l}`;return Dz(i,d,(f=a[u])!=null?f:l)});return Array.isArray(t)?s:s[0]}}var ye=(...e)=>e.filter(Boolean).join(" ");function Hn(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Rr(e,...t){return Bz(e)?e(...t):e}var Bz=e=>typeof e=="function",ke=e=>e?"":void 0,Ks=e=>e?!0:void 0;function Pe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function bm(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var yp={exports:{}};yp.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",d="[object Error]",g="[object Function]",w="[object GeneratorFunction]",y="[object Map]",k="[object Number]",S="[object Null]",b="[object Object]",C="[object Proxy]",R="[object RegExp]",_="[object Set]",O="[object String]",E="[object Undefined]",p="[object WeakMap]",v="[object ArrayBuffer]",h="[object DataView]",x="[object Float32Array]",T="[object Float64Array]",I="[object Int8Array]",A="[object Int16Array]",L="[object Int32Array]",$="[object Uint8Array]",j="[object Uint8ClampedArray]",M="[object Uint16Array]",z="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,D=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,W={};W[x]=W[T]=W[I]=W[A]=W[L]=W[$]=W[j]=W[M]=W[z]=!0,W[s]=W[l]=W[v]=W[c]=W[h]=W[f]=W[d]=W[g]=W[y]=W[k]=W[b]=W[R]=W[_]=W[O]=W[p]=!1;var H=typeof Or=="object"&&Or&&Or.Object===Object&&Or,Y=typeof self=="object"&&self&&self.Object===Object&&self,q=H||Y||Function("return this")(),X=t&&!t.nodeType&&t,Q=X&&!0&&e&&!e.nodeType&&e,oe=Q&&Q.exports===X,pe=oe&&H.process,re=function(){try{var B=Q&&Q.require&&Q.require("util").types;return B||pe&&pe.binding&&pe.binding("util")}catch{}}(),ie=re&&re.isTypedArray;function Ce(B,U,K){switch(K.length){case 0:return B.call(U);case 1:return B.call(U,K[0]);case 2:return B.call(U,K[0],K[1]);case 3:return B.call(U,K[0],K[1],K[2])}return B.apply(U,K)}function rt(B,U){for(var K=-1,ue=Array(B);++K-1}function a3(B,U){var K=this.__data__,ue=Sf(K,B);return ue<0?(++this.size,K.push([B,U])):K[ue][1]=U,this}Ro.prototype.clear=n3,Ro.prototype.delete=r3,Ro.prototype.get=o3,Ro.prototype.has=i3,Ro.prototype.set=a3;function ns(B){var U=-1,K=B==null?0:B.length;for(this.clear();++U1?K[De-1]:void 0,ut=De>2?K[2]:void 0;for(et=B.length>3&&typeof et=="function"?(De--,et):void 0,ut&&M3(K[0],K[1],ut)&&(et=De<3?void 0:et,De=1),U=Object(U);++ue-1&&B%1==0&&B0){if(++U>=o)return arguments[0]}else U=0;return B.apply(void 0,arguments)}}function V3(B){if(B!=null){try{return en.call(B)}catch{}try{return B+""}catch{}}return""}function Cf(B,U){return B===U||B!==B&&U!==U}var fv=QS(function(){return arguments}())?QS:function(B){return Fl(B)&&kt.call(B,"callee")&&!q$.call(B,"callee")},dv=Array.isArray;function pv(B){return B!=null&&rx(B.length)&&!hv(B)}function H3(B){return Fl(B)&&pv(B)}var nx=G$||Y3;function hv(B){if(!ra(B))return!1;var U=xf(B);return U==g||U==w||U==u||U==C}function rx(B){return typeof B=="number"&&B>-1&&B%1==0&&B<=a}function ra(B){var U=typeof B;return B!=null&&(U=="object"||U=="function")}function Fl(B){return B!=null&&typeof B=="object"}function W3(B){if(!Fl(B)||xf(B)!=b)return!1;var U=GS(B);if(U===null)return!0;var K=kt.call(U,"constructor")&&U.constructor;return typeof K=="function"&&K instanceof K&&en.call(K)==Ji}var ox=ie?ne(ie):S3;function q3(B){return R3(B,ix(B))}function ix(B){return pv(B)?y3(B,!0):x3(B)}var K3=I3(function(B,U,K,ue){JS(B,U,K,ue)});function G3(B){return function(){return B}}function ax(B){return B}function Y3(){return!1}e.exports=K3})(yp,yp.exports);var Fz=yp.exports;const Ir=Ve(Fz);var Uz=e=>/!(important)?$/.test(e),PE=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,Vz=(e,t)=>n=>{const r=String(t),o=Uz(r),i=PE(r),a=e?`${e}.${i}`:i;let s=Hn(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=PE(s),o?`${s} !important`:s};function Q1(e){const{scale:t,transform:n,compose:r}=e;return(i,a)=>{var s;const l=Vz(t,i)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var Hf=(...e)=>t=>e.reduce((n,r)=>r(n),t);function wr(e,t){return n=>{const r={property:n,scale:e};return r.transform=Q1({scale:e,transform:t}),r}}var Hz=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function Wz(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:Hz(t),transform:n?Q1({scale:n,compose:r}):r}}var J2=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function qz(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...J2].join(" ")}function Kz(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...J2].join(" ")}var Gz={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Yz={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function Xz(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var Zz={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},w0={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},Qz=new Set(Object.values(w0)),S0=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Jz=e=>e.trim();function eN(e,t){if(e==null||S0.has(e))return e;if(!(x0(e)||S0.has(e)))return`url('${e}')`;const o=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=o==null?void 0:o[1],a=o==null?void 0:o[2];if(!i||!a)return e;const s=i.includes("-gradient")?i:`${i}-gradient`,[l,...u]=a.split(",").map(Jz).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in w0?w0[l]:l;u.unshift(c);const f=u.map(d=>{if(Qz.has(d))return d;const g=d.indexOf(" "),[w,y]=g!==-1?[d.substr(0,g),d.substr(g+1)]:[d],k=x0(y)?y:y&&y.split(" "),S=`colors.${w}`,b=S in t.__cssMap?t.__cssMap[S].varRef:w;return k?[b,...Array.isArray(k)?k:[k]].join(" "):b});return`${s}(${f.join(", ")})`}var x0=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),tN=(e,t)=>eN(e,t??{});function nN(e){return/^var\(--.+\)$/.test(e)}var rN=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},oo=e=>t=>`${e}(${t})`,Ue={filter(e){return e!=="auto"?e:Gz},backdropFilter(e){return e!=="auto"?e:Yz},ring(e){return Xz(Ue.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?qz():e==="auto-gpu"?Kz():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=rN(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(nN(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:tN,blur:oo("blur"),opacity:oo("opacity"),brightness:oo("brightness"),contrast:oo("contrast"),dropShadow:oo("drop-shadow"),grayscale:oo("grayscale"),hueRotate:oo("hue-rotate"),invert:oo("invert"),saturate:oo("saturate"),sepia:oo("sepia"),bgImage(e){return e==null||x0(e)||S0.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=Zz[e])!=null?t:{},o={flexDirection:e};return n&&(o[n]=1),r&&(o[r]=1),o}},V={borderWidths:wr("borderWidths"),borderStyles:wr("borderStyles"),colors:wr("colors"),borders:wr("borders"),gradients:wr("gradients",Ue.gradient),radii:wr("radii",Ue.px),space:wr("space",Hf(Ue.vh,Ue.px)),spaceT:wr("space",Hf(Ue.vh,Ue.px)),degreeT(e){return{property:e,transform:Ue.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:Q1({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:wr("sizes",Hf(Ue.vh,Ue.px)),sizesT:wr("sizes",Hf(Ue.vh,Ue.fraction)),shadows:wr("shadows"),logical:Wz,blur:wr("blur",Ue.blur)},Pd={background:V.colors("background"),backgroundColor:V.colors("backgroundColor"),backgroundImage:V.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Ue.bgClip},bgSize:V.prop("backgroundSize"),bgPosition:V.prop("backgroundPosition"),bg:V.colors("background"),bgColor:V.colors("backgroundColor"),bgPos:V.prop("backgroundPosition"),bgRepeat:V.prop("backgroundRepeat"),bgAttachment:V.prop("backgroundAttachment"),bgGradient:V.gradients("backgroundImage"),bgClip:{transform:Ue.bgClip}};Object.assign(Pd,{bgImage:Pd.backgroundImage,bgImg:Pd.backgroundImage});var He={border:V.borders("border"),borderWidth:V.borderWidths("borderWidth"),borderStyle:V.borderStyles("borderStyle"),borderColor:V.colors("borderColor"),borderRadius:V.radii("borderRadius"),borderTop:V.borders("borderTop"),borderBlockStart:V.borders("borderBlockStart"),borderTopLeftRadius:V.radii("borderTopLeftRadius"),borderStartStartRadius:V.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:V.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:V.radii("borderTopRightRadius"),borderStartEndRadius:V.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:V.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:V.borders("borderRight"),borderInlineEnd:V.borders("borderInlineEnd"),borderBottom:V.borders("borderBottom"),borderBlockEnd:V.borders("borderBlockEnd"),borderBottomLeftRadius:V.radii("borderBottomLeftRadius"),borderBottomRightRadius:V.radii("borderBottomRightRadius"),borderLeft:V.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:V.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:V.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:V.borders(["borderLeft","borderRight"]),borderInline:V.borders("borderInline"),borderY:V.borders(["borderTop","borderBottom"]),borderBlock:V.borders("borderBlock"),borderTopWidth:V.borderWidths("borderTopWidth"),borderBlockStartWidth:V.borderWidths("borderBlockStartWidth"),borderTopColor:V.colors("borderTopColor"),borderBlockStartColor:V.colors("borderBlockStartColor"),borderTopStyle:V.borderStyles("borderTopStyle"),borderBlockStartStyle:V.borderStyles("borderBlockStartStyle"),borderBottomWidth:V.borderWidths("borderBottomWidth"),borderBlockEndWidth:V.borderWidths("borderBlockEndWidth"),borderBottomColor:V.colors("borderBottomColor"),borderBlockEndColor:V.colors("borderBlockEndColor"),borderBottomStyle:V.borderStyles("borderBottomStyle"),borderBlockEndStyle:V.borderStyles("borderBlockEndStyle"),borderLeftWidth:V.borderWidths("borderLeftWidth"),borderInlineStartWidth:V.borderWidths("borderInlineStartWidth"),borderLeftColor:V.colors("borderLeftColor"),borderInlineStartColor:V.colors("borderInlineStartColor"),borderLeftStyle:V.borderStyles("borderLeftStyle"),borderInlineStartStyle:V.borderStyles("borderInlineStartStyle"),borderRightWidth:V.borderWidths("borderRightWidth"),borderInlineEndWidth:V.borderWidths("borderInlineEndWidth"),borderRightColor:V.colors("borderRightColor"),borderInlineEndColor:V.colors("borderInlineEndColor"),borderRightStyle:V.borderStyles("borderRightStyle"),borderInlineEndStyle:V.borderStyles("borderInlineEndStyle"),borderTopRadius:V.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:V.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:V.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:V.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(He,{rounded:He.borderRadius,roundedTop:He.borderTopRadius,roundedTopLeft:He.borderTopLeftRadius,roundedTopRight:He.borderTopRightRadius,roundedTopStart:He.borderStartStartRadius,roundedTopEnd:He.borderStartEndRadius,roundedBottom:He.borderBottomRadius,roundedBottomLeft:He.borderBottomLeftRadius,roundedBottomRight:He.borderBottomRightRadius,roundedBottomStart:He.borderEndStartRadius,roundedBottomEnd:He.borderEndEndRadius,roundedLeft:He.borderLeftRadius,roundedRight:He.borderRightRadius,roundedStart:He.borderInlineStartRadius,roundedEnd:He.borderInlineEndRadius,borderStart:He.borderInlineStart,borderEnd:He.borderInlineEnd,borderTopStartRadius:He.borderStartStartRadius,borderTopEndRadius:He.borderStartEndRadius,borderBottomStartRadius:He.borderEndStartRadius,borderBottomEndRadius:He.borderEndEndRadius,borderStartRadius:He.borderInlineStartRadius,borderEndRadius:He.borderInlineEndRadius,borderStartWidth:He.borderInlineStartWidth,borderEndWidth:He.borderInlineEndWidth,borderStartColor:He.borderInlineStartColor,borderEndColor:He.borderInlineEndColor,borderStartStyle:He.borderInlineStartStyle,borderEndStyle:He.borderInlineEndStyle});var oN={color:V.colors("color"),textColor:V.colors("color"),fill:V.colors("fill"),stroke:V.colors("stroke")},E0={boxShadow:V.shadows("boxShadow"),mixBlendMode:!0,blendMode:V.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:V.prop("backgroundBlendMode"),opacity:!0};Object.assign(E0,{shadow:E0.boxShadow});var iN={filter:{transform:Ue.filter},blur:V.blur("--chakra-blur"),brightness:V.propT("--chakra-brightness",Ue.brightness),contrast:V.propT("--chakra-contrast",Ue.contrast),hueRotate:V.degreeT("--chakra-hue-rotate"),invert:V.propT("--chakra-invert",Ue.invert),saturate:V.propT("--chakra-saturate",Ue.saturate),dropShadow:V.propT("--chakra-drop-shadow",Ue.dropShadow),backdropFilter:{transform:Ue.backdropFilter},backdropBlur:V.blur("--chakra-backdrop-blur"),backdropBrightness:V.propT("--chakra-backdrop-brightness",Ue.brightness),backdropContrast:V.propT("--chakra-backdrop-contrast",Ue.contrast),backdropHueRotate:V.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:V.propT("--chakra-backdrop-invert",Ue.invert),backdropSaturate:V.propT("--chakra-backdrop-saturate",Ue.saturate)},gp={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Ue.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:V.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:V.space("gap"),rowGap:V.space("rowGap"),columnGap:V.space("columnGap")};Object.assign(gp,{flexDir:gp.flexDirection});var eR={gridGap:V.space("gridGap"),gridColumnGap:V.space("gridColumnGap"),gridRowGap:V.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},aN={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Ue.outline},outlineOffset:!0,outlineColor:V.colors("outlineColor")},Cr={width:V.sizesT("width"),inlineSize:V.sizesT("inlineSize"),height:V.sizes("height"),blockSize:V.sizes("blockSize"),boxSize:V.sizes(["width","height"]),minWidth:V.sizes("minWidth"),minInlineSize:V.sizes("minInlineSize"),minHeight:V.sizes("minHeight"),minBlockSize:V.sizes("minBlockSize"),maxWidth:V.sizes("maxWidth"),maxInlineSize:V.sizes("maxInlineSize"),maxHeight:V.sizes("maxHeight"),maxBlockSize:V.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (min-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?o:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (max-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?o:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:V.propT("float",Ue.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Cr,{w:Cr.width,h:Cr.height,minW:Cr.minWidth,maxW:Cr.maxWidth,minH:Cr.minHeight,maxH:Cr.maxHeight,overscroll:Cr.overscrollBehavior,overscrollX:Cr.overscrollBehaviorX,overscrollY:Cr.overscrollBehaviorY});var sN={listStyleType:!0,listStylePosition:!0,listStylePos:V.prop("listStylePosition"),listStyleImage:!0,listStyleImg:V.prop("listStyleImage")};function lN(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(o))return s.get(o);const l=e(r,o,i,a);return s.set(o,l),l}},cN=uN(lN),fN={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},dN={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Hv=(e,t,n)=>{const r={},o=cN(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},pN={srOnly:{transform(e){return e===!0?fN:e==="focusable"?dN:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Hv(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Hv(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Hv(t,e,n)}},Ru={position:!0,pos:V.prop("position"),zIndex:V.prop("zIndex","zIndices"),inset:V.spaceT("inset"),insetX:V.spaceT(["left","right"]),insetInline:V.spaceT("insetInline"),insetY:V.spaceT(["top","bottom"]),insetBlock:V.spaceT("insetBlock"),top:V.spaceT("top"),insetBlockStart:V.spaceT("insetBlockStart"),bottom:V.spaceT("bottom"),insetBlockEnd:V.spaceT("insetBlockEnd"),left:V.spaceT("left"),insetInlineStart:V.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:V.spaceT("right"),insetInlineEnd:V.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Ru,{insetStart:Ru.insetInlineStart,insetEnd:Ru.insetInlineEnd});var hN={ring:{transform:Ue.ring},ringColor:V.colors("--chakra-ring-color"),ringOffset:V.prop("--chakra-ring-offset-width"),ringOffsetColor:V.colors("--chakra-ring-offset-color"),ringInset:V.prop("--chakra-ring-inset")},st={margin:V.spaceT("margin"),marginTop:V.spaceT("marginTop"),marginBlockStart:V.spaceT("marginBlockStart"),marginRight:V.spaceT("marginRight"),marginInlineEnd:V.spaceT("marginInlineEnd"),marginBottom:V.spaceT("marginBottom"),marginBlockEnd:V.spaceT("marginBlockEnd"),marginLeft:V.spaceT("marginLeft"),marginInlineStart:V.spaceT("marginInlineStart"),marginX:V.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:V.spaceT("marginInline"),marginY:V.spaceT(["marginTop","marginBottom"]),marginBlock:V.spaceT("marginBlock"),padding:V.space("padding"),paddingTop:V.space("paddingTop"),paddingBlockStart:V.space("paddingBlockStart"),paddingRight:V.space("paddingRight"),paddingBottom:V.space("paddingBottom"),paddingBlockEnd:V.space("paddingBlockEnd"),paddingLeft:V.space("paddingLeft"),paddingInlineStart:V.space("paddingInlineStart"),paddingInlineEnd:V.space("paddingInlineEnd"),paddingX:V.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:V.space("paddingInline"),paddingY:V.space(["paddingTop","paddingBottom"]),paddingBlock:V.space("paddingBlock")};Object.assign(st,{m:st.margin,mt:st.marginTop,mr:st.marginRight,me:st.marginInlineEnd,marginEnd:st.marginInlineEnd,mb:st.marginBottom,ml:st.marginLeft,ms:st.marginInlineStart,marginStart:st.marginInlineStart,mx:st.marginX,my:st.marginY,p:st.padding,pt:st.paddingTop,py:st.paddingY,px:st.paddingX,pb:st.paddingBottom,pl:st.paddingLeft,ps:st.paddingInlineStart,paddingStart:st.paddingInlineStart,pr:st.paddingRight,pe:st.paddingInlineEnd,paddingEnd:st.paddingInlineEnd});var mN={textDecorationColor:V.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:V.shadows("textShadow")},vN={clipPath:!0,transform:V.propT("transform",Ue.transform),transformOrigin:!0,translateX:V.spaceT("--chakra-translate-x"),translateY:V.spaceT("--chakra-translate-y"),skewX:V.degreeT("--chakra-skew-x"),skewY:V.degreeT("--chakra-skew-y"),scaleX:V.prop("--chakra-scale-x"),scaleY:V.prop("--chakra-scale-y"),scale:V.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:V.degreeT("--chakra-rotate")},yN={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:V.prop("transitionDuration","transition.duration"),transitionProperty:V.prop("transitionProperty","transition.property"),transitionTimingFunction:V.prop("transitionTimingFunction","transition.easing")},gN={fontFamily:V.prop("fontFamily","fonts"),fontSize:V.prop("fontSize","fontSizes",Ue.px),fontWeight:V.prop("fontWeight","fontWeights"),lineHeight:V.prop("lineHeight","lineHeights"),letterSpacing:V.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},bN={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:V.spaceT("scrollMargin"),scrollMarginTop:V.spaceT("scrollMarginTop"),scrollMarginBottom:V.spaceT("scrollMarginBottom"),scrollMarginLeft:V.spaceT("scrollMarginLeft"),scrollMarginRight:V.spaceT("scrollMarginRight"),scrollMarginX:V.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:V.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:V.spaceT("scrollPadding"),scrollPaddingTop:V.spaceT("scrollPaddingTop"),scrollPaddingBottom:V.spaceT("scrollPaddingBottom"),scrollPaddingLeft:V.spaceT("scrollPaddingLeft"),scrollPaddingRight:V.spaceT("scrollPaddingRight"),scrollPaddingX:V.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:V.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function tR(e){return Hn(e)&&e.reference?e.reference:String(e)}var wm=(e,...t)=>t.map(tR).join(` ${e} `).replace(/calc/g,""),_E=(...e)=>`calc(${wm("+",...e)})`,OE=(...e)=>`calc(${wm("-",...e)})`,C0=(...e)=>`calc(${wm("*",...e)})`,TE=(...e)=>`calc(${wm("/",...e)})`,RE=e=>{const t=tR(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:C0(t,-1)},ca=Object.assign(e=>({add:(...t)=>ca(_E(e,...t)),subtract:(...t)=>ca(OE(e,...t)),multiply:(...t)=>ca(C0(e,...t)),divide:(...t)=>ca(TE(e,...t)),negate:()=>ca(RE(e)),toString:()=>e.toString()}),{add:_E,subtract:OE,multiply:C0,divide:TE,negate:RE});function wN(e,t="-"){return e.replace(/\s+/g,t)}function SN(e){const t=wN(e.toString());return EN(xN(t))}function xN(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function EN(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function CN(e,t=""){return[t,e].filter(Boolean).join("-")}function kN(e,t){return`var(${e}${t?`, ${t}`:""})`}function PN(e,t=""){return SN(`--${CN(e,t)}`)}function ge(e,t,n){const r=PN(e,n);return{variable:r,reference:kN(r,t)}}function _N(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[o,i]=r;n[o]=ge(`${e}-${o}`,i);continue}n[r]=ge(`${e}-${r}`)}return n}function ON(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function TN(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function k0(e){if(e==null)return e;const{unitless:t}=TN(e);return t||typeof e=="number"?`${e}px`:e}var nR=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,J1=e=>Object.fromEntries(Object.entries(e).sort(nR));function IE(e){const t=J1(e);return Object.assign(Object.values(t),t)}function RN(e){const t=Object.keys(J1(e));return new Set(t)}function AE(e){var t;if(!e)return e;e=(t=k0(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function fu(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${k0(e)})`),t&&n.push("and",`(max-width: ${k0(t)})`),n.join(" ")}function IN(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=IE(e),r=Object.entries(e).sort(nR).map(([a,s],l,u)=>{var c;let[,f]=(c=u[l+1])!=null?c:[];return f=parseFloat(f)>0?AE(f):void 0,{_minW:AE(s),breakpoint:a,minW:s,maxW:f,maxWQuery:fu(null,f),minWQuery:fu(s),minMaxQuery:fu(s,f)}}),o=RN(e),i=Array.from(o.values());return{keys:o,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>o.has(l))},asObject:J1(e),asArray:IE(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>fu(a)).slice(1)],toArrayValue(a){if(!Hn(a))throw new Error("toArrayValue: value must be an object");const s=i.map(l=>{var u;return(u=a[l])!=null?u:null});for(;ON(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const c=i[u];return c!=null&&l!=null&&(s[c]=l),s},{})}}}var tn={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},si=e=>rR(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Io=e=>rR(t=>e(t,"~ &"),"[data-peer]",".peer"),rR=(e,...t)=>t.map(e).join(", "),Sm={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:si(tn.hover),_peerHover:Io(tn.hover),_groupFocus:si(tn.focus),_peerFocus:Io(tn.focus),_groupFocusVisible:si(tn.focusVisible),_peerFocusVisible:Io(tn.focusVisible),_groupActive:si(tn.active),_peerActive:Io(tn.active),_groupDisabled:si(tn.disabled),_peerDisabled:Io(tn.disabled),_groupInvalid:si(tn.invalid),_peerInvalid:Io(tn.invalid),_groupChecked:si(tn.checked),_peerChecked:Io(tn.checked),_groupFocusWithin:si(tn.focusWithin),_peerFocusWithin:Io(tn.focusWithin),_peerPlaceholderShown:Io(tn.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},oR=Object.keys(Sm);function LE(e,t){return ge(String(e).replace(/\./g,"-"),void 0,t)}function AN(e,t){let n={};const r={};for(const[o,i]of Object.entries(e)){const{isSemantic:a,value:s}=i,{variable:l,reference:u}=LE(o,t==null?void 0:t.cssVarPrefix);if(!a){if(o.startsWith("space")){const d=o.split("."),[g,...w]=d,y=`${g}.-${w.join(".")}`,k=ca.negate(s),S=ca.negate(u);r[y]={value:k,var:l,varRef:S}}n[l]=s,r[o]={value:s,var:l,varRef:u};continue}const c=d=>{const w=[String(o).split(".")[0],d].join(".");if(!e[w])return d;const{reference:k}=LE(w,t==null?void 0:t.cssVarPrefix);return k},f=Hn(s)?s:{default:s};n=Ir(n,Object.entries(f).reduce((d,[g,w])=>{var y,k;if(!w)return d;const S=c(`${w}`);if(g==="default")return d[l]=S,d;const b=(k=(y=Sm)==null?void 0:y[g])!=null?k:g;return d[b]={[l]:S},d},{})),r[o]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function LN(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function jN(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function MN(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function jE(e,t,n={}){const{stop:r,getKey:o}=n;function i(a,s=[]){var l;if(MN(a)||Array.isArray(a)){const u={};for(const[c,f]of Object.entries(a)){const d=(l=o==null?void 0:o(c))!=null?l:c,g=[...s,d];if(r!=null&&r(a,g))return t(a,s);u[d]=i(f,g)}return u}return t(a,s)}return i(e)}var $N=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function DN(e){return jN(e,$N)}function zN(e){return e.semanticTokens}function NN(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...o}=e;return o}var BN=e=>oR.includes(e)||e==="default";function FN({tokens:e,semanticTokens:t}){const n={};return jE(e,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!1,value:r})}),jE(t,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(BN)}),n}function UN(e){var t;const n=NN(e),r=DN(n),o=zN(n),i=FN({tokens:r,semanticTokens:o}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=AN(i,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:IN(n.breakpoints)}),n}var ew=Ir({},Pd,He,oN,gp,Cr,iN,hN,aN,eR,pN,Ru,E0,st,bN,gN,mN,vN,sN,yN),VN=Object.assign({},st,Cr,gp,eR,Ru),HN=Object.keys(VN),WN=[...Object.keys(ew),...oR],qN={...ew,...Sm},KN=e=>e in qN,GN=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const a in e){let s=Rr(e[a],t);if(s==null)continue;if(s=Hn(s)&&n(s)?r(s):s,!Array.isArray(s)){i[a]=s;continue}const l=s.slice(0,o.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!XN(t),QN=(e,t)=>{var n,r;if(t==null)return t;const o=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},i=l=>{var u;return(u=o(l))!=null?u:l},[a,s]=YN(t);return t=(r=(n=o(a))!=null?n:i(s))!=null?r:i(t),t};function JN(e){const{configs:t={},pseudos:n={},theme:r}=e,o=(i,a=!1)=>{var s,l,u;const c=Rr(i,r),f=GN(c)(r);let d={};for(let g in f){const w=f[g];let y=Rr(w,r);g in n&&(g=n[g]),ZN(g,y)&&(y=QN(r,y));let k=t[g];if(k===!0&&(k={property:g}),Hn(y)){d[g]=(s=d[g])!=null?s:{},d[g]=Ir({},d[g],o(y,!0));continue}let S=(u=(l=k==null?void 0:k.transform)==null?void 0:l.call(k,y,r,c))!=null?u:y;S=k!=null&&k.processResult?o(S,!0):S;const b=Rr(k==null?void 0:k.property,r);if(!a&&(k!=null&&k.static)){const C=Rr(k.static,r);d=Ir({},d,C)}if(b&&Array.isArray(b)){for(const C of b)d[C]=S;continue}if(b){b==="&"&&Hn(S)?d=Ir({},d,S):d[b]=S;continue}if(Hn(S)){d=Ir({},d,S);continue}d[g]=S}return d};return o}var iR=e=>t=>JN({theme:t,pseudos:Sm,configs:ew})(e);function it(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function eB(e,t){if(Array.isArray(e))return e;if(Hn(e))return t(e);if(e!=null)return[e]}function tB(e,t){for(let n=t+1;n{Ir(u,{[C]:d?b[C]:{[S]:b[C]}})});continue}if(!g){d?Ir(u,b):u[S]=b;continue}u[S]=b}}return u}}function rB(e){return t=>{var n;const{variant:r,size:o,theme:i}=t,a=nB(i);return Ir({},Rr((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",o,t),a(e,"variants",r,t))}}function oB(e,t,n){var r,o,i;return(i=(o=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:o.varRef)!=null?i:n}function mt(e){return LN(e,["styleConfig","size","variant","colorScheme"])}var iB=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function aB(e){return Hn(e)?iB.every(t=>Object.prototype.hasOwnProperty.call(e,t)):!1}var sB={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},lB={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},uB={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},cB={property:sB,easing:lB,duration:uB},fB=cB,dB={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},pB=dB,hB={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},mB=hB,vB={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},yB=vB,gB={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},bB=gB,wB={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},SB=wB,xB={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},EB=xB,CB={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},kB=CB,PB={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},aR=PB,sR={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},_B={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},OB={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},TB={...sR,..._B,container:OB},lR=TB,RB={breakpoints:yB,zIndices:pB,radii:SB,blur:kB,colors:bB,...aR,sizes:lR,shadows:EB,space:sR,borders:mB,transition:fB},{defineMultiStyleConfig:IB,definePartsStyle:du}=it(["stepper","step","title","description","indicator","separator","icon","number"]),Mo=ge("stepper-indicator-size"),Ts=ge("stepper-icon-size"),Rs=ge("stepper-title-font-size"),pu=ge("stepper-description-font-size"),Ql=ge("stepper-accent-color"),AB=du(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[Ql.variable]:`colors.${e}.500`,_dark:{[Ql.variable]:`colors.${e}.200`}},title:{fontSize:Rs.reference,fontWeight:"medium"},description:{fontSize:pu.reference,color:"chakra-subtle-text"},number:{fontSize:Rs.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Ts.reference,height:Ts.reference},indicator:{flexShrink:0,borderRadius:"full",width:Mo.reference,height:Mo.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:Ql.reference},"&[data-status=complete]":{bg:Ql.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:Ql.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${Mo.reference} - 8px)`,top:`calc(${Mo.reference} + 4px)`,insetStart:`calc(${Mo.reference} / 2 - 1px)`}}})),LB=IB({baseStyle:AB,sizes:{xs:du({stepper:{[Mo.variable]:"sizes.4",[Ts.variable]:"sizes.3",[Rs.variable]:"fontSizes.xs",[pu.variable]:"fontSizes.xs"}}),sm:du({stepper:{[Mo.variable]:"sizes.6",[Ts.variable]:"sizes.4",[Rs.variable]:"fontSizes.sm",[pu.variable]:"fontSizes.xs"}}),md:du({stepper:{[Mo.variable]:"sizes.8",[Ts.variable]:"sizes.5",[Rs.variable]:"fontSizes.md",[pu.variable]:"fontSizes.sm"}}),lg:du({stepper:{[Mo.variable]:"sizes.10",[Ts.variable]:"sizes.6",[Rs.variable]:"fontSizes.lg",[pu.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function Ge(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function o(...c){r();for(const f of c)t[f]=l(f);return Ge(e,t)}function i(...c){for(const f of c)f in t||(t[f]=l(f));return Ge(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([f,d])=>[f,d.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([f,d])=>[f,d.className]))}function l(c){const g=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:g,selector:`.${g}`,toString:()=>c}}return{parts:o,toPart:l,extend:i,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var jB=Ge("accordion").parts("root","container","button","panel").extend("icon"),MB=Ge("alert").parts("title","description","container").extend("icon","spinner"),$B=Ge("avatar").parts("label","badge","container").extend("excessLabel","group"),DB=Ge("breadcrumb").parts("link","item","container").extend("separator");Ge("button").parts();var zB=Ge("checkbox").parts("control","icon","container").extend("label");Ge("progress").parts("track","filledTrack").extend("label");var NB=Ge("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),BB=Ge("editable").parts("preview","input","textarea"),FB=Ge("form").parts("container","requiredIndicator","helperText"),UB=Ge("formError").parts("text","icon"),VB=Ge("input").parts("addon","field","element","group"),HB=Ge("list").parts("container","item","icon"),WB=Ge("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),qB=Ge("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),KB=Ge("numberinput").parts("root","field","stepperGroup","stepper");Ge("pininput").parts("field");var GB=Ge("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),YB=Ge("progress").parts("label","filledTrack","track"),XB=Ge("radio").parts("container","control","label"),ZB=Ge("select").parts("field","icon"),QB=Ge("slider").parts("container","track","thumb","filledTrack","mark"),JB=Ge("stat").parts("container","label","helpText","number","icon"),eF=Ge("switch").parts("container","track","thumb"),tF=Ge("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),nF=Ge("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),rF=Ge("tag").parts("container","label","closeButton"),oF=Ge("card").parts("container","header","body","footer");function ga(e,t,n){return Math.min(Math.max(e,n),t)}class iF extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var hu=iF;function tw(e){if(typeof e!="string")throw new hu(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=pF.test(e)?lF(e):e;const n=uF.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(mc(s,2),16)),parseInt(mc(a[3]||"f",2),16)/255]}const r=cF.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const o=fF.exec(t);if(o){const a=Array.from(o).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const i=dF.exec(t);if(i){const[a,s,l,u]=Array.from(i).slice(1).map(parseFloat);if(ga(0,100,s)!==s)throw new hu(e);if(ga(0,100,l)!==l)throw new hu(e);return[...hF(a,s,l),Number.isNaN(u)?1:u]}throw new hu(e)}function aF(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const ME=e=>parseInt(e.replace(/_/g,""),36),sF="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=ME(t.substring(0,3)),r=ME(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function lF(e){const t=e.toLowerCase().trim(),n=sF[aF(t)];if(!n)throw new hu(e);return`#${n}`}const mc=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),uF=new RegExp(`^#${mc("([a-f0-9])",3)}([a-f0-9])?$`,"i"),cF=new RegExp(`^#${mc("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),fF=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${mc(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),dF=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,pF=/^[a-z]+$/i,$E=e=>Math.round(e*255),hF=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map($E);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),a=i*(1-Math.abs(o%2-1));let s=0,l=0,u=0;o>=0&&o<1?(s=i,l=a):o>=1&&o<2?(s=a,l=i):o>=2&&o<3?(l=i,u=a):o>=3&&o<4?(l=a,u=i):o>=4&&o<5?(s=a,u=i):o>=5&&o<6&&(s=i,u=a);const c=r-i/2,f=s+c,d=l+c,g=u+c;return[f,d,g].map($E)};function mF(e,t,n,r){return`rgba(${ga(0,255,e).toFixed()}, ${ga(0,255,t).toFixed()}, ${ga(0,255,n).toFixed()}, ${parseFloat(ga(0,1,r).toFixed(3))})`}function vF(e,t){const[n,r,o,i]=tw(e);return mF(n,r,o,i-t)}function yF(e){const[t,n,r,o]=tw(e);let i=a=>{const s=ga(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${i(t)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}function gF(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,Pn=(e,t,n)=>{const r=gF(e,`colors.${t}`,t);try{return yF(r),r}catch{return n??"#000000"}},wF=e=>{const[t,n,r]=tw(e);return(t*299+n*587+r*114)/1e3},SF=e=>t=>{const n=Pn(t,e);return wF(n)<128?"dark":"light"},xF=e=>t=>SF(e)(t)==="dark",pl=(e,t)=>n=>{const r=Pn(n,e);return vF(r,1-t)};function DE(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( - 45deg, - ${t} 25%, - transparent 25%, - transparent 50%, - ${t} 50%, - ${t} 75%, - transparent 75%, - transparent - )`,backgroundSize:`${e} ${e}`}}var EF=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function CF(e){const t=EF();return!e||bF(e)?t:e.string&&e.colors?PF(e.string,e.colors):e.string&&!e.colors?kF(e.string):e.colors&&!e.string?_F(e.colors):t}function kF(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${o.toString(16)}`.substr(-2)}return n}function PF(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function nw(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function uR(e){return Hn(e)&&e.reference?e.reference:String(e)}var xm=(e,...t)=>t.map(uR).join(` ${e} `).replace(/calc/g,""),zE=(...e)=>`calc(${xm("+",...e)})`,NE=(...e)=>`calc(${xm("-",...e)})`,P0=(...e)=>`calc(${xm("*",...e)})`,BE=(...e)=>`calc(${xm("/",...e)})`,FE=e=>{const t=uR(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:P0(t,-1)},$o=Object.assign(e=>({add:(...t)=>$o(zE(e,...t)),subtract:(...t)=>$o(NE(e,...t)),multiply:(...t)=>$o(P0(e,...t)),divide:(...t)=>$o(BE(e,...t)),negate:()=>$o(FE(e)),toString:()=>e.toString()}),{add:zE,subtract:NE,multiply:P0,divide:BE,negate:FE});function OF(e){return!Number.isInteger(parseFloat(e.toString()))}function TF(e,t="-"){return e.replace(/\s+/g,t)}function cR(e){const t=TF(e.toString());return t.includes("\\.")?e:OF(e)?t.replace(".","\\."):e}function RF(e,t=""){return[t,cR(e)].filter(Boolean).join("-")}function IF(e,t){return`var(${cR(e)}${t?`, ${t}`:""})`}function AF(e,t=""){return`--${RF(e,t)}`}function qt(e,t){const n=AF(e,t==null?void 0:t.prefix);return{variable:n,reference:IF(n,LF(t==null?void 0:t.fallback))}}function LF(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:jF,definePartsStyle:_d}=it(eF.keys),Iu=qt("switch-track-width"),ka=qt("switch-track-height"),Wv=qt("switch-track-diff"),MF=$o.subtract(Iu,ka),_0=qt("switch-thumb-x"),Jl=qt("switch-bg"),$F=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Iu.reference],height:[ka.reference],transitionProperty:"common",transitionDuration:"fast",[Jl.variable]:"colors.gray.300",_dark:{[Jl.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[Jl.variable]:`colors.${t}.500`,_dark:{[Jl.variable]:`colors.${t}.200`}},bg:Jl.reference}},DF={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[ka.reference],height:[ka.reference],_checked:{transform:`translateX(${_0.reference})`}},zF=_d(e=>({container:{[Wv.variable]:MF,[_0.variable]:Wv.reference,_rtl:{[_0.variable]:$o(Wv).negate().toString()}},track:$F(e),thumb:DF})),NF={sm:_d({container:{[Iu.variable]:"1.375rem",[ka.variable]:"sizes.3"}}),md:_d({container:{[Iu.variable]:"1.875rem",[ka.variable]:"sizes.4"}}),lg:_d({container:{[Iu.variable]:"2.875rem",[ka.variable]:"sizes.6"}})},BF=jF({baseStyle:zF,sizes:NF,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:FF,definePartsStyle:Gs}=it(tF.keys),UF=Gs({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),bp={"&[data-is-numeric=true]":{textAlign:"end"}},VF=Gs(e=>{const{colorScheme:t}=e;return{th:{color:Se("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Se(`${t}.100`,`${t}.700`)(e),...bp},td:{borderBottom:"1px",borderColor:Se(`${t}.100`,`${t}.700`)(e),...bp},caption:{color:Se("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),HF=Gs(e=>{const{colorScheme:t}=e;return{th:{color:Se("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Se(`${t}.100`,`${t}.700`)(e),...bp},td:{borderBottom:"1px",borderColor:Se(`${t}.100`,`${t}.700`)(e),...bp},caption:{color:Se("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Se(`${t}.100`,`${t}.700`)(e)},td:{background:Se(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),WF={simple:VF,striped:HF,unstyled:{}},qF={sm:Gs({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:Gs({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Gs({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},KF=FF({baseStyle:UF,variants:WF,sizes:qF,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),zn=ge("tabs-color"),Kr=ge("tabs-bg"),Wf=ge("tabs-border-color"),{defineMultiStyleConfig:GF,definePartsStyle:xo}=it(nF.keys),YF=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},XF=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},ZF=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},QF={p:4},JF=xo(e=>({root:YF(e),tab:XF(e),tablist:ZF(e),tabpanel:QF})),e6={sm:xo({tab:{py:1,px:4,fontSize:"sm"}}),md:xo({tab:{fontSize:"md",py:2,px:4}}),lg:xo({tab:{fontSize:"lg",py:3,px:4}})},t6=xo(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",o=r?"borderStart":"borderBottom",i=r?"marginStart":"marginBottom";return{tablist:{[o]:"2px solid",borderColor:"inherit"},tab:{[o]:"2px solid",borderColor:"transparent",[i]:"-2px",_selected:{[zn.variable]:`colors.${t}.600`,_dark:{[zn.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Kr.variable]:"colors.gray.200",_dark:{[Kr.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:zn.reference,bg:Kr.reference}}}),n6=xo(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Wf.variable]:"transparent",_selected:{[zn.variable]:`colors.${t}.600`,[Wf.variable]:"colors.white",_dark:{[zn.variable]:`colors.${t}.300`,[Wf.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Wf.reference},color:zn.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),r6=xo(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Kr.variable]:"colors.gray.50",_dark:{[Kr.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Kr.variable]:"colors.white",[zn.variable]:`colors.${t}.600`,_dark:{[Kr.variable]:"colors.gray.800",[zn.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:zn.reference,bg:Kr.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),o6=xo(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:Pn(n,`${t}.700`),bg:Pn(n,`${t}.100`)}}}}),i6=xo(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[zn.variable]:"colors.gray.600",_dark:{[zn.variable]:"inherit"},_selected:{[zn.variable]:"colors.white",[Kr.variable]:`colors.${t}.600`,_dark:{[zn.variable]:"colors.gray.800",[Kr.variable]:`colors.${t}.300`}},color:zn.reference,bg:Kr.reference}}}),a6=xo({}),s6={line:t6,enclosed:n6,"enclosed-colored":r6,"soft-rounded":o6,"solid-rounded":i6,unstyled:a6},l6=GF({baseStyle:JF,sizes:e6,variants:s6,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),Mt=_N("badge",["bg","color","shadow"]),u6={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:Mt.bg.reference,color:Mt.color.reference,boxShadow:Mt.shadow.reference},c6=e=>{const{colorScheme:t,theme:n}=e,r=pl(`${t}.500`,.6)(n);return{[Mt.bg.variable]:`colors.${t}.500`,[Mt.color.variable]:"colors.white",_dark:{[Mt.bg.variable]:r,[Mt.color.variable]:"colors.whiteAlpha.800"}}},f6=e=>{const{colorScheme:t,theme:n}=e,r=pl(`${t}.200`,.16)(n);return{[Mt.bg.variable]:`colors.${t}.100`,[Mt.color.variable]:`colors.${t}.800`,_dark:{[Mt.bg.variable]:r,[Mt.color.variable]:`colors.${t}.200`}}},d6=e=>{const{colorScheme:t,theme:n}=e,r=pl(`${t}.200`,.8)(n);return{[Mt.color.variable]:`colors.${t}.500`,_dark:{[Mt.color.variable]:r},[Mt.shadow.variable]:`inset 0 0 0px 1px ${Mt.color.reference}`}},p6={solid:c6,subtle:f6,outline:d6},Au={baseStyle:u6,variants:p6,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:h6,definePartsStyle:Pa}=it(rF.keys),UE=ge("tag-bg"),VE=ge("tag-color"),qv=ge("tag-shadow"),Od=ge("tag-min-height"),Td=ge("tag-min-width"),Rd=ge("tag-font-size"),Id=ge("tag-padding-inline"),m6={fontWeight:"medium",lineHeight:1.2,outline:0,[VE.variable]:Mt.color.reference,[UE.variable]:Mt.bg.reference,[qv.variable]:Mt.shadow.reference,color:VE.reference,bg:UE.reference,boxShadow:qv.reference,borderRadius:"md",minH:Od.reference,minW:Td.reference,fontSize:Rd.reference,px:Id.reference,_focusVisible:{[qv.variable]:"shadows.outline"}},v6={lineHeight:1.2,overflow:"visible"},y6={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},g6=Pa({container:m6,label:v6,closeButton:y6}),b6={sm:Pa({container:{[Od.variable]:"sizes.5",[Td.variable]:"sizes.5",[Rd.variable]:"fontSizes.xs",[Id.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Pa({container:{[Od.variable]:"sizes.6",[Td.variable]:"sizes.6",[Rd.variable]:"fontSizes.sm",[Id.variable]:"space.2"}}),lg:Pa({container:{[Od.variable]:"sizes.8",[Td.variable]:"sizes.8",[Rd.variable]:"fontSizes.md",[Id.variable]:"space.3"}})},w6={subtle:Pa(e=>{var t;return{container:(t=Au.variants)==null?void 0:t.subtle(e)}}),solid:Pa(e=>{var t;return{container:(t=Au.variants)==null?void 0:t.solid(e)}}),outline:Pa(e=>{var t;return{container:(t=Au.variants)==null?void 0:t.outline(e)}})},S6=h6({variants:w6,baseStyle:g6,sizes:b6,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Bo,defineMultiStyleConfig:x6}=it(VB.keys),Is=ge("input-height"),As=ge("input-font-size"),Ls=ge("input-padding"),js=ge("input-border-radius"),E6=Bo({addon:{height:Is.reference,fontSize:As.reference,px:Ls.reference,borderRadius:js.reference},field:{width:"100%",height:Is.reference,fontSize:As.reference,px:Ls.reference,borderRadius:js.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),li={lg:{[As.variable]:"fontSizes.lg",[Ls.variable]:"space.4",[js.variable]:"radii.md",[Is.variable]:"sizes.12"},md:{[As.variable]:"fontSizes.md",[Ls.variable]:"space.4",[js.variable]:"radii.md",[Is.variable]:"sizes.10"},sm:{[As.variable]:"fontSizes.sm",[Ls.variable]:"space.3",[js.variable]:"radii.sm",[Is.variable]:"sizes.8"},xs:{[As.variable]:"fontSizes.xs",[Ls.variable]:"space.2",[js.variable]:"radii.sm",[Is.variable]:"sizes.6"}},C6={lg:Bo({field:li.lg,group:li.lg}),md:Bo({field:li.md,group:li.md}),sm:Bo({field:li.sm,group:li.sm}),xs:Bo({field:li.xs,group:li.xs})};function rw(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Se("blue.500","blue.300")(e),errorBorderColor:n||Se("red.500","red.300")(e)}}var k6=Bo(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=rw(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Se("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Pn(t,r),boxShadow:`0 0 0 1px ${Pn(t,r)}`},_focusVisible:{zIndex:1,borderColor:Pn(t,n),boxShadow:`0 0 0 1px ${Pn(t,n)}`}},addon:{border:"1px solid",borderColor:Se("inherit","whiteAlpha.50")(e),bg:Se("gray.100","whiteAlpha.300")(e)}}}),P6=Bo(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=rw(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Se("gray.100","whiteAlpha.50")(e),_hover:{bg:Se("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Pn(t,r)},_focusVisible:{bg:"transparent",borderColor:Pn(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Se("gray.100","whiteAlpha.50")(e)}}}),_6=Bo(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=rw(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Pn(t,r),boxShadow:`0px 1px 0px 0px ${Pn(t,r)}`},_focusVisible:{borderColor:Pn(t,n),boxShadow:`0px 1px 0px 0px ${Pn(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),O6=Bo({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),T6={outline:k6,filled:P6,flushed:_6,unstyled:O6},Ke=x6({baseStyle:E6,sizes:C6,variants:T6,defaultProps:{size:"md",variant:"outline"}}),HE,R6={...(HE=Ke.baseStyle)==null?void 0:HE.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},WE,qE,I6={outline:e=>{var t,n;return(n=(t=Ke.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=Ke.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=Ke.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(qE=(WE=Ke.variants)==null?void 0:WE.unstyled.field)!=null?qE:{}},KE,GE,YE,XE,ZE,QE,JE,eC,A6={xs:(GE=(KE=Ke.sizes)==null?void 0:KE.xs.field)!=null?GE:{},sm:(XE=(YE=Ke.sizes)==null?void 0:YE.sm.field)!=null?XE:{},md:(QE=(ZE=Ke.sizes)==null?void 0:ZE.md.field)!=null?QE:{},lg:(eC=(JE=Ke.sizes)==null?void 0:JE.lg.field)!=null?eC:{}},L6={baseStyle:R6,sizes:A6,variants:I6,defaultProps:{size:"md",variant:"outline"}},qf=qt("tooltip-bg"),Kv=qt("tooltip-fg"),j6=qt("popper-arrow-bg"),M6={bg:qf.reference,color:Kv.reference,[qf.variable]:"colors.gray.700",[Kv.variable]:"colors.whiteAlpha.900",_dark:{[qf.variable]:"colors.gray.300",[Kv.variable]:"colors.gray.900"},[j6.variable]:qf.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},$6={baseStyle:M6},{defineMultiStyleConfig:D6,definePartsStyle:mu}=it(YB.keys),z6=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:o}=e,i=Se(DE(),DE("1rem","rgba(0,0,0,0.1)"))(e),a=Se(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( - to right, - transparent 0%, - ${Pn(n,a)} 50%, - transparent 100% - )`;return{...!r&&o&&i,...r?{bgImage:s}:{bgColor:a}}},N6={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},B6=e=>({bg:Se("gray.100","whiteAlpha.300")(e)}),F6=e=>({transitionProperty:"common",transitionDuration:"slow",...z6(e)}),U6=mu(e=>({label:N6,filledTrack:F6(e),track:B6(e)})),V6={xs:mu({track:{h:"1"}}),sm:mu({track:{h:"2"}}),md:mu({track:{h:"3"}}),lg:mu({track:{h:"4"}})},H6=D6({sizes:V6,baseStyle:U6,defaultProps:{size:"md",colorScheme:"blue"}}),W6=e=>typeof e=="function";function Tn(e,...t){return W6(e)?e(...t):e}var{definePartsStyle:Ad,defineMultiStyleConfig:q6}=it(zB.keys),Lu=ge("checkbox-size"),K6=e=>{const{colorScheme:t}=e;return{w:Lu.reference,h:Lu.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Se(`${t}.500`,`${t}.200`)(e),borderColor:Se(`${t}.500`,`${t}.200`)(e),color:Se("white","gray.900")(e),_hover:{bg:Se(`${t}.600`,`${t}.300`)(e),borderColor:Se(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Se("gray.200","transparent")(e),bg:Se("gray.200","whiteAlpha.300")(e),color:Se("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Se(`${t}.500`,`${t}.200`)(e),borderColor:Se(`${t}.500`,`${t}.200`)(e),color:Se("white","gray.900")(e)},_disabled:{bg:Se("gray.100","whiteAlpha.100")(e),borderColor:Se("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Se("red.500","red.300")(e)}}},G6={_disabled:{cursor:"not-allowed"}},Y6={userSelect:"none",_disabled:{opacity:.4}},X6={transitionProperty:"transform",transitionDuration:"normal"},Z6=Ad(e=>({icon:X6,container:G6,control:Tn(K6,e),label:Y6})),Q6={sm:Ad({control:{[Lu.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:Ad({control:{[Lu.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:Ad({control:{[Lu.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},wp=q6({baseStyle:Z6,sizes:Q6,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:J6,definePartsStyle:Ld}=it(XB.keys),e8=e=>{var t;const n=(t=Tn(wp.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},t8=Ld(e=>{var t,n,r,o;return{label:(n=(t=wp).baseStyle)==null?void 0:n.call(t,e).label,container:(o=(r=wp).baseStyle)==null?void 0:o.call(r,e).container,control:e8(e)}}),n8={md:Ld({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Ld({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Ld({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},r8=J6({baseStyle:t8,sizes:n8,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:o8,definePartsStyle:i8}=it(ZB.keys),Kf=ge("select-bg"),tC,a8={...(tC=Ke.baseStyle)==null?void 0:tC.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Kf.reference,[Kf.variable]:"colors.white",_dark:{[Kf.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Kf.reference}},s8={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},l8=i8({field:a8,icon:s8}),Gf={paddingInlineEnd:"8"},nC,rC,oC,iC,aC,sC,lC,uC,u8={lg:{...(nC=Ke.sizes)==null?void 0:nC.lg,field:{...(rC=Ke.sizes)==null?void 0:rC.lg.field,...Gf}},md:{...(oC=Ke.sizes)==null?void 0:oC.md,field:{...(iC=Ke.sizes)==null?void 0:iC.md.field,...Gf}},sm:{...(aC=Ke.sizes)==null?void 0:aC.sm,field:{...(sC=Ke.sizes)==null?void 0:sC.sm.field,...Gf}},xs:{...(lC=Ke.sizes)==null?void 0:lC.xs,field:{...(uC=Ke.sizes)==null?void 0:uC.xs.field,...Gf},icon:{insetEnd:"1"}}},c8=o8({baseStyle:l8,sizes:u8,variants:Ke.variants,defaultProps:Ke.defaultProps}),Gv=ge("skeleton-start-color"),Yv=ge("skeleton-end-color"),f8={[Gv.variable]:"colors.gray.100",[Yv.variable]:"colors.gray.400",_dark:{[Gv.variable]:"colors.gray.800",[Yv.variable]:"colors.gray.600"},background:Gv.reference,borderColor:Yv.reference,opacity:.7,borderRadius:"sm"},d8={baseStyle:f8},Xv=ge("skip-link-bg"),p8={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Xv.variable]:"colors.white",_dark:{[Xv.variable]:"colors.gray.700"},bg:Xv.reference}},h8={baseStyle:p8},{defineMultiStyleConfig:m8,definePartsStyle:Em}=it(QB.keys),vc=ge("slider-thumb-size"),yc=ge("slider-track-size"),bi=ge("slider-bg"),v8=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...nw({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},y8=e=>({...nw({orientation:e.orientation,horizontal:{h:yc.reference},vertical:{w:yc.reference}}),overflow:"hidden",borderRadius:"sm",[bi.variable]:"colors.gray.200",_dark:{[bi.variable]:"colors.whiteAlpha.200"},_disabled:{[bi.variable]:"colors.gray.300",_dark:{[bi.variable]:"colors.whiteAlpha.300"}},bg:bi.reference}),g8=e=>{const{orientation:t}=e;return{...nw({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:vc.reference,h:vc.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},b8=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[bi.variable]:`colors.${t}.500`,_dark:{[bi.variable]:`colors.${t}.200`},bg:bi.reference}},w8=Em(e=>({container:v8(e),track:y8(e),thumb:g8(e),filledTrack:b8(e)})),S8=Em({container:{[vc.variable]:"sizes.4",[yc.variable]:"sizes.1"}}),x8=Em({container:{[vc.variable]:"sizes.3.5",[yc.variable]:"sizes.1"}}),E8=Em({container:{[vc.variable]:"sizes.2.5",[yc.variable]:"sizes.0.5"}}),C8={lg:S8,md:x8,sm:E8},k8=m8({baseStyle:w8,sizes:C8,defaultProps:{size:"md",colorScheme:"blue"}}),fa=qt("spinner-size"),P8={width:[fa.reference],height:[fa.reference]},_8={xs:{[fa.variable]:"sizes.3"},sm:{[fa.variable]:"sizes.4"},md:{[fa.variable]:"sizes.6"},lg:{[fa.variable]:"sizes.8"},xl:{[fa.variable]:"sizes.12"}},O8={baseStyle:P8,sizes:_8,defaultProps:{size:"md"}},{defineMultiStyleConfig:T8,definePartsStyle:fR}=it(JB.keys),R8={fontWeight:"medium"},I8={opacity:.8,marginBottom:"2"},A8={verticalAlign:"baseline",fontWeight:"semibold"},L8={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},j8=fR({container:{},label:R8,helpText:I8,number:A8,icon:L8}),M8={md:fR({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},$8=T8({baseStyle:j8,sizes:M8,defaultProps:{size:"md"}}),Zv=ge("kbd-bg"),D8={[Zv.variable]:"colors.gray.100",_dark:{[Zv.variable]:"colors.whiteAlpha.100"},bg:Zv.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},z8={baseStyle:D8},N8={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},B8={baseStyle:N8},{defineMultiStyleConfig:F8,definePartsStyle:U8}=it(HB.keys),V8={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},H8=U8({icon:V8}),W8=F8({baseStyle:H8}),{defineMultiStyleConfig:q8,definePartsStyle:K8}=it(WB.keys),lo=ge("menu-bg"),Qv=ge("menu-shadow"),G8={[lo.variable]:"#fff",[Qv.variable]:"shadows.sm",_dark:{[lo.variable]:"colors.gray.700",[Qv.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:lo.reference,boxShadow:Qv.reference},Y8={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[lo.variable]:"colors.gray.100",_dark:{[lo.variable]:"colors.whiteAlpha.100"}},_active:{[lo.variable]:"colors.gray.200",_dark:{[lo.variable]:"colors.whiteAlpha.200"}},_expanded:{[lo.variable]:"colors.gray.100",_dark:{[lo.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:lo.reference},X8={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},Z8={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},Q8={opacity:.6},J8={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},eU={transitionProperty:"common",transitionDuration:"normal"},tU=K8({button:eU,list:G8,item:Y8,groupTitle:X8,icon:Z8,command:Q8,divider:J8}),nU=q8({baseStyle:tU}),{defineMultiStyleConfig:rU,definePartsStyle:O0}=it(qB.keys),Jv=ge("modal-bg"),ey=ge("modal-shadow"),oU={bg:"blackAlpha.600",zIndex:"modal"},iU=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},aU=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[Jv.variable]:"colors.white",[ey.variable]:"shadows.lg",_dark:{[Jv.variable]:"colors.gray.700",[ey.variable]:"shadows.dark-lg"},bg:Jv.reference,boxShadow:ey.reference}},sU={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},lU={position:"absolute",top:"2",insetEnd:"3"},uU=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},cU={px:"6",py:"4"},fU=O0(e=>({overlay:oU,dialogContainer:Tn(iU,e),dialog:Tn(aU,e),header:sU,closeButton:lU,body:Tn(uU,e),footer:cU}));function Ur(e){return O0(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var dU={xs:Ur("xs"),sm:Ur("sm"),md:Ur("md"),lg:Ur("lg"),xl:Ur("xl"),"2xl":Ur("2xl"),"3xl":Ur("3xl"),"4xl":Ur("4xl"),"5xl":Ur("5xl"),"6xl":Ur("6xl"),full:Ur("full")},pU=rU({baseStyle:fU,sizes:dU,defaultProps:{size:"md"}}),{defineMultiStyleConfig:hU,definePartsStyle:dR}=it(KB.keys),ow=qt("number-input-stepper-width"),pR=qt("number-input-input-padding"),mU=$o(ow).add("0.5rem").toString(),ty=qt("number-input-bg"),ny=qt("number-input-color"),ry=qt("number-input-border-color"),vU={[ow.variable]:"sizes.6",[pR.variable]:mU},yU=e=>{var t,n;return(n=(t=Tn(Ke.baseStyle,e))==null?void 0:t.field)!=null?n:{}},gU={width:ow.reference},bU={borderStart:"1px solid",borderStartColor:ry.reference,color:ny.reference,bg:ty.reference,[ny.variable]:"colors.chakra-body-text",[ry.variable]:"colors.chakra-border-color",_dark:{[ny.variable]:"colors.whiteAlpha.800",[ry.variable]:"colors.whiteAlpha.300"},_active:{[ty.variable]:"colors.gray.200",_dark:{[ty.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},wU=dR(e=>{var t;return{root:vU,field:(t=Tn(yU,e))!=null?t:{},stepperGroup:gU,stepper:bU}});function Yf(e){var t,n,r;const o=(t=Ke.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=o.field)==null?void 0:n.fontSize)!=null?r:"md",s=aR.fontSizes[a];return dR({field:{...o.field,paddingInlineEnd:pR.reference,verticalAlign:"top"},stepper:{fontSize:$o(s).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var SU={xs:Yf("xs"),sm:Yf("sm"),md:Yf("md"),lg:Yf("lg")},xU=hU({baseStyle:wU,sizes:SU,variants:Ke.variants,defaultProps:Ke.defaultProps}),cC,EU={...(cC=Ke.baseStyle)==null?void 0:cC.field,textAlign:"center"},CU={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},fC,dC,kU={outline:e=>{var t,n,r;return(r=(n=Tn((t=Ke.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=Tn((t=Ke.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=Tn((t=Ke.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(dC=(fC=Ke.variants)==null?void 0:fC.unstyled.field)!=null?dC:{}},PU={baseStyle:EU,sizes:CU,variants:kU,defaultProps:Ke.defaultProps},{defineMultiStyleConfig:_U,definePartsStyle:OU}=it(GB.keys),Xf=qt("popper-bg"),TU=qt("popper-arrow-bg"),pC=qt("popper-arrow-shadow-color"),RU={zIndex:10},IU={[Xf.variable]:"colors.white",bg:Xf.reference,[TU.variable]:Xf.reference,[pC.variable]:"colors.gray.200",_dark:{[Xf.variable]:"colors.gray.700",[pC.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},AU={px:3,py:2,borderBottomWidth:"1px"},LU={px:3,py:2},jU={px:3,py:2,borderTopWidth:"1px"},MU={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},$U=OU({popper:RU,content:IU,header:AU,body:LU,footer:jU,closeButton:MU}),DU=_U({baseStyle:$U}),{definePartsStyle:T0,defineMultiStyleConfig:zU}=it(NB.keys),oy=ge("drawer-bg"),iy=ge("drawer-box-shadow");function is(e){return T0(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var NU={bg:"blackAlpha.600",zIndex:"overlay"},BU={display:"flex",zIndex:"modal",justifyContent:"center"},FU=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[oy.variable]:"colors.white",[iy.variable]:"shadows.lg",_dark:{[oy.variable]:"colors.gray.700",[iy.variable]:"shadows.dark-lg"},bg:oy.reference,boxShadow:iy.reference}},UU={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},VU={position:"absolute",top:"2",insetEnd:"3"},HU={px:"6",py:"2",flex:"1",overflow:"auto"},WU={px:"6",py:"4"},qU=T0(e=>({overlay:NU,dialogContainer:BU,dialog:Tn(FU,e),header:UU,closeButton:VU,body:HU,footer:WU})),KU={xs:is("xs"),sm:is("md"),md:is("lg"),lg:is("2xl"),xl:is("4xl"),full:is("full")},GU=zU({baseStyle:qU,sizes:KU,defaultProps:{size:"xs"}}),{definePartsStyle:YU,defineMultiStyleConfig:XU}=it(BB.keys),ZU={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},QU={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},JU={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},eV=YU({preview:ZU,input:QU,textarea:JU}),tV=XU({baseStyle:eV}),{definePartsStyle:nV,defineMultiStyleConfig:rV}=it(FB.keys),Ys=ge("form-control-color"),oV={marginStart:"1",[Ys.variable]:"colors.red.500",_dark:{[Ys.variable]:"colors.red.300"},color:Ys.reference},iV={mt:"2",[Ys.variable]:"colors.gray.600",_dark:{[Ys.variable]:"colors.whiteAlpha.600"},color:Ys.reference,lineHeight:"normal",fontSize:"sm"},aV=nV({container:{width:"100%",position:"relative"},requiredIndicator:oV,helperText:iV}),sV=rV({baseStyle:aV}),{definePartsStyle:lV,defineMultiStyleConfig:uV}=it(UB.keys),Xs=ge("form-error-color"),cV={[Xs.variable]:"colors.red.500",_dark:{[Xs.variable]:"colors.red.300"},color:Xs.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},fV={marginEnd:"0.5em",[Xs.variable]:"colors.red.500",_dark:{[Xs.variable]:"colors.red.300"},color:Xs.reference},dV=lV({text:cV,icon:fV}),pV=uV({baseStyle:dV}),hV={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},mV={baseStyle:hV},vV={fontFamily:"heading",fontWeight:"bold"},yV={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},gV={baseStyle:vV,sizes:yV,defaultProps:{size:"xl"}},{defineMultiStyleConfig:bV,definePartsStyle:wV}=it(DB.keys),ay=ge("breadcrumb-link-decor"),SV={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:ay.reference,[ay.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[ay.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},xV=wV({link:SV}),EV=bV({baseStyle:xV}),CV={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},hR=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Se("gray.800","whiteAlpha.900")(e),_hover:{bg:Se("gray.100","whiteAlpha.200")(e)},_active:{bg:Se("gray.200","whiteAlpha.300")(e)}};const r=pl(`${t}.200`,.12)(n),o=pl(`${t}.200`,.24)(n);return{color:Se(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Se(`${t}.50`,r)(e)},_active:{bg:Se(`${t}.100`,o)(e)}}},kV=e=>{const{colorScheme:t}=e,n=Se("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...Tn(hR,e)}},PV={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},_V=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=Se("gray.100","whiteAlpha.200")(e);return{bg:l,color:Se("gray.800","whiteAlpha.900")(e),_hover:{bg:Se("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:Se("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:o="white",hoverBg:i=`${n}.600`,activeBg:a=`${n}.700`}=(t=PV[n])!=null?t:{},s=Se(r,`${n}.200`)(e);return{bg:s,color:Se(o,"gray.800")(e),_hover:{bg:Se(i,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:Se(a,`${n}.400`)(e)}}},OV=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Se(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Se(`${t}.700`,`${t}.500`)(e)}}},TV={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},RV={ghost:hR,outline:kV,solid:_V,link:OV,unstyled:TV},IV={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},AV={baseStyle:CV,variants:RV,sizes:IV,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:_a,defineMultiStyleConfig:LV}=it(oF.keys),Sp=ge("card-bg"),Vo=ge("card-padding"),mR=ge("card-shadow"),jd=ge("card-radius"),vR=ge("card-border-width","0"),yR=ge("card-border-color"),jV=_a({container:{[Sp.variable]:"colors.chakra-body-bg",backgroundColor:Sp.reference,boxShadow:mR.reference,borderRadius:jd.reference,color:"chakra-body-text",borderWidth:vR.reference,borderColor:yR.reference},body:{padding:Vo.reference,flex:"1 1 0%"},header:{padding:Vo.reference},footer:{padding:Vo.reference}}),MV={sm:_a({container:{[jd.variable]:"radii.base",[Vo.variable]:"space.3"}}),md:_a({container:{[jd.variable]:"radii.md",[Vo.variable]:"space.5"}}),lg:_a({container:{[jd.variable]:"radii.xl",[Vo.variable]:"space.7"}})},$V={elevated:_a({container:{[mR.variable]:"shadows.base",_dark:{[Sp.variable]:"colors.gray.700"}}}),outline:_a({container:{[vR.variable]:"1px",[yR.variable]:"colors.chakra-border-color"}}),filled:_a({container:{[Sp.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Vo.variable]:0},header:{[Vo.variable]:0},footer:{[Vo.variable]:0}}},DV=LV({baseStyle:jV,variants:$V,sizes:MV,defaultProps:{variant:"elevated",size:"md"}}),ju=qt("close-button-size"),eu=qt("close-button-bg"),zV={w:[ju.reference],h:[ju.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[eu.variable]:"colors.blackAlpha.100",_dark:{[eu.variable]:"colors.whiteAlpha.100"}},_active:{[eu.variable]:"colors.blackAlpha.200",_dark:{[eu.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:eu.reference},NV={lg:{[ju.variable]:"sizes.10",fontSize:"md"},md:{[ju.variable]:"sizes.8",fontSize:"xs"},sm:{[ju.variable]:"sizes.6",fontSize:"2xs"}},BV={baseStyle:zV,sizes:NV,defaultProps:{size:"md"}},{variants:FV,defaultProps:UV}=Au,VV={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:Mt.bg.reference,color:Mt.color.reference,boxShadow:Mt.shadow.reference},HV={baseStyle:VV,variants:FV,defaultProps:UV},WV={w:"100%",mx:"auto",maxW:"prose",px:"4"},qV={baseStyle:WV},KV={opacity:.6,borderColor:"inherit"},GV={borderStyle:"solid"},YV={borderStyle:"dashed"},XV={solid:GV,dashed:YV},ZV={baseStyle:KV,variants:XV,defaultProps:{variant:"solid"}},{definePartsStyle:QV,defineMultiStyleConfig:JV}=it(jB.keys),eH={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},tH={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},nH={pt:"2",px:"4",pb:"5"},rH={fontSize:"1.25em"},oH=QV({container:eH,button:tH,panel:nH,icon:rH}),iH=JV({baseStyle:oH}),{definePartsStyle:qc,defineMultiStyleConfig:aH}=it(MB.keys),or=ge("alert-fg"),Xo=ge("alert-bg"),sH=qc({container:{bg:Xo.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:or.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:or.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function iw(e){const{theme:t,colorScheme:n}=e,r=pl(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var lH=qc(e=>{const{colorScheme:t}=e,n=iw(e);return{container:{[or.variable]:`colors.${t}.500`,[Xo.variable]:n.light,_dark:{[or.variable]:`colors.${t}.200`,[Xo.variable]:n.dark}}}}),uH=qc(e=>{const{colorScheme:t}=e,n=iw(e);return{container:{[or.variable]:`colors.${t}.500`,[Xo.variable]:n.light,_dark:{[or.variable]:`colors.${t}.200`,[Xo.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:or.reference}}}),cH=qc(e=>{const{colorScheme:t}=e,n=iw(e);return{container:{[or.variable]:`colors.${t}.500`,[Xo.variable]:n.light,_dark:{[or.variable]:`colors.${t}.200`,[Xo.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:or.reference}}}),fH=qc(e=>{const{colorScheme:t}=e;return{container:{[or.variable]:"colors.white",[Xo.variable]:`colors.${t}.500`,_dark:{[or.variable]:"colors.gray.900",[Xo.variable]:`colors.${t}.200`},color:or.reference}}}),dH={subtle:lH,"left-accent":uH,"top-accent":cH,solid:fH},pH=aH({baseStyle:sH,variants:dH,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:gR,defineMultiStyleConfig:hH}=it($B.keys),Zs=ge("avatar-border-color"),Mu=ge("avatar-bg"),gc=ge("avatar-font-size"),hl=ge("avatar-size"),mH={borderRadius:"full",border:"0.2em solid",borderColor:Zs.reference,[Zs.variable]:"white",_dark:{[Zs.variable]:"colors.gray.800"}},vH={bg:Mu.reference,fontSize:gc.reference,width:hl.reference,height:hl.reference,lineHeight:"1",[Mu.variable]:"colors.gray.200",_dark:{[Mu.variable]:"colors.whiteAlpha.400"}},yH=e=>{const{name:t,theme:n}=e,r=t?CF({string:t}):"colors.gray.400",o=xF(r)(n);let i="white";return o||(i="gray.800"),{bg:Mu.reference,fontSize:gc.reference,color:i,borderColor:Zs.reference,verticalAlign:"top",width:hl.reference,height:hl.reference,"&:not([data-loaded])":{[Mu.variable]:r},[Zs.variable]:"colors.white",_dark:{[Zs.variable]:"colors.gray.800"}}},gH={fontSize:gc.reference,lineHeight:"1"},bH=gR(e=>({badge:Tn(mH,e),excessLabel:Tn(vH,e),container:Tn(yH,e),label:gH}));function ui(e){const t=e!=="100%"?lR[e]:void 0;return gR({container:{[hl.variable]:t??e,[gc.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[hl.variable]:t??e,[gc.variable]:`calc(${t??e} / 2.5)`}})}var wH={"2xs":ui(4),xs:ui(6),sm:ui(8),md:ui(12),lg:ui(16),xl:ui(24),"2xl":ui(32),full:ui("100%")},SH=hH({baseStyle:bH,sizes:wH,defaultProps:{size:"md"}}),xH={Accordion:iH,Alert:pH,Avatar:SH,Badge:Au,Breadcrumb:EV,Button:AV,Checkbox:wp,CloseButton:BV,Code:HV,Container:qV,Divider:ZV,Drawer:GU,Editable:tV,Form:sV,FormError:pV,FormLabel:mV,Heading:gV,Input:Ke,Kbd:z8,Link:B8,List:W8,Menu:nU,Modal:pU,NumberInput:xU,PinInput:PU,Popover:DU,Progress:H6,Radio:r8,Select:c8,Skeleton:d8,SkipLink:h8,Slider:k8,Spinner:O8,Stat:$8,Switch:BF,Table:KF,Tabs:l6,Tag:S6,Textarea:L6,Tooltip:$6,Card:DV,Stepper:LB},EH={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},CH={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},kH="ltr",PH={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},bR={semanticTokens:EH,direction:kH,...RB,components:xH,styles:CH,config:PH};function vu(e){return typeof e=="function"}function _H(...e){return t=>e.reduce((n,r)=>r(n),t)}var OH=e=>function(...n){let r=[...n],o=n[n.length-1];return aB(o)&&r.length>1?r=r.slice(0,r.length-1):o=e,_H(...r.map(i=>a=>vu(i)?i(a):RH(a,i)))(o)},TH=OH(bR);function RH(...e){return Ir({},...e,wR)}function wR(e,t,n,r){if((vu(e)||vu(t))&&Object.prototype.hasOwnProperty.call(r,n))return(...o)=>{const i=vu(e)?e(...o):e,a=vu(t)?t(...o):t;return Ir({},i,a,wR)}}function IH(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var AH=IH();function LH(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function jH(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(o))return s.get(o);const l=e(r,o,i,a);return s.set(o,l),l}},SR=MH(jH);function xR(e,t){const n={};return Object.keys(e).forEach(r=>{const o=e[r];t(o,r,e)&&(n[r]=o)}),n}var ER=e=>xR(e,t=>t!=null);function $H(e){return typeof e=="function"}function CR(e,...t){return $H(e)?e(...t):e}function DH(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var zH=typeof Element<"u",NH=typeof Map=="function",BH=typeof Set=="function",FH=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Md(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Md(e[r],t[r]))return!1;return!0}var i;if(NH&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!Md(r.value[1],t.get(r.value[0])))return!1;return!0}if(BH&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(FH&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(zH&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&e.$$typeof)&&!Md(e[o[r]],t[o[r]]))return!1;return!0}return e!==e&&t!==t}var aw=function(t,n){try{return Md(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const UH=Ve(aw);function kR(e,t={}){var n;const{styleConfig:r,...o}=t,{theme:i,colorMode:a}=Q2(),s=e?SR(i,`components.${e}`):void 0,l=r||s,u=Ir({theme:i,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},ER(LH(o,["children"]))),c=P.useRef({});if(l){const d=rB(l)(u);UH(c.current,d)||(c.current=d)}return c.current}function Nr(e,t={}){return kR(e,t)}function Xn(e,t={}){return kR(e,t)}var VH=new Set([...WN,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),HH=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function WH(e){return HH.has(e)||!VH.has(e)}function qH(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(o in n&&delete n[o],n[o]=r[o]);return n}function PR(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var KH=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,GH=AO(function(e){return KH.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),YH=GH,XH=function(t){return t!=="theme"},hC=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?YH:XH},mC=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(a){return t.__emotion_forwardProp(a)&&i(a)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},ZH=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return zO(n,r,o),u5(function(){return NO(n,r,o)}),null},QH=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,a;n!==void 0&&(i=n.label,a=n.target);var s=mC(t,n,r),l=s||hC(o),u=!l("as");return function(){var c=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&f.push("label:"+i+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{f.push(c[0][0]);for(var d=c.length,g=1;gt=>{const{theme:n,css:r,__css:o,sx:i,...a}=t,s=xR(a,(f,d)=>KN(d)),l=CR(e,t),u=qH({},o,l,ER(s),i),c=iR(u)(t.theme);return r?[c,r]:c};function sy(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=WH);const o=t9({baseStyle:n}),i=e9(e,r)(o);return Z.forwardRef(function(l,u){const{colorMode:c,forced:f}=gm();return Z.createElement(i,{ref:u,"data-theme":f?c:void 0,...l})})}function n9(){const e=new Map;return new Proxy(sy,{apply(t,n,r){return sy(...r)},get(t,n){return e.has(n)||e.set(n,sy(n)),e.get(n)}})}var J=n9();function le(e){return P.forwardRef(e)}function _R(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,o=P.createContext(void 0);o.displayName=r;function i(){var a;const s=P.useContext(o);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,i),l}return s}return[o.Provider,i,o]}function r9(e){const{cssVarsRoot:t,theme:n,children:r}=e,o=P.useMemo(()=>UN(n),[n]);return m.jsxs(d5,{theme:o,children:[m.jsx(o9,{root:t}),r]})}function o9({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return m.jsx(tm,{styles:n=>({[t]:n.__cssVars})})}_R({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function i9(e){return _R({name:`${e}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${e} />" `})}function a9(){const{colorMode:e}=gm();return m.jsx(tm,{styles:t=>{const n=SR(t,"styles.global"),r=CR(n,{theme:t,colorMode:e});return r?iR(r)(t):void 0}})}var sw=P.createContext({getDocument(){return document},getWindow(){return window}});sw.displayName="EnvironmentContext";function s9({defer:e}={}){const[,t]=P.useReducer(n=>n+1,0);return bo(()=>{e&&t()},[e]),P.useContext(sw)}function OR(e){const{children:t,environment:n,disabled:r}=e,o=P.useRef(null),i=P.useMemo(()=>n||{getDocument:()=>{var s,l;return(l=(s=o.current)==null?void 0:s.ownerDocument)!=null?l:document},getWindow:()=>{var s,l;return(l=(s=o.current)==null?void 0:s.ownerDocument.defaultView)!=null?l:window}},[n]),a=!r||!n;return m.jsxs(sw.Provider,{value:i,children:[t,a&&m.jsx("span",{id:"__chakra_env",hidden:!0,ref:o})]})}OR.displayName="EnvironmentProvider";var l9=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetScope:o,resetCSS:i=!0,theme:a={},environment:s,cssVarsRoot:l,disableEnvironment:u,disableGlobalStyle:c}=e,f=m.jsx(OR,{environment:s,disabled:u,children:t});return m.jsx(r9,{theme:a,cssVarsRoot:l,children:m.jsxs(Z2,{colorModeManager:n,options:a.config,children:[i?m.jsx(m5,{scope:o}):m.jsx(h5,{}),!c&&m.jsx(a9,{}),r?m.jsx(qO,{zIndex:r,children:f}):f]})})},u9=(e,t)=>e.find(n=>n.id===t);function yC(e,t){const n=TR(e,t),r=n?e[n].findIndex(o=>o.id===t):-1;return{position:n,index:r}}function TR(e,t){for(const[n,r]of Object.entries(e))if(u9(r,t))return n}function c9(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function f9(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,o=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,i=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:o,right:i,left:a}}function Ai(e,t=[]){const n=P.useRef(e);return P.useEffect(()=>{n.current=e}),P.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function d9(e,t){const n=Ai(e);P.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function Na(e,t){const n=P.useRef(!1),r=P.useRef(!1);P.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),P.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const RR=P.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Cm=P.createContext({}),Kc=P.createContext(null),km=typeof document<"u",Ep=km?P.useLayoutEffect:P.useEffect,IR=P.createContext({strict:!1});function p9(e,t,n,r){const{visualElement:o}=P.useContext(Cm),i=P.useContext(IR),a=P.useContext(Kc),s=P.useContext(RR).reducedMotion,l=P.useRef();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return P.useInsertionEffect(()=>{u&&u.update(n,a)}),Ep(()=>{u&&u.render()}),P.useEffect(()=>{u&&u.updateFeatures()}),(window.HandoffAppearAnimations?Ep:P.useEffect)(()=>{u&&u.animationState&&u.animationState.animateChanges()}),u}function Ms(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function h9(e,t,n){return P.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ms(n)&&(n.current=r))},[t])}function bc(e){return typeof e=="string"||Array.isArray(e)}function Pm(e){return typeof e=="object"&&typeof e.start=="function"}const lw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],uw=["initial",...lw];function _m(e){return Pm(e.animate)||uw.some(t=>bc(e[t]))}function AR(e){return!!(_m(e)||e.variants)}function m9(e,t){if(_m(e)){const{initial:n,animate:r}=e;return{initial:n===!1||bc(n)?n:void 0,animate:bc(r)?r:void 0}}return e.inherit!==!1?t:{}}function v9(e){const{initial:t,animate:n}=m9(e,P.useContext(Cm));return P.useMemo(()=>({initial:t,animate:n}),[gC(t),gC(n)])}function gC(e){return Array.isArray(e)?e.join(" "):e}const bC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},wc={};for(const e in bC)wc[e]={isEnabled:t=>bC[e].some(n=>!!t[n])};function y9(e){for(const t in e)wc[t]={...wc[t],...e[t]}}const cw=P.createContext({}),LR=P.createContext({}),g9=Symbol.for("motionComponentSymbol");function b9({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&y9(e);function i(s,l){let u;const c={...P.useContext(RR),...s,layoutId:w9(s)},{isStatic:f}=c,d=v9(s),g=r(s,f);if(!f&&km){d.visualElement=p9(o,g,c,t);const w=P.useContext(LR),y=P.useContext(IR).strict;d.visualElement&&(u=d.visualElement.loadFeatures(c,y,e,w))}return P.createElement(Cm.Provider,{value:d},u&&d.visualElement?P.createElement(u,{visualElement:d.visualElement,...c}):null,n(o,s,h9(g,d.visualElement,l),g,f,d.visualElement))}const a=P.forwardRef(i);return a[g9]=o,a}function w9({layoutId:e}){const t=P.useContext(cw).id;return t&&e!==void 0?t+"-"+e:e}function S9(e){function t(r,o={}){return b9(e(r,o))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,o)=>(n.has(o)||n.set(o,t(o)),n.get(o))})}const x9=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function fw(e){return typeof e!="string"||e.includes("-")?!1:!!(x9.indexOf(e)>-1||/[A-Z]/.test(e))}const Cp={};function E9(e){Object.assign(Cp,e)}const Gc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ga=new Set(Gc);function jR(e,{layout:t,layoutId:n}){return Ga.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cp[e]||e==="opacity")}const Yn=e=>!!(e&&e.getVelocity),C9={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},k9=Gc.length;function P9(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let a=0;at=>typeof t=="string"&&t.startsWith(e),$R=MR("--"),R0=MR("var(--"),_9=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,O9=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ni=(e,t,n)=>Math.min(Math.max(n,e),t),Ya={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},$u={...Ya,transform:e=>Ni(0,1,e)},Zf={...Ya,default:1},Du=e=>Math.round(e*1e5)/1e5,Om=/(-)?([\d]*\.?[\d])+/g,DR=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,T9=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Yc(e){return typeof e=="string"}const Xc=e=>({test:t=>Yc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),di=Xc("deg"),Eo=Xc("%"),Ee=Xc("px"),R9=Xc("vh"),I9=Xc("vw"),wC={...Eo,parse:e=>Eo.parse(e)/100,transform:e=>Eo.transform(e*100)},SC={...Ya,transform:Math.round},zR={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,radius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,size:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,rotate:di,rotateX:di,rotateY:di,rotateZ:di,scale:Zf,scaleX:Zf,scaleY:Zf,scaleZ:Zf,skew:di,skewX:di,skewY:di,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:$u,originX:wC,originY:wC,originZ:Ee,zIndex:SC,fillOpacity:$u,strokeOpacity:$u,numOctaves:SC};function dw(e,t,n,r){const{style:o,vars:i,transform:a,transformOrigin:s}=e;let l=!1,u=!1,c=!0;for(const f in t){const d=t[f];if($R(f)){i[f]=d;continue}const g=zR[f],w=O9(d,g);if(Ga.has(f)){if(l=!0,a[f]=w,!c)continue;d!==(g.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,s[f]=w):o[f]=w}if(t.transform||(l||r?o.transform=P9(e.transform,n,c,r):o.transform&&(o.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:g=0}=s;o.transformOrigin=`${f} ${d} ${g}`}}const pw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function NR(e,t,n){for(const r in t)!Yn(t[r])&&!jR(r,n)&&(e[r]=t[r])}function A9({transformTemplate:e},t,n){return P.useMemo(()=>{const r=pw();return dw(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function L9(e,t,n){const r=e.style||{},o={};return NR(o,r,e),Object.assign(o,A9(e,t,n)),e.transformValues?e.transformValues(o):o}function j9(e,t,n){const r={},o=L9(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const M9=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function kp(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||M9.has(e)}let BR=e=>!kp(e);function $9(e){e&&(BR=t=>t.startsWith("on")?!kp(t):e(t))}try{$9(require("@emotion/is-prop-valid").default)}catch{}function D9(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(BR(o)||n===!0&&kp(o)||!t&&!kp(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function xC(e,t,n){return typeof e=="string"?e:Ee.transform(t+n*e)}function z9(e,t,n){const r=xC(t,e.x,e.width),o=xC(n,e.y,e.height);return`${r} ${o}`}const N9={offset:"stroke-dashoffset",array:"stroke-dasharray"},B9={offset:"strokeDashoffset",array:"strokeDasharray"};function F9(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?N9:B9;e[i.offset]=Ee.transform(-r);const a=Ee.transform(t),s=Ee.transform(n);e[i.array]=`${a} ${s}`}function hw(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...u},c,f,d){if(dw(e,u,c,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:w,dimensions:y}=e;g.transform&&(y&&(w.transform=g.transform),delete g.transform),y&&(o!==void 0||i!==void 0||w.transform)&&(w.transformOrigin=z9(y,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),a!==void 0&&F9(g,a,s,l,!1)}const FR=()=>({...pw(),attrs:{}}),mw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function U9(e,t,n,r){const o=P.useMemo(()=>{const i=FR();return hw(i,t,{enableHardwareAcceleration:!1},mw(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};NR(i,e.style,e),o.style={...i,...o.style}}return o}function V9(e=!1){return(n,r,o,{latestValues:i},a)=>{const l=(fw(n)?U9:j9)(r,i,a,n),c={...D9(r,typeof n=="string",e),...l,ref:o},{children:f}=r,d=P.useMemo(()=>Yn(f)?f.get():f,[f]);return P.createElement(n,{...c,children:d})}}const vw=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function UR(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const VR=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function HR(e,t,n,r){UR(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(VR.has(o)?o:vw(o),t.attrs[o])}function yw(e,t){const{style:n}=e,r={};for(const o in n)(Yn(n[o])||t.style&&Yn(t.style[o])||jR(o,e))&&(r[o]=n[o]);return r}function WR(e,t){const n=yw(e,t);for(const r in e)if(Yn(e[r])||Yn(t[r])){const o=Gc.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[o]=e[r]}return n}function gw(e,t,n,r={},o={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),t}function qR(e){const t=P.useRef(null);return t.current===null&&(t.current=e()),t.current}const Pp=e=>Array.isArray(e),H9=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),W9=e=>Pp(e)?e[e.length-1]||0:e;function $d(e){const t=Yn(e)?e.get():e;return H9(t)?t.toValue():t}function q9({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const a={latestValues:K9(r,o,i,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const KR=e=>(t,n)=>{const r=P.useContext(Cm),o=P.useContext(Kc),i=()=>q9(e,t,r,o);return n?i():qR(i)};function K9(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=$d(i[d]);let{initial:a,animate:s}=e;const l=_m(e),u=AR(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const f=c?s:a;return f&&typeof f!="boolean"&&!Pm(f)&&(Array.isArray(f)?f:[f]).forEach(g=>{const w=gw(e,g);if(!w)return;const{transitionEnd:y,transition:k,...S}=w;for(const b in S){let C=S[b];if(Array.isArray(C)){const R=c?C.length-1:0;C=C[R]}C!==null&&(o[b]=C)}for(const b in y)o[b]=y[b]}),o}const G9={useVisualState:KR({scrapeMotionValuesFromProps:WR,createRenderState:FR,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}hw(n,r,{enableHardwareAcceleration:!1},mw(t.tagName),e.transformTemplate),HR(t,n)}})},Y9={useVisualState:KR({scrapeMotionValuesFromProps:yw,createRenderState:pw})};function X9(e,{forwardMotionProps:t=!1},n,r){return{...fw(e)?G9:Y9,preloadedFeatures:n,useRender:V9(t),createVisualElement:r,Component:e}}function Fo(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const GR=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Tm(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const Z9=e=>t=>GR(t)&&e(t,Tm(t));function Ho(e,t,n,r){return Fo(e,t,Z9(n),r)}const Q9=(e,t)=>n=>t(e(n)),Li=(...e)=>e.reduce(Q9);function YR(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const EC=YR("dragHorizontal"),CC=YR("dragVertical");function XR(e){let t=!1;if(e==="y")t=CC();else if(e==="x")t=EC();else{const n=EC(),r=CC();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function ZR(){const e=XR(!0);return e?(e(),!1):!0}class qi{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Rt=e=>e;function J9(e){let t=[],n=[],r=0,o=!1,i=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const f=c&&o,d=f?t:n;return u&&a.add(l),d.indexOf(l)===-1&&(d.push(l),f&&o&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(o){i=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(f[d]=J9(()=>n=!0),f),{}),a=f=>i[f].process(o),s=f=>{n=!1,o.delta=r?1e3/60:Math.max(Math.min(f-o.timestamp,eW),1),o.timestamp=f,o.isProcessing=!0,Qf.forEach(a),o.isProcessing=!1,n&&t&&(r=!1,e(s))},l=()=>{n=!0,r=!0,o.isProcessing||e(s)};return{schedule:Qf.reduce((f,d)=>{const g=i[d];return f[d]=(w,y=!1,k=!1)=>(n||l(),g.schedule(w,y,k)),f},{}),cancel:f=>Qf.forEach(d=>i[d].cancel(f)),state:o,steps:i}}const{schedule:ht,cancel:Zo,state:mn,steps:ly}=tW(typeof requestAnimationFrame<"u"?requestAnimationFrame:Rt,!0);function kC(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),o=(i,a)=>{if(i.type==="touch"||ZR())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[r]&&ht.update(()=>s[r](i,a))};return Ho(e.current,n,o,{passive:!e.getProps()[r]})}class nW extends qi{mount(){this.unmount=Li(kC(this.node,!0),kC(this.node,!1))}unmount(){}}class rW extends qi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Li(Fo(this.node.current,"focus",()=>this.onFocus()),Fo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const QR=(e,t)=>t?e===t?!0:QR(e,t.parentElement):!1;function uy(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Tm(n))}class oW extends qi{constructor(){super(...arguments),this.removeStartListeners=Rt,this.removeEndListeners=Rt,this.removeAccessibleListeners=Rt,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),i=Ho(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();ht.update(()=>{QR(this.node.current,s.target)?u&&u(s,l):c&&c(s,l)})},{passive:!(r.onTap||r.onPointerUp)}),a=Ho(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Li(i,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=i=>{if(i.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||uy("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&ht.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Fo(this.node.current,"keyup",a),uy("down",(s,l)=>{this.startPress(s,l)})},n=Fo(this.node.current,"keydown",t),r=()=>{this.isPressing&&uy("cancel",(i,a)=>this.cancelPress(i,a))},o=Fo(this.node.current,"blur",r);this.removeAccessibleListeners=Li(n,o)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&ht.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!ZR()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&ht.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Ho(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Fo(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Li(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const I0=new WeakMap,cy=new WeakMap,iW=e=>{const t=I0.get(e.target);t&&t(e)},aW=e=>{e.forEach(iW)};function sW({root:e,...t}){const n=e||document;cy.has(n)||cy.set(n,{});const r=cy.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(aW,{root:e,...t})),r[o]}function lW(e,t,n){const r=sW(t);return I0.set(e,n),r.observe(e),()=>{I0.delete(e),r.unobserve(e)}}const uW={some:0,all:1};class cW extends qi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:uW[o]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return lW(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(fW(t,n))&&this.startObserver()}unmount(){}}function fW({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const dW={inView:{Feature:cW},tap:{Feature:oW},focus:{Feature:rW},hover:{Feature:nW}};function JR(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function hW(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Rm(e,t,n){const r=e.getProps();return gw(r,t,n!==void 0?n:r.custom,pW(e),hW(e))}const mW="framerAppearId",vW="data-"+vw(mW);let yW=Rt,bw=Rt;const ji=e=>e*1e3,Wo=e=>e/1e3,gW={current:!1},eI=e=>Array.isArray(e)&&typeof e[0]=="number";function tI(e){return!!(!e||typeof e=="string"&&nI[e]||eI(e)||Array.isArray(e)&&e.every(tI))}const yu=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,nI={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yu([0,.65,.55,1]),circOut:yu([.55,0,1,.45]),backIn:yu([.31,.01,.66,-.59]),backOut:yu([.33,1.53,.69,.99])};function rI(e){if(e)return eI(e)?yu(e):Array.isArray(e)?e.map(rI):nI[e]}function bW(e,t,n,{delay:r=0,duration:o,repeat:i=0,repeatType:a="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=rI(s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"})}function wW(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const oI=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,SW=1e-7,xW=12;function EW(e,t,n,r,o){let i,a,s=0;do a=t+(n-t)/2,i=oI(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>SW&&++sEW(i,0,1,e,n);return i=>i===0||i===1?i:oI(o(i),t,r)}const CW=Zc(.42,0,1,1),kW=Zc(0,0,.58,1),iI=Zc(.42,0,.58,1),PW=e=>Array.isArray(e)&&typeof e[0]!="number",aI=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,sI=e=>t=>1-e(1-t),lI=e=>1-Math.sin(Math.acos(e)),ww=sI(lI),_W=aI(ww),uI=Zc(.33,1.53,.69,.99),Sw=sI(uI),OW=aI(Sw),TW=e=>(e*=2)<1?.5*Sw(e):.5*(2-Math.pow(2,-10*(e-1))),RW={linear:Rt,easeIn:CW,easeInOut:iI,easeOut:kW,circIn:lI,circInOut:_W,circOut:ww,backIn:Sw,backInOut:OW,backOut:uI,anticipate:TW},PC=e=>{if(Array.isArray(e)){bw(e.length===4);const[t,n,r,o]=e;return Zc(t,n,r,o)}else if(typeof e=="string")return RW[e];return e},xw=(e,t)=>n=>!!(Yc(n)&&T9.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),cI=(e,t,n)=>r=>{if(!Yc(r))return r;const[o,i,a,s]=r.match(Om);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},IW=e=>Ni(0,255,e),fy={...Ya,transform:e=>Math.round(IW(e))},ba={test:xw("rgb","red"),parse:cI("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+fy.transform(e)+", "+fy.transform(t)+", "+fy.transform(n)+", "+Du($u.transform(r))+")"};function AW(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const A0={test:xw("#"),parse:AW,transform:ba.transform},$s={test:xw("hsl","hue"),parse:cI("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Eo.transform(Du(t))+", "+Eo.transform(Du(n))+", "+Du($u.transform(r))+")"},Cn={test:e=>ba.test(e)||A0.test(e)||$s.test(e),parse:e=>ba.test(e)?ba.parse(e):$s.test(e)?$s.parse(e):A0.parse(e),transform:e=>Yc(e)?e:e.hasOwnProperty("red")?ba.transform(e):$s.transform(e)},xt=(e,t,n)=>-n*e+n*t+e;function dy(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function LW({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=dy(l,s,e+1/3),i=dy(l,s,e),a=dy(l,s,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}const py=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},jW=[A0,ba,$s],MW=e=>jW.find(t=>t.test(e));function _C(e){const t=MW(e);let n=t.parse(e);return t===$s&&(n=LW(n)),n}const fI=(e,t)=>{const n=_C(e),r=_C(t),o={...n};return i=>(o.red=py(n.red,r.red,i),o.green=py(n.green,r.green,i),o.blue=py(n.blue,r.blue,i),o.alpha=xt(n.alpha,r.alpha,i),ba.transform(o))};function $W(e){var t,n;return isNaN(e)&&Yc(e)&&(((t=e.match(Om))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(DR))===null||n===void 0?void 0:n.length)||0)>0}const dI={regex:_9,countKey:"Vars",token:"${v}",parse:Rt},pI={regex:DR,countKey:"Colors",token:"${c}",parse:Cn.parse},hI={regex:Om,countKey:"Numbers",token:"${n}",parse:Ya.parse};function hy(e,{regex:t,countKey:n,token:r,parse:o}){const i=e.tokenised.match(t);i&&(e["num"+n]=i.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...i.map(o)))}function _p(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&hy(n,dI),hy(n,pI),hy(n,hI),n}function mI(e){return _p(e).values}function vI(e){const{values:t,numColors:n,numVars:r,tokenised:o}=_p(e),i=t.length;return a=>{let s=o;for(let l=0;ltypeof e=="number"?0:e;function zW(e){const t=mI(e);return vI(e)(t.map(DW))}const Bi={test:$W,parse:mI,createTransformer:vI,getAnimatableNone:zW},yI=(e,t)=>n=>`${n>0?t:e}`;function gI(e,t){return typeof e=="number"?n=>xt(e,t,n):Cn.test(e)?fI(e,t):e.startsWith("var(")?yI(e,t):wI(e,t)}const bI=(e,t)=>{const n=[...e],r=n.length,o=e.map((i,a)=>gI(i,t[a]));return i=>{for(let a=0;a{const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=gI(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}},wI=(e,t)=>{const n=Bi.createTransformer(t),r=_p(e),o=_p(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?Li(bI(r.values,o.values),n):yI(e,t)},Sc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},OC=(e,t)=>n=>xt(e,t,n);function BW(e){return typeof e=="number"?OC:typeof e=="string"?Cn.test(e)?fI:wI:Array.isArray(e)?bI:typeof e=="object"?NW:OC}function FW(e,t,n){const r=[],o=n||BW(e[0]),i=e.length-1;for(let a=0;at[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=FW(t,r,o),s=a.length,l=u=>{let c=0;if(s>1)for(;cl(Ni(e[0],e[i-1],u)):l}function UW(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Sc(0,t,r);e.push(xt(n,1,o))}}function VW(e){const t=[0];return UW(t,e.length-1),t}function HW(e,t){return e.map(n=>n*t)}function WW(e,t){return e.map(()=>t||iI).splice(0,e.length-1)}function Op({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=PW(r)?r.map(PC):PC(r),i={done:!1,value:t[0]},a=HW(n&&n.length===t.length?n:VW(t),e),s=SI(a,t,{ease:Array.isArray(o)?o:WW(t,o)});return{calculatedDuration:e,next:l=>(i.value=s(l),i.done=l>=e,i)}}function xI(e,t){return t?e*(1e3/t):0}const qW=5;function EI(e,t,n){const r=Math.max(t-qW,0);return xI(n-e(r),t-r)}const my=.001,KW=.01,TC=10,GW=.05,YW=1;function XW({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;yW(e<=ji(TC));let a=1-t;a=Ni(GW,YW,a),e=Ni(KW,TC,Wo(e)),a<1?(o=u=>{const c=u*a,f=c*e,d=c-n,g=L0(u,a),w=Math.exp(-f);return my-d/g*w},i=u=>{const f=u*a*e,d=f*n+n,g=Math.pow(a,2)*Math.pow(u,2)*e,w=Math.exp(-f),y=L0(Math.pow(u,2),a);return(-o(u)+my>0?-1:1)*((d-g)*w)/y}):(o=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-my+c*f},i=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const s=5/e,l=QW(o,i,s);if(e=ji(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const ZW=12;function QW(e,t,n){let r=n;for(let o=1;oe[n]!==void 0)}function t7(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!RC(e,e7)&&RC(e,JW)){const n=XW(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function CI({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],a={done:!1,value:o},{stiffness:s,damping:l,mass:u,velocity:c,duration:f,isResolvedFromDuration:d}=t7(r),g=c?-Wo(c):0,w=l/(2*Math.sqrt(s*u)),y=i-o,k=Wo(Math.sqrt(s/u)),S=Math.abs(y)<5;n||(n=S?.01:2),t||(t=S?.005:.5);let b;if(w<1){const C=L0(k,w);b=R=>{const _=Math.exp(-w*k*R);return i-_*((g+w*k*y)/C*Math.sin(C*R)+y*Math.cos(C*R))}}else if(w===1)b=C=>i-Math.exp(-k*C)*(y+(g+k*y)*C);else{const C=k*Math.sqrt(w*w-1);b=R=>{const _=Math.exp(-w*k*R),O=Math.min(C*R,300);return i-_*((g+w*k*y)*Math.sinh(O)+C*y*Math.cosh(O))/C}}return{calculatedDuration:d&&f||null,next:C=>{const R=b(C);if(d)a.done=C>=f;else{let _=g;C!==0&&(w<1?_=EI(b,C,R):_=0);const O=Math.abs(_)<=n,E=Math.abs(i-R)<=t;a.done=O&&E}return a.value=a.done?i:R,a}}}function IC({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],d={done:!1,value:f},g=p=>s!==void 0&&pl,w=p=>s===void 0?l:l===void 0||Math.abs(s-p)-y*Math.exp(-p/r),C=p=>S+b(p),R=p=>{const v=b(p),h=C(p);d.done=Math.abs(v)<=u,d.value=d.done?S:h};let _,O;const E=p=>{g(d.value)&&(_=p,O=CI({keyframes:[d.value,w(d.value)],velocity:EI(C,p,d.value),damping:o,stiffness:i,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:p=>{let v=!1;return!O&&_===void 0&&(v=!0,R(p),E(p)),_!==void 0&&p>_?O.next(p-_):(!v&&R(p),d)}}}const n7=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ht.update(t,!0),stop:()=>Zo(t),now:()=>mn.isProcessing?mn.timestamp:performance.now()}},AC=2e4;function LC(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=AC?1/0:t}const r7={decay:IC,inertia:IC,tween:Op,keyframes:Op,spring:CI};function Tp({autoplay:e=!0,delay:t=0,driver:n=n7,keyframes:r,type:o="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:f,...d}){let g=1,w=!1,y,k;const S=()=>{k=new Promise(D=>{y=D})};S();let b;const C=r7[o]||Op;let R;C!==Op&&typeof r[0]!="number"&&(R=SI([0,100],r,{clamp:!1}),r=[0,100]);const _=C({...d,keyframes:r});let O;s==="mirror"&&(O=C({...d,keyframes:[...r].reverse(),velocity:-(d.velocity||0)}));let E="idle",p=null,v=null,h=null;_.calculatedDuration===null&&i&&(_.calculatedDuration=LC(_));const{calculatedDuration:x}=_;let T=1/0,I=1/0;x!==null&&(T=x+a,I=T*(i+1)-a);let A=0;const L=D=>{if(v===null)return;g>0&&(v=Math.min(v,D)),g<0&&(v=Math.min(D-I/g,v)),p!==null?A=p:A=Math.round(D-v)*g;const F=A-t*(g>=0?1:-1),W=g>=0?F<0:F>I;A=Math.max(F,0),E==="finished"&&p===null&&(A=I);let H=A,Y=_;if(i){const oe=A/T;let pe=Math.floor(oe),re=oe%1;!re&&oe>=1&&(re=1),re===1&&pe--,pe=Math.min(pe,i+1);const ie=!!(pe%2);ie&&(s==="reverse"?(re=1-re,a&&(re-=a/T)):s==="mirror"&&(Y=O));let Ce=Ni(0,1,re);A>I&&(Ce=s==="reverse"&&ie?1:0),H=Ce*T}const q=W?{done:!1,value:r[0]}:Y.next(H);R&&(q.value=R(q.value));let{done:X}=q;!W&&x!==null&&(X=g>=0?A>=I:A<=0);const Q=p===null&&(E==="finished"||E==="running"&&X);return f&&f(q.value),Q&&M(),q},$=()=>{b&&b.stop(),b=void 0},j=()=>{E="idle",$(),y(),S(),v=h=null},M=()=>{E="finished",c&&c(),$(),y()},z=()=>{if(w)return;b||(b=n(L));const D=b.now();l&&l(),p!==null?v=D-p:(!v||E==="finished")&&(v=D),E==="finished"&&S(),h=v,p=null,E="running",b.start()};e&&z();const N={then(D,F){return k.then(D,F)},get time(){return Wo(A)},set time(D){D=ji(D),A=D,p!==null||!b||g===0?p=D:v=b.now()-D/g},get duration(){const D=_.calculatedDuration===null?LC(_):_.calculatedDuration;return Wo(D)},get speed(){return g},set speed(D){D===g||!b||(g=D,N.time=Wo(A))},get state(){return E},play:z,pause:()=>{E="paused",p=A},stop:()=>{w=!0,E!=="idle"&&(E="idle",u&&u(),j())},cancel:()=>{h!==null&&L(h),j()},complete:()=>{E="finished"},sample:D=>(v=0,L(D))};return N}function o7(e){let t;return()=>(t===void 0&&(t=e()),t)}const i7=o7(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),a7=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Jf=10,s7=2e4,l7=(e,t)=>t.type==="spring"||e==="backgroundColor"||!tI(t.ease);function u7(e,t,{onUpdate:n,onComplete:r,...o}){if(!(i7()&&a7.has(t)&&!o.repeatDelay&&o.repeatType!=="mirror"&&o.damping!==0&&o.type!=="inertia"))return!1;let a=!1,s,l;const u=()=>{l=new Promise(b=>{s=b})};u();let{keyframes:c,duration:f=300,ease:d,times:g}=o;if(l7(t,o)){const b=Tp({...o,repeat:0,delay:0});let C={done:!1,value:c[0]};const R=[];let _=0;for(;!C.done&&_w.cancel(),k=()=>{ht.update(y),s(),u()};return w.onfinish=()=>{e.set(wW(c,o)),r&&r(),k()},{then(b,C){return l.then(b,C)},attachTimeline(b){return w.timeline=b,w.onfinish=null,Rt},get time(){return Wo(w.currentTime||0)},set time(b){w.currentTime=ji(b)},get speed(){return w.playbackRate},set speed(b){w.playbackRate=b},get duration(){return Wo(f)},play:()=>{a||(w.play(),Zo(y))},pause:()=>w.pause(),stop:()=>{if(a=!0,w.playState==="idle")return;const{currentTime:b}=w;if(b){const C=Tp({...o,autoplay:!1});e.setWithVelocity(C.sample(b-Jf).value,C.sample(b).value,Jf)}k()},complete:()=>w.finish(),cancel:k}}function c7({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Rt,pause:Rt,stop:Rt,then:i=>(i(),Promise.resolve()),cancel:Rt,complete:Rt});return t?Tp({keyframes:[0,1],duration:0,delay:t,onComplete:o}):o()}const f7={type:"spring",stiffness:500,damping:25,restSpeed:10},d7=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),p7={type:"keyframes",duration:.8},h7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},m7=(e,{keyframes:t})=>t.length>2?p7:Ga.has(e)?e.startsWith("scale")?d7(t[1]):f7:h7,j0=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Bi.test(t)||t==="0")&&!t.startsWith("url(")),v7=new Set(["brightness","contrast","saturate","opacity"]);function y7(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Om)||[];if(!r)return e;const o=n.replace(r,"");let i=v7.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const g7=/([a-z-]*)\(.*?\)/g,M0={...Bi,getAnimatableNone:e=>{const t=e.match(g7);return t?t.map(y7).join(" "):e}},b7={...zR,color:Cn,backgroundColor:Cn,outlineColor:Cn,fill:Cn,stroke:Cn,borderColor:Cn,borderTopColor:Cn,borderRightColor:Cn,borderBottomColor:Cn,borderLeftColor:Cn,filter:M0,WebkitFilter:M0},Ew=e=>b7[e];function kI(e,t){let n=Ew(e);return n!==M0&&(n=Bi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const PI=e=>/^0[^.\s]+$/.test(e);function w7(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||PI(e)}function S7(e,t,n,r){const o=j0(t,n);let i;Array.isArray(n)?i=[...n]:i=[null,n];const a=r.from!==void 0?r.from:e.get();let s;const l=[];for(let u=0;uo=>{const i=_I(r,e)||{},a=i.delay||r.delay||0;let{elapsed:s=0}=r;s=s-ji(a);const l=S7(t,e,n,i),u=l[0],c=l[l.length-1],f=j0(e,u),d=j0(e,c);let g={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...i,delay:-s,onUpdate:w=>{t.set(w),i.onUpdate&&i.onUpdate(w)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(x7(i)||(g={...g,...m7(e,g)}),g.duration&&(g.duration=ji(g.duration)),g.repeatDelay&&(g.repeatDelay=ji(g.repeatDelay)),!f||!d||gW.current||i.type===!1)return c7(g);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const w=u7(t,e,g);if(w)return w}return Tp(g)};function Rp(e){return!!(Yn(e)&&e.add)}const E7=e=>/^\-?\d*\.?\d+$/.test(e);function kw(e,t){e.indexOf(t)===-1&&e.push(t)}function Pw(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class _w{constructor(){this.subscriptions=[]}add(t){return kw(this.subscriptions,t),()=>Pw(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class k7{constructor(t,n={}){this.version="10.15.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,o=!0)=>{this.prev=this.current,this.current=r;const{delta:i,timestamp:a}=mn;this.lastUpdated!==a&&(this.timeDelta=i,this.lastUpdated=a,ht.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>ht.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=C7(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new _w);const r=this.events[t].add(n);return t==="change"?()=>{r(),ht.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?xI(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ml(e,t){return new k7(e,t)}const OI=e=>t=>t.test(e),P7={test:e=>e==="auto",parse:e=>e},TI=[Ya,Ee,Eo,di,I9,R9,P7],tu=e=>TI.find(OI(e)),_7=[...TI,Cn,Bi],O7=e=>_7.find(OI(e));function T7(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ml(n))}function R7(e,t){const n=Rm(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const a in i){const s=W9(i[a]);T7(e,a,s)}}function I7(e,t,n){var r,o;const i=Object.keys(t).filter(s=>!e.hasValue(s)),a=i.length;if(a)for(let s=0;sl.remove(f))),u.push(y)}return a&&Promise.all(u).then(()=>{a&&R7(e,a)}),u}function $0(e,t,n={}){const r=Rm(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(RI(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:f}=o;return M7(e,t,u+l,c,f,n)}:()=>Promise.resolve(),{when:s}=o;if(s){const[l,u]=s==="beforeChildren"?[i,a]:[a,i];return l().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function M7(e,t,n=0,r=0,o=1,i){const a=[],s=(e.variantChildren.size-1)*r,l=o===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort($7).forEach((u,c)=>{u.notify("AnimationStart",t),a.push($0(u,t,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function $7(e,t){return e.sortNodePosition(t)}function D7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>$0(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=$0(e,t,n);else{const o=typeof t=="function"?Rm(e,t,n.custom):t;r=Promise.all(RI(e,o,n))}return r.then(()=>e.notify("AnimationComplete",t))}const z7=[...lw].reverse(),N7=lw.length;function B7(e){return t=>Promise.all(t.map(({animation:n,options:r})=>D7(e,n,r)))}function F7(e){let t=B7(e);const n=V7();let r=!0;const o=(l,u)=>{const c=Rm(e,u);if(c){const{transition:f,transitionEnd:d,...g}=c;l={...l,...g,...d}}return l};function i(l){t=l(e)}function a(l,u){const c=e.getProps(),f=e.getVariantContext(!0)||{},d=[],g=new Set;let w={},y=1/0;for(let S=0;Sy&&_;const h=Array.isArray(R)?R:[R];let x=h.reduce(o,{});O===!1&&(x={});const{prevResolvedValues:T={}}=C,I={...T,...x},A=L=>{v=!0,g.delete(L),C.needsAnimating[L]=!0};for(const L in I){const $=x[L],j=T[L];w.hasOwnProperty(L)||($!==j?Pp($)&&Pp(j)?!JR($,j)||p?A(L):C.protectedKeys[L]=!0:$!==void 0?A(L):g.add(L):$!==void 0&&g.has(L)?A(L):C.protectedKeys[L]=!0)}C.prevProp=R,C.prevResolvedValues=x,C.isActive&&(w={...w,...x}),r&&e.blockInitialAnimation&&(v=!1),v&&!E&&d.push(...h.map(L=>({animation:L,options:{type:b,...l}})))}if(g.size){const S={};g.forEach(b=>{const C=e.getBaseTarget(b);C!==void 0&&(S[b]=C)}),d.push({animation:S})}let k=!!d.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(k=!1),r=!1,k?t(d):Promise.resolve()}function s(l,u,c){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(g=>{var w;return(w=g.animationState)===null||w===void 0?void 0:w.setActive(l,u)}),n[l].isActive=u;const d=a(c,l);for(const g in n)n[g].protectedKeys={};return d}return{animateChanges:a,setActive:s,setAnimateFunction:i,getState:()=>n}}function U7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!JR(t,e):!1}function oa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function V7(){return{animate:oa(!0),whileInView:oa(),whileHover:oa(),whileTap:oa(),whileDrag:oa(),whileFocus:oa(),exit:oa()}}class H7 extends qi{constructor(t){super(t),t.animationState||(t.animationState=F7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Pm(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let W7=0;class q7 extends qi{constructor(){super(...arguments),this.id=W7++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const i=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const K7={animation:{Feature:H7},exit:{Feature:q7}},jC=(e,t)=>Math.abs(e-t);function G7(e,t){const n=jC(e.x,t.x),r=jC(e.y,t.y);return Math.sqrt(n**2+r**2)}class II{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=yy(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,f=G7(u.offset,{x:0,y:0})>=3;if(!c&&!f)return;const{point:d}=u,{timestamp:g}=mn;this.history.push({...d,timestamp:g});const{onStart:w,onMove:y}=this.handlers;c||(w&&w(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=vy(c,this.transformPagePoint),ht.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,g=yy(u.type==="pointercancel"?this.lastMoveEventInfo:vy(c,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,g),d&&d(u,g)},!GR(t))return;this.handlers=n,this.transformPagePoint=r;const o=Tm(t),i=vy(o,this.transformPagePoint),{point:a}=i,{timestamp:s}=mn;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,yy(i,this.history)),this.removeListeners=Li(Ho(window,"pointermove",this.handlePointerMove),Ho(window,"pointerup",this.handlePointerUp),Ho(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Zo(this.updatePoint)}}function vy(e,t){return t?{point:t(e.point)}:e}function MC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yy({point:e},t){return{point:e,delta:MC(e,AI(t)),offset:MC(e,Y7(t)),velocity:X7(t,.1)}}function Y7(e){return e[0]}function AI(e){return e[e.length-1]}function X7(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=AI(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ji(t)));)n--;if(!r)return{x:0,y:0};const i=Wo(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function hr(e){return e.max-e.min}function D0(e,t=0,n=.01){return Math.abs(e-t)<=n}function $C(e,t,n,r=.5){e.origin=r,e.originPoint=xt(t.min,t.max,e.origin),e.scale=hr(n)/hr(t),(D0(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=xt(n.min,n.max,e.origin)-e.originPoint,(D0(e.translate)||isNaN(e.translate))&&(e.translate=0)}function zu(e,t,n,r){$C(e.x,t.x,n.x,r?r.originX:void 0),$C(e.y,t.y,n.y,r?r.originY:void 0)}function DC(e,t,n){e.min=n.min+t.min,e.max=e.min+hr(t)}function Z7(e,t,n){DC(e.x,t.x,n.x),DC(e.y,t.y,n.y)}function zC(e,t,n){e.min=t.min-n.min,e.max=e.min+hr(t)}function Nu(e,t,n){zC(e.x,t.x,n.x),zC(e.y,t.y,n.y)}function Q7(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?xt(n,e,r.max):Math.min(e,n)),e}function NC(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function J7(e,{top:t,left:n,bottom:r,right:o}){return{x:NC(e.x,n,o),y:NC(e.y,t,r)}}function BC(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Sc(t.min,t.max-r,e.min):r>o&&(n=Sc(e.min,e.max-o,t.min)),Ni(0,1,n)}function nq(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const z0=.35;function rq(e=z0){return e===!1?e=0:e===!0&&(e=z0),{x:FC(e,"left","right"),y:FC(e,"top","bottom")}}function FC(e,t,n){return{min:UC(e,t),max:UC(e,n)}}function UC(e,t){return typeof e=="number"?e:e[t]||0}const VC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ds=()=>({x:VC(),y:VC()}),HC=()=>({min:0,max:0}),Dt=()=>({x:HC(),y:HC()});function so(e){return[e("x"),e("y")]}function LI({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function oq({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iq(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function gy(e){return e===void 0||e===1}function N0({scale:e,scaleX:t,scaleY:n}){return!gy(e)||!gy(t)||!gy(n)}function sa(e){return N0(e)||jI(e)||e.z||e.rotate||e.rotateX||e.rotateY}function jI(e){return WC(e.x)||WC(e.y)}function WC(e){return e&&e!=="0%"}function Ip(e,t,n){const r=e-n,o=t*r;return n+o}function qC(e,t,n,r,o){return o!==void 0&&(e=Ip(e,o,r)),Ip(e,n,r)+t}function B0(e,t=0,n=1,r,o){e.min=qC(e.min,t,n,r,o),e.max=qC(e.max,t,n,r,o)}function MI(e,{x:t,y:n}){B0(e.x,t.translate,t.scale,t.originPoint),B0(e.y,n.translate,n.scale,n.originPoint)}function aq(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,a;for(let s=0;s1.0000000000001||e<.999999999999?e:1}function mi(e,t){e.min=e.min+t,e.max=e.max+t}function GC(e,t,[n,r,o]){const i=t[o]!==void 0?t[o]:.5,a=xt(e.min,e.max,i);B0(e,t[n],t[r],a,t.scale)}const sq=["x","scaleX","originX"],lq=["y","scaleY","originY"];function zs(e,t){GC(e.x,t,sq),GC(e.y,t,lq)}function $I(e,t){return LI(iq(e.getBoundingClientRect(),t))}function uq(e,t,n){const r=$I(e,n),{scroll:o}=t;return o&&(mi(r.x,o.offset.x),mi(r.y,o.offset.y)),r}const cq=new WeakMap;class fq{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Dt(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=l=>{this.stopAnimation(),n&&this.snapToCursor(Tm(l,"page").point)},i=(l,u)=>{const{drag:c,dragPropagation:f,onDragStart:d}=this.getProps();if(c&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=XR(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),so(w=>{let y=this.getAxisMotionValue(w).get()||0;if(Eo.test(y)){const{projection:k}=this.visualElement;if(k&&k.layout){const S=k.layout.layoutBox[w];S&&(y=hr(S)*(parseFloat(y)/100))}}this.originPoint[w]=y}),d&&ht.update(()=>d(l,u),!1,!0);const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(l,u)=>{const{dragPropagation:c,dragDirectionLock:f,onDirectionLock:d,onDrag:g}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:w}=u;if(f&&this.currentDirection===null){this.currentDirection=dq(w),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,w),this.updateAxis("y",u.point,w),this.visualElement.render(),g&&g(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new II(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:s},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&ht.update(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!ed(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Q7(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},o=this.constraints;t&&Ms(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=J7(r.layoutBox,t):this.constraints=!1,this.elastic=rq(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&so(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=nq(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ms(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=uq(r,o.root,this.visualElement.getTransformPagePoint());let a=eq(o.layout.layoutBox,i);if(n){const s=n(oq(a));this.hasMutatedConstraints=!!s,s&&(a=LI(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=so(c=>{if(!ed(c,n,this.currentDirection))return;let f=l&&l[c]||{};a&&(f={min:0,max:0});const d=o?200:1e6,g=o?40:1e7,w={type:"inertia",velocity:r?t[c]:0,bounceStiffness:d,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,w)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(Cw(t,r,0,n))}stopAnimation(){so(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){so(n=>{const{drag:r}=this.getProps();if(!ed(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:s}=o.layout.layoutBox[n];i.set(t[n]-xt(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ms(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};so(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();o[a]=tq({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),so(a=>{if(!ed(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(xt(l,u,o[a]))})}addListeners(){if(!this.visualElement.current)return;cq.set(this.visualElement,this);const t=this.visualElement.current,n=Ho(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ms(l)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),r();const a=Fo(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(so(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=z0,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:s}}}function ed(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function dq(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class pq extends qi{constructor(t){super(t),this.removeGroupControls=Rt,this.removeListeners=Rt,this.controls=new fq(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rt}unmount(){this.removeGroupControls(),this.removeListeners()}}const YC=e=>(t,n)=>{e&&ht.update(()=>e(t,n))};class hq extends qi{constructor(){super(...arguments),this.removePointerDownListener=Rt}onPointerDown(t){this.session=new II(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:YC(t),onStart:YC(n),onMove:r,onEnd:(i,a)=>{delete this.session,o&&ht.update(()=>o(i,a))}}}mount(){this.removePointerDownListener=Ho(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function DI(){const e=P.useContext(Kc);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=P.useId();return P.useEffect(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}function mq(){return vq(P.useContext(Kc))}function vq(e){return e===null?!0:e.isPresent}const Dd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function XC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const nu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ee.test(e))e=parseFloat(e);else return e;const n=XC(e,t.target.x),r=XC(e,t.target.y);return`${n}% ${r}%`}},yq={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Bi.parse(e);if(o.length>5)return r;const i=Bi.createTransformer(e),a=typeof o[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;o[0+a]/=s,o[1+a]/=l;const u=xt(s,l,.5);return typeof o[2+a]=="number"&&(o[2+a]/=u),typeof o[3+a]=="number"&&(o[3+a]/=u),i(o)}};class gq extends Z.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;E9(bq),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Dd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,o||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||ht.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function zI(e){const[t,n]=DI(),r=P.useContext(cw);return Z.createElement(gq,{...e,layoutGroup:r,switchLayoutGroup:P.useContext(LR),isPresent:t,safeToRemove:n})}const bq={borderRadius:{...nu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:nu,borderTopRightRadius:nu,borderBottomLeftRadius:nu,borderBottomRightRadius:nu,boxShadow:yq},NI=["TopLeft","TopRight","BottomLeft","BottomRight"],wq=NI.length,ZC=e=>typeof e=="string"?parseFloat(e):e,QC=e=>typeof e=="number"||Ee.test(e);function Sq(e,t,n,r,o,i){o?(e.opacity=xt(0,n.opacity!==void 0?n.opacity:1,xq(r)),e.opacityExit=xt(t.opacity!==void 0?t.opacity:1,0,Eq(r))):i&&(e.opacity=xt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(Sc(e,t,r))}function ek(e,t){e.min=t.min,e.max=t.max}function Sr(e,t){ek(e.x,t.x),ek(e.y,t.y)}function tk(e,t,n,r,o){return e-=t,e=Ip(e,1/n,r),o!==void 0&&(e=Ip(e,1/o,r)),e}function Cq(e,t=0,n=1,r=.5,o,i=e,a=e){if(Eo.test(t)&&(t=parseFloat(t),t=xt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=xt(i.min,i.max,r);e===i&&(s-=t),e.min=tk(e.min,t,n,s,o),e.max=tk(e.max,t,n,s,o)}function nk(e,t,[n,r,o],i,a){Cq(e,t[n],t[r],t[o],t.scale,i,a)}const kq=["x","scaleX","originX"],Pq=["y","scaleY","originY"];function rk(e,t,n,r){nk(e.x,t,kq,n?n.x:void 0,r?r.x:void 0),nk(e.y,t,Pq,n?n.y:void 0,r?r.y:void 0)}function ok(e){return e.translate===0&&e.scale===1}function FI(e){return ok(e.x)&&ok(e.y)}function _q(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function UI(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function ik(e){return hr(e.x)/hr(e.y)}class Oq{constructor(){this.members=[]}add(t){kw(this.members,t),t.scheduleRender()}remove(t){if(Pw(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ak(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const Tq=(e,t)=>e.depth-t.depth;class Rq{constructor(){this.children=[],this.isDirty=!1}add(t){kw(this.children,t),this.isDirty=!0}remove(t){Pw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Tq),this.isDirty=!1,this.children.forEach(t)}}function Iq(e,t){const n=performance.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Zo(r),e(i-t))};return ht.read(r,!0),()=>Zo(r)}function Aq(e){window.MotionDebug&&window.MotionDebug.record(e)}function Lq(e){return e instanceof SVGElement&&e.tagName!=="svg"}function jq(e,t,n){const r=Yn(e)?e:ml(e);return r.start(Cw("",r,t,n)),r.animation}const sk=["","X","Y","Z"],lk=1e3;let Mq=0;const la={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function VI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},s=t==null?void 0:t()){this.id=Mq++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{la.totalNodes=la.resolvedTargetDeltas=la.recalculatedProjection=0,this.nodes.forEach(zq),this.nodes.forEach(Vq),this.nodes.forEach(Hq),this.nodes.forEach(Nq),Aq(la)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Iq(d,250),Dd.hasAnimatedSinceResize&&(Dd.hasAnimatedSinceResize=!1,this.nodes.forEach(ck))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:g,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||Yq,{onLayoutAnimationStart:k,onLayoutAnimationComplete:S}=c.getProps(),b=!this.targetLayout||!UI(this.targetLayout,w)||g,C=!d&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||C||d&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const R={..._I(y,"layout"),onPlay:k,onComplete:S};(c.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R)}else d||ck(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Zo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Wq),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(Bq),this.sharedNodes.forEach(qq)}scheduleUpdateProjection(){ht.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){ht.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const _=R/1e3;fk(f.x,a.x,_),fk(f.y,a.y,_),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Nu(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Kq(this.relativeTarget,this.relativeTargetOrigin,d,_),C&&_q(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Dt()),Sr(C,this.relativeTarget)),y&&(this.animationValues=c,Sq(c,u,this.latestValues,_,b,S)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Zo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ht.update(()=>{Dd.hasAnimatedSinceResize=!0,this.currentAnimation=jq(0,lk,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(lk),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&HI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Dt();const f=hr(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const d=hr(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+d}Sr(s,l),zs(s,c),zu(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Oq),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let c=0;c{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(uk),this.root.sharedNodes.clear()}}}function $q(e){e.updateLayout()}function Dq(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,a=n.source!==e.layout.source;i==="size"?so(f=>{const d=a?n.measuredBox[f]:n.layoutBox[f],g=hr(d);d.min=r[f].min,d.max=d.min+g}):HI(i,n.layoutBox,r)&&so(f=>{const d=a?n.measuredBox[f]:n.layoutBox[f],g=hr(r[f]);d.max=d.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const s=Ds();zu(s,r,n.layoutBox);const l=Ds();a?zu(l,e.applyTransform(o,!0),n.measuredBox):zu(l,r,n.layoutBox);const u=!FI(s);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:g}=f;if(d&&g){const w=Dt();Nu(w,n.layoutBox,d.layoutBox);const y=Dt();Nu(y,r,g.layoutBox),UI(w,y)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=w,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function zq(e){la.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Nq(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Bq(e){e.clearSnapshot()}function uk(e){e.clearMeasurements()}function Fq(e){e.isLayoutDirty=!1}function Uq(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ck(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Vq(e){e.resolveTargetDelta()}function Hq(e){e.calcProjection()}function Wq(e){e.resetRotation()}function qq(e){e.removeLeadSnapshot()}function fk(e,t,n){e.translate=xt(t.translate,0,n),e.scale=xt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function dk(e,t,n,r){e.min=xt(t.min,n.min,r),e.max=xt(t.max,n.max,r)}function Kq(e,t,n,r){dk(e.x,t.x,n.x,r),dk(e.y,t.y,n.y,r)}function Gq(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Yq={duration:.45,ease:[.4,0,.1,1]},pk=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),hk=pk("applewebkit/")&&!pk("chrome/")?Math.round:Rt;function mk(e){e.min=hk(e.min),e.max=hk(e.max)}function Xq(e){mk(e.x),mk(e.y)}function HI(e,t,n){return e==="position"||e==="preserve-aspect"&&!D0(ik(t),ik(n),.2)}const Zq=VI({attachResizeListener:(e,t)=>Fo(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),by={current:void 0},WI=VI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!by.current){const e=new Zq({});e.mount(window),e.setOptions({layoutScroll:!0}),by.current=e}return by.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Qq={pan:{Feature:hq},drag:{Feature:pq,ProjectionNode:WI,MeasureLayout:zI}},Jq=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function eK(e){const t=Jq.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function F0(e,t,n=1){const[r,o]=eK(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);return i?i.trim():R0(o)?F0(o,t,n+1):o}function tK(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(o=>{const i=o.get();if(!R0(i))return;const a=F0(i,r);a&&o.set(a)});for(const o in t){const i=t[o];if(!R0(i))continue;const a=F0(i,r);a&&(t[o]=a,n||(n={}),n[o]===void 0&&(n[o]=i))}return{target:t,transitionEnd:n}}const nK=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),qI=e=>nK.has(e),rK=e=>Object.keys(e).some(qI),vk=e=>e===Ya||e===Ee,yk=(e,t)=>parseFloat(e.split(", ")[t]),gk=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return yk(o[1],t);{const i=r.match(/^matrix\((.+)\)$/);return i?yk(i[1],e):0}},oK=new Set(["x","y","z"]),iK=Gc.filter(e=>!oK.has(e));function aK(e){const t=[];return iK.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const vl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:gk(4,13),y:gk(5,14)};vl.translateX=vl.x;vl.translateY=vl.y;const sK=(e,t,n)=>{const r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),{display:a}=i,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=vl[u](r,i)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(s[u]),e[u]=vl[u](l,i)}),e},lK=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(qI);let i=[],a=!1;const s=[];if(o.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],f=tu(c);const d=t[l];let g;if(Pp(d)){const w=d.length,y=d[0]===null?1:0;c=d[y],f=tu(c);for(let k=y;k=0?window.pageYOffset:null,u=sK(t,e,s);return i.length&&i.forEach(([c,f])=>{e.getValue(c).set(f)}),e.render(),km&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function uK(e,t,n,r){return rK(t)?lK(e,t,n,r):{target:t,transitionEnd:r}}const cK=(e,t,n,r)=>{const o=tK(e,t,r);return t=o.target,r=o.transitionEnd,uK(e,t,n,r)},U0={current:null},KI={current:!1};function fK(){if(KI.current=!0,!!km)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>U0.current=e.matches;e.addListener(t),t()}else U0.current=!1}function dK(e,t,n){const{willChange:r}=t;for(const o in t){const i=t[o],a=n[o];if(Yn(i))e.addValue(o,i),Rp(r)&&r.add(o);else if(Yn(a))e.addValue(o,ml(i,{owner:e})),Rp(r)&&r.remove(o);else if(a!==i)if(e.hasValue(o)){const s=e.getValue(o);!s.hasAnimated&&s.set(i)}else{const s=e.getStaticValue(o);e.addValue(o,ml(s!==void 0?s:i,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const bk=new WeakMap,GI=Object.keys(wc),pK=GI.length,wk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],hK=uw.length;class mK{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>ht.render(this.render,!1,!0);const{latestValues:s,renderState:l}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.isControllingVariants=_m(n),this.isVariantNode=AR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const f in c){const d=c[f];s[f]!==void 0&&Yn(d)&&(d.set(s[f],!1),Rp(u)&&u.add(f))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,bk.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),KI.current||fK(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:U0.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){bk.delete(this.current),this.projection&&this.projection.unmount(),Zo(this.notifyUpdate),Zo(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Ga.has(t),o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ht.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,o,i){let a,s;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:i,layoutScroll:d,layoutRoot:g})}return s}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Dt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ml(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,o=typeof r=="string"||typeof r=="object"?(n=gw(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&o!==void 0)return o;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Yn(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new _w),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class YI extends mK{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:o},i){let a=L7(r,t||{},this);if(o&&(n&&(n=o(n)),r&&(r=o(r)),a&&(a=o(a))),i){I7(this,r,a);const s=cK(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function vK(e){return window.getComputedStyle(e)}class yK extends YI{readValueFromInstance(t,n){if(Ga.has(n)){const r=Ew(n);return r&&r.default||0}else{const r=vK(t),o=($R(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return $I(t,n)}build(t,n,r,o){dw(t,n,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,n){return yw(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Yn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,o){UR(t,n,r,o)}}class gK extends YI{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ga.has(n)){const r=Ew(n);return r&&r.default||0}return n=VR.has(n)?n:vw(n),t.getAttribute(n)}measureInstanceViewportBox(){return Dt()}scrapeMotionValuesFromProps(t,n){return WR(t,n)}build(t,n,r,o){hw(t,n,r,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,r,o){HR(t,n,r,o)}mount(t){this.isSVGTag=mw(t.tagName),super.mount(t)}}const bK=(e,t)=>fw(e)?new gK(t,{enableHardwareAcceleration:!1}):new yK(t,{enableHardwareAcceleration:!0}),wK={layout:{ProjectionNode:WI,MeasureLayout:zI}},SK={...K7,...dW,...Qq,...wK},ti=S9((e,t)=>X9(e,t,SK,bK));function XI(){const e=P.useRef(!1);return Ep(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function xK(){const e=XI(),[t,n]=P.useState(0),r=P.useCallback(()=>{e.current&&n(t+1)},[t]);return[P.useCallback(()=>ht.postRender(r),[r]),t]}class EK extends P.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function CK({children:e,isPresent:t}){const n=P.useId(),r=P.useRef(null),o=P.useRef({width:0,height:0,top:0,left:0});return P.useInsertionEffect(()=>{const{width:i,height:a,top:s,left:l}=o.current;if(t||!r.current||!i||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` - [data-motion-pop-id="${n}"] { - position: absolute !important; - width: ${i}px !important; - height: ${a}px !important; - top: ${s}px !important; - left: ${l}px !important; - } - `),()=>{document.head.removeChild(u)}},[t]),P.createElement(EK,{isPresent:t,childRef:r,sizeRef:o},P.cloneElement(e,{ref:r}))}const wy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a})=>{const s=qR(kK),l=P.useId(),u=P.useMemo(()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:c=>{s.set(c,!0);for(const f of s.values())if(!f)return;r&&r()},register:c=>(s.set(c,!1),()=>s.delete(c))}),i?void 0:[n]);return P.useMemo(()=>{s.forEach((c,f)=>s.set(f,!1))},[n]),P.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=P.createElement(CK,{isPresent:n},e)),P.createElement(Kc.Provider,{value:u},e)};function kK(){return new Map}function PK(e){return P.useEffect(()=>()=>e(),[])}const hs=e=>e.key||"";function _K(e,t){e.forEach(n=>{const r=hs(n);t.set(r,n)})}function OK(e){const t=[];return P.Children.forEach(e,n=>{P.isValidElement(n)&&t.push(n)}),t}const Al=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:a="sync"})=>{const s=P.useContext(cw).forceRender||xK()[0],l=XI(),u=OK(e);let c=u;const f=P.useRef(new Map).current,d=P.useRef(c),g=P.useRef(new Map).current,w=P.useRef(!0);if(Ep(()=>{w.current=!1,_K(u,g),d.current=c}),PK(()=>{w.current=!0,g.clear(),f.clear()}),w.current)return P.createElement(P.Fragment,null,c.map(b=>P.createElement(wy,{key:hs(b),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:i,mode:a},b)));c=[...c];const y=d.current.map(hs),k=u.map(hs),S=y.length;for(let b=0;b{if(k.indexOf(C)!==-1)return;const R=g.get(C);if(!R)return;const _=y.indexOf(C);let O=b;if(!O){const E=()=>{g.delete(C),f.delete(C);const p=d.current.findIndex(v=>v.key===C);if(d.current.splice(p,1),!f.size){if(d.current=u,l.current===!1)return;s(),r&&r()}};O=P.createElement(wy,{key:hs(R),isPresent:!1,onExitComplete:E,custom:t,presenceAffectsLayout:i,mode:a},R),f.set(C,O)}c.splice(_,0,O)}),c=c.map(b=>{const C=b.key;return f.has(C)?b:P.createElement(wy,{key:hs(b),isPresent:!0,presenceAffectsLayout:i,mode:a},b)}),P.createElement(P.Fragment,null,f.size?c:c.map(b=>P.cloneElement(b)))};var TK={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},ZI=P.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:o,requestClose:i=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=TK,toastSpacing:c="0.5rem"}=e,[f,d]=P.useState(s),g=mq();Na(()=>{g||r==null||r()},[g]),Na(()=>{d(s)},[s]);const w=()=>d(null),y=()=>d(s),k=()=>{g&&o()};P.useEffect(()=>{g&&i&&o()},[g,i,o]),d9(k,f);const S=P.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),b=P.useMemo(()=>c9(a),[a]);return m.jsx(ti.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:w,onHoverEnd:y,custom:{position:a},style:b,children:m.jsx(J.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:S,children:Rr(n,{id:t,onClose:k})})})});ZI.displayName="ToastComponent";function RK(e,t){var n;const r=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=i==null?void 0:i[t])!=null?n:r}var Sk={path:m.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[m.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),m.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),m.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Ne=le((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:i=!1,children:a,className:s,__css:l,...u}=e,c=ye("chakra-icon",s),f=Nr("Icon",e),d={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...l,...f},g={ref:t,focusable:i,className:c,__css:d},w=r??Sk.viewBox;if(n&&typeof n!="string")return m.jsx(J.svg,{as:n,...g,...u});const y=a??Sk.path;return m.jsx(J.svg,{verticalAlign:"middle",viewBox:w,...g,...u,children:y})});Ne.displayName="Icon";function IK(e){return m.jsx(Ne,{viewBox:"0 0 24 24",...e,children:m.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function AK(e){return m.jsx(Ne,{viewBox:"0 0 24 24",...e,children:m.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function xk(e){return m.jsx(Ne,{viewBox:"0 0 24 24",...e,children:m.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var LK=_o({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Im=le((e,t)=>{const n=Nr("Spinner",e),{label:r="Loading...",thickness:o="2px",speed:i="0.45s",emptyColor:a="transparent",className:s,...l}=mt(e),u=ye("chakra-spinner",s),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:o,borderBottomColor:a,borderLeftColor:a,animation:`${LK} ${i} linear infinite`,...n};return m.jsx(J.div,{ref:t,__css:c,className:u,...l,children:r&&m.jsx(J.span,{srOnly:!0,children:r})})});Im.displayName="Spinner";var[jK,Ow]=$t({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[MK,Tw]=$t({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),QI={info:{icon:AK,colorScheme:"blue"},warning:{icon:xk,colorScheme:"orange"},success:{icon:IK,colorScheme:"green"},error:{icon:xk,colorScheme:"red"},loading:{icon:Im,colorScheme:"blue"}};function $K(e){return QI[e].colorScheme}function DK(e){return QI[e].icon}var JI=le(function(t,n){const r=Tw(),{status:o}=Ow(),i={display:"inline",...r.description};return m.jsx(J.div,{ref:n,"data-status":o,...t,className:ye("chakra-alert__desc",t.className),__css:i})});JI.displayName="AlertDescription";function eA(e){const{status:t}=Ow(),n=DK(t),r=Tw(),o=t==="loading"?r.spinner:r.icon;return m.jsx(J.span,{display:"inherit","data-status":t,...e,className:ye("chakra-alert__icon",e.className),__css:o,children:e.children||m.jsx(n,{h:"100%",w:"100%"})})}eA.displayName="AlertIcon";var tA=le(function(t,n){const r=Tw(),{status:o}=Ow();return m.jsx(J.div,{ref:n,"data-status":o,...t,className:ye("chakra-alert__title",t.className),__css:r.title})});tA.displayName="AlertTitle";var nA=le(function(t,n){var r;const{status:o="info",addRole:i=!0,...a}=mt(t),s=(r=t.colorScheme)!=null?r:$K(o),l=Xn("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return m.jsx(jK,{value:{status:o},children:m.jsx(MK,{value:l,children:m.jsx(J.div,{"data-status":o,role:i?"alert":void 0,ref:n,...a,className:ye("chakra-alert",t.className),__css:u})})})});nA.displayName="Alert";function zK(e){return m.jsx(Ne,{focusable:"false","aria-hidden":!0,...e,children:m.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var Am=le(function(t,n){const r=Nr("CloseButton",t),{children:o,isDisabled:i,__css:a,...s}=mt(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return m.jsx(J.button,{type:"button","aria-label":"Close",ref:n,disabled:i,__css:{...l,...r,...a},...s,children:o||m.jsx(zK,{width:"1em",height:"1em"})})});Am.displayName="CloseButton";var NK={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},mo=BK(NK);function BK(e){let t=e;const n=new Set,r=o=>{t=o(t),n.forEach(i=>i())};return{getState:()=>t,subscribe:o=>(n.add(o),()=>{r(()=>e),n.delete(o)}),removeToast:(o,i)=>{r(a=>({...a,[i]:a[i].filter(s=>s.id!=o)}))},notify:(o,i)=>{const a=FK(o,i),{position:s,id:l}=a;return r(u=>{var c,f;const g=s.includes("top")?[a,...(c=u[s])!=null?c:[]]:[...(f=u[s])!=null?f:[],a];return{...u,[s]:g}}),l},update:(o,i)=>{o&&r(a=>{const s={...a},{position:l,index:u}=yC(s,o);return l&&u!==-1&&(s[l][u]={...s[l][u],...i,message:rA(i)}),s})},closeAll:({positions:o}={})=>{r(i=>(o??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=i[u].map(c=>({...c,requestClose:!0})),l),{...i}))},close:o=>{r(i=>{const a=TR(i,o);return a?{...i,[a]:i[a].map(s=>s.id==o?{...s,requestClose:!0}:s)}:i})},isActive:o=>!!yC(mo.getState(),o).position}}var Ek=0;function FK(e,t={}){var n,r;Ek+=1;const o=(n=t.id)!=null?n:Ek,i=(r=t.position)!=null?r:"bottom";return{id:o,message:e,position:i,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>mo.removeToast(String(o),i),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var UK=e=>{const{status:t,variant:n="solid",id:r,title:o,isClosable:i,onClose:a,description:s,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return m.jsxs(nA,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[m.jsx(eA,{children:u}),m.jsxs(J.div,{flex:"1",maxWidth:"100%",children:[o&&m.jsx(tA,{id:c==null?void 0:c.title,children:o}),s&&m.jsx(JI,{id:c==null?void 0:c.description,display:"block",children:s})]}),i&&m.jsx(Am,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function rA(e={}){const{render:t,toastComponent:n=UK}=e;return o=>typeof t=="function"?t({...o,...e}):m.jsx(n,{...o,...e})}function VK(e,t){const n=o=>{var i;return{...t,...o,position:RK((i=o==null?void 0:o.position)!=null?i:t==null?void 0:t.position,e)}},r=o=>{const i=n(o),a=rA(i);return mo.notify(a,i)};return r.update=(o,i)=>{mo.update(o,n(i))},r.promise=(o,i)=>{const a=r({...i.loading,status:"loading",duration:null});o.then(s=>r.update(a,{status:"success",duration:5e3,...Rr(i.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...Rr(i.error,s)}))},r.closeAll=mo.closeAll,r.close=mo.close,r.isActive=mo.isActive,r}var[HK,WK]=$t({name:"ToastOptionsContext",strict:!1}),qK=e=>{const t=P.useSyncExternalStore(mo.subscribe,mo.getState,mo.getState),{motionVariants:n,component:r=ZI,portalProps:o}=e,a=Object.keys(t).map(s=>{const l=t[s];return m.jsx("div",{role:"region","aria-live":"polite","aria-label":"Notifications",id:`chakra-toast-manager-${s}`,style:f9(s),children:m.jsx(Al,{initial:!1,children:l.map(u=>m.jsx(r,{motionVariants:n,...u},u.id))})},s)});return m.jsx(Il,{...o,children:a})};function ni(e){const{theme:t}=Q2(),n=WK();return P.useMemo(()=>VK(t.direction,{...n,...e}),[e,t.direction,n])}var KK=e=>function({children:n,theme:r=e,toastOptions:o,...i}){return m.jsxs(l9,{theme:r,...i,children:[m.jsx(HK,{value:o==null?void 0:o.defaultOptions,children:n}),m.jsx(qK,{...o})]})},GK=KK(bR),YK=Object.defineProperty,XK=(e,t,n)=>t in e?YK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pt=(e,t,n)=>(XK(e,typeof t!="symbol"?t+"":t,n),n);function Ck(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var ZK=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function kk(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Pk(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var V0=typeof window<"u"?P.useLayoutEffect:P.useEffect,Ap=e=>e,QK=class{constructor(){Pt(this,"descendants",new Map),Pt(this,"register",e=>{if(e!=null)return ZK(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),Pt(this,"unregister",e=>{this.descendants.delete(e);const t=Ck(Array.from(this.descendants.keys()));this.assignIndex(t)}),Pt(this,"destroy",()=>{this.descendants.clear()}),Pt(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),Pt(this,"count",()=>this.descendants.size),Pt(this,"enabledCount",()=>this.enabledValues().length),Pt(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),Pt(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),Pt(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),Pt(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),Pt(this,"first",()=>this.item(0)),Pt(this,"firstEnabled",()=>this.enabledItem(0)),Pt(this,"last",()=>this.item(this.descendants.size-1)),Pt(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),Pt(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),Pt(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),Pt(this,"next",(e,t=!0)=>{const n=kk(e,this.count(),t);return this.item(n)}),Pt(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=kk(r,this.enabledCount(),t);return this.enabledItem(o)}),Pt(this,"prev",(e,t=!0)=>{const n=Pk(e,this.count()-1,t);return this.item(n)}),Pt(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Pk(r,this.enabledCount()-1,t);return this.enabledItem(o)}),Pt(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Ck(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function JK(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function jt(...e){return t=>{e.forEach(n=>{JK(n,t)})}}function eG(...e){return P.useMemo(()=>jt(...e),e)}function tG(){const e=P.useRef(new QK);return V0(()=>()=>e.current.destroy()),e.current}var[nG,oA]=$t({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function rG(e){const t=oA(),[n,r]=P.useState(-1),o=P.useRef(null);V0(()=>()=>{o.current&&t.unregister(o.current)},[]),V0(()=>{if(!o.current)return;const a=Number(o.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const i=Ap(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:jt(i,o)}}function oG(){return[Ap(nG),()=>Ap(oA()),()=>tG(),o=>rG(o)]}var _k={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Oa={enter:{duration:.2,ease:_k.easeOut},exit:{duration:.1,ease:_k.easeIn}},Ta={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},iG={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Ta.enter(Oa.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Ta.exit(Oa.exit,n),transitionEnd:t==null?void 0:t.exit}}},iA={initial:"exit",animate:"enter",exit:"exit",variants:iG},aG=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:i,transition:a,transitionEnd:s,delay:l,...u}=t,c=o||r?"enter":"exit",f=r?o&&r:!0,d={transition:a,transitionEnd:s,delay:l};return m.jsx(Al,{custom:d,children:f&&m.jsx(ti.div,{ref:n,className:ye("chakra-fade",i),custom:d,...iA,animate:c,...u})})});aG.displayName="Fade";var sG={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(i=n==null?void 0:n.exit)!=null?i:Ta.exit(Oa.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Ta.enter(Oa.enter,n),transitionEnd:e==null?void 0:e.enter}}},aA={initial:"exit",animate:"enter",exit:"exit",variants:sG},lG=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:c,...f}=t,d=r?o&&r:!0,g=o||r?"enter":"exit",w={initialScale:a,reverse:i,transition:l,transitionEnd:u,delay:c};return m.jsx(Al,{custom:w,children:d&&m.jsx(ti.div,{ref:n,className:ye("chakra-offset-slide",s),...aA,animate:g,custom:w,...f})})});lG.displayName="ScaleFade";var uG={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,x:e,y:t,transition:(i=n==null?void 0:n.exit)!=null?i:Ta.exit(Oa.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Ta.enter(Oa.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:i})=>{var a;const s={x:t,y:e};return{opacity:0,transition:(a=n==null?void 0:n.exit)!=null?a:Ta.exit(Oa.exit,i),...o?{...s,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...s,...r==null?void 0:r.exit}}}}},H0={initial:"initial",animate:"enter",exit:"exit",variants:uG},cG=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:c,delay:f,...d}=t,g=r?o&&r:!0,w=o||r?"enter":"exit",y={offsetX:s,offsetY:l,reverse:i,transition:u,transitionEnd:c,delay:f};return m.jsx(Al,{custom:y,children:g&&m.jsx(ti.div,{ref:n,className:ye("chakra-offset-slide",a),custom:y,...H0,animate:w,...d})})});cG.displayName="SlideFade";var[fG,dG]=$t({name:"AvatarStylesContext",hookName:"useAvatarStyles",providerName:""});function pG(e){var t;const n=e.split(" "),r=(t=n[0])!=null?t:"",o=n.length>1?n[n.length-1]:"";return r&&o?`${r.charAt(0)}${o.charAt(0)}`:r.charAt(0)}function sA(e){const{name:t,getInitials:n,...r}=e,o=dG();return m.jsx(J.div,{role:"img","aria-label":t,...r,__css:o.label,children:t?n==null?void 0:n(t):null})}sA.displayName="AvatarName";var lA=e=>m.jsxs(J.svg,{viewBox:"0 0 128 128",color:"#fff",width:"100%",height:"100%",className:"chakra-avatar__svg",...e,children:[m.jsx("path",{fill:"currentColor",d:"M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"}),m.jsx("path",{fill:"currentColor",d:"M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"})]}),W0=le(function(t,n){const{htmlWidth:r,htmlHeight:o,alt:i,...a}=t;return m.jsx("img",{width:r,height:o,ref:n,alt:i,...a})});W0.displayName="NativeImage";function uA(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:i,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,c]=P.useState("pending");P.useEffect(()=>{c(n?"loading":"pending")},[n]);const f=P.useRef(),d=P.useCallback(()=>{if(!n)return;g();const w=new Image;w.src=n,a&&(w.crossOrigin=a),r&&(w.srcset=r),s&&(w.sizes=s),t&&(w.loading=t),w.onload=y=>{g(),c("loaded"),o==null||o(y)},w.onerror=y=>{g(),c("failed"),i==null||i(y)},f.current=w},[n,a,r,s,o,i,t]),g=()=>{f.current&&(f.current.onload=null,f.current.onerror=null,f.current=null)};return bo(()=>{if(!l)return u==="loading"&&d(),()=>{g()}},[u,d,l]),l?"loaded":u}var hG=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function mG(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Ll=le(function(t,n){const{fallbackSrc:r,fallback:o,src:i,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:c,crossOrigin:f,fallbackStrategy:d="beforeLoadOrError",referrerPolicy:g,...w}=t,y=r!==void 0||o!==void 0,k=u!=null||c||!y,S=uA({...t,crossOrigin:f,ignoreFallback:k}),b=hG(S,d),C={ref:n,objectFit:l,objectPosition:s,...k?w:mG(w,["onError","onLoad"])};return b?o||m.jsx(J.img,{as:W0,className:"chakra-image__placeholder",src:r,...C}):m.jsx(J.img,{as:W0,src:i,srcSet:a,crossOrigin:f,loading:u,referrerPolicy:g,className:"chakra-image",...C})});Ll.displayName="Image";function cA(e){const{src:t,srcSet:n,onError:r,onLoad:o,getInitials:i,name:a,borderRadius:s,loading:l,iconLabel:u,icon:c=m.jsx(lA,{}),ignoreFallback:f,referrerPolicy:d,crossOrigin:g}=e,y=uA({src:t,onError:r,crossOrigin:g,ignoreFallback:f})==="loaded";return!t||!y?a?m.jsx(sA,{className:"chakra-avatar__initials",getInitials:i,name:a}):P.cloneElement(c,{role:"img","aria-label":u}):m.jsx(J.img,{src:t,srcSet:n,alt:a,onLoad:o,referrerPolicy:d,crossOrigin:g??void 0,className:"chakra-avatar__img",loading:l,__css:{width:"100%",height:"100%",objectFit:"cover",borderRadius:s}})}cA.displayName="AvatarImage";var vG={display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",textTransform:"uppercase",fontWeight:"medium",position:"relative",flexShrink:0},Lp=le((e,t)=>{const n=Xn("Avatar",e),[r,o]=P.useState(!1),{src:i,srcSet:a,name:s,showBorder:l,borderRadius:u="full",onError:c,onLoad:f,getInitials:d=pG,icon:g=m.jsx(lA,{}),iconLabel:w=" avatar",loading:y,children:k,borderColor:S,ignoreFallback:b,crossOrigin:C,referrerPolicy:R,..._}=mt(e),O={borderRadius:u,borderWidth:l?"2px":void 0,...vG,...n.container};return S&&(O.borderColor=S),m.jsx(J.span,{ref:t,..._,className:ye("chakra-avatar",e.className),"data-loaded":ke(r),__css:O,children:m.jsxs(fG,{value:n,children:[m.jsx(cA,{src:i,srcSet:a,loading:y,onLoad:Pe(f,()=>{o(!0)}),onError:c,getInitials:d,name:s,borderRadius:u,icon:g,iconLabel:w,ignoreFallback:b,crossOrigin:C,referrerPolicy:R}),k]})})});Lp.displayName="Avatar";function fA(e){return P.Children.toArray(e).filter(t=>P.isValidElement(t))}var[yG,gG]=$t({strict:!1,name:"ButtonGroupContext"}),bG={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},wG={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Qc=le(function(t,n){const{size:r,colorScheme:o,variant:i,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,orientation:c="horizontal",...f}=t,d=ye("chakra-button__group",a),g=P.useMemo(()=>({size:r,colorScheme:o,variant:i,isDisabled:u}),[r,o,i,u]);let w={display:"inline-flex",...l?bG[c]:wG[c](s)};const y=c==="vertical";return m.jsx(yG,{value:g,children:m.jsx(J.div,{ref:n,role:"group",__css:w,className:d,"data-attached":l?"":void 0,"data-orientation":c,flexDir:y?"column":void 0,...f})})});Qc.displayName="ButtonGroup";function SG(e){const[t,n]=P.useState(!e);return{ref:P.useCallback(i=>{i&&n(i.tagName==="BUTTON")},[]),type:t?"button":void 0}}function q0(e){const{children:t,className:n,...r}=e,o=P.isValidElement(t)?P.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,i=ye("chakra-button__icon",n);return m.jsx(J.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:i,children:o})}q0.displayName="ButtonIcon";function K0(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=m.jsx(Im,{color:"currentColor",width:"1em",height:"1em"}),className:i,__css:a,...s}=e,l=ye("chakra-button__spinner",i),u=n==="start"?"marginEnd":"marginStart",c=P.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return m.jsx(J.div,{className:l,...s,__css:c,children:o})}K0.displayName="ButtonSpinner";var ve=le((e,t)=>{const n=gG(),r=Nr("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:i,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:c,iconSpacing:f="0.5rem",type:d,spinner:g,spinnerPlacement:w="start",className:y,as:k,...S}=mt(e),b=P.useMemo(()=>{const O={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:O}}},[r,n]),{ref:C,type:R}=SG(k),_={rightIcon:u,leftIcon:l,iconSpacing:f,children:s};return m.jsxs(J.button,{ref:eG(t,C),as:k,type:d??R,"data-active":ke(a),"data-loading":ke(i),__css:b,className:ye("chakra-button",y),...S,disabled:o||i,children:[i&&w==="start"&&m.jsx(K0,{className:"chakra-button__spinner--start",label:c,placement:"start",spacing:f,children:g}),i?c||m.jsx(J.span,{opacity:0,children:m.jsx(Ok,{..._})}):m.jsx(Ok,{..._}),i&&w==="end"&&m.jsx(K0,{className:"chakra-button__spinner--end",label:c,placement:"end",spacing:f,children:g})]})});ve.displayName="Button";function Ok(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return m.jsxs(m.Fragment,{children:[t&&m.jsx(q0,{marginEnd:o,children:t}),r,n&&m.jsx(q0,{marginStart:o,children:n})]})}var Lm=le((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":i,...a}=e,s=n||r,l=P.isValidElement(s)?P.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return m.jsx(ve,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i,...a,children:l})});Lm.displayName="IconButton";var[xG,Rw]=i9("Card"),EG=le(function(t,n){const{className:r,...o}=t,i=Rw();return m.jsx(J.div,{ref:n,className:ye("chakra-card__body",r),__css:i.body,...o})}),CG=le(function(t,n){const{className:r,justify:o,...i}=t,a=Rw();return m.jsx(J.div,{ref:n,className:ye("chakra-card__footer",r),__css:{display:"flex",justifyContent:o,...a.footer},...i})}),kG=le(function(t,n){const{className:r,...o}=t,i=Rw();return m.jsx(J.div,{ref:n,className:ye("chakra-card__header",r),__css:i.header,...o})}),PG=le(function(t,n){const{className:r,children:o,direction:i="column",justify:a,align:s,...l}=mt(t),u=Xn("Card",t);return m.jsx(J.div,{ref:n,className:ye("chakra-card",r),__css:{display:"flex",flexDirection:i,justifyContent:a,alignItems:s,position:"relative",minWidth:0,wordWrap:"break-word",...u.container},...l,children:m.jsx(xG,{value:u,children:o})})}),[Qde,_G]=$t({name:"CheckboxGroupContext",strict:!1});function OG(e){const[t,n]=P.useState(e),[r,o]=P.useState(!1);return e!==t&&(o(!0),n(e)),r}function TG(e){return m.jsx(J.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:m.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function RG(e){return m.jsx(J.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:m.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function IG(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?RG:TG;return n||t?m.jsx(J.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:m.jsx(o,{...r})}):null}var[AG,dA]=$t({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[LG,Jc]=$t({strict:!1,name:"FormControlContext"});function jG(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:i,...a}=e,s=P.useId(),l=t||`field-${s}`,u=`${l}-label`,c=`${l}-feedback`,f=`${l}-helptext`,[d,g]=P.useState(!1),[w,y]=P.useState(!1),[k,S]=P.useState(!1),b=P.useCallback((E={},p=null)=>({id:f,...E,ref:jt(p,v=>{v&&y(!0)})}),[f]),C=P.useCallback((E={},p=null)=>({...E,ref:p,"data-focus":ke(k),"data-disabled":ke(o),"data-invalid":ke(r),"data-readonly":ke(i),id:E.id!==void 0?E.id:u,htmlFor:E.htmlFor!==void 0?E.htmlFor:l}),[l,o,k,r,i,u]),R=P.useCallback((E={},p=null)=>({id:c,...E,ref:jt(p,v=>{v&&g(!0)}),"aria-live":"polite"}),[c]),_=P.useCallback((E={},p=null)=>({...E,...a,ref:p,role:"group"}),[a]),O=P.useCallback((E={},p=null)=>({...E,ref:p,role:"presentation","aria-hidden":!0,children:E.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!k,onFocus:()=>S(!0),onBlur:()=>S(!1),hasFeedbackText:d,setHasFeedbackText:g,hasHelpText:w,setHasHelpText:y,id:l,labelId:u,feedbackId:c,helpTextId:f,htmlProps:a,getHelpTextProps:b,getErrorMessageProps:R,getRootProps:_,getLabelProps:C,getRequiredIndicatorProps:O}}var En=le(function(t,n){const r=Xn("Form",t),o=mt(t),{getRootProps:i,htmlProps:a,...s}=jG(o),l=ye("chakra-form-control",t.className);return m.jsx(LG,{value:s,children:m.jsx(AG,{value:r,children:m.jsx(J.div,{...i({},n),className:l,__css:r.container})})})});En.displayName="FormControl";var ua=le(function(t,n){const r=Jc(),o=dA(),i=ye("chakra-form__helper-text",t.className);return m.jsx(J.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:i})});ua.displayName="FormHelperText";var on=le(function(t,n){var r;const o=Nr("FormLabel",t),i=mt(t),{className:a,children:s,requiredIndicator:l=m.jsx(pA,{}),optionalIndicator:u=null,...c}=i,f=Jc(),d=(r=f==null?void 0:f.getLabelProps(c,n))!=null?r:{ref:n,...c};return m.jsxs(J.label,{...d,className:ye("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...o},children:[s,f!=null&&f.isRequired?l:u]})});on.displayName="FormLabel";var pA=le(function(t,n){const r=Jc(),o=dA();if(!(r!=null&&r.isRequired))return null;const i=ye("chakra-form__required-indicator",t.className);return m.jsx(J.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:i})});pA.displayName="RequiredIndicator";function hA(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...i}=mA(e);return{...i,disabled:t,readOnly:r,required:o,"aria-invalid":Ks(n),"aria-required":Ks(o),"aria-readonly":Ks(r)}}function mA(e){var t,n,r;const o=Jc(),{id:i,disabled:a,readOnly:s,required:l,isRequired:u,isInvalid:c,isReadOnly:f,isDisabled:d,onFocus:g,onBlur:w,...y}=e,k=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&k.push(o.feedbackId),o!=null&&o.hasHelpText&&k.push(o.helpTextId),{...y,"aria-describedby":k.join(" ")||void 0,id:i??(o==null?void 0:o.id),isDisabled:(t=a??d)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=s??f)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=l??u)!=null?r:o==null?void 0:o.isRequired,isInvalid:c??(o==null?void 0:o.isInvalid),onFocus:Pe(o==null?void 0:o.onFocus,g),onBlur:Pe(o==null?void 0:o.onBlur,w)}}var MG={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};const $G=()=>typeof document<"u";let Tk=!1,ef=null,Ba=!1,G0=!1;const Y0=new Set;function Iw(e,t){Y0.forEach(n=>n(e,t))}const DG=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function zG(e){return!(e.metaKey||!DG&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Rk(e){Ba=!0,zG(e)&&(ef="keyboard",Iw("keyboard",e))}function as(e){if(ef="pointer",e.type==="mousedown"||e.type==="pointerdown"){Ba=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;Iw("pointer",e)}}function NG(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function BG(e){NG(e)&&(Ba=!0,ef="virtual")}function FG(e){e.target===window||e.target===document||(!Ba&&!G0&&(ef="virtual",Iw("virtual",e)),Ba=!1,G0=!1)}function UG(){Ba=!1,G0=!0}function Ik(){return ef!=="pointer"}function VG(){if(!$G()||Tk)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Ba=!0,e.apply(this,n)},document.addEventListener("keydown",Rk,!0),document.addEventListener("keyup",Rk,!0),document.addEventListener("click",BG,!0),window.addEventListener("focus",FG,!0),window.addEventListener("blur",UG,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",as,!0),document.addEventListener("pointermove",as,!0),document.addEventListener("pointerup",as,!0)):(document.addEventListener("mousedown",as,!0),document.addEventListener("mousemove",as,!0),document.addEventListener("mouseup",as,!0)),Tk=!0}function vA(e){VG(),e(Ik());const t=()=>e(Ik());return Y0.add(t),()=>{Y0.delete(t)}}function HG(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function yA(e={}){const t=mA(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:i,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:c,isChecked:f,isFocusable:d,onChange:g,isIndeterminate:w,name:y,value:k,tabIndex:S=void 0,"aria-label":b,"aria-labelledby":C,"aria-invalid":R,..._}=e,O=HG(_,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),E=Ai(g),p=Ai(s),v=Ai(l),[h,x]=P.useState(!1),[T,I]=P.useState(!1),[A,L]=P.useState(!1),[$,j]=P.useState(!1);P.useEffect(()=>vA(x),[]);const M=P.useRef(null),[z,N]=P.useState(!0),[D,F]=P.useState(!!c),W=f!==void 0,H=W?f:D,Y=P.useCallback(ne=>{if(r||n){ne.preventDefault();return}W||F(H?ne.target.checked:w?!0:ne.target.checked),E==null||E(ne)},[r,n,H,W,w,E]);bo(()=>{M.current&&(M.current.indeterminate=!!w)},[w]),Na(()=>{n&&I(!1)},[n,I]),bo(()=>{const ne=M.current;if(!(ne!=null&&ne.form))return;const be=()=>{F(!!c)};return ne.form.addEventListener("reset",be),()=>{var Te;return(Te=ne.form)==null?void 0:Te.removeEventListener("reset",be)}},[]);const q=n&&!d,X=P.useCallback(ne=>{ne.key===" "&&j(!0)},[j]),Q=P.useCallback(ne=>{ne.key===" "&&j(!1)},[j]);bo(()=>{if(!M.current)return;M.current.checked!==H&&F(M.current.checked)},[M.current]);const oe=P.useCallback((ne={},be=null)=>{const Te=je=>{T&&je.preventDefault(),j(!0)};return{...ne,ref:be,"data-active":ke($),"data-hover":ke(A),"data-checked":ke(H),"data-focus":ke(T),"data-focus-visible":ke(T&&h),"data-indeterminate":ke(w),"data-disabled":ke(n),"data-invalid":ke(i),"data-readonly":ke(r),"aria-hidden":!0,onMouseDown:Pe(ne.onMouseDown,Te),onMouseUp:Pe(ne.onMouseUp,()=>j(!1)),onMouseEnter:Pe(ne.onMouseEnter,()=>L(!0)),onMouseLeave:Pe(ne.onMouseLeave,()=>L(!1))}},[$,H,n,T,h,A,w,i,r]),pe=P.useCallback((ne={},be=null)=>({...ne,ref:be,"data-active":ke($),"data-hover":ke(A),"data-checked":ke(H),"data-focus":ke(T),"data-focus-visible":ke(T&&h),"data-indeterminate":ke(w),"data-disabled":ke(n),"data-invalid":ke(i),"data-readonly":ke(r)}),[$,H,n,T,h,A,w,i,r]),re=P.useCallback((ne={},be=null)=>({...O,...ne,ref:jt(be,Te=>{Te&&N(Te.tagName==="LABEL")}),onClick:Pe(ne.onClick,()=>{var Te;z||((Te=M.current)==null||Te.click(),requestAnimationFrame(()=>{var je;(je=M.current)==null||je.focus({preventScroll:!0})}))}),"data-disabled":ke(n),"data-checked":ke(H),"data-invalid":ke(i)}),[O,n,H,i,z]),ie=P.useCallback((ne={},be=null)=>({...ne,ref:jt(M,be),type:"checkbox",name:y,value:k,id:a,tabIndex:S,onChange:Pe(ne.onChange,Y),onBlur:Pe(ne.onBlur,p,()=>I(!1)),onFocus:Pe(ne.onFocus,v,()=>I(!0)),onKeyDown:Pe(ne.onKeyDown,X),onKeyUp:Pe(ne.onKeyUp,Q),required:o,checked:H,disabled:q,readOnly:r,"aria-label":b,"aria-labelledby":C,"aria-invalid":R?!!R:i,"aria-describedby":u,"aria-disabled":n,style:MG}),[y,k,a,Y,p,v,X,Q,o,H,q,r,b,C,R,i,u,n,S]),Ce=P.useCallback((ne={},be=null)=>({...ne,ref:be,onMouseDown:Pe(ne.onMouseDown,WG),"data-disabled":ke(n),"data-checked":ke(H),"data-invalid":ke(i)}),[H,n,i]);return{state:{isInvalid:i,isFocused:T,isChecked:H,isActive:$,isHovered:A,isIndeterminate:w,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:re,getCheckboxProps:oe,getIndicatorProps:pe,getInputProps:ie,getLabelProps:Ce,htmlProps:O}}function WG(e){e.preventDefault(),e.stopPropagation()}var qG={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},KG={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},GG=_o({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),YG=_o({from:{opacity:0},to:{opacity:1}}),XG=_o({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),gA=le(function(t,n){const r=_G(),o={...r,...t},i=Xn("Checkbox",o),a=mt(t),{spacing:s="0.5rem",className:l,children:u,iconColor:c,iconSize:f,icon:d=m.jsx(IG,{}),isChecked:g,isDisabled:w=r==null?void 0:r.isDisabled,onChange:y,inputProps:k,...S}=a;let b=g;r!=null&&r.value&&a.value&&(b=r.value.includes(a.value));let C=y;r!=null&&r.onChange&&a.value&&(C=bm(r.onChange,y));const{state:R,getInputProps:_,getCheckboxProps:O,getLabelProps:E,getRootProps:p}=yA({...S,isDisabled:w,isChecked:b,onChange:C}),v=OG(R.isChecked),h=P.useMemo(()=>({animation:v?R.isIndeterminate?`${YG} 20ms linear, ${XG} 200ms linear`:`${GG} 200ms linear`:void 0,fontSize:f,color:c,...i.icon}),[c,f,v,R.isIndeterminate,i.icon]),x=P.cloneElement(d,{__css:h,isIndeterminate:R.isIndeterminate,isChecked:R.isChecked});return m.jsxs(J.label,{__css:{...KG,...i.container},className:ye("chakra-checkbox",l),...p(),children:[m.jsx("input",{className:"chakra-checkbox__input",..._(k,n)}),m.jsx(J.span,{__css:{...qG,...i.control},className:"chakra-checkbox__control",...O(),children:x}),u&&m.jsx(J.span,{className:"chakra-checkbox__label",...E(),__css:{marginStart:s,...i.label},children:u})]})});gA.displayName="Checkbox";function Qs(e,t,n,r){const o=Ai(n);return P.useEffect(()=>{const i=typeof e=="function"?e():e??document;if(!(!n||!i))return i.addEventListener(t,o,r),()=>{i.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const i=typeof e=="function"?e():e??document;i==null||i.removeEventListener(t,o,r)}}function ZG(e){return"current"in e}var bA=()=>typeof window<"u";function QG(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var JG=e=>bA()&&e.test(navigator.vendor),eY=e=>bA()&&e.test(QG()),tY=()=>eY(/mac|iphone|ipad|ipod/i),nY=()=>tY()&&JG(/apple/i);function rY(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var i,a;return(a=(i=t.current)==null?void 0:i.ownerDocument)!=null?a:document};Qs(o,"pointerdown",i=>{if(!nY()||!r)return;const a=i.target,l=(n??[t]).some(u=>{const c=ZG(u)?u.current:u;return(c==null?void 0:c.contains(a))||c===a});o().activeElement!==a&&l&&(i.preventDefault(),a.focus())})}function oY(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var wA={exports:{}},iY="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",aY=iY,sY=aY;function SA(){}function xA(){}xA.resetWarningCache=SA;var lY=function(){function e(r,o,i,a,s,l){if(l!==sY){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:xA,resetWarningCache:SA};return n.PropTypes=n,n};wA.exports=lY();var uY=wA.exports,X0="data-focus-lock",EA="data-focus-lock-disabled",cY="data-no-focus-lock",fY="data-autofocus-inside",dY="data-no-autofocus";function pY(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function hY(e,t){var n=P.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function CA(e,t){return hY(t||null,function(n){return e.forEach(function(r){return pY(r,n)})})}var Sy={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},vo=function(){return vo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r=0}).sort(AY)},LY=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Mw=LY.join(","),jY="".concat(Mw,", [data-focus-guard]"),UA=function(e,t){return Oo((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?jY:Mw)?[r]:[],UA(r))},[])},MY=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?jm([e.contentDocument.body],t):[e]},jm=function(e,t){return e.reduce(function(n,r){var o,i=UA(r,t),a=(o=[]).concat.apply(o,i.map(function(s){return MY(s,t)}));return n.concat(a,r.parentNode?Oo(r.parentNode.querySelectorAll(Mw)).filter(function(s){return s===r}):[])},[])},$Y=function(e){var t=e.querySelectorAll("[".concat(fY,"]"));return Oo(t).map(function(n){return jm([n])}).reduce(function(n,r){return n.concat(r)},[])},$w=function(e,t){return Oo(e).filter(function(n){return $A(t,n)}).filter(function(n){return TY(n)})},Ak=function(e,t){return t===void 0&&(t=new Map),Oo(e).filter(function(n){return DA(t,n)})},Q0=function(e,t,n){return FA($w(jm(e,n),t),!0,n)},Lk=function(e,t){return FA($w(jm(e),t),!1)},DY=function(e,t){return $w($Y(e),t)},Js=function(e,t){return e.shadowRoot?Js(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Oo(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?Js(o,t):!1}return Js(n,t)})},zY=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},VA=function(e){return e.parentNode?VA(e.parentNode):e},Dw=function(e){var t=jp(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(X0);return n.push.apply(n,o?zY(Oo(VA(r).querySelectorAll("[".concat(X0,'="').concat(o,'"]:not([').concat(EA,'="disabled"])')))):[r]),n},[])},NY=function(e){try{return e()}catch{return}},Ec=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Ec(t.shadowRoot):t instanceof HTMLIFrameElement&&NY(function(){return t.contentWindow.document})?Ec(t.contentWindow.document):t}},BY=function(e,t){return e===t},FY=function(e,t){return!!Oo(e.querySelectorAll("iframe")).some(function(n){return BY(n,t)})},HA=function(e,t){return t===void 0&&(t=Ec(LA(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Dw(e).some(function(n){return Js(n,t)||FY(n,t)})},UY=function(e){e===void 0&&(e=document);var t=Ec(e);return t?Oo(e.querySelectorAll("[".concat(cY,"]"))).some(function(n){return Js(n,t)}):!1},VY=function(e,t){return t.filter(BA).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},zw=function(e,t){return BA(e)&&e.name?VY(e,t):e},HY=function(e){var t=new Set;return e.forEach(function(n){return t.add(zw(n,e))}),e.filter(function(n){return t.has(n)})},jk=function(e){return e[0]&&e.length>1?zw(e[0],e):e[0]},Mk=function(e,t){return e.length>1?e.indexOf(zw(e[t],e)):t},WA="NEW_FOCUS",WY=function(e,t,n,r){var o=e.length,i=e[0],a=e[o-1],s=jw(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,c=r?e.indexOf(r):-1,f=l-u,d=t.indexOf(i),g=t.indexOf(a),w=HY(t),y=n!==void 0?w.indexOf(n):-1,k=y-(r?w.indexOf(r):l),S=Mk(e,0),b=Mk(e,o-1);if(l===-1||c===-1)return WA;if(!f&&c>=0)return c;if(l<=d&&s&&Math.abs(f)>1)return b;if(l>=g&&s&&Math.abs(f)>1)return S;if(f&&Math.abs(k)>1)return c;if(l<=d)return b;if(l>g)return S;if(f)return Math.abs(f)>1?c:(o+c+f)%o}},qY=function(e){return function(t){var n,r=(n=zA(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},KY=function(e,t,n){var r=e.map(function(i){var a=i.node;return a}),o=Ak(r.filter(qY(n)));return o&&o.length?jk(o):jk(Ak(t))},J0=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&J0(e.parentNode.host||e.parentNode,t),t},xy=function(e,t){for(var n=J0(e),r=J0(t),o=0;o=0)return i}return!1},qA=function(e,t,n){var r=jp(e),o=jp(t),i=r[0],a=!1;return o.filter(Boolean).forEach(function(s){a=xy(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=xy(i,l);u&&(!a||Js(u,a)?a=u:a=xy(u,a))})}),a},GY=function(e,t){return e.reduce(function(n,r){return n.concat(DY(r,t))},[])},YY=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(IY)},XY=function(e,t){var n=Ec(jp(e).length>0?document:LA(e).ownerDocument),r=Dw(e).filter(Mp),o=qA(n||e,e,r),i=new Map,a=Lk(r,i),s=Q0(r,i).filter(function(g){var w=g.node;return Mp(w)});if(!(!s[0]&&(s=a,!s[0]))){var l=Lk([o],i).map(function(g){var w=g.node;return w}),u=YY(l,s),c=u.map(function(g){var w=g.node;return w}),f=WY(c,l,n,t);if(f===WA){var d=KY(a,c,GY(r,i));if(d)return{node:d};console.warn("focus-lock: cannot find any node to move focus into");return}return f===void 0?f:u[f]}},ZY=function(e){var t=Dw(e).filter(Mp),n=qA(e,e,t),r=new Map,o=Q0([n],r,!0),i=Q0(t,r).filter(function(a){var s=a.node;return Mp(s)}).map(function(a){var s=a.node;return s});return o.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:i.indexOf(s)>=0,guard:jw(s)}})},QY=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},Ey=0,Cy=!1,KA=function(e,t,n){n===void 0&&(n={});var r=XY(e,t);if(!Cy&&r){if(Ey>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Cy=!0,setTimeout(function(){Cy=!1},1);return}Ey++,QY(r.node,n.focusOptions),Ey--}};function Nw(e){setTimeout(e,1)}var JY=function(){return document&&document.activeElement===document.body},eX=function(){return JY()||UY()},el=null,Ns=null,tl=null,Cc=!1,tX=function(){return!0},nX=function(t){return(el.whiteList||tX)(t)},rX=function(t,n){tl={observerNode:t,portaledElement:n}},oX=function(t){return tl&&tl.portaledElement===t};function $k(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else if(a.lockItem){if(i!==e)return;o=null}else break}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var iX=function(t){return t&&"current"in t?t.current:t},aX=function(t){return t?!!Cc:Cc==="meanwhile"},sX=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},lX=function(t,n){return n.some(function(r){return sX(t,r,r)})},$p=function(){var t=!1;if(el){var n=el,r=n.observed,o=n.persistentFocus,i=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||tl&&tl.portaledElement,c=document&&document.activeElement;if(u){var f=[u].concat(a.map(iX).filter(Boolean));if((!c||nX(c))&&(o||aX(s)||!eX()||!Ns&&i)&&(u&&!(HA(f)||c&&lX(c,f)||oX(c))&&(document&&!Ns&&c&&!i?(c.blur&&c.blur(),document.body.focus()):(t=KA(f,Ns,{focusOptions:l}),tl={})),Cc=!1,Ns=document&&document.activeElement),document){var d=document&&document.activeElement,g=ZY(f),w=g.map(function(y){var k=y.node;return k}).indexOf(d);w>-1&&(g.filter(function(y){var k=y.guard,S=y.node;return k&&S.dataset.focusAutoGuard}).forEach(function(y){var k=y.node;return k.removeAttribute("tabIndex")}),$k(w,g.length,1,g),$k(w,-1,-1,g))}}}return t},GA=function(t){$p()&&t&&(t.stopPropagation(),t.preventDefault())},Bw=function(){return Nw($p)},uX=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||rX(r,n)},cX=function(){return null},YA=function(){Cc="just",Nw(function(){Cc="meanwhile"})},fX=function(){document.addEventListener("focusin",GA),document.addEventListener("focusout",Bw),window.addEventListener("blur",YA)},dX=function(){document.removeEventListener("focusin",GA),document.removeEventListener("focusout",Bw),window.removeEventListener("blur",YA)};function pX(e){return e.filter(function(t){var n=t.disabled;return!n})}function hX(e){var t=e.slice(-1)[0];t&&!el&&fX();var n=el,r=n&&t&&t.id===n.id;el=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var i=o.id;return i===n.id}).length||n.returnFocus(!t)),t?(Ns=null,(!r||n.observed!==t.observed)&&t.onActivation(),$p(),Nw($p)):(dX(),Ns=null)}RA.assignSyncMedium(uX);IA.assignMedium(Bw);yY.assignMedium(function(e){return e({moveFocusInside:KA,focusInside:HA})});const mX=CY(pX,hX)(cX);var XA=P.forwardRef(function(t,n){return P.createElement(AA,La({sideCar:mX,ref:n},t))}),ZA=AA.propTypes||{};ZA.sideCar;oY(ZA,["sideCar"]);XA.propTypes={};const Dk=XA;function QA(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Fw(e){var t;if(!QA(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function vX(e){var t,n;return(n=(t=JA(e))==null?void 0:t.defaultView)!=null?n:window}function JA(e){return QA(e)?e.ownerDocument:document}function yX(e){return JA(e).activeElement}function gX(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function bX(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function eL(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Fw(e)&&gX(e)?e:eL(bX(e))}var tL=e=>e.hasAttribute("tabindex"),wX=e=>tL(e)&&e.tabIndex===-1;function SX(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function nL(e){return e.parentElement&&nL(e.parentElement)?!0:e.hidden}function xX(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function rL(e){if(!Fw(e)||nL(e)||SX(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():xX(e)?!0:tL(e)}function EX(e){return e?Fw(e)&&rL(e)&&!wX(e):!1}var CX=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],kX=CX.join(),PX=e=>e.offsetWidth>0&&e.offsetHeight>0;function oL(e){const t=Array.from(e.querySelectorAll(kX));return t.unshift(e),t.filter(n=>rL(n)&&PX(n))}var zk,_X=(zk=Dk.default)!=null?zk:Dk,iL=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:i,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,c=P.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&oL(r.current).length===0&&requestAnimationFrame(()=>{var w;(w=r.current)==null||w.focus()})},[t,r]),f=P.useCallback(()=>{var g;(g=n==null?void 0:n.current)==null||g.focus()},[n]),d=o&&!n;return m.jsx(_X,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:c,onDeactivation:f,returnFocus:d,children:i})};iL.displayName="FocusLock";var OX=AH?P.useLayoutEffect:P.useEffect;function Nk(e,t=[]){const n=P.useRef(e);return OX(()=>{n.current=e}),P.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function TX(e,t){const n=P.useId();return P.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function RX(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function yn(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=Nk(n),a=Nk(t),[s,l]=P.useState(e.defaultIsOpen||!1),[u,c]=RX(r,s),f=TX(o,"disclosure"),d=P.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),g=P.useCallback(()=>{u||l(!0),i==null||i()},[u,i]),w=P.useCallback(()=>{(c?d:g)()},[c,g,d]);return{isOpen:!!c,onOpen:g,onClose:d,onToggle:w,isControlled:u,getButtonProps:(y={})=>({...y,"aria-expanded":c,"aria-controls":f,onClick:DH(y.onClick,w)}),getDisclosureProps:(y={})=>({...y,hidden:!c,id:f})}}var[IX,AX]=$t({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),aL=le(function(t,n){const r=Xn("Input",t),{children:o,className:i,...a}=mt(t),s=ye("chakra-input__group",i),l={},u=fA(o),c=r.field;u.forEach(d=>{var g,w;r&&(c&&d.type.id==="InputLeftElement"&&(l.paddingStart=(g=c.height)!=null?g:c.h),c&&d.type.id==="InputRightElement"&&(l.paddingEnd=(w=c.height)!=null?w:c.h),d.type.id==="InputRightAddon"&&(l.borderEndRadius=0),d.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const f=u.map(d=>{var g,w;const y=PR({size:((g=d.props)==null?void 0:g.size)||t.size,variant:((w=d.props)==null?void 0:w.variant)||t.variant});return d.type.id!=="Input"?P.cloneElement(d,y):P.cloneElement(d,Object.assign(y,l,d.props))});return m.jsx(J.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...a,children:m.jsx(IX,{value:r,children:f})})});aL.displayName="InputGroup";var LX={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},jX=J("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),Uw=le(function(t,n){var r;const{placement:o="left",...i}=t,a=(r=LX[o])!=null?r:{},s=AX();return m.jsx(jX,{ref:n,...i,__css:{...s.addon,...a}})});Uw.displayName="InputAddon";var Vw=le(function(t,n){return m.jsx(Uw,{ref:n,placement:"left",...t,className:ye("chakra-input__left-addon",t.className)})});Vw.displayName="InputLeftAddon";Vw.id="InputLeftAddon";var sL=le(function(t,n){return m.jsx(Uw,{ref:n,placement:"right",...t,className:ye("chakra-input__right-addon",t.className)})});sL.displayName="InputRightAddon";sL.id="InputRightAddon";var Ot=le(function(t,n){const{htmlSize:r,...o}=t,i=Xn("Input",o),a=mt(o),s=hA(a),l=ye("chakra-input",t.className);return m.jsx(J.input,{size:r,...s,__css:i.field,ref:n,className:l})});Ot.displayName="Input";Ot.id="Input";var Kt=le(function(t,n){const r=Nr("Link",t),{className:o,isExternal:i,...a}=mt(t);return m.jsx(J.a,{target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:n,className:ye("chakra-link",o),...a,__css:r})});Kt.displayName="Link";var jl=le(function(t,n){const{templateAreas:r,gap:o,rowGap:i,columnGap:a,column:s,row:l,autoFlow:u,autoRows:c,templateRows:f,autoColumns:d,templateColumns:g,...w}=t,y={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:i,gridColumnGap:a,gridAutoColumns:d,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:c,gridTemplateRows:f,gridTemplateColumns:g};return m.jsx(J.div,{ref:n,__css:y,...w})});jl.displayName="Grid";function lL(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Hn(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Xa=J("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Xa.displayName="Spacer";var fe=le(function(t,n){const r=Nr("Text",t),{className:o,align:i,decoration:a,casing:s,...l}=mt(t),u=PR({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return m.jsx(J.p,{ref:n,className:ye("chakra-text",t.className),...u,...l,__css:r})});fe.displayName="Text";var uL=e=>m.jsx(J.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});uL.displayName="StackItem";function MX(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":lL(n,o=>r[o])}}var Mm=le((e,t)=>{const{isInline:n,direction:r,align:o,justify:i,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:c,shouldWrapChildren:f,...d}=e,g=n?"row":r??"column",w=P.useMemo(()=>MX({spacing:a,direction:g}),[a,g]),y=!!u,k=!f&&!y,S=P.useMemo(()=>{const C=fA(l);return k?C:C.map((R,_)=>{const O=typeof R.key<"u"?R.key:_,E=_+1===C.length,v=f?m.jsx(uL,{children:R},O):R;if(!y)return v;const h=P.cloneElement(u,{__css:w}),x=E?null:h;return m.jsxs(P.Fragment,{children:[v,x]},O)})},[u,w,y,k,f,l]),b=ye("chakra-stack",c);return m.jsx(J.div,{ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:g,flexWrap:s,gap:y?void 0:a,className:b,...d,children:S})});Mm.displayName="Stack";var Ra=le((e,t)=>m.jsx(Mm,{align:"center",...e,direction:"column",ref:t}));Ra.displayName="VStack";var tt=le((e,t)=>m.jsx(Mm,{align:"center",...e,direction:"row",ref:t}));tt.displayName="HStack";var Qr=le(function(t,n){const r=Nr("Heading",t),{className:o,...i}=mt(t);return m.jsx(J.h2,{ref:n,className:ye("chakra-heading",t.className),...i,__css:r})});Qr.displayName="Heading";var he=J("div");he.displayName="Box";var cL=le(function(t,n){const{size:r,centerContent:o=!0,...i}=t,a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return m.jsx(he,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...i})});cL.displayName="Square";var $X=le(function(t,n){const{size:r,...o}=t;return m.jsx(cL,{size:r,ref:n,borderRadius:"9999px",...o})});$X.displayName="Circle";var fL=le(function(e,t){const{ratio:n=4/3,children:r,className:o,...i}=e,a=P.Children.only(r),s=ye("chakra-aspect-ratio",o);return m.jsx(J.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:lL(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...i,children:a})});fL.displayName="AspectRatio";var dL=le(function(t,n){const{className:r,centerContent:o,...i}=mt(t),a=Nr("Container",t);return m.jsx(J.div,{ref:n,className:ye("chakra-container",r),...i,__css:{...a,...o&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});dL.displayName="Container";var eb=le(function(t,n){const{direction:r,align:o,justify:i,wrap:a,basis:s,grow:l,shrink:u,...c}=t,f={display:"flex",flexDirection:r,alignItems:o,justifyContent:i,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return m.jsx(J.div,{ref:n,__css:f,...c})});eb.displayName="Flex";function DX(e,t={}){const{ssr:n=!0,fallback:r}=t,{getWindow:o}=s9(),i=Array.isArray(e)?e:[e];let a=Array.isArray(r)?r:[r];a=a.filter(u=>u!=null);const[s,l]=P.useState(()=>i.map((u,c)=>({media:u,matches:n?!!a[c]:o().matchMedia(u).matches})));return P.useEffect(()=>{const u=o();l(i.map(d=>({media:d,matches:u.matchMedia(d).matches})));const c=i.map(d=>u.matchMedia(d)),f=d=>{l(g=>g.slice().map(w=>w.media===d.media?{...w,matches:d.matches}:w))};return c.forEach(d=>{typeof d.addListener=="function"?d.addListener(f):d.addEventListener("change",f)}),()=>{c.forEach(d=>{typeof d.removeListener=="function"?d.removeListener(f):d.removeEventListener("change",f)})}},[o]),s.map(u=>u.matches)}function zX(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function NX(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=P.useState([]),i=P.useRef(),a=()=>{i.current&&(clearTimeout(i.current),i.current=null)},s=()=>{a(),i.current=setTimeout(()=>{o([]),i.current=null},t)};P.useEffect(()=>a,[]);function l(u){return c=>{if(c.key==="Backspace"){const f=[...r];f.pop(),o(f);return}if(zX(c)){const f=r.concat(c.key);n(c)&&(c.preventDefault(),c.stopPropagation()),o(f),u(f.join("")),s()}}}return l}function BX(e,t,n,r){if(t==null)return r;if(!r)return e.find(a=>n(a).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let i;return o.includes(r)?(i=o.indexOf(r)+1,i===o.length&&(i=0),o[i]):(i=e.indexOf(o[0]),e[i])}return r}function FX(){const e=P.useRef(new Map),t=e.current,n=P.useCallback((o,i,a,s)=>{e.current.set(a,{type:i,el:o,options:s}),o.addEventListener(i,a,s)},[]),r=P.useCallback((o,i,a,s)=>{o.removeEventListener(i,a,s),e.current.delete(a)},[]);return P.useEffect(()=>()=>{t.forEach((o,i)=>{r(o.el,o.type,i,o.options)})},[r,t]),{add:n,remove:r}}function ky(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function UX(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:i=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:c,tabIndex:f,onMouseOver:d,onMouseLeave:g,...w}=e,[y,k]=P.useState(!0),[S,b]=P.useState(!1),C=FX(),R=j=>{j&&j.tagName!=="BUTTON"&&k(!1)},_=y?f:f||0,O=n&&!r,E=P.useCallback(j=>{if(n){j.stopPropagation(),j.preventDefault();return}j.currentTarget.focus(),l==null||l(j)},[n,l]),p=P.useCallback(j=>{S&&ky(j)&&(j.preventDefault(),j.stopPropagation(),b(!1),C.remove(document,"keyup",p,!1))},[S,C]),v=P.useCallback(j=>{if(u==null||u(j),n||j.defaultPrevented||j.metaKey||!ky(j.nativeEvent)||y)return;const M=o&&j.key==="Enter";i&&j.key===" "&&(j.preventDefault(),b(!0)),M&&(j.preventDefault(),j.currentTarget.click()),C.add(document,"keyup",p,!1)},[n,y,u,o,i,C,p]),h=P.useCallback(j=>{if(c==null||c(j),n||j.defaultPrevented||j.metaKey||!ky(j.nativeEvent)||y)return;i&&j.key===" "&&(j.preventDefault(),b(!1),j.currentTarget.click())},[i,y,n,c]),x=P.useCallback(j=>{j.button===0&&(b(!1),C.remove(document,"mouseup",x,!1))},[C]),T=P.useCallback(j=>{if(j.button!==0)return;if(n){j.stopPropagation(),j.preventDefault();return}y||b(!0),j.currentTarget.focus({preventScroll:!0}),C.add(document,"mouseup",x,!1),a==null||a(j)},[n,y,a,C,x]),I=P.useCallback(j=>{j.button===0&&(y||b(!1),s==null||s(j))},[s,y]),A=P.useCallback(j=>{if(n){j.preventDefault();return}d==null||d(j)},[n,d]),L=P.useCallback(j=>{S&&(j.preventDefault(),b(!1)),g==null||g(j)},[S,g]),$=jt(t,R);return y?{...w,ref:$,type:"button","aria-disabled":O?void 0:n,disabled:O,onClick:E,onMouseDown:a,onMouseUp:s,onKeyUp:c,onKeyDown:u,onMouseOver:d,onMouseLeave:g}:{...w,ref:$,role:"button","data-active":ke(S),"aria-disabled":n?"true":void 0,tabIndex:O?void 0:_,onClick:E,onMouseDown:T,onMouseUp:I,onKeyUp:h,onKeyDown:v,onMouseOver:A,onMouseLeave:L}}function VX(e){const t=e.current;if(!t)return!1;const n=yX(t);return!n||t.contains(n)?!1:!!EX(n)}function pL(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,i=n&&!r;Na(()=>{if(!i||VX(e))return;const a=(o==null?void 0:o.current)||e.current;let s;if(a)return s=requestAnimationFrame(()=>{a.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(s)}},[i,e,o])}var HX={preventScroll:!0,shouldFocus:!1};function WX(e,t=HX){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:i}=t,a=qX(e)?e.current:e,s=o&&i,l=P.useRef(s),u=P.useRef(i);bo(()=>{!u.current&&i&&(l.current=s),u.current=i},[i,s]);const c=P.useCallback(()=>{if(!(!i||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var f;(f=n.current)==null||f.focus({preventScroll:r})});else{const f=oL(a);f.length>0&&requestAnimationFrame(()=>{f[0].focus({preventScroll:r})})}},[i,r,a,n]);Na(()=>{c()},[c]),Qs(a,"transitionend",c)}function qX(e){return"current"in e}var ss=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),Nt={arrowShadowColor:ss("--popper-arrow-shadow-color"),arrowSize:ss("--popper-arrow-size","8px"),arrowSizeHalf:ss("--popper-arrow-size-half"),arrowBg:ss("--popper-arrow-bg"),transformOrigin:ss("--popper-transform-origin"),arrowOffset:ss("--popper-arrow-offset")};function KX(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var GX={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},YX=e=>GX[e],Bk={scroll:!0,resize:!0};function XX(e){let t;return typeof e=="object"?t={enabled:!0,options:{...Bk,...e}}:t={enabled:e,options:Bk},t}var ZX={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},QX={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{Fk(e)},effect:({state:e})=>()=>{Fk(e)}},Fk=e=>{e.elements.popper.style.setProperty(Nt.transformOrigin.var,YX(e.placement))},JX={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{eZ(e)}},eZ=e=>{var t;if(!e.placement)return;const n=tZ(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:Nt.arrowSize.varRef,height:Nt.arrowSize.varRef,zIndex:-1});const r={[Nt.arrowSizeHalf.var]:`calc(${Nt.arrowSize.varRef} / 2 - 1px)`,[Nt.arrowOffset.var]:`calc(${Nt.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},tZ=e=>{if(e.startsWith("top"))return{property:"bottom",value:Nt.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:Nt.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:Nt.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:Nt.arrowOffset.varRef}},nZ={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{Uk(e)},effect:({state:e})=>()=>{Uk(e)}},Uk=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=KX(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:Nt.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},rZ={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},oZ={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function iZ(e,t="ltr"){var n,r;const o=((n=rZ[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=oZ[e])!=null?r:o}var Wn="top",Dr="bottom",zr="right",qn="left",Hw="auto",tf=[Wn,Dr,zr,qn],yl="start",kc="end",aZ="clippingParents",hL="viewport",ru="popper",sZ="reference",Vk=tf.reduce(function(e,t){return e.concat([t+"-"+yl,t+"-"+kc])},[]),mL=[].concat(tf,[Hw]).reduce(function(e,t){return e.concat([t,t+"-"+yl,t+"-"+kc])},[]),lZ="beforeRead",uZ="read",cZ="afterRead",fZ="beforeMain",dZ="main",pZ="afterMain",hZ="beforeWrite",mZ="write",vZ="afterWrite",yZ=[lZ,uZ,cZ,fZ,dZ,pZ,hZ,mZ,vZ];function ko(e){return e?(e.nodeName||"").toLowerCase():null}function mr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Fa(e){var t=mr(e).Element;return e instanceof t||e instanceof Element}function jr(e){var t=mr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Ww(e){if(typeof ShadowRoot>"u")return!1;var t=mr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function gZ(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!jr(i)||!ko(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function bZ(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!jr(o)||!ko(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const wZ={name:"applyStyles",enabled:!0,phase:"write",fn:gZ,effect:bZ,requires:["computeStyles"]};function Co(e){return e.split("-")[0]}var Ia=Math.max,Dp=Math.min,gl=Math.round;function tb(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function vL(){return!/^((?!chrome|android).)*safari/i.test(tb())}function bl(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&jr(e)&&(o=e.offsetWidth>0&&gl(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&gl(r.height)/e.offsetHeight||1);var a=Fa(e)?mr(e):window,s=a.visualViewport,l=!vL()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/o,c=(r.top+(l&&s?s.offsetTop:0))/i,f=r.width/o,d=r.height/i;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function qw(e){var t=bl(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function yL(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ww(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Qo(e){return mr(e).getComputedStyle(e)}function SZ(e){return["table","td","th"].indexOf(ko(e))>=0}function Ki(e){return((Fa(e)?e.ownerDocument:e.document)||window.document).documentElement}function $m(e){return ko(e)==="html"?e:e.assignedSlot||e.parentNode||(Ww(e)?e.host:null)||Ki(e)}function Hk(e){return!jr(e)||Qo(e).position==="fixed"?null:e.offsetParent}function xZ(e){var t=/firefox/i.test(tb()),n=/Trident/i.test(tb());if(n&&jr(e)){var r=Qo(e);if(r.position==="fixed")return null}var o=$m(e);for(Ww(o)&&(o=o.host);jr(o)&&["html","body"].indexOf(ko(o))<0;){var i=Qo(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function nf(e){for(var t=mr(e),n=Hk(e);n&&SZ(n)&&Qo(n).position==="static";)n=Hk(n);return n&&(ko(n)==="html"||ko(n)==="body"&&Qo(n).position==="static")?t:n||xZ(e)||t}function Kw(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Bu(e,t,n){return Ia(e,Dp(t,n))}function EZ(e,t,n){var r=Bu(e,t,n);return r>n?n:r}function gL(){return{top:0,right:0,bottom:0,left:0}}function bL(e){return Object.assign({},gL(),e)}function wL(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var CZ=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,bL(typeof t!="number"?t:wL(t,tf))};function kZ(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Co(n.placement),l=Kw(s),u=[qn,zr].indexOf(s)>=0,c=u?"height":"width";if(!(!i||!a)){var f=CZ(o.padding,n),d=qw(i),g=l==="y"?Wn:qn,w=l==="y"?Dr:zr,y=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],k=a[l]-n.rects.reference[l],S=nf(i),b=S?l==="y"?S.clientHeight||0:S.clientWidth||0:0,C=y/2-k/2,R=f[g],_=b-d[c]-f[w],O=b/2-d[c]/2+C,E=Bu(R,O,_),p=l;n.modifiersData[r]=(t={},t[p]=E,t.centerOffset=E-O,t)}}function PZ(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||yL(t.elements.popper,o)&&(t.elements.arrow=o))}const _Z={name:"arrow",enabled:!0,phase:"main",fn:kZ,effect:PZ,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wl(e){return e.split("-")[1]}var OZ={top:"auto",right:"auto",bottom:"auto",left:"auto"};function TZ(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:gl(n*o)/o||0,y:gl(r*o)/o||0}}function Wk(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=a.x,g=d===void 0?0:d,w=a.y,y=w===void 0?0:w,k=typeof c=="function"?c({x:g,y}):{x:g,y};g=k.x,y=k.y;var S=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),C=qn,R=Wn,_=window;if(u){var O=nf(n),E="clientHeight",p="clientWidth";if(O===mr(n)&&(O=Ki(n),Qo(O).position!=="static"&&s==="absolute"&&(E="scrollHeight",p="scrollWidth")),O=O,o===Wn||(o===qn||o===zr)&&i===kc){R=Dr;var v=f&&O===_&&_.visualViewport?_.visualViewport.height:O[E];y-=v-r.height,y*=l?1:-1}if(o===qn||(o===Wn||o===Dr)&&i===kc){C=zr;var h=f&&O===_&&_.visualViewport?_.visualViewport.width:O[p];g-=h-r.width,g*=l?1:-1}}var x=Object.assign({position:s},u&&OZ),T=c===!0?TZ({x:g,y},mr(n)):{x:g,y};if(g=T.x,y=T.y,l){var I;return Object.assign({},x,(I={},I[R]=b?"0":"",I[C]=S?"0":"",I.transform=(_.devicePixelRatio||1)<=1?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",I))}return Object.assign({},x,(t={},t[R]=b?y+"px":"",t[C]=S?g+"px":"",t.transform="",t))}function RZ(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Co(t.placement),variation:wl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Wk(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Wk(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const IZ={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:RZ,data:{}};var td={passive:!0};function AZ(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,l=mr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",n.update,td)}),s&&l.addEventListener("resize",n.update,td),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",n.update,td)}),s&&l.removeEventListener("resize",n.update,td)}}const LZ={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:AZ,data:{}};var jZ={left:"right",right:"left",bottom:"top",top:"bottom"};function zd(e){return e.replace(/left|right|bottom|top/g,function(t){return jZ[t]})}var MZ={start:"end",end:"start"};function qk(e){return e.replace(/start|end/g,function(t){return MZ[t]})}function Gw(e){var t=mr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Yw(e){return bl(Ki(e)).left+Gw(e).scrollLeft}function $Z(e,t){var n=mr(e),r=Ki(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=vL();(u||!u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+Yw(e),y:l}}function DZ(e){var t,n=Ki(e),r=Gw(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Ia(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ia(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Yw(e),l=-r.scrollTop;return Qo(o||n).direction==="rtl"&&(s+=Ia(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}function Xw(e){var t=Qo(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function SL(e){return["html","body","#document"].indexOf(ko(e))>=0?e.ownerDocument.body:jr(e)&&Xw(e)?e:SL($m(e))}function Fu(e,t){var n;t===void 0&&(t=[]);var r=SL(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=mr(r),a=o?[i].concat(i.visualViewport||[],Xw(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Fu($m(a)))}function nb(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function zZ(e,t){var n=bl(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Kk(e,t,n){return t===hL?nb($Z(e,n)):Fa(t)?zZ(t,n):nb(DZ(Ki(e)))}function NZ(e){var t=Fu($m(e)),n=["absolute","fixed"].indexOf(Qo(e).position)>=0,r=n&&jr(e)?nf(e):e;return Fa(r)?t.filter(function(o){return Fa(o)&&yL(o,r)&&ko(o)!=="body"}):[]}function BZ(e,t,n,r){var o=t==="clippingParents"?NZ(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(l,u){var c=Kk(e,u,r);return l.top=Ia(c.top,l.top),l.right=Dp(c.right,l.right),l.bottom=Dp(c.bottom,l.bottom),l.left=Ia(c.left,l.left),l},Kk(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function xL(e){var t=e.reference,n=e.element,r=e.placement,o=r?Co(r):null,i=r?wl(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(o){case Wn:l={x:a,y:t.y-n.height};break;case Dr:l={x:a,y:t.y+t.height};break;case zr:l={x:t.x+t.width,y:s};break;case qn:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=o?Kw(o):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case yl:l[u]=l[u]-(t[c]/2-n[c]/2);break;case kc:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Pc(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,l=s===void 0?aZ:s,u=n.rootBoundary,c=u===void 0?hL:u,f=n.elementContext,d=f===void 0?ru:f,g=n.altBoundary,w=g===void 0?!1:g,y=n.padding,k=y===void 0?0:y,S=bL(typeof k!="number"?k:wL(k,tf)),b=d===ru?sZ:ru,C=e.rects.popper,R=e.elements[w?b:d],_=BZ(Fa(R)?R:R.contextElement||Ki(e.elements.popper),l,c,a),O=bl(e.elements.reference),E=xL({reference:O,element:C,strategy:"absolute",placement:o}),p=nb(Object.assign({},C,E)),v=d===ru?p:O,h={top:_.top-v.top+S.top,bottom:v.bottom-_.bottom+S.bottom,left:_.left-v.left+S.left,right:v.right-_.right+S.right},x=e.modifiersData.offset;if(d===ru&&x){var T=x[o];Object.keys(h).forEach(function(I){var A=[zr,Dr].indexOf(I)>=0?1:-1,L=[Wn,Dr].indexOf(I)>=0?"y":"x";h[I]+=T[L]*A})}return h}function FZ(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?mL:l,c=wl(r),f=c?s?Vk:Vk.filter(function(w){return wl(w)===c}):tf,d=f.filter(function(w){return u.indexOf(w)>=0});d.length===0&&(d=f);var g=d.reduce(function(w,y){return w[y]=Pc(e,{placement:y,boundary:o,rootBoundary:i,padding:a})[Co(y)],w},{});return Object.keys(g).sort(function(w,y){return g[w]-g[y]})}function UZ(e){if(Co(e)===Hw)return[];var t=zd(e);return[qk(e),t,qk(t)]}function VZ(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,g=n.flipVariations,w=g===void 0?!0:g,y=n.allowedAutoPlacements,k=t.options.placement,S=Co(k),b=S===k,C=l||(b||!w?[zd(k)]:UZ(k)),R=[k].concat(C).reduce(function(H,Y){return H.concat(Co(Y)===Hw?FZ(t,{placement:Y,boundary:c,rootBoundary:f,padding:u,flipVariations:w,allowedAutoPlacements:y}):Y)},[]),_=t.rects.reference,O=t.rects.popper,E=new Map,p=!0,v=R[0],h=0;h=0,L=A?"width":"height",$=Pc(t,{placement:x,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),j=A?I?zr:qn:I?Dr:Wn;_[L]>O[L]&&(j=zd(j));var M=zd(j),z=[];if(i&&z.push($[T]<=0),s&&z.push($[j]<=0,$[M]<=0),z.every(function(H){return H})){v=x,p=!1;break}E.set(x,z)}if(p)for(var N=w?3:1,D=function(Y){var q=R.find(function(X){var Q=E.get(X);if(Q)return Q.slice(0,Y).every(function(oe){return oe})});if(q)return v=q,"break"},F=N;F>0;F--){var W=D(F);if(W==="break")break}t.placement!==v&&(t.modifiersData[r]._skip=!0,t.placement=v,t.reset=!0)}}const HZ={name:"flip",enabled:!0,phase:"main",fn:VZ,requiresIfExists:["offset"],data:{_skip:!1}};function Gk(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Yk(e){return[Wn,zr,Dr,qn].some(function(t){return e[t]>=0})}function WZ(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Pc(t,{elementContext:"reference"}),s=Pc(t,{altBoundary:!0}),l=Gk(a,r),u=Gk(s,o,i),c=Yk(l),f=Yk(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const qZ={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WZ};function KZ(e,t,n){var r=Co(e),o=[qn,Wn].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[qn,zr].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function GZ(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=mL.reduce(function(c,f){return c[f]=KZ(f,t.rects,i),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const YZ={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:GZ};function XZ(e){var t=e.state,n=e.name;t.modifiersData[n]=xL({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const ZZ={name:"popperOffsets",enabled:!0,phase:"read",fn:XZ,data:{}};function QZ(e){return e==="x"?"y":"x"}function JZ(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,g=d===void 0?!0:d,w=n.tetherOffset,y=w===void 0?0:w,k=Pc(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),S=Co(t.placement),b=wl(t.placement),C=!b,R=Kw(S),_=QZ(R),O=t.modifiersData.popperOffsets,E=t.rects.reference,p=t.rects.popper,v=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,h=typeof v=="number"?{mainAxis:v,altAxis:v}:Object.assign({mainAxis:0,altAxis:0},v),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,T={x:0,y:0};if(O){if(i){var I,A=R==="y"?Wn:qn,L=R==="y"?Dr:zr,$=R==="y"?"height":"width",j=O[R],M=j+k[A],z=j-k[L],N=g?-p[$]/2:0,D=b===yl?E[$]:p[$],F=b===yl?-p[$]:-E[$],W=t.elements.arrow,H=g&&W?qw(W):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:gL(),q=Y[A],X=Y[L],Q=Bu(0,E[$],H[$]),oe=C?E[$]/2-N-Q-q-h.mainAxis:D-Q-q-h.mainAxis,pe=C?-E[$]/2+N+Q+X+h.mainAxis:F+Q+X+h.mainAxis,re=t.elements.arrow&&nf(t.elements.arrow),ie=re?R==="y"?re.clientTop||0:re.clientLeft||0:0,Ce=(I=x==null?void 0:x[R])!=null?I:0,rt=j+oe-Ce-ie,ne=j+pe-Ce,be=Bu(g?Dp(M,rt):M,j,g?Ia(z,ne):z);O[R]=be,T[R]=be-j}if(s){var Te,je=R==="x"?Wn:qn,Mn=R==="x"?Dr:zr,It=O[_],Jt=_==="y"?"height":"width",en=It+k[je],kt=It-k[Mn],Br=[Wn,qn].indexOf(S)!==-1,no=(Te=x==null?void 0:x[_])!=null?Te:0,Ji=Br?en:It-E[Jt]-p[Jt]-no+h.altAxis,ea=Br?It+E[Jt]+p[Jt]-no-h.altAxis:kt,ii=g&&Br?EZ(Ji,It,ea):Bu(g?Ji:en,It,g?ea:kt);O[_]=ii,T[_]=ii-It}t.modifiersData[r]=T}}const eQ={name:"preventOverflow",enabled:!0,phase:"main",fn:JZ,requiresIfExists:["offset"]};function tQ(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function nQ(e){return e===mr(e)||!jr(e)?Gw(e):tQ(e)}function rQ(e){var t=e.getBoundingClientRect(),n=gl(t.width)/e.offsetWidth||1,r=gl(t.height)/e.offsetHeight||1;return n!==1||r!==1}function oQ(e,t,n){n===void 0&&(n=!1);var r=jr(t),o=jr(t)&&rQ(t),i=Ki(t),a=bl(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((ko(t)!=="body"||Xw(i))&&(s=nQ(t)),jr(t)?(l=bl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Yw(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function iQ(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function aQ(e){var t=iQ(e);return yZ.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function sQ(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function lQ(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Xk={placement:"bottom",modifiers:[],strategy:"absolute"};function Zk(){for(var e=arguments.length,t=new Array(e),n=0;n{}),C=P.useCallback(()=>{var h;!t||!w.current||!y.current||((h=b.current)==null||h.call(b),k.current=fQ(w.current,y.current,{placement:S,modifiers:[nZ,JX,QX,{...ZX,enabled:!!d},{name:"eventListeners",...XX(a)},{name:"arrow",options:{padding:i}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!f,options:{boundary:c}},...n??[]],strategy:o}),k.current.forceUpdate(),b.current=k.current.destroy)},[S,t,n,d,a,i,s,l,u,f,c,o]);P.useEffect(()=>()=>{var h;!w.current&&!y.current&&((h=k.current)==null||h.destroy(),k.current=null)},[]);const R=P.useCallback(h=>{w.current=h,C()},[C]),_=P.useCallback((h={},x=null)=>({...h,ref:jt(R,x)}),[R]),O=P.useCallback(h=>{y.current=h,C()},[C]),E=P.useCallback((h={},x=null)=>({...h,ref:jt(O,x),style:{...h.style,position:o,minWidth:d?void 0:"max-content",inset:"0 auto auto 0"}}),[o,O,d]),p=P.useCallback((h={},x=null)=>{const{size:T,shadowColor:I,bg:A,style:L,...$}=h;return{...$,ref:x,"data-popper-arrow":"",style:dQ(h)}},[]),v=P.useCallback((h={},x=null)=>({...h,ref:x,"data-popper-arrow-inner":""}),[]);return{update(){var h;(h=k.current)==null||h.update()},forceUpdate(){var h;(h=k.current)==null||h.forceUpdate()},transformOrigin:Nt.transformOrigin.varRef,referenceRef:R,popperRef:O,getPopperProps:E,getArrowProps:p,getArrowInnerProps:v,getReferenceProps:_}}function dQ(e){const{size:t,shadowColor:n,bg:r,style:o}=e,i={...o,position:"absolute"};return t&&(i["--popper-arrow-size"]=t),n&&(i["--popper-arrow-shadow-color"]=n),r&&(i["--popper-arrow-bg"]=r),i}function Qw(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=Ai(n),a=Ai(t),[s,l]=P.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,c=r!==void 0,f=P.useId(),d=o??`disclosure-${f}`,g=P.useCallback(()=>{c||l(!1),a==null||a()},[c,a]),w=P.useCallback(()=>{c||l(!0),i==null||i()},[c,i]),y=P.useCallback(()=>{u?g():w()},[u,w,g]);function k(b={}){return{...b,"aria-expanded":u,"aria-controls":d,onClick(C){var R;(R=b.onClick)==null||R.call(b,C),y()}}}function S(b={}){return{...b,hidden:!u,id:d}}return{isOpen:u,onOpen:w,onClose:g,onToggle:y,isControlled:c,getButtonProps:k,getDisclosureProps:S}}function pQ(e){const{ref:t,handler:n,enabled:r=!0}=e,o=Ai(n),a=P.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;P.useEffect(()=>{if(!r)return;const s=f=>{Py(f,t)&&(a.isPointerDown=!0)},l=f=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&Py(f,t)&&(a.isPointerDown=!1,o(f))},u=f=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&Py(f,t)&&(a.isPointerDown=!1,o(f))},c=EL(t.current);return c.addEventListener("mousedown",s,!0),c.addEventListener("mouseup",l,!0),c.addEventListener("touchstart",s,!0),c.addEventListener("touchend",u,!0),()=>{c.removeEventListener("mousedown",s,!0),c.removeEventListener("mouseup",l,!0),c.removeEventListener("touchstart",s,!0),c.removeEventListener("touchend",u,!0)}},[n,t,o,a,r])}function Py(e,t){var n;const r=e.target;return r&&!EL(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function EL(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function CL(e){const{isOpen:t,ref:n}=e,[r,o]=P.useState(t),[i,a]=P.useState(!1);return P.useEffect(()=>{i||(o(t),a(!0))},[t,i,r]),Qs(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=vX(n.current),c=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(c)}}}function kL(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[hQ,mQ,vQ,yQ]=oG(),[gQ,rf]=$t({strict:!1,name:"MenuContext"});function bQ(e,...t){const n=P.useId(),r=e||n;return P.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function PL(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Qk(e){return PL(e).activeElement===e}function wQ(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:i=!0,isLazy:a,isOpen:s,defaultIsOpen:l,onClose:u,onOpen:c,placement:f="bottom-start",lazyBehavior:d="unmount",direction:g,computePositionOnMount:w=!1,...y}=e,k=P.useRef(null),S=P.useRef(null),b=vQ(),C=P.useCallback(()=>{requestAnimationFrame(()=>{var W;(W=k.current)==null||W.focus({preventScroll:!1})})},[]),R=P.useCallback(()=>{const W=setTimeout(()=>{var H;if(o)(H=o.current)==null||H.focus();else{const Y=b.firstEnabled();Y&&I(Y.index)}});M.current.add(W)},[b,o]),_=P.useCallback(()=>{const W=setTimeout(()=>{const H=b.lastEnabled();H&&I(H.index)});M.current.add(W)},[b]),O=P.useCallback(()=>{c==null||c(),i?R():C()},[i,R,C,c]),{isOpen:E,onOpen:p,onClose:v,onToggle:h}=Qw({isOpen:s,defaultIsOpen:l,onClose:u,onOpen:O});pQ({enabled:E&&r,ref:k,handler:W=>{var H;(H=S.current)!=null&&H.contains(W.target)||v()}});const x=Zw({...y,enabled:E||w,placement:f,direction:g}),[T,I]=P.useState(-1);Na(()=>{E||I(-1)},[E]),pL(k,{focusRef:S,visible:E,shouldFocus:!0});const A=CL({isOpen:E,ref:k}),[L,$]=bQ(t,"menu-button","menu-list"),j=P.useCallback(()=>{p(),C()},[p,C]),M=P.useRef(new Set([]));_Q(()=>{M.current.forEach(W=>clearTimeout(W)),M.current.clear()});const z=P.useCallback(()=>{p(),R()},[R,p]),N=P.useCallback(()=>{p(),_()},[p,_]),D=P.useCallback(()=>{var W,H;const Y=PL(k.current),q=(W=k.current)==null?void 0:W.contains(Y.activeElement);if(!(E&&!q))return;const Q=(H=b.item(T))==null?void 0:H.node;Q==null||Q.focus()},[E,T,b]),F=P.useRef(null);return{openAndFocusMenu:j,openAndFocusFirstItem:z,openAndFocusLastItem:N,onTransitionEnd:D,unstable__animationState:A,descendants:b,popper:x,buttonId:L,menuId:$,forceUpdate:x.forceUpdate,orientation:"vertical",isOpen:E,onToggle:h,onOpen:p,onClose:v,menuRef:k,buttonRef:S,focusedIndex:T,closeOnSelect:n,closeOnBlur:r,autoSelect:i,setFocusedIndex:I,isLazy:a,lazyBehavior:d,initialFocusRef:o,rafId:F}}function SQ(e={},t=null){const n=rf(),{onToggle:r,popper:o,openAndFocusFirstItem:i,openAndFocusLastItem:a}=n,s=P.useCallback(l=>{const u=l.key,f={Enter:i,ArrowDown:i,ArrowUp:a}[u];f&&(l.preventDefault(),l.stopPropagation(),f(l))},[i,a]);return{...e,ref:jt(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":ke(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:Pe(e.onClick,r),onKeyDown:Pe(e.onKeyDown,s)}}function rb(e){var t;return kQ(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function xQ(e={},t=null){const n=rf();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:r,setFocusedIndex:o,menuRef:i,isOpen:a,onClose:s,menuId:l,isLazy:u,lazyBehavior:c,unstable__animationState:f}=n,d=mQ(),g=NX({preventDefault:S=>S.key!==" "&&rb(S.target)}),w=P.useCallback(S=>{if(!S.currentTarget.contains(S.target))return;const b=S.key,R={Tab:O=>O.preventDefault(),Escape:s,ArrowDown:()=>{const O=d.nextEnabled(r);O&&o(O.index)},ArrowUp:()=>{const O=d.prevEnabled(r);O&&o(O.index)}}[b];if(R){S.preventDefault(),R(S);return}const _=g(O=>{const E=BX(d.values(),O,p=>{var v,h;return(h=(v=p==null?void 0:p.node)==null?void 0:v.textContent)!=null?h:""},d.item(r));if(E){const p=d.indexOf(E.node);o(p)}});rb(S.target)&&_(S)},[d,r,g,s,o]),y=P.useRef(!1);a&&(y.current=!0);const k=kL({wasSelected:y.current,enabled:u,mode:c,isSelected:f.present});return{...e,ref:jt(i,t),children:k?e.children:null,tabIndex:-1,role:"menu",id:l,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:Pe(e.onKeyDown,w)}}function EQ(e={}){const{popper:t,isOpen:n}=rf();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function CQ(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:i,onFocus:a,isDisabled:s,isFocusable:l,closeOnSelect:u,type:c,...f}=e,d=rf(),{setFocusedIndex:g,focusedIndex:w,closeOnSelect:y,onClose:k,menuRef:S,isOpen:b,menuId:C,rafId:R}=d,_=P.useRef(null),O=`${C}-menuitem-${P.useId()}`,{index:E,register:p}=yQ({disabled:s&&!l}),v=P.useCallback(j=>{n==null||n(j),!s&&g(E)},[g,E,s,n]),h=P.useCallback(j=>{r==null||r(j),_.current&&!Qk(_.current)&&v(j)},[v,r]),x=P.useCallback(j=>{o==null||o(j),!s&&g(-1)},[g,s,o]),T=P.useCallback(j=>{i==null||i(j),rb(j.currentTarget)&&(u??y)&&k()},[k,i,y,u]),I=P.useCallback(j=>{a==null||a(j),g(E)},[g,a,E]),A=E===w,L=s&&!l;Na(()=>{b&&(A&&!L&&_.current?(R.current&&cancelAnimationFrame(R.current),R.current=requestAnimationFrame(()=>{var j;(j=_.current)==null||j.focus(),R.current=null})):S.current&&!Qk(S.current)&&S.current.focus({preventScroll:!0}))},[A,L,S,b]);const $=UX({onClick:T,onFocus:I,onMouseEnter:v,onMouseMove:h,onMouseLeave:x,ref:jt(p,_,t),isDisabled:s,isFocusable:l});return{...f,...$,type:c??$.type,id:O,role:"menuitem",tabIndex:A?0:-1}}function kQ(e){var t;if(!PQ(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function PQ(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function _Q(e,t=[]){return P.useEffect(()=>()=>e(),t)}var[OQ,of]=$t({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Jw=e=>{const{children:t}=e,n=Xn("Menu",e),r=mt(e),{direction:o}=Wc(),{descendants:i,...a}=wQ({...r,direction:o}),s=P.useMemo(()=>a,[a]),{isOpen:l,onClose:u,forceUpdate:c}=s;return m.jsx(hQ,{value:i,children:m.jsx(gQ,{value:s,children:m.jsx(OQ,{value:n,children:Rr(t,{isOpen:l,onClose:u,forceUpdate:c})})})})};Jw.displayName="Menu";var _L=le((e,t)=>{const n=of();return m.jsx(J.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});_L.displayName="MenuCommand";var TQ=le((e,t)=>{const{type:n,...r}=e,o=of(),i=r.as||n?n??void 0:"button",a=P.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return m.jsx(J.button,{ref:t,type:i,...r,__css:a})}),OL=e=>{const{className:t,children:n,...r}=e,o=of(),i=P.Children.only(n),a=P.isValidElement(i)?P.cloneElement(i,{focusable:"false","aria-hidden":!0,className:ye("chakra-menu__icon",i.props.className)}):null,s=ye("chakra-menu__icon-wrapper",t);return m.jsx(J.span,{className:s,...r,__css:o.icon,children:a})};OL.displayName="MenuIcon";var fo=le((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:i="0.75rem",children:a,...s}=e,l=CQ(s,t),c=n||o?m.jsx("span",{style:{pointerEvents:"none",flex:1},children:a}):a;return m.jsxs(TQ,{...l,className:ye("chakra-menu__menuitem",l.className),children:[n&&m.jsx(OL,{fontSize:"0.8em",marginEnd:r,children:n}),c,o&&m.jsx(_L,{marginStart:i,children:o})]})});fo.displayName="MenuItem";var RQ={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},IQ=J(ti.div),eS=le(function(t,n){var r,o;const{rootProps:i,motionProps:a,...s}=t,{isOpen:l,onTransitionEnd:u,unstable__animationState:c}=rf(),f=xQ(s,n),d=EQ(i),g=of();return m.jsx(J.div,{...d,__css:{zIndex:(o=t.zIndex)!=null?o:(r=g.list)==null?void 0:r.zIndex},children:m.jsx(IQ,{variants:RQ,initial:!1,animate:l?"enter":"exit",__css:{outline:0,...g.list},...a,className:ye("chakra-menu__menu-list",f.className),...f,onUpdate:u,onAnimationComplete:bm(c.onComplete,f.onAnimationComplete)})})});eS.displayName="MenuList";var AQ=le((e,t)=>{const n=of();return m.jsx(J.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),tS=le((e,t)=>{const{children:n,as:r,...o}=e,i=SQ(o,t),a=r||AQ;return m.jsx(a,{...i,className:ye("chakra-menu__menu-button",e.className),children:m.jsx(J.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});tS.displayName="MenuButton";var LQ={slideInBottom:{...H0,custom:{offsetY:16,reverse:!0}},slideInRight:{...H0,custom:{offsetX:16,reverse:!0}},scale:{...aA,custom:{initialScale:.95,reverse:!0}},none:{}},jQ=J(ti.section),MQ=e=>LQ[e||"none"],TL=P.forwardRef((e,t)=>{const{preset:n,motionProps:r=MQ(n),...o}=e;return m.jsx(jQ,{ref:t,...r,...o})});TL.displayName="ModalTransition";var $Q=Object.defineProperty,DQ=(e,t,n)=>t in e?$Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zQ=(e,t,n)=>(DQ(e,typeof t!="symbol"?t+"":t,n),n),NQ=class{constructor(){zQ(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},ob=new NQ;function RL(e,t){const[n,r]=P.useState(0);return P.useEffect(()=>{const o=e.current;if(o){if(t){const i=ob.add(o);r(i)}return()=>{ob.remove(o),r(0)}}},[t,e]),n}var BQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ls=new WeakMap,nd=new WeakMap,rd={},_y=0,IL=function(e){return e&&(e.host||IL(e.parentNode))},FQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=IL(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},UQ=function(e,t,n,r){var o=FQ(t,Array.isArray(e)?e:[e]);rd[n]||(rd[n]=new WeakMap);var i=rd[n],a=[],s=new Set,l=new Set(o),u=function(f){!f||s.has(f)||(s.add(f),u(f.parentNode))};o.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(d){if(s.has(d))c(d);else{var g=d.getAttribute(r),w=g!==null&&g!=="false",y=(ls.get(d)||0)+1,k=(i.get(d)||0)+1;ls.set(d,y),i.set(d,k),a.push(d),y===1&&w&&nd.set(d,!0),k===1&&d.setAttribute(n,"true"),w||d.setAttribute(r,"true")}})};return c(t),s.clear(),_y++,function(){a.forEach(function(f){var d=ls.get(f)-1,g=i.get(f)-1;ls.set(f,d),i.set(f,g),d||(nd.has(f)||f.removeAttribute(r),nd.delete(f)),g||f.removeAttribute(n)}),_y--,_y||(ls=new WeakMap,ls=new WeakMap,nd=new WeakMap,rd={})}},VQ=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||BQ(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),UQ(r,o,n,"aria-hidden")):function(){return null}};function HQ(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=P.useRef(null),c=P.useRef(null),[f,d,g]=qQ(r,"chakra-modal","chakra-modal--header","chakra-modal--body");WQ(u,t&&a);const w=RL(u,t),y=P.useRef(null),k=P.useCallback(v=>{y.current=v.target},[]),S=P.useCallback(v=>{v.key==="Escape"&&(v.stopPropagation(),i&&(n==null||n()),l==null||l())},[i,n,l]),[b,C]=P.useState(!1),[R,_]=P.useState(!1),O=P.useCallback((v={},h=null)=>({role:"dialog",...v,ref:jt(h,u),id:f,tabIndex:-1,"aria-modal":!0,"aria-labelledby":b?d:void 0,"aria-describedby":R?g:void 0,onClick:Pe(v.onClick,x=>x.stopPropagation())}),[g,R,f,d,b]),E=P.useCallback(v=>{v.stopPropagation(),y.current===v.target&&ob.isTopModal(u.current)&&(o&&(n==null||n()),s==null||s())},[n,o,s]),p=P.useCallback((v={},h=null)=>({...v,ref:jt(h,c),onClick:Pe(v.onClick,E),onKeyDown:Pe(v.onKeyDown,S),onMouseDown:Pe(v.onMouseDown,k)}),[S,k,E]);return{isOpen:t,onClose:n,headerId:d,bodyId:g,setBodyMounted:_,setHeaderMounted:C,dialogRef:u,overlayRef:c,getDialogProps:O,getDialogContainerProps:p,index:w}}function WQ(e,t){const n=e.current;P.useEffect(()=>{if(!(!e.current||!t))return VQ(e.current)},[t,e,n])}function qQ(e,...t){const n=P.useId(),r=e||n;return P.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[KQ,Ml]=$t({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[GQ,Ua]=$t({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),ir=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:i,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:c,preserveScrollBarGap:f,motionPreset:d,lockFocusAcrossFrames:g,onCloseComplete:w}=t,y=Xn("Modal",t),S={...HQ(t),autoFocus:o,trapFocus:i,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:c,preserveScrollBarGap:f,motionPreset:d,lockFocusAcrossFrames:g};return m.jsx(GQ,{value:S,children:m.jsx(KQ,{value:y,children:m.jsx(Al,{onExitComplete:w,children:S.isOpen&&m.jsx(Il,{...n,children:r})})})})};ir.displayName="Modal";var Nd="right-scroll-bar-position",Bd="width-before-scroll-bar",YQ="with-scroll-bars-hidden",XQ="--removed-body-scroll-bar-size",AL=OA(),Oy=function(){},Dm=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:Oy,onWheelCapture:Oy,onTouchMoveCapture:Oy}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,f=e.shards,d=e.sideCar,g=e.noIsolation,w=e.inert,y=e.allowPinchZoom,k=e.as,S=k===void 0?"div":k,b=e.gapMode,C=kA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=d,_=CA([n,t]),O=vo(vo({},C),o);return P.createElement(P.Fragment,null,c&&P.createElement(R,{sideCar:AL,removeScrollBar:u,shards:f,noIsolation:g,inert:w,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:b}),a?P.cloneElement(P.Children.only(s),vo(vo({},O),{ref:_})):P.createElement(S,vo({},O,{className:l,ref:_}),s))});Dm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Dm.classNames={fullWidth:Bd,zeroRight:Nd};var Jk,ZQ=function(){if(Jk)return Jk;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function QQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ZQ();return t&&e.setAttribute("nonce",t),e}function JQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eJ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tJ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=QQ())&&(JQ(t,n),eJ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nJ=function(){var e=tJ();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},LL=function(){var e=nJ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},rJ={left:0,top:0,right:0,gap:0},Ty=function(e){return parseInt(e||"",10)||0},oJ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ty(n),Ty(r),Ty(o)]},iJ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rJ;var t=oJ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},aJ=LL(),sJ=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` - .`.concat(YQ,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(s,"px ").concat(r,`; - } - body { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(a,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(s,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Nd,` { - right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(Bd,` { - margin-right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(Nd," .").concat(Nd,` { - right: 0 `).concat(r,`; - } - - .`).concat(Bd," .").concat(Bd,` { - margin-right: 0 `).concat(r,`; - } - - body { - `).concat(XQ,": ").concat(s,`px; - } -`)},lJ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=P.useMemo(function(){return iJ(o)},[o]);return P.createElement(aJ,{styles:sJ(i,!t,o,n?"":"!important")})},ib=!1;if(typeof window<"u")try{var od=Object.defineProperty({},"passive",{get:function(){return ib=!0,!0}});window.addEventListener("test",od,od),window.removeEventListener("test",od,od)}catch{ib=!1}var us=ib?{passive:!1}:!1,uJ=function(e){return e.tagName==="TEXTAREA"},jL=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uJ(e)&&n[t]==="visible")},cJ=function(e){return jL(e,"overflowY")},fJ=function(e){return jL(e,"overflowX")},eP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ML(e,r);if(o){var i=$L(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dJ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pJ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ML=function(e,t){return e==="v"?cJ(t):fJ(t)},$L=function(e,t){return e==="v"?dJ(t):pJ(t)},hJ=function(e,t){return e==="h"&&t==="rtl"?-1:1},mJ=function(e,t,n,r,o){var i=hJ(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),u=!1,c=a>0,f=0,d=0;do{var g=$L(e,s),w=g[0],y=g[1],k=g[2],S=y-k-i*w;(w||S)&&ML(e,s)&&(f+=S,d+=w),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(o&&f===0||!o&&a>f)||!c&&(o&&d===0||!o&&-a>d))&&(u=!0),u},id=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tP=function(e){return[e.deltaX,e.deltaY]},nP=function(e){return e&&"current"in e?e.current:e},vJ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yJ=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},gJ=0,cs=[];function bJ(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),o=P.useState(gJ++)[0],i=P.useState(LL)[0],a=P.useRef(e);P.useEffect(function(){a.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=mY([e.lockRef.current],(e.shards||[]).map(nP),!0).filter(Boolean);return y.forEach(function(k){return k.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=P.useCallback(function(y,k){if("touches"in y&&y.touches.length===2)return!a.current.allowPinchZoom;var S=id(y),b=n.current,C="deltaX"in y?y.deltaX:b[0]-S[0],R="deltaY"in y?y.deltaY:b[1]-S[1],_,O=y.target,E=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in y&&E==="h"&&O.type==="range")return!1;var p=eP(E,O);if(!p)return!0;if(p?_=E:(_=E==="v"?"h":"v",p=eP(E,O)),!p)return!1;if(!r.current&&"changedTouches"in y&&(C||R)&&(r.current=_),!_)return!0;var v=r.current||_;return mJ(v,k,y,v==="h"?C:R,!0)},[]),l=P.useCallback(function(y){var k=y;if(!(!cs.length||cs[cs.length-1]!==i)){var S="deltaY"in k?tP(k):id(k),b=t.current.filter(function(_){return _.name===k.type&&_.target===k.target&&vJ(_.delta,S)})[0];if(b&&b.should){k.cancelable&&k.preventDefault();return}if(!b){var C=(a.current.shards||[]).map(nP).filter(Boolean).filter(function(_){return _.contains(k.target)}),R=C.length>0?s(k,C[0]):!a.current.noIsolation;R&&k.cancelable&&k.preventDefault()}}},[]),u=P.useCallback(function(y,k,S,b){var C={name:y,delta:k,target:S,should:b};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),c=P.useCallback(function(y){n.current=id(y),r.current=void 0},[]),f=P.useCallback(function(y){u(y.type,tP(y),y.target,s(y,e.lockRef.current))},[]),d=P.useCallback(function(y){u(y.type,id(y),y.target,s(y,e.lockRef.current))},[]);P.useEffect(function(){return cs.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,us),document.addEventListener("touchmove",l,us),document.addEventListener("touchstart",c,us),function(){cs=cs.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,us),document.removeEventListener("touchmove",l,us),document.removeEventListener("touchstart",c,us)}},[]);var g=e.removeScrollBar,w=e.inert;return P.createElement(P.Fragment,null,w?P.createElement(i,{styles:yJ(o)}):null,g?P.createElement(lJ,{gapMode:e.gapMode}):null)}const wJ=vY(AL,bJ);var DL=P.forwardRef(function(e,t){return P.createElement(Dm,vo({},e,{ref:t,sideCar:wJ}))});DL.classNames=Dm.classNames;const SJ=DL;function xJ(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:c,isOpen:f}=Ua(),[d,g]=DI();P.useEffect(()=>{!d&&g&&setTimeout(g)},[d,g]);const w=RL(r,f);return m.jsx(iL,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:c,children:m.jsx(SJ,{removeScrollBar:!u,allowPinchZoom:a,enabled:w===1&&i,forwardProps:!0,children:e.children})})}var ar=le((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:i,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Ua(),u=s(a,t),c=l(o),f=ye("chakra-modal__content",n),d=Ml(),g={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...d.dialog},w={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...d.dialogContainer},{motionPreset:y}=Ua();return m.jsx(xJ,{children:m.jsx(J.div,{...c,className:"chakra-modal__content-container",tabIndex:-1,__css:w,children:m.jsx(TL,{preset:y,motionProps:i,className:f,...u,__css:g,children:r})})})});ar.displayName="ModalContent";var af=le((e,t)=>{const{className:n,...r}=e,o=ye("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...Ml().footer};return m.jsx(J.footer,{ref:t,...r,__css:a,className:o})});af.displayName="ModalFooter";var sr=le((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:i}=Ua();P.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=ye("chakra-modal__header",n),l={flex:0,...Ml().header};return m.jsx(J.header,{ref:t,className:a,id:o,...r,__css:l})});sr.displayName="ModalHeader";var EJ=J(ti.div),lr=le((e,t)=>{const{className:n,transition:r,motionProps:o,...i}=e,a=ye("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Ml().overlay},{motionPreset:u}=Ua(),f=o||(u==="none"?{}:iA);return m.jsx(EJ,{...f,__css:l,ref:t,className:a,...i})});lr.displayName="ModalOverlay";var ur=le((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:i}=Ua();P.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=ye("chakra-modal__body",n),s=Ml();return m.jsx(J.div,{ref:t,className:a,id:o,...r,__css:s.body})});ur.displayName="ModalBody";var cr=le((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:i}=Ua(),a=ye("chakra-modal__close-btn",r),s=Ml();return m.jsx(Am,{ref:t,__css:s.closeButton,className:a,onClick:Pe(n,l=>{l.stopPropagation(),i()}),...o})});cr.displayName="ModalCloseButton";var[CJ,Za]=$t({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[kJ,sf]=$t({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),zL=le(function(t,n){const{getHeaderProps:r}=Za(),o=sf();return m.jsx(J.header,{...r(t,n),className:ye("chakra-popover__header",t.className),__css:o.header})});zL.displayName="PopoverHeader";function nS(e){const t=P.Children.only(e.children),{getTriggerProps:n}=Za();return P.cloneElement(t,n(t.props,t.ref))}nS.displayName="PopoverTrigger";var fs={click:"click",hover:"hover"};function PJ(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:i=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=fs.click,openDelay:c=200,closeDelay:f=200,isLazy:d,lazyBehavior:g="unmount",computePositionOnMount:w,...y}=e,{isOpen:k,onClose:S,onOpen:b,onToggle:C}=Qw(e),R=P.useRef(null),_=P.useRef(null),O=P.useRef(null),E=P.useRef(!1),p=P.useRef(!1);k&&(p.current=!0);const[v,h]=P.useState(!1),[x,T]=P.useState(!1),I=P.useId(),A=o??I,[L,$,j,M]=["popover-trigger","popover-content","popover-header","popover-body"].map(ne=>`${ne}-${A}`),{referenceRef:z,getArrowProps:N,getPopperProps:D,getArrowInnerProps:F,forceUpdate:W}=Zw({...y,enabled:k||!!w}),H=CL({isOpen:k,ref:O});rY({enabled:k,ref:_}),pL(O,{focusRef:_,visible:k,shouldFocus:i&&u===fs.click}),WX(O,{focusRef:r,visible:k,shouldFocus:a&&u===fs.click});const Y=kL({wasSelected:p.current,enabled:d,mode:g,isSelected:H.present}),q=P.useCallback((ne={},be=null)=>{const Te={...ne,style:{...ne.style,transformOrigin:Nt.transformOrigin.varRef,[Nt.arrowSize.var]:s?`${s}px`:void 0,[Nt.arrowShadowColor.var]:l},ref:jt(O,be),children:Y?ne.children:null,id:$,tabIndex:-1,role:"dialog",onKeyDown:Pe(ne.onKeyDown,je=>{n&&je.key==="Escape"&&S()}),onBlur:Pe(ne.onBlur,je=>{const Mn=rP(je),It=Ry(O.current,Mn),Jt=Ry(_.current,Mn);k&&t&&(!It&&!Jt)&&S()}),"aria-labelledby":v?j:void 0,"aria-describedby":x?M:void 0};return u===fs.hover&&(Te.role="tooltip",Te.onMouseEnter=Pe(ne.onMouseEnter,()=>{E.current=!0}),Te.onMouseLeave=Pe(ne.onMouseLeave,je=>{je.nativeEvent.relatedTarget!==null&&(E.current=!1,setTimeout(()=>S(),f))})),Te},[Y,$,v,j,x,M,u,n,S,k,t,f,l,s]),X=P.useCallback((ne={},be=null)=>D({...ne,style:{visibility:k?"visible":"hidden",...ne.style}},be),[k,D]),Q=P.useCallback((ne,be=null)=>({...ne,ref:jt(be,R,z)}),[R,z]),oe=P.useRef(),pe=P.useRef(),re=P.useCallback(ne=>{R.current==null&&z(ne)},[z]),ie=P.useCallback((ne={},be=null)=>{const Te={...ne,ref:jt(_,be,re),id:L,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":$};return u===fs.click&&(Te.onClick=Pe(ne.onClick,C)),u===fs.hover&&(Te.onFocus=Pe(ne.onFocus,()=>{oe.current===void 0&&b()}),Te.onBlur=Pe(ne.onBlur,je=>{const Mn=rP(je),It=!Ry(O.current,Mn);k&&t&&It&&S()}),Te.onKeyDown=Pe(ne.onKeyDown,je=>{je.key==="Escape"&&S()}),Te.onMouseEnter=Pe(ne.onMouseEnter,()=>{E.current=!0,oe.current=window.setTimeout(()=>b(),c)}),Te.onMouseLeave=Pe(ne.onMouseLeave,()=>{E.current=!1,oe.current&&(clearTimeout(oe.current),oe.current=void 0),pe.current=window.setTimeout(()=>{E.current===!1&&S()},f)})),Te},[L,k,$,u,re,C,b,t,S,c,f]);P.useEffect(()=>()=>{oe.current&&clearTimeout(oe.current),pe.current&&clearTimeout(pe.current)},[]);const Ce=P.useCallback((ne={},be=null)=>({...ne,id:j,ref:jt(be,Te=>{h(!!Te)})}),[j]),rt=P.useCallback((ne={},be=null)=>({...ne,id:M,ref:jt(be,Te=>{T(!!Te)})}),[M]);return{forceUpdate:W,isOpen:k,onAnimationComplete:H.onComplete,onClose:S,getAnchorProps:Q,getArrowProps:N,getArrowInnerProps:F,getPopoverPositionerProps:X,getPopoverProps:q,getTriggerProps:ie,getHeaderProps:Ce,getBodyProps:rt}}function Ry(e,t){return e===t||(e==null?void 0:e.contains(t))}function rP(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function rS(e){const t=Xn("Popover",e),{children:n,...r}=mt(e),o=Wc(),i=PJ({...r,direction:o.direction});return m.jsx(CJ,{value:i,children:m.jsx(kJ,{value:t,children:Rr(n,{isOpen:i.isOpen,onClose:i.onClose,forceUpdate:i.forceUpdate})})})}rS.displayName="Popover";var Iy=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function oS(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:i,boxShadow:a,shadowColor:s}=e,{getArrowProps:l,getArrowInnerProps:u}=Za(),c=sf(),f=(t=n??r)!=null?t:o,d=i??a;return m.jsx(J.div,{...l(),className:"chakra-popover__arrow-positioner",children:m.jsx(J.div,{className:ye("chakra-popover__arrow",e.className),...u(e),__css:{"--popper-arrow-shadow-color":Iy("colors",s),"--popper-arrow-bg":Iy("colors",f),"--popper-arrow-shadow":Iy("shadows",d),...c.arrow}})})}oS.displayName="PopoverArrow";var iS=le(function(t,n){const{getBodyProps:r}=Za(),o=sf();return m.jsx(J.div,{...r(t,n),className:ye("chakra-popover__body",t.className),__css:o.body})});iS.displayName="PopoverBody";var aS=le(function(t,n){const{onClose:r}=Za(),o=sf();return m.jsx(Am,{size:"sm",onClick:r,className:ye("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});aS.displayName="PopoverCloseButton";function _J(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var OJ={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},TJ=J(ti.section),NL=le(function(t,n){const{variants:r=OJ,...o}=t,{isOpen:i}=Za();return m.jsx(TJ,{ref:n,variants:_J(r),initial:!1,animate:i?"enter":"exit",...o})});NL.displayName="PopoverTransition";var sS=le(function(t,n){const{rootProps:r,motionProps:o,...i}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=Za(),u=sf(),c={position:"relative",display:"flex",flexDirection:"column",...u.content};return m.jsx(J.div,{...s(r),__css:u.popper,className:"chakra-popover__popper",children:m.jsx(NL,{...o,...a(i,n),onAnimationComplete:bm(l,i.onAnimationComplete),className:ye("chakra-popover__content",t.className),__css:c})})});sS.displayName="PopoverContent";function RJ(e,t,n){return(e-t)*100/(n-t)}_o({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});_o({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var IJ=_o({"0%":{left:"-40%"},"100%":{left:"100%"}}),AJ=_o({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function LJ(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:i,isIndeterminate:a,role:s="progressbar"}=e,l=RJ(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof i=="function"?i(t,l):o})(),role:s},percent:l,value:t}}var[jJ,MJ]=$t({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),$J=le((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:i,role:a,...s}=e,l=LJ({value:o,min:n,max:r,isIndeterminate:i,role:a}),c={height:"100%",...MJ().filledTrack};return m.jsx(J.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:c})}),BL=le((e,t)=>{var n;const{value:r,min:o=0,max:i=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:c,"aria-label":f,"aria-labelledby":d,"aria-valuetext":g,title:w,role:y,...k}=mt(e),S=Xn("Progress",e),b=u??((n=S.track)==null?void 0:n.borderRadius),C={animation:`${AJ} 1s linear infinite`},O={...!c&&a&&s&&C,...c&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${IJ} 1s ease infinite normal none running`}},E={overflow:"hidden",position:"relative",...S.track};return m.jsx(J.div,{ref:t,borderRadius:b,__css:E,...k,children:m.jsxs(jJ,{value:S,children:[m.jsx($J,{"aria-label":f,"aria-labelledby":d,"aria-valuetext":g,min:o,max:i,value:r,isIndeterminate:c,css:O,borderRadius:b,title:w,role:y}),l]})})});BL.displayName="Progress";function DJ(e){return e&&Hn(e)&&Hn(e.target)}function zJ(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:i,isFocusable:a,isNative:s,...l}=e,[u,c]=P.useState(r||""),f=typeof n<"u",d=f?n:u,g=P.useRef(null),w=P.useCallback(()=>{const _=g.current;if(!_)return;let O="input:not(:disabled):checked";const E=_.querySelector(O);if(E){E.focus();return}O="input:not(:disabled)";const p=_.querySelector(O);p==null||p.focus()},[]),k=`radio-${P.useId()}`,S=o||k,b=P.useCallback(_=>{const O=DJ(_)?_.target.value:_;f||c(O),t==null||t(String(O))},[t,f]),C=P.useCallback((_={},O=null)=>({..._,ref:jt(O,g),role:"radiogroup"}),[]),R=P.useCallback((_={},O=null)=>({..._,ref:O,name:S,[s?"checked":"isChecked"]:d!=null?_.value===d:void 0,onChange(p){b(p)},"data-radiogroup":!0}),[s,S,b,d]);return{getRootProps:C,getRadioProps:R,name:S,ref:g,focus:w,setValue:c,value:d,onChange:b,isDisabled:i,isFocusable:a,htmlProps:l}}var[NJ,FL]=$t({name:"RadioGroupContext",strict:!1}),UL=le((e,t)=>{const{colorScheme:n,size:r,variant:o,children:i,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:c,onChange:f,getRootProps:d,name:g,htmlProps:w}=zJ(u),y=P.useMemo(()=>({name:g,size:r,onChange:f,colorScheme:n,value:c,variant:o,isDisabled:s,isFocusable:l}),[g,r,f,n,c,o,s,l]);return m.jsx(NJ,{value:y,children:m.jsx(J.div,{...d(w,t),className:ye("chakra-radio-group",a),children:i})})});UL.displayName="RadioGroup";var BJ={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function FJ(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:i,isRequired:a,onChange:s,isInvalid:l,name:u,value:c,id:f,"data-radiogroup":d,"aria-describedby":g,...w}=e,y=`radio-${P.useId()}`,k=Jc(),b=!!FL()||!!d;let R=!!k&&!b?k.id:y;R=f??R;const _=o??(k==null?void 0:k.isDisabled),O=i??(k==null?void 0:k.isReadOnly),E=a??(k==null?void 0:k.isRequired),p=l??(k==null?void 0:k.isInvalid),[v,h]=P.useState(!1),[x,T]=P.useState(!1),[I,A]=P.useState(!1),[L,$]=P.useState(!1),[j,M]=P.useState(!!t),z=typeof n<"u",N=z?n:j;P.useEffect(()=>vA(h),[]);const D=P.useCallback(re=>{if(O||_){re.preventDefault();return}z||M(re.target.checked),s==null||s(re)},[z,_,O,s]),F=P.useCallback(re=>{re.key===" "&&$(!0)},[$]),W=P.useCallback(re=>{re.key===" "&&$(!1)},[$]),H=P.useCallback((re={},ie=null)=>({...re,ref:ie,"data-active":ke(L),"data-hover":ke(I),"data-disabled":ke(_),"data-invalid":ke(p),"data-checked":ke(N),"data-focus":ke(x),"data-focus-visible":ke(x&&v),"data-readonly":ke(O),"aria-hidden":!0,onMouseDown:Pe(re.onMouseDown,()=>$(!0)),onMouseUp:Pe(re.onMouseUp,()=>$(!1)),onMouseEnter:Pe(re.onMouseEnter,()=>A(!0)),onMouseLeave:Pe(re.onMouseLeave,()=>A(!1))}),[L,I,_,p,N,x,O,v]),{onFocus:Y,onBlur:q}=k??{},X=P.useCallback((re={},ie=null)=>{const Ce=_&&!r;return{...re,id:R,ref:ie,type:"radio",name:u,value:c,onChange:Pe(re.onChange,D),onBlur:Pe(q,re.onBlur,()=>T(!1)),onFocus:Pe(Y,re.onFocus,()=>T(!0)),onKeyDown:Pe(re.onKeyDown,F),onKeyUp:Pe(re.onKeyUp,W),checked:N,disabled:Ce,readOnly:O,required:E,"aria-invalid":Ks(p),"aria-disabled":Ks(Ce),"aria-required":Ks(E),"data-readonly":ke(O),"aria-describedby":g,style:BJ}},[_,r,R,u,c,D,q,Y,F,W,N,O,E,p,g]);return{state:{isInvalid:p,isFocused:x,isChecked:N,isActive:L,isHovered:I,isDisabled:_,isReadOnly:O,isRequired:E},getCheckboxProps:H,getRadioProps:H,getInputProps:X,getLabelProps:(re={},ie=null)=>({...re,ref:ie,onMouseDown:Pe(re.onMouseDown,UJ),"data-disabled":ke(_),"data-checked":ke(N),"data-invalid":ke(p)}),getRootProps:(re,ie=null)=>({...re,ref:ie,"data-disabled":ke(_),"data-checked":ke(N),"data-invalid":ke(p)}),htmlProps:w}}function UJ(e){e.preventDefault(),e.stopPropagation()}function VJ(e,t){const n={},r={};for(const[o,i]of Object.entries(e))t.includes(o)?n[o]=i:r[o]=i;return[n,r]}var gu=le((e,t)=>{var n;const r=FL(),{onChange:o,value:i}=e,a=Xn("Radio",{...r,...e}),s=mt(e),{spacing:l="0.5rem",children:u,isDisabled:c=r==null?void 0:r.isDisabled,isFocusable:f=r==null?void 0:r.isFocusable,inputProps:d,...g}=s;let w=e.isChecked;(r==null?void 0:r.value)!=null&&i!=null&&(w=r.value===i);let y=o;r!=null&&r.onChange&&i!=null&&(y=bm(r.onChange,o));const k=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:S,getCheckboxProps:b,getLabelProps:C,getRootProps:R,htmlProps:_}=FJ({...g,isChecked:w,isFocusable:f,isDisabled:c,onChange:y,name:k}),[O,E]=VJ(_,HN),p=b(E),v=S(d,t),h=C(),x=Object.assign({},O,R()),T={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},I={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},A={userSelect:"none",marginStart:l,...a.label};return m.jsxs(J.label,{className:"chakra-radio",...x,__css:T,children:[m.jsx("input",{className:"chakra-radio__input",...v}),m.jsx(J.span,{className:"chakra-radio__control",...p,__css:I}),u&&m.jsx(J.span,{className:"chakra-radio__label",...h,__css:A,children:u})]})});gu.displayName="Radio";function HJ(){const e=P.useRef(!0);return P.useEffect(()=>{e.current=!1},[]),e.current}function WJ(e){const t=P.useRef();return P.useEffect(()=>{t.current=e},[e]),t.current}var qJ=J("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),ab=ge("skeleton-start-color"),sb=ge("skeleton-end-color"),KJ=_o({from:{opacity:0},to:{opacity:1}}),GJ=_o({from:{borderColor:ab.reference,background:ab.reference},to:{borderColor:sb.reference,background:sb.reference}}),VL=le((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=Nr("Skeleton",n),o=HJ(),{startColor:i="",endColor:a="",isLoaded:s,fadeDuration:l,speed:u,className:c,fitContent:f,...d}=mt(n),[g,w]=zz("colors",[i,a]),y=WJ(s),k=ye("chakra-skeleton",c),S={...g&&{[ab.variable]:g},...w&&{[sb.variable]:w}};if(s){const b=o||y?"none":`${KJ} ${l}s`;return m.jsx(J.div,{ref:t,className:k,__css:{animation:b},...d})}return m.jsx(qJ,{ref:t,className:k,...d,__css:{width:f?"fit-content":void 0,...r,...S,_dark:{...r._dark,...S},animation:`${u}s linear infinite alternate ${GJ}`}})});VL.displayName="Skeleton";var lb=le(function(t,n){const r=Xn("Switch",t),{spacing:o="0.5rem",children:i,...a}=mt(t),{getIndicatorProps:s,getInputProps:l,getCheckboxProps:u,getRootProps:c,getLabelProps:f}=yA(a),d=P.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),g=P.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),w=P.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return m.jsxs(J.label,{...c(),className:ye("chakra-switch",t.className),__css:d,children:[m.jsx("input",{className:"chakra-switch__input",...l({},n)}),m.jsx(J.span,{...u(),className:"chakra-switch__track",__css:g,children:m.jsx(J.span,{__css:r.thumb,className:"chakra-switch__thumb",...s()})}),i&&m.jsx(J.span,{className:"chakra-switch__label",...f(),__css:w,children:i})]})});lb.displayName="Switch";var[YJ,lf]=$t({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "
" `}),uf=le((e,t)=>{const n=Xn("Table",e),{className:r,layout:o,...i}=mt(e);return m.jsx(YJ,{value:n,children:m.jsx(J.table,{ref:t,__css:{tableLayout:o,...n.table},className:ye("chakra-table",r),...i})})});uf.displayName="Table";var zm=le((e,t)=>{const n=lf();return m.jsx(J.thead,{...e,ref:t,__css:n.thead})}),Fi=le((e,t)=>{const n=lf();return m.jsx(J.tr,{...e,ref:t,__css:n.tr})}),Nm=le((e,t)=>{const n=lf();return m.jsx(J.tbody,{...e,ref:t,__css:n.tbody})}),wt=le(({isNumeric:e,...t},n)=>{const r=lf();return m.jsx(J.td,{...t,ref:n,__css:r.td,"data-is-numeric":e})}),St=le(({isNumeric:e,...t},n)=>{const r=lf();return m.jsx(J.th,{...t,ref:n,__css:r.th,"data-is-numeric":e})});function XJ(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var ZJ=["h","minH","height","minHeight"],lS=le((e,t)=>{const n=Nr("Textarea",e),{className:r,rows:o,...i}=mt(e),a=hA(i),s=o?XJ(n,ZJ):n;return m.jsx(J.textarea,{ref:t,rows:o,...a,className:ye("chakra-textarea",r),__css:s})});lS.displayName="Textarea";var QJ={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},ub=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Fd=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function JJ(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:i,closeOnPointerDown:a=o,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:c,id:f,isOpen:d,defaultIsOpen:g,arrowSize:w=10,arrowShadowColor:y,arrowPadding:k,modifiers:S,isDisabled:b,gutter:C,offset:R,direction:_,...O}=e,{isOpen:E,onOpen:p,onClose:v}=Qw({isOpen:d,defaultIsOpen:g,onOpen:l,onClose:u}),{referenceRef:h,getPopperProps:x,getArrowInnerProps:T,getArrowProps:I}=Zw({enabled:E,placement:c,arrowPadding:k,modifiers:S,gutter:C,offset:R,direction:_}),A=P.useId(),$=`tooltip-${f??A}`,j=P.useRef(null),M=P.useRef(),z=P.useCallback(()=>{M.current&&(clearTimeout(M.current),M.current=void 0)},[]),N=P.useRef(),D=P.useCallback(()=>{N.current&&(clearTimeout(N.current),N.current=void 0)},[]),F=P.useCallback(()=>{D(),v()},[v,D]),W=eee(j,F),H=P.useCallback(()=>{if(!b&&!M.current){E&&W();const ie=Fd(j);M.current=ie.setTimeout(p,t)}},[W,b,E,p,t]),Y=P.useCallback(()=>{z();const ie=Fd(j);N.current=ie.setTimeout(F,n)},[n,F,z]),q=P.useCallback(()=>{E&&r&&Y()},[r,Y,E]),X=P.useCallback(()=>{E&&a&&Y()},[a,Y,E]),Q=P.useCallback(ie=>{E&&ie.key==="Escape"&&Y()},[E,Y]);Qs(()=>ub(j),"keydown",s?Q:void 0),Qs(()=>{const ie=j.current;if(!ie)return null;const Ce=eL(ie);return Ce.localName==="body"?Fd(j):Ce},"scroll",()=>{E&&i&&F()},{passive:!0,capture:!0}),P.useEffect(()=>{b&&(z(),E&&v())},[b,E,v,z]),P.useEffect(()=>()=>{z(),D()},[z,D]),Qs(()=>j.current,"pointerleave",Y);const oe=P.useCallback((ie={},Ce=null)=>({...ie,ref:jt(j,Ce,h),onPointerEnter:Pe(ie.onPointerEnter,ne=>{ne.pointerType!=="touch"&&H()}),onClick:Pe(ie.onClick,q),onPointerDown:Pe(ie.onPointerDown,X),onFocus:Pe(ie.onFocus,H),onBlur:Pe(ie.onBlur,Y),"aria-describedby":E?$:void 0}),[H,Y,X,E,$,q,h]),pe=P.useCallback((ie={},Ce=null)=>x({...ie,style:{...ie.style,[Nt.arrowSize.var]:w?`${w}px`:void 0,[Nt.arrowShadowColor.var]:y}},Ce),[x,w,y]),re=P.useCallback((ie={},Ce=null)=>{const rt={...ie.style,position:"relative",transformOrigin:Nt.transformOrigin.varRef};return{ref:Ce,...O,...ie,id:$,role:"tooltip",style:rt}},[O,$]);return{isOpen:E,show:H,hide:Y,getTriggerProps:oe,getTooltipProps:re,getTooltipPositionerProps:pe,getArrowProps:I,getArrowInnerProps:T}}var Ay="chakra-ui:close-tooltip";function eee(e,t){return P.useEffect(()=>{const n=ub(e);return n.addEventListener(Ay,t),()=>n.removeEventListener(Ay,t)},[t,e]),()=>{const n=ub(e),r=Fd(e);n.dispatchEvent(new r.CustomEvent(Ay))}}function tee(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function nee(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var ree=J(ti.div),zp=le((e,t)=>{var n,r;const o=Nr("Tooltip",e),i=mt(e),a=Wc(),{children:s,label:l,shouldWrapChildren:u,"aria-label":c,hasArrow:f,bg:d,portalProps:g,background:w,backgroundColor:y,bgColor:k,motionProps:S,...b}=i,C=(r=(n=w??y)!=null?n:d)!=null?r:k;if(C){o.bg=C;const x=oB(a,"colors",C);o[Nt.arrowBg.var]=x}const R=JJ({...b,direction:a.direction}),_=typeof s=="string"||u;let O;if(_)O=m.jsx(J.span,{display:"inline-block",tabIndex:0,...R.getTriggerProps(),children:s});else{const x=P.Children.only(s);O=P.cloneElement(x,R.getTriggerProps(x.props,x.ref))}const E=!!c,p=R.getTooltipProps({},t),v=E?tee(p,["role","id"]):p,h=nee(p,["role","id"]);return l?m.jsxs(m.Fragment,{children:[O,m.jsx(Al,{children:R.isOpen&&m.jsx(Il,{...g,children:m.jsx(J.div,{...R.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:m.jsxs(ree,{variants:QJ,initial:"exit",animate:"enter",exit:"exit",...S,...v,__css:o,children:[l,E&&m.jsx(J.span,{srOnly:!0,...h,children:c}),f&&m.jsx(J.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:m.jsx(J.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):m.jsx(m.Fragment,{children:s})});zp.displayName="Tooltip";var cb={},oP=ym;cb.createRoot=oP.createRoot,cb.hydrateRoot=oP.hydrateRoot;/** - * @remix-run/router v1.8.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function _c(){return _c=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function uS(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function iee(){return Math.random().toString(36).substr(2,8)}function aP(e,t){return{usr:e.state,key:e.key,idx:t}}function fb(e,t,n,r){return n===void 0&&(n=null),_c({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?$l(t):t,{state:n,key:t&&t.key||r||iee()})}function Np(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function $l(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function aee(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s=xi.Pop,l=null,u=c();u==null&&(u=0,a.replaceState(_c({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function f(){s=xi.Pop;let k=c(),S=k==null?null:k-u;u=k,l&&l({action:s,location:y.location,delta:S})}function d(k,S){s=xi.Push;let b=fb(y.location,k,S);n&&n(b,k),u=c()+1;let C=aP(b,u),R=y.createHref(b);try{a.pushState(C,"",R)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;o.location.assign(R)}i&&l&&l({action:s,location:y.location,delta:1})}function g(k,S){s=xi.Replace;let b=fb(y.location,k,S);n&&n(b,k),u=c();let C=aP(b,u),R=y.createHref(b);a.replaceState(C,"",R),i&&l&&l({action:s,location:y.location,delta:0})}function w(k){let S=o.location.origin!=="null"?o.location.origin:o.location.href,b=typeof k=="string"?k:Np(k);return Ft(S,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,S)}let y={get action(){return s},get location(){return e(o,a)},listen(k){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(iP,f),l=k,()=>{o.removeEventListener(iP,f),l=null}},createHref(k){return t(o,k)},createURL:w,encodeLocation(k){let S=w(k);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:d,replace:g,go(k){return a.go(k)}};return y}var sP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(sP||(sP={}));function see(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?$l(t):t,o=cS(r.pathname||"/",n);if(o==null)return null;let i=HL(e);lee(i);let a=null;for(let s=0;a==null&&s{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(Ft(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Mi([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(Ft(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),HL(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:mee(u,i.index),routesMeta:c})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let l of WL(i.path))o(i,a,l)}),t}function WL(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=WL(r.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function lee(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vee(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uee=/^:\w+$/,cee=3,fee=2,dee=1,pee=10,hee=-2,lP=e=>e==="*";function mee(e,t){let n=e.split("/"),r=n.length;return n.some(lP)&&(r+=hee),t&&(r+=fee),n.filter(o=>!lP(o)).reduce((o,i)=>o+(uee.test(i)?cee:i===""?dee:pee),r)}function vee(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function yee(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{if(c==="*"){let d=s[f]||"";a=i.slice(0,i.length-d.length).replace(/(.)\/+$/,"$1")}return u[c]=See(s[f]||"",c),u},{}),pathname:i,pathnameBase:a,pattern:e}}function bee(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),uS(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function wee(e){try{return decodeURI(e)}catch(t){return uS(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function See(e,t){try{return decodeURIComponent(e)}catch(n){return uS(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function cS(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function xee(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?$l(e):e;return{pathname:n?n.startsWith("/")?n:Eee(n,t):t,search:kee(r),hash:Pee(o)}}function Eee(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Ly(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function qL(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function KL(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=$l(e):(o=_c({},e),Ft(!o.pathname||!o.pathname.includes("?"),Ly("?","pathname","search",o)),Ft(!o.pathname||!o.pathname.includes("#"),Ly("#","pathname","hash",o)),Ft(!o.search||!o.search.includes("#"),Ly("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(r||a==null)s=n;else{let f=t.length-1;if(a.startsWith("..")){let d=a.split("/");for(;d[0]==="..";)d.shift(),f-=1;o.pathname=d.join("/")}s=f>=0?t[f]:"/"}let l=xee(o,s),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Mi=e=>e.join("/").replace(/\/\/+/g,"/"),Cee=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),kee=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Pee=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _ee(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const GL=["post","put","patch","delete"];new Set(GL);const Oee=["get",...GL];new Set(Oee);/** - * React Router v6.15.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Bp(){return Bp=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),a=P.useRef(!1);return ZL(()=>{a.current=!0}),P.useCallback(function(l,u){if(u===void 0&&(u={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let c=KL(l,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Mi([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,i,o,e])}const Aee=P.createContext(null);function Lee(e){let t=P.useContext(ri).outlet;return t&&P.createElement(Aee.Provider,{value:e},t)}function dS(){let{matches:e}=P.useContext(ri),t=e[e.length-1];return t?t.params:{}}function pS(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=P.useContext(ri),{pathname:o}=ff(),i=JSON.stringify(qL(r).map(a=>a.pathnameBase));return P.useMemo(()=>KL(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function jee(e,t){return Mee(e,t)}function Mee(e,t,n){cf()||Ft(!1);let{navigator:r}=P.useContext(Qa),{matches:o}=P.useContext(ri),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let s=i?i.pathnameBase:"/";i&&i.route;let l=ff(),u;if(t){var c;let y=typeof t=="string"?$l(t):t;s==="/"||(c=y.pathname)!=null&&c.startsWith(s)||Ft(!1),u=y}else u=l;let f=u.pathname||"/",d=s==="/"?f:f.slice(s.length)||"/",g=see(e,{pathname:d}),w=Bee(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Mi([s,r.encodeLocation?r.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?s:Mi([s,r.encodeLocation?r.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,n);return t&&w?P.createElement(Bm.Provider,{value:{location:Bp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:xi.Pop}},w):w}function $ee(){let e=Hee(),t=_ee(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),n?P.createElement("pre",{style:o},n):null,i)}const Dee=P.createElement($ee,null);class zee extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?P.createElement(ri.Provider,{value:this.props.routeContext},P.createElement(XL.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Nee(e){let{routeContext:t,match:n,children:r}=e,o=P.useContext(fS);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),P.createElement(ri.Provider,{value:t},r)}function Bee(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let s=i.findIndex(l=>l.route.id&&(a==null?void 0:a[l.route.id]));s>=0||Ft(!1),i=i.slice(0,Math.min(i.length,s+1))}return i.reduceRight((s,l,u)=>{let c=l.route.id?a==null?void 0:a[l.route.id]:null,f=null;n&&(f=l.route.errorElement||Dee);let d=t.concat(i.slice(0,u+1)),g=()=>{let w;return c?w=f:l.route.Component?w=P.createElement(l.route.Component,null):l.route.element?w=l.route.element:w=s,P.createElement(Nee,{match:l,routeContext:{outlet:s,matches:d,isDataRoute:n!=null},children:w})};return n&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?P.createElement(zee,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:g(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):g()},null)}var QL=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(QL||{}),Fp=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Fp||{});function Fee(e){let t=P.useContext(fS);return t||Ft(!1),t}function Uee(e){let t=P.useContext(YL);return t||Ft(!1),t}function Vee(e){let t=P.useContext(ri);return t||Ft(!1),t}function JL(e){let t=Vee(),n=t.matches[t.matches.length-1];return n.route.id||Ft(!1),n.route.id}function Hee(){var e;let t=P.useContext(XL),n=Uee(Fp.UseRouteError),r=JL(Fp.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function Wee(){let{router:e}=Fee(QL.UseNavigateStable),t=JL(Fp.UseNavigateStable),n=P.useRef(!1);return ZL(()=>{n.current=!0}),P.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Bp({fromRouteId:t},i)))},[e,t])}function qee(e){return Lee(e.context)}function Vr(e){Ft(!1)}function Kee(e){let{basename:t="/",children:n=null,location:r,navigationType:o=xi.Pop,navigator:i,static:a=!1}=e;cf()&&Ft(!1);let s=t.replace(/^\/*/,"/"),l=P.useMemo(()=>({basename:s,navigator:i,static:a}),[s,i,a]);typeof r=="string"&&(r=$l(r));let{pathname:u="/",search:c="",hash:f="",state:d=null,key:g="default"}=r,w=P.useMemo(()=>{let y=cS(u,s);return y==null?null:{location:{pathname:y,search:c,hash:f,state:d,key:g},navigationType:o}},[s,u,c,f,d,g,o]);return w==null?null:P.createElement(Qa.Provider,{value:l},P.createElement(Bm.Provider,{children:n,value:w}))}function Gee(e){let{children:t,location:n}=e;return jee(db(t),n)}new Promise(()=>{});function db(e,t){t===void 0&&(t=[]);let n=[];return P.Children.forEach(e,(r,o)=>{if(!P.isValidElement(r))return;let i=[...t,o];if(r.type===P.Fragment){n.push.apply(n,db(r.props.children,i));return}r.type!==Vr&&Ft(!1),!r.props.index||!r.props.children||Ft(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=db(r.props.children,i)),n.push(a)}),n}/** - * React Router DOM v6.15.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Up(){return Up=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Yee(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xee(e,t){return e.button===0&&(!t||t==="_self")&&!Yee(e)}const Zee=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Qee=["aria-current","caseSensitive","className","end","style","to","children"],Jee="startTransition",uP=kg[Jee];function ete(e){let{basename:t,children:n,future:r,window:o}=e,i=P.useRef();i.current==null&&(i.current=oee({window:o,v5Compat:!0}));let a=i.current,[s,l]=P.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},c=P.useCallback(f=>{u&&uP?uP(()=>l(f)):l(f)},[l,u]);return P.useLayoutEffect(()=>a.listen(c),[a,c]),P.createElement(Kee,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a})}const tte=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nte=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Oc=P.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:l,to:u,preventScrollReset:c}=t,f=ej(t,Zee),{basename:d}=P.useContext(Qa),g,w=!1;if(typeof u=="string"&&nte.test(u)&&(g=u,tte))try{let b=new URL(window.location.href),C=u.startsWith("//")?new URL(b.protocol+u):new URL(u),R=cS(C.pathname,d);C.origin===b.origin&&R!=null?u=R+C.search+C.hash:w=!0}catch{}let y=Tee(u,{relative:o}),k=rte(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:o});function S(b){r&&r(b),b.defaultPrevented||k(b)}return P.createElement("a",Up({},f,{href:g||y,onClick:w||i?r:S,ref:n,target:l}))}),Vp=P.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:l,children:u}=t,c=ej(t,Qee),f=pS(l,{relative:c.relative}),d=ff(),g=P.useContext(YL),{navigator:w}=P.useContext(Qa),y=w.encodeLocation?w.encodeLocation(f).pathname:f.pathname,k=d.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;o||(k=k.toLowerCase(),S=S?S.toLowerCase():null,y=y.toLowerCase());let b=k===y||!a&&k.startsWith(y)&&k.charAt(y.length)==="/",C=S!=null&&(S===y||!a&&S.startsWith(y)&&S.charAt(y.length)==="/"),R=b?r:void 0,_;typeof i=="function"?_=i({isActive:b,isPending:C}):_=[i,b?"active":null,C?"pending":null].filter(Boolean).join(" ");let O=typeof s=="function"?s({isActive:b,isPending:C}):s;return P.createElement(Oc,Up({},c,{"aria-current":R,className:_,ref:n,style:O,to:l}),typeof u=="function"?u({isActive:b,isPending:C}):u)});var cP;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(cP||(cP={}));var fP;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(fP||(fP={}));function rte(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a}=t===void 0?{}:t,s=Ree(),l=ff(),u=pS(e,{relative:a});return P.useCallback(c=>{if(Xee(c,n)){c.preventDefault();let f=r!==void 0?r:Np(l)===Np(u);s(e,{replace:f,state:o,preventScrollReset:i,relative:a})}},[l,s,u,r,o,n,e,i,a])}let ote=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var Tc={};Object.defineProperty(Tc,"__esModule",{value:!0});Tc.bech32m=Yr=Tc.bech32=void 0;const Hp="qpzry9x8gf2tvdw0s3jn54khce6mua7l",tj={};for(let e=0;e>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function dP(e){let t=1;for(let n=0;n126)return"Invalid prefix ("+e+")";t=nl(t)^r>>5}t=nl(t);for(let n=0;n=n;)i-=n,s.push(o>>i&a);if(r)i>0&&s.push(o<=t)return"Excess padding";if(o<l)throw new TypeError("Exceeds length limit");a=a.toLowerCase();let u=dP(a);if(typeof u=="string")throw new Error(u);let c=a+"1";for(let f=0;f>5)throw new Error("Non 5-bit word");u=nl(u)^d,c+=Hp.charAt(d)}for(let f=0;f<6;++f)u=nl(u);u^=t;for(let f=0;f<6;++f){const d=u>>(5-f)*5&31;c+=Hp.charAt(d)}return c}function r(a,s){if(s=s||90,a.length<8)return a+" too short";if(a.length>s)return"Exceeds length limit";const l=a.toLowerCase(),u=a.toUpperCase();if(a!==l&&a!==u)return"Mixed-case string "+a;a=l;const c=a.lastIndexOf("1");if(c===-1)return"No separator character for "+a;if(c===0)return"Missing prefix for "+a;const f=a.slice(0,c),d=a.slice(c+1);if(d.length<6)return"Data too short";let g=dP(f);if(typeof g=="string")return g;const w=[];for(let y=0;y=d.length)&&w.push(S)}return g!==t?"Invalid checksum for "+a:{prefix:f,words:w}}function o(a,s){const l=r(a,s);if(typeof l=="object")return l}function i(a,s){const l=r(a,s);if(typeof l=="object")return l;throw new Error(l)}return{decodeUnsafe:o,decode:i,encode:n,toWords:ite,fromWordsUnsafe:ate,fromWords:ste}}var Yr=Tc.bech32=nj("bech32");Tc.bech32m=nj("bech32m");var rj={};(function(e){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(x){if(!Number.isSafeInteger(x))throw new Error(`Wrong integer: ${x}`)}e.assertNumber=t;function n(...x){const T=(L,$)=>j=>L($(j)),I=Array.from(x).reverse().reduce((L,$)=>L?T(L,$.encode):$.encode,void 0),A=x.reduce((L,$)=>L?T(L,$.decode):$.decode,void 0);return{encode:I,decode:A}}function r(x){return{encode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return T.map(I=>{if(t(I),I<0||I>=x.length)throw new Error(`Digit index outside alphabet: ${I} (alphabet: ${x.length})`);return x[I]})},decode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("alphabet.decode input should be array of strings");return T.map(I=>{if(typeof I!="string")throw new Error(`alphabet.decode: not string element=${I}`);const A=x.indexOf(I);if(A===-1)throw new Error(`Unknown letter: "${I}". Allowed: ${x}`);return A})}}}function o(x=""){if(typeof x!="string")throw new Error("join separator should be string");return{encode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("join.encode input should be array of strings");for(let I of T)if(typeof I!="string")throw new Error(`join.encode: non-string input=${I}`);return T.join(x)},decode:T=>{if(typeof T!="string")throw new Error("join.decode input should be string");return T.split(x)}}}function i(x,T="="){if(t(x),typeof T!="string")throw new Error("padding chr should be string");return{encode(I){if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("padding.encode input should be array of strings");for(let A of I)if(typeof A!="string")throw new Error(`padding.encode: non-string input=${A}`);for(;I.length*x%8;)I.push(T);return I},decode(I){if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("padding.encode input should be array of strings");for(let L of I)if(typeof L!="string")throw new Error(`padding.decode: non-string input=${L}`);let A=I.length;if(A*x%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;A>0&&I[A-1]===T;A--)if(!((A-1)*x%8))throw new Error("Invalid padding: string has too much padding");return I.slice(0,A)}}}function a(x){if(typeof x!="function")throw new Error("normalize fn should be function");return{encode:T=>T,decode:T=>x(T)}}function s(x,T,I){if(T<2)throw new Error(`convertRadix: wrong from=${T}, base cannot be less than 2`);if(I<2)throw new Error(`convertRadix: wrong to=${I}, base cannot be less than 2`);if(!Array.isArray(x))throw new Error("convertRadix: data should be array");if(!x.length)return[];let A=0;const L=[],$=Array.from(x);for($.forEach(j=>{if(t(j),j<0||j>=T)throw new Error(`Wrong integer: ${j}`)});;){let j=0,M=!0;for(let z=A;z<$.length;z++){const N=$[z],D=T*j+N;if(!Number.isSafeInteger(D)||T*j/T!==j||D-N!==T*j)throw new Error("convertRadix: carry overflow");if(j=D%I,$[z]=Math.floor(D/I),!Number.isSafeInteger($[z])||$[z]*I+j!==D)throw new Error("convertRadix: carry overflow");if(M)$[z]?M=!1:A=z;else continue}if(L.push(j),M)break}for(let j=0;jT?l(T,x%T):x,u=(x,T)=>x+(T-l(x,T));function c(x,T,I,A){if(!Array.isArray(x))throw new Error("convertRadix2: data should be array");if(T<=0||T>32)throw new Error(`convertRadix2: wrong from=${T}`);if(I<=0||I>32)throw new Error(`convertRadix2: wrong to=${I}`);if(u(T,I)>32)throw new Error(`convertRadix2: carry overflow from=${T} to=${I} carryBits=${u(T,I)}`);let L=0,$=0;const j=2**I-1,M=[];for(const z of x){if(t(z),z>=2**T)throw new Error(`convertRadix2: invalid data word=${z} from=${T}`);if(L=L<32)throw new Error(`convertRadix2: carry overflow pos=${$} from=${T}`);for($+=T;$>=I;$-=I)M.push((L>>$-I&j)>>>0);L&=2**$-1}if(L=L<=T)throw new Error("Excess padding");if(!A&&L)throw new Error(`Non-zero padding: ${L}`);return A&&$>0&&M.push(L>>>0),M}function f(x){return t(x),{encode:T=>{if(!(T instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return s(Array.from(T),2**8,x)},decode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(s(T,x,2**8))}}}function d(x,T=!1){if(t(x),x<=0||x>32)throw new Error("radix2: bits should be in (0..32]");if(u(8,x)>32||u(x,8)>32)throw new Error("radix2: carry overflow");return{encode:I=>{if(!(I instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return c(Array.from(I),8,x,!T)},decode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(c(I,x,8,T))}}}function g(x){if(typeof x!="function")throw new Error("unsafeWrapper fn should be function");return function(...T){try{return x.apply(null,T)}catch{}}}function w(x,T){if(t(x),typeof T!="function")throw new Error("checksum fn should be function");return{encode(I){if(!(I instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const A=T(I).slice(0,x),L=new Uint8Array(I.length+x);return L.set(I),L.set(A,I.length),L},decode(I){if(!(I instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const A=I.slice(0,-x),L=T(A).slice(0,x),$=I.slice(-x);for(let j=0;jx.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),o("")),e.base64url=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),o(""));const y=x=>n(f(58),r(x),o(""));e.base58=y("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=y("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=y("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const k=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(x){let T="";for(let I=0;In(w(4,T=>x(x(T))),e.base58);e.base58check=S;const b=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),C=[996825010,642813549,513874426,1027748829,705979059];function R(x){const T=x>>25;let I=(x&33554431)<<5;for(let A=0;A>A&1)===1&&(I^=C[A]);return I}function _(x,T,I=1){const A=x.length;let L=1;for(let $=0;$126)throw new Error(`Invalid prefix (${x})`);L=R(L)^j>>5}L=R(L);for(let $=0;$W)throw new TypeError(`Length ${H} exceeds limit ${W}`);return D=D.toLowerCase(),`${D}1${b.encode(F)}${_(D,F,T)}`}function M(D,F=90){if(typeof D!="string")throw new Error(`bech32.decode input should be string, not ${typeof D}`);if(D.length<8||F!==!1&&D.length>F)throw new TypeError(`Wrong string length: ${D.length} (${D}). Expected (8..${F})`);const W=D.toLowerCase();if(D!==W&&D!==D.toUpperCase())throw new Error("String must be lowercase or uppercase");D=W;const H=D.lastIndexOf("1");if(H===0||H===-1)throw new Error('Letter "1" must be present between prefix and data only');const Y=D.slice(0,H),q=D.slice(H+1);if(q.length<6)throw new Error("Data must be at least 6 characters long");const X=b.decode(q).slice(0,-6),Q=_(Y,X,T);if(!q.endsWith(Q))throw new Error(`Invalid checksum in ${D}: expected "${Q}"`);return{prefix:Y,words:X}}const z=g(M);function N(D){const{prefix:F,words:W}=M(D,!1);return{prefix:F,words:W,bytes:A(W)}}return{encode:j,decode:M,decodeToBytes:N,decodeUnsafe:z,fromWords:A,fromWordsUnsafe:$,toWords:L}}e.bech32=O("bech32"),e.bech32m=O("bech32m"),e.utf8={encode:x=>new TextDecoder().decode(x),decode:x=>new TextEncoder().encode(x)},e.hex=n(d(4),r("0123456789abcdef"),o(""),a(x=>{if(typeof x!="string"||x.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof x} with length ${x.length}`);return x.toLowerCase()}));const E={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},p=`Invalid encoding type. Available types: ${Object.keys(E).join(", ")}`,v=(x,T)=>{if(typeof x!="string"||!E.hasOwnProperty(x))throw new TypeError(p);if(!(T instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return E[x].encode(T)};e.bytesToString=v,e.str=e.bytesToString;const h=(x,T)=>{if(!E.hasOwnProperty(x))throw new TypeError(p);if(typeof T!="string")throw new TypeError("stringToBytes() expects string");return E[x].decode(T)};e.stringToBytes=h,e.bytes=e.stringToBytes})(rj);const{bech32:po,hex:Gr,utf8:lte}=rj,pP={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},hP={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},mP={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},vP={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},ad=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],ute={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},cte=BigInt("2100000000000000000"),yP=BigInt(1e11),pb={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},oj={};for(let e=0,t=Object.keys(pb);eGr.encode(po.fromWordsUnsafe(e)),16:e=>Gr.encode(po.fromWordsUnsafe(e)),13:e=>lte.encode(po.fromWordsUnsafe(e)),19:e=>Gr.encode(po.fromWordsUnsafe(e)),23:e=>Gr.encode(po.fromWordsUnsafe(e)),27:e=>Gr.encode(po.fromWordsUnsafe(e)),6:Wp,24:Wp,3:pte,5:hte};function dte(e){return t=>({tagCode:parseInt(e),words:po.encode("unknown",t,Number.MAX_SAFE_INTEGER)})}function Wp(e){return e.reverse().reduce((t,n,r)=>t+n*Math.pow(32,r),0)}function pte(e){const t=[];let n,r,o,i,a,s=po.fromWordsUnsafe(e);for(;s.length>0;)n=Gr.encode(s.slice(0,33)),r=Gr.encode(s.slice(33,41)),o=parseInt(Gr.encode(s.slice(41,45)),16),i=parseInt(Gr.encode(s.slice(45,49)),16),a=parseInt(Gr.encode(s.slice(49,51)),16),s=s.slice(51),t.push({pubkey:n,short_channel_id:r,fee_base_msat:o,fee_proportional_millionths:i,cltv_expiry_delta:a});return t}function hte(e){const t=e.slice().reverse().map(o=>[!!(o&1),!!(o&2),!!(o&4),!!(o&8),!!(o&16)]).reduce((o,i)=>o.concat(i),[]);for(;t.length{let a;t[i*2]?a="required":t[i*2+1]?a="supported":a="unsupported",n[o]=a});const r=t.slice(ad.length*2);return n.extra_bits={start_bit:ad.length*2,bits:r,has_required:r.reduce((o,i,a)=>a%2!==0?o||!1:o||i,!1)},n}function ij(e,t){let n,r;if(e.slice(-1).match(/^[munp]$/))n=e.slice(-1),r=e.slice(0,-1);else{if(e.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=e}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const o=BigInt(r),i=n?o*yP/ute[n]:o*yP;if(n==="p"&&o%BigInt(10)!==BigInt(0)||i>cte)throw new Error("Amount is outside of valid range");return t?i.toString():i}function mte(e,t){if(typeof e!="string")throw new Error("Lightning Payment Request must be string");if(e.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=po.decode(e,Number.MAX_SAFE_INTEGER);e=e.toLowerCase();const o=r.prefix;let i=r.words,a=e.slice(o.length+1),s=i.slice(-104);i=i.slice(0,-104);let l=o.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(l&&!l[2]&&(l=o.match(/^ln(\S+)$/)),!l)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const u=l[1];let c;if(t){if(t.bech32===void 0||t.pubKeyHash===void 0||t.scriptHash===void 0||!Array.isArray(t.validWitnessVersions))throw new Error("Invalid network");c=t}else switch(u){case pP.bech32:c=pP;break;case hP.bech32:c=hP;break;case mP.bech32:c=mP;break;case vP.bech32:c=vP;break}if(!c||c.bech32!==u)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:u,value:c});const f=l[2];let d;if(f){const R=l[3];d=ij(f+R,!0),n.push({name:"amount",letters:l[2]+l[3],value:d})}else d=null;n.push({name:"separator",letters:"1"});const g=Wp(i.slice(0,7));i=i.slice(7),n.push({name:"timestamp",letters:a.slice(0,7),value:g}),a=a.slice(7);let w,y,k,S;for(;i.length>0;){const R=i[0].toString();w=oj[R]||"unknown_tag",y=fte[R]||dte(R),i=i.slice(1),k=Wp(i.slice(0,2)),i=i.slice(2),S=i.slice(0,k),i=i.slice(k),n.push({name:w,tag:a[0],letters:a.slice(0,1+2+k),value:y(S)}),a=a.slice(1+2+k)}n.push({name:"signature",letters:a.slice(0,104),value:Gr.encode(po.fromWordsUnsafe(s))}),a=a.slice(104),n.push({name:"checksum",letters:a});let b={paymentRequest:e,sections:n,get expiry(){let R=n.find(_=>_.name==="expiry");if(R)return C("timestamp")+R.value},get route_hints(){return n.filter(R=>R.name==="route_hint").map(R=>R.value)}};for(let R in pb)R!=="route_hint"&&Object.defineProperty(b,R,{get(){return C(R)}});return b;function C(R){let _=n.find(O=>O.name===R);return _?_.value:void 0}}var vte={decode:mte,hrpToMillisat:ij};function hb(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function yte(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function aj(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function gte(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");hb(e.outputLen),hb(e.blockLen)}function bte(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function wte(e,t){aj(e);const n=t.outputLen;if(e.lengthe instanceof Uint8Array,My=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),io=(e,t)=>e<<32-t|e>>>t,Ste=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ste)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function xte(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function mS(e){if(typeof e=="string"&&(e=xte(e)),!sj(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Ete(...e){const t=new Uint8Array(e.reduce((r,o)=>r+o.length,0));let n=0;return e.forEach(r=>{if(!sj(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class lj{clone(){return this._cloneInto()}}function uj(e){const t=r=>e().update(mS(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function cj(e=32){if(jy&&typeof jy.getRandomValues=="function")return jy.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function Cte(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),l=r?4:0,u=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+u,s,r)}class kte extends lj{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=My(this.buffer)}update(t){wa.exists(this);const{view:n,buffer:r,blockLen:o}=this;t=mS(t);const i=t.length;for(let a=0;ao-a&&(this.process(r,0),a=0);for(let f=a;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&n,_te=(e,t,n)=>e&t^e&n^t&n,Ote=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ci=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),fi=new Uint32Array(64);class fj extends kte{constructor(){super(64,32,8,!1),this.A=ci[0]|0,this.B=ci[1]|0,this.C=ci[2]|0,this.D=ci[3]|0,this.E=ci[4]|0,this.F=ci[5]|0,this.G=ci[6]|0,this.H=ci[7]|0}get(){const{A:t,B:n,C:r,D:o,E:i,F:a,G:s,H:l}=this;return[t,n,r,o,i,a,s,l]}set(t,n,r,o,i,a,s,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=s|0,this.H=l|0}process(t,n){for(let f=0;f<16;f++,n+=4)fi[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const d=fi[f-15],g=fi[f-2],w=io(d,7)^io(d,18)^d>>>3,y=io(g,17)^io(g,19)^g>>>10;fi[f]=y+fi[f-7]+w+fi[f-16]|0}let{A:r,B:o,C:i,D:a,E:s,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=io(s,6)^io(s,11)^io(s,25),g=c+d+Pte(s,l,u)+Ote[f]+fi[f]|0,y=(io(r,2)^io(r,13)^io(r,22))+_te(r,o,i)|0;c=u,u=l,l=s,s=a+g|0,a=i,i=o,o=r,r=g+y|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,o,i,a,s,l,u,c)}roundClean(){fi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class Tte extends fj{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const qp=uj(()=>new fj);uj(()=>new Tte);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const dj=BigInt(0),Fm=BigInt(1),Rte=BigInt(2),Um=e=>e instanceof Uint8Array,Ite=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Po(e){if(!Um(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+o.length,0));let n=0;return e.forEach(r=>{if(!Um(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function Lte(e,t){if(e.length!==t.length)return!1;for(let n=0;ndj;e>>=Fm,t+=1);return t}function $te(e,t){return e>>BigInt(t)&Fm}const Dte=(e,t,n)=>e|(n?Fm:dj)<(Rte<new Uint8Array(e),gP=e=>Uint8Array.from(e);function mj(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=$y(e),o=$y(e),i=0;const a=()=>{r.fill(1),o.fill(0),i=0},s=(...f)=>n(o,r,...f),l=(f=$y())=>{o=s(gP([0]),f),r=s(),f.length!==0&&(o=s(gP([1]),f),r=s())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f{a(),l(f);let g;for(;!(g=d(u()));)l();return a(),g}}const zte={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function df(e,t,n={}){const r=(o,i,a)=>{const s=zte[i];if(typeof s!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=e[o];if(!(a&&l===void 0)&&!s(l,e))throw new Error(`Invalid param ${String(o)}=${l} (${typeof l}), expected ${i}`)};for(const[o,i]of Object.entries(t))r(o,i,!1);for(const[o,i]of Object.entries(n))r(o,i,!0);return e}const Nte=Object.freeze(Object.defineProperty({__proto__:null,bitGet:$te,bitLen:Mte,bitMask:gS,bitSet:Dte,bytesToHex:Po,bytesToNumberBE:Kn,bytesToNumberLE:yS,concatBytes:Va,createHmacDrbg:mj,ensureBytes:an,equalBytes:Lte,hexToBytes:Sl,hexToNumber:vS,numberToBytesBE:$i,numberToBytesLE:hj,numberToHexUnpadded:pj,numberToVarBytesBE:Ate,utf8ToBytes:jte,validateObject:df},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Yt=BigInt(0),Lt=BigInt(1),da=BigInt(2),Bte=BigInt(3),mb=BigInt(4),bP=BigInt(5),wP=BigInt(8);BigInt(9);BigInt(16);function ln(e,t){const n=e%t;return n>=Yt?n:t+n}function Fte(e,t,n){if(n<=Yt||t 0");if(n===Lt)return Yt;let r=Lt;for(;t>Yt;)t&Lt&&(r=r*e%n),e=e*e%n,t>>=Lt;return r}function xr(e,t,n){let r=e;for(;t-- >Yt;)r*=r,r%=n;return r}function vb(e,t){if(e===Yt||t<=Yt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=ln(e,t),r=t,o=Yt,i=Lt;for(;n!==Yt;){const s=r/n,l=r%n,u=o-i*s;r=n,n=l,o=i,i=u}if(r!==Lt)throw new Error("invert: does not exist");return ln(o,t)}function Ute(e){const t=(e-Lt)/da;let n,r,o;for(n=e-Lt,r=0;n%da===Yt;n/=da,r++);for(o=da;o(r[o]="function",r),t);return df(e,n)}function qte(e,t,n){if(n 0");if(n===Yt)return e.ONE;if(n===Lt)return t;let r=e.ONE,o=t;for(;n>Yt;)n&Lt&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Lt;return r}function Kte(e,t){const n=new Array(t.length),r=t.reduce((i,a,s)=>e.is0(a)?i:(n[s]=i,e.mul(i,a)),e.ONE),o=e.inv(r);return t.reduceRight((i,a,s)=>e.is0(a)?i:(n[s]=e.mul(i,n[s]),e.mul(i,a)),o),n}function bS(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Gte(e,t,n=!1,r={}){if(e<=Yt)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:i}=bS(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=Vte(e),s=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:gS(o),ZERO:Yt,ONE:Lt,create:l=>ln(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return Yt<=l&&ll===Yt,isOdd:l=>(l&Lt)===Lt,neg:l=>ln(-l,e),eql:(l,u)=>l===u,sqr:l=>ln(l*l,e),add:(l,u)=>ln(l+u,e),sub:(l,u)=>ln(l-u,e),mul:(l,u)=>ln(l*u,e),pow:(l,u)=>qte(s,l,u),div:(l,u)=>ln(l*vb(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>vb(l,e),sqrt:r.sqrt||(l=>a(s,l)),invertBatch:l=>Kte(s,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?hj(l,i):$i(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?yS(l):Kn(l)}});return Object.freeze(s)}function Yte(e,t,n=!1){e=an("privateHash",e);const r=e.length,o=bS(t).nByteLength+8;if(o<24||r1024)throw new Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${r}`);const i=n?yS(e):Kn(e);return ln(i,t-Lt)+Lt}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xte=BigInt(0),Dy=BigInt(1);function Zte(e,t){const n=(o,i)=>{const a=i.negate();return o?a:i},r=o=>{const i=Math.ceil(t/o)+1,a=2**(o-1);return{windows:i,windowSize:a}};return{constTimeNegate:n,unsafeLadder(o,i){let a=e.ZERO,s=o;for(;i>Xte;)i&Dy&&(a=a.add(s)),s=s.double(),i>>=Dy;return a},precomputeWindow(o,i){const{windows:a,windowSize:s}=r(i),l=[];let u=o,c=u;for(let f=0;f>=g,k>l&&(k-=d,a+=Dy);const S=y,b=y+Math.abs(k)-1,C=w%2!==0,R=k<0;k===0?c=c.add(n(C,i[S])):u=u.add(n(R,i[b]))}return{p:u,f:c}},wNAFCached(o,i,a,s){const l=o._WINDOW_SIZE||1;let u=i.get(o);return u||(u=this.precomputeWindow(o,l),l!==1&&i.set(o,s(u))),this.wNAF(l,u,a)}}}function vj(e){return Wte(e.Fp),df(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...bS(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Qte(e){const t=vj(e);df(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:Jte,hexToBytes:ene}=Nte,Sa={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Sa;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Jte(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Sa,n=typeof e=="string"?ene(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:o,l:i}=Sa._parseInt(n.subarray(2)),{d:a,l:s}=Sa._parseInt(i);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=t(n(e.s)),o=t(n(e.r)),i=r.length/2,a=o.length/2,s=n(i),l=n(a);return`30${n(a+i+4)}02${l}${o}02${s}${r}`}},Do=BigInt(0),kr=BigInt(1);BigInt(2);const SP=BigInt(3);BigInt(4);function tne(e){const t=Qte(e),{Fp:n}=t,r=t.toBytes||((w,y,k)=>{const S=y.toAffine();return Va(Uint8Array.from([4]),n.toBytes(S.x),n.toBytes(S.y))}),o=t.fromBytes||(w=>{const y=w.subarray(1),k=n.fromBytes(y.subarray(0,n.BYTES)),S=n.fromBytes(y.subarray(n.BYTES,2*n.BYTES));return{x:k,y:S}});function i(w){const{a:y,b:k}=t,S=n.sqr(w),b=n.mul(S,w);return n.add(n.add(b,n.mul(w,y)),k)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(w){return typeof w=="bigint"&&Don.eql(C,n.ZERO);return b(k)&&b(S)?f.ZERO:new f(k,S,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){const k=n.invertBatch(y.map(S=>S.pz));return y.map((S,b)=>S.toAffine(k[b])).map(f.fromAffine)}static fromHex(y){const k=f.fromAffine(o(an("pointHex",y)));return k.assertValidity(),k}static fromPrivateKey(y){return f.BASE.multiply(l(y))}_setWindowSize(y){this._WINDOW_SIZE=y,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:y,y:k}=this.toAffine();if(!n.isValid(y)||!n.isValid(k))throw new Error("bad point: x or y not FE");const S=n.sqr(k),b=i(y);if(!n.eql(S,b))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y}=this.toAffine();if(n.isOdd)return!n.isOdd(y);throw new Error("Field doesn't support isOdd")}equals(y){c(y);const{px:k,py:S,pz:b}=this,{px:C,py:R,pz:_}=y,O=n.eql(n.mul(k,_),n.mul(C,b)),E=n.eql(n.mul(S,_),n.mul(R,b));return O&&E}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:y,b:k}=t,S=n.mul(k,SP),{px:b,py:C,pz:R}=this;let _=n.ZERO,O=n.ZERO,E=n.ZERO,p=n.mul(b,b),v=n.mul(C,C),h=n.mul(R,R),x=n.mul(b,C);return x=n.add(x,x),E=n.mul(b,R),E=n.add(E,E),_=n.mul(y,E),O=n.mul(S,h),O=n.add(_,O),_=n.sub(v,O),O=n.add(v,O),O=n.mul(_,O),_=n.mul(x,_),E=n.mul(S,E),h=n.mul(y,h),x=n.sub(p,h),x=n.mul(y,x),x=n.add(x,E),E=n.add(p,p),p=n.add(E,p),p=n.add(p,h),p=n.mul(p,x),O=n.add(O,p),h=n.mul(C,R),h=n.add(h,h),p=n.mul(h,x),_=n.sub(_,p),E=n.mul(h,v),E=n.add(E,E),E=n.add(E,E),new f(_,O,E)}add(y){c(y);const{px:k,py:S,pz:b}=this,{px:C,py:R,pz:_}=y;let O=n.ZERO,E=n.ZERO,p=n.ZERO;const v=t.a,h=n.mul(t.b,SP);let x=n.mul(k,C),T=n.mul(S,R),I=n.mul(b,_),A=n.add(k,S),L=n.add(C,R);A=n.mul(A,L),L=n.add(x,T),A=n.sub(A,L),L=n.add(k,b);let $=n.add(C,_);return L=n.mul(L,$),$=n.add(x,I),L=n.sub(L,$),$=n.add(S,b),O=n.add(R,_),$=n.mul($,O),O=n.add(T,I),$=n.sub($,O),p=n.mul(v,L),O=n.mul(h,I),p=n.add(O,p),O=n.sub(T,p),p=n.add(T,p),E=n.mul(O,p),T=n.add(x,x),T=n.add(T,x),I=n.mul(v,I),L=n.mul(h,L),T=n.add(T,I),I=n.sub(x,I),I=n.mul(v,I),L=n.add(L,I),x=n.mul(T,L),E=n.add(E,x),x=n.mul($,L),O=n.mul(A,O),O=n.sub(O,x),x=n.mul(A,T),p=n.mul($,p),p=n.add(p,x),new f(O,E,p)}subtract(y){return this.add(y.negate())}is0(){return this.equals(f.ZERO)}wNAF(y){return g.wNAFCached(this,u,y,k=>{const S=n.invertBatch(k.map(b=>b.pz));return k.map((b,C)=>b.toAffine(S[C])).map(f.fromAffine)})}multiplyUnsafe(y){const k=f.ZERO;if(y===Do)return k;if(s(y),y===kr)return this;const{endo:S}=t;if(!S)return g.unsafeLadder(this,y);let{k1neg:b,k1:C,k2neg:R,k2:_}=S.splitScalar(y),O=k,E=k,p=this;for(;C>Do||_>Do;)C&kr&&(O=O.add(p)),_&kr&&(E=E.add(p)),p=p.double(),C>>=kr,_>>=kr;return b&&(O=O.negate()),R&&(E=E.negate()),E=new f(n.mul(E.px,S.beta),E.py,E.pz),O.add(E)}multiply(y){s(y);let k=y,S,b;const{endo:C}=t;if(C){const{k1neg:R,k1:_,k2neg:O,k2:E}=C.splitScalar(k);let{p,f:v}=this.wNAF(_),{p:h,f:x}=this.wNAF(E);p=g.constTimeNegate(R,p),h=g.constTimeNegate(O,h),h=new f(n.mul(h.px,C.beta),h.py,h.pz),S=p.add(h),b=v.add(x)}else{const{p:R,f:_}=this.wNAF(k);S=R,b=_}return f.normalizeZ([S,b])[0]}multiplyAndAddUnsafe(y,k,S){const b=f.BASE,C=(_,O)=>O===Do||O===kr||!_.equals(b)?_.multiplyUnsafe(O):_.multiply(O),R=C(this,k).add(C(y,S));return R.is0()?void 0:R}toAffine(y){const{px:k,py:S,pz:b}=this,C=this.is0();y==null&&(y=C?n.ONE:n.inv(b));const R=n.mul(k,y),_=n.mul(S,y),O=n.mul(b,y);if(C)return{x:n.ZERO,y:n.ZERO};if(!n.eql(O,n.ONE))throw new Error("invZ was invalid");return{x:R,y:_}}isTorsionFree(){const{h:y,isTorsionFree:k}=t;if(y===kr)return!0;if(k)return k(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:y,clearCofactor:k}=t;return y===kr?this:k?k(f,this):this.multiplyUnsafe(t.h)}toRawBytes(y=!0){return this.assertValidity(),r(f,this,y)}toHex(y=!0){return Po(this.toRawBytes(y))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=t.nBitLength,g=Zte(f,t.endo?Math.ceil(d/2):d);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:a}}function nne(e){const t=vj(e);return df(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function rne(e){const t=nne(e),{Fp:n,n:r}=t,o=n.BYTES+1,i=2*n.BYTES+1;function a(L){return DoPo($i(L,t.nByteLength));function w(L){const $=r>>kr;return L>$}function y(L){return w(L)?s(-L):L}const k=(L,$,j)=>Kn(L.slice($,j));class S{constructor($,j,M){this.r=$,this.s=j,this.recovery=M,this.assertValidity()}static fromCompact($){const j=t.nByteLength;return $=an("compactSignature",$,j*2),new S(k($,0,j),k($,j,2*j))}static fromDER($){const{r:j,s:M}=Sa.toSig(an("DER",$));return new S(j,M)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit($){return new S(this.r,this.s,$)}recoverPublicKey($){const{r:j,s:M,recovery:z}=this,N=E(an("msgHash",$));if(z==null||![0,1,2,3].includes(z))throw new Error("recovery id invalid");const D=z===2||z===3?j+t.n:j;if(D>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const F=z&1?"03":"02",W=u.fromHex(F+g(D)),H=l(D),Y=s(-N*H),q=s(M*H),X=u.BASE.multiplyAndAddUnsafe(W,Y,q);if(!X)throw new Error("point at infinify");return X.assertValidity(),X}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new S(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Sl(this.toDERHex())}toDERHex(){return Sa.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Sl(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const b={isValidPrivateKey(L){try{return c(L),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const L=t.randomBytes(n.BYTES+8),$=Yte(L,r);return $i($,t.nByteLength)},precompute(L=8,$=u.BASE){return $._setWindowSize(L),$.multiply(BigInt(3)),$}};function C(L,$=!0){return u.fromPrivateKey(L).toRawBytes($)}function R(L){const $=L instanceof Uint8Array,j=typeof L=="string",M=($||j)&&L.length;return $?M===o||M===i:j?M===2*o||M===2*i:L instanceof u}function _(L,$,j=!0){if(R(L))throw new Error("first arg must be private key");if(!R($))throw new Error("second arg must be public key");return u.fromHex($).multiply(c(L)).toRawBytes(j)}const O=t.bits2int||function(L){const $=Kn(L),j=L.length*8-t.nBitLength;return j>0?$>>BigInt(j):$},E=t.bits2int_modN||function(L){return s(O(L))},p=gS(t.nBitLength);function v(L){if(typeof L!="bigint")throw new Error("bigint expected");if(!(Do<=L&&Loe in j))throw new Error("sign() legacy options not supported");const{hash:M,randomBytes:z}=t;let{lowS:N,prehash:D,extraEntropy:F}=j;N==null&&(N=!0),L=an("msgHash",L),D&&(L=an("prehashed msgHash",M(L)));const W=E(L),H=c($),Y=[v(H),v(W)];if(F!=null){const oe=F===!0?z(n.BYTES):F;Y.push(an("extraEntropy",oe,n.BYTES))}const q=Va(...Y),X=W;function Q(oe){const pe=O(oe);if(!d(pe))return;const re=l(pe),ie=u.BASE.multiply(pe).toAffine(),Ce=s(ie.x);if(Ce===Do)return;const rt=s(re*s(X+Ce*H));if(rt===Do)return;let ne=(ie.x===Ce?0:2)|Number(ie.y&kr),be=rt;return N&&w(rt)&&(be=y(rt),ne^=1),new S(Ce,be,ne)}return{seed:q,k2sig:Q}}const x={lowS:t.lowS,prehash:!1},T={lowS:t.lowS,prehash:!1};function I(L,$,j=x){const{seed:M,k2sig:z}=h(L,$,j),N=t;return mj(N.hash.outputLen,N.nByteLength,N.hmac)(M,z)}u.BASE._setWindowSize(8);function A(L,$,j,M=T){var ie;const z=L;if($=an("msgHash",$),j=an("publicKey",j),"strict"in M)throw new Error("options.strict was renamed to lowS");const{lowS:N,prehash:D}=M;let F,W;try{if(typeof z=="string"||z instanceof Uint8Array)try{F=S.fromDER(z)}catch(Ce){if(!(Ce instanceof Sa.Err))throw Ce;F=S.fromCompact(z)}else if(typeof z=="object"&&typeof z.r=="bigint"&&typeof z.s=="bigint"){const{r:Ce,s:rt}=z;F=new S(Ce,rt)}else throw new Error("PARSE");W=u.fromHex(j)}catch(Ce){if(Ce.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(N&&F.hasHighS())return!1;D&&($=t.hash($));const{r:H,s:Y}=F,q=E($),X=l(Y),Q=s(q*X),oe=s(H*X),pe=(ie=u.BASE.multiplyAndAddUnsafe(W,Q,oe))==null?void 0:ie.toAffine();return pe?s(pe.x)===H:!1}return{CURVE:t,getPublicKey:C,getSharedSecret:_,sign:I,verify:A,ProjectivePoint:u,Signature:S,utils:b}}class yj extends lj{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,wa.hash(t);const r=mS(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?t.create().update(r).digest():r);for(let a=0;anew yj(e,t).update(n).digest();gj.create=(e,t)=>new yj(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function one(e){return{hash:e,hmac:(t,...n)=>gj(e,t,Ete(...n)),randomBytes:cj}}function ine(e,t){const n=r=>rne({...e,...one(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Vm=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Kp=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),bj=BigInt(1),Gp=BigInt(2),xP=(e,t)=>(e+t/Gp)/t;function wj(e){const t=Vm,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),l=BigInt(88),u=e*e*e%t,c=u*u*e%t,f=xr(c,n,t)*c%t,d=xr(f,n,t)*c%t,g=xr(d,Gp,t)*u%t,w=xr(g,o,t)*g%t,y=xr(w,i,t)*w%t,k=xr(y,s,t)*y%t,S=xr(k,l,t)*k%t,b=xr(S,s,t)*y%t,C=xr(b,n,t)*c%t,R=xr(C,a,t)*w%t,_=xr(R,r,t)*u%t,O=xr(_,Gp,t);if(!yb.eql(yb.sqr(O),e))throw new Error("Cannot find square root");return O}const yb=Gte(Vm,void 0,void 0,{sqrt:wj}),wS=ine({a:BigInt(0),b:BigInt(7),Fp:yb,n:Kp,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Kp,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-bj*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,a=BigInt("0x100000000000000000000000000000000"),s=xP(i*e,t),l=xP(-r*e,t);let u=ln(e-s*n-l*o,t),c=ln(-s*r-l*i,t);const f=u>a,d=c>a;if(f&&(u=t-u),d&&(c=t-c),u>a||c>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},qp),Hm=BigInt(0),Sj=e=>typeof e=="bigint"&&Hmtypeof e=="bigint"&&Hmo.charCodeAt(0)));n=Va(r,r),EP[e]=n}return qp(Va(n,...t))}const SS=e=>e.toRawBytes(!0).slice(1),gb=e=>$i(e,32),zy=e=>ln(e,Vm),Rc=e=>ln(e,Kp),xS=wS.ProjectivePoint,sne=(e,t,n)=>xS.BASE.multiplyAndAddUnsafe(e,t,n);function bb(e){let t=wS.utils.normPrivateKeyToScalar(e),n=xS.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:Rc(-t),bytes:SS(n)}}function xj(e){if(!Sj(e))throw new Error("bad x: need 0 < x < p");const t=zy(e*e),n=zy(t*e+BigInt(7));let r=wj(n);r%Gp!==Hm&&(r=zy(-r));const o=new xS(e,r,bj);return o.assertValidity(),o}function Ej(...e){return Rc(Kn(Yp("BIP0340/challenge",...e)))}function lne(e){return bb(e).bytes}function une(e,t,n=cj(32)){const r=an("message",e),{bytes:o,scalar:i}=bb(t),a=an("auxRand",n,32),s=gb(i^Kn(Yp("BIP0340/aux",a))),l=Yp("BIP0340/nonce",s,o,r),u=Rc(Kn(l));if(u===Hm)throw new Error("sign failed: k is zero");const{bytes:c,scalar:f}=bb(u),d=Ej(c,o,r),g=new Uint8Array(64);if(g.set(c,0),g.set(gb(Rc(f+d*i)),32),!Cj(g,r,o))throw new Error("sign: Invalid signature produced");return g}function Cj(e,t,n){const r=an("signature",e,64),o=an("message",t),i=an("publicKey",n,32);try{const a=xj(Kn(i)),s=Kn(r.subarray(0,32));if(!Sj(s))return!1;const l=Kn(r.subarray(32,64));if(!ane(l))return!1;const u=Ej(gb(s),SS(a),o),c=sne(a,l,Rc(-u));return!(!c||!c.hasEvenY()||c.toAffine().x!==s)}catch{return!1}}const wb=(()=>({getPublicKey:lne,sign:une,verify:Cj,utils:{randomPrivateKey:wS.utils.randomPrivateKey,lift_x:xj,pointToBytes:SS,numberToBytesBE:$i,bytesToNumberBE:Kn,taggedHash:Yp,mod:ln}}))();var ES=(e=>(e.PublicKeys="npub",e.PrivateKeys="nsec",e.NoteIDs="note",e.LNURL="lnurl",e.Profile="nprofile",e.Event="nevent",e.Relay="nrelay",e.EventCoordinate="naddr",e))(ES||{}),pf=(e=>(e.AUTH="AUTH",e.CLOSE="CLOSE",e.COUNT="COUNT",e.EVENT="EVENT",e.REQ="REQ",e))(pf||{}),Rn=(e=>(e[e.METADATA=0]="METADATA",e[e.SHORT_TEXT_NOTE=1]="SHORT_TEXT_NOTE",e[e.RECOMMEND_RELAY=2]="RECOMMEND_RELAY",e[e.CONTACTS=3]="CONTACTS",e[e.ENCRYPTED_DIRECT_MESSAGES=4]="ENCRYPTED_DIRECT_MESSAGES",e[e.EVENT_DELETION=5]="EVENT_DELETION",e[e.REPOST=6]="REPOST",e[e.REACTION=7]="REACTION",e[e.BADGE_AWARD=8]="BADGE_AWARD",e[e.GENERIC_REPOST=16]="GENERIC_REPOST",e[e.CHANNEL_CREATION=40]="CHANNEL_CREATION",e[e.CHANNEL_METADATA=41]="CHANNEL_METADATA",e[e.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",e[e.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",e[e.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",e[e.FILE_METADATA=1063]="FILE_METADATA",e[e.LIVE_CHAT_MESSAGE=1311]="LIVE_CHAT_MESSAGE",e[e.REPORTING=1984]="REPORTING",e[e.LABEL=1985]="LABEL",e[e.ZAP_REQUEST=9734]="ZAP_REQUEST",e[e.ZAP_RECEIPT=9735]="ZAP_RECEIPT",e[e.MUTE_LIST=1e4]="MUTE_LIST",e[e.PIN_LIST=10001]="PIN_LIST",e[e.RELAY_LIST_METADATA=10002]="RELAY_LIST_METADATA",e[e.WALLET_INFO=13194]="WALLET_INFO",e[e.CLIENT_AUTHENTICATION=22242]="CLIENT_AUTHENTICATION",e[e.WALLET_REQUEST=23194]="WALLET_REQUEST",e[e.WALLET_RESPONSE=23195]="WALLET_RESPONSE",e[e.NOSTR_CONNECT=24133]="NOSTR_CONNECT",e[e.HTTP_AUTH=27235]="HTTP_AUTH",e[e.CATEGORIZED_PEOPLE_LIST=3e4]="CATEGORIZED_PEOPLE_LIST",e[e.CATEGORIZED_BOOKMARK_LIST=30001]="CATEGORIZED_BOOKMARK_LIST",e[e.PROFILE_BADGES=30008]="PROFILE_BADGES",e[e.BADGE_DEFINITION=30009]="BADGE_DEFINITION",e[e.CREATE_OR_UPDATE_A_STALL=30017]="CREATE_OR_UPDATE_A_STALL",e[e.CREATE_OR_UPDATE_A_PRODUCT=30018]="CREATE_OR_UPDATE_A_PRODUCT",e[e.LONG_FORM_CONTENT=30023]="LONG_FORM_CONTENT",e[e.DRAFT_LONG_FORM_CONTENT=30024]="DRAFT_LONG_FORM_CONTENT",e[e.APPLICATION_SPECIFIC_DATA=30078]="APPLICATION_SPECIFIC_DATA",e[e.LIVE_EVENT=30311]="LIVE_EVENT",e[e.CLASSIFIED_LISTING=30402]="CLASSIFIED_LISTING",e[e.DRAFT_CLASSIFIED_LISTING=30403]="DRAFT_CLASSIFIED_LISTING",e[e.HANDLER_RECOMMENDATION=31989]="HANDLER_RECOMMENDATION",e[e.HANDLER_INFORMATION=31990]="HANDLER_INFORMATION",e))(Rn||{}),kj=(e=>(e.GITHUB="github",e.TWITTER="twitter",e.MASTODON="mastodon",e.TELEGRAM="telegram",e))(kj||{}),ms=(e=>(e.AUTH="AUTH",e.COUNT="COUNT",e.EOSE="EOSE",e.EVENT="EVENT",e.NOTICE="NOTICE",e.OK="OK",e))(ms||{});function Pj(e){const t=new Uint8Array(Math.ceil(e.length/2));for(let n=0;nt.toString(16).padStart(2,"0")).join("")}function cne(e){const t=[];for(const i of e){const a=new Uint8Array([i.type]);let s;i.type===1?s=new TextEncoder().encode(i.value):i.type===3?s=new Uint32Array([i.value]):s=Pj(i.value);const l=new Uint8Array([s.length]);t.push(a),t.push(l),t.push(s)}let n=t.reduce((i,a)=>i+a.length,0);const r=new Uint8Array(n);let o=0;for(const i of t)r.set(i,o),o+=i.length;return r}function fne(e){let t=0;const n=[];for(;t{let n;return t.type===3?n=t.value:t.type===1?n=new TextDecoder().decode(t.value):n=_j(t.value),{type:t.type,value:n}})}function Oj(e,t){let n;e==="npub"||e==="nsec"||e==="note"||e==="lnurl"?n=Pj(t[0].value):n=cne(t);const r=Yr.toWords(new Uint8Array(n.buffer));return Yr.encode(e,r,1023)}function Wm(e){const{prefix:t,words:n}=Yr.decode(e,1023),r=new Uint8Array(Yr.fromWords(n));let o;if(t==="npub"||t==="nsec"||t==="note"||t==="lnurl")o=[{type:0,value:_j(r)}];else if(t==="nprofile"||t==="nevent"||t==="nrelay"||t==="naddr"){const i=fne(r);o=dne(i)}else throw new Error("Unknown prefix: "+t);return{prefix:t,tlvItems:o}}function pne(e){return vte.decode(e)}function hne(e){const t=e.tags.filter(r=>r[0]==="amount");if(t.length===0)return;const n=[];for(const r of t)r.length===2&&n.push(r[1]);return n&&n.length>0?n:void 0}function mne(e){return["amount",e]}function Tj(e){if(!e.tags)return;let t=!1,n="";for(const r of e.tags)r.find(i=>i==="content-warning")&&(t=!0,r.length===2&&r[0]==="content-warning"||r.length===3&&r[2]==="content-warning"&&r[0]==="l"?n=r[1]:n="N/A");return t?n:void 0}var vne=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/g,Rj=(e=>(e.npub="npub",e.nsec="nsec",e.note="note",e.lnurl="lnurl",e.nprofile="nprofile",e.nevent="nevent",e))(Rj||{});function Ij(e){return/^(wss?):\/\/([a-zA-Z0-9.-]+)(:\d+)?(\/[a-zA-Z0-9_/.-]*)?$/.test(e)}function yne(e,t){if(!e||e==="")return{isValid:!0};if(t===6)try{return JSON.parse(e),{isValid:!0}}catch(n){return console.error(n),{isValid:!1,error:"Invalid JSON format"}}else if(t===2&&!Ij(e))return{isValid:!1,error:`Expected a valid websocket URL, got ${e}.`};return gne(e)?{isValid:!1,error:"HTML tags are not allowed"}:{isValid:!0}}function gne(e){return/<[^>]*>/.test(e)}var Aj=[{name:"www.youtube.com"},{name:"music.youtube.com"},{name:"youtu.be",rewrite:e=>`https://www.youtube.com/watch?v=${e.split("/").pop()}`},{name:"twitch.tv"},{name:"vimeo.com"},{name:"rumble.com"}],bne=["jpg","jpeg","png","gif","webp"],wne=["mp4","webm","ogg"],Sne=Aj.map(e=>e.name.replace(/\./g,"\\.")).join("|"),xne=wne.join("|"),Ene=`https?:\\/\\/(${Sne})\\/\\w+\\/([a-zA-Z0-9_-]+)(?:\\?[a-zA-Z0-9_=&-]+)?|https?:\\/\\/\\S+\\.(${xne})`,Cne=new RegExp(Ene,"gi"),kne=bne.join("|"),Pne=new RegExp(`\\bhttps?:\\/\\/\\S+?\\.(${kne})(?:\\?\\S+)?\\b`,"gi");function Lj(e){if(e===void 0)return;const t=e==null?void 0:e.match(Pne),n=e==null?void 0:e.match(Cne),o=Array.from(e.matchAll(vne),s=>s.slice(1,3)).map(([s,l])=>Object.values(Rj).includes(s)?{type:s,data:l}:null).filter(s=>s!==null),i=/#[a-zA-Z0-9_-]+/gi,a=e==null?void 0:e.match(i);return t&&e&&t.forEach(s=>e=e.replace(s,"")),n&&e&&n.forEach(s=>e=e.replace(s,"")),n&&n.forEach((s,l)=>{const u=Aj.find(c=>s.includes(c.name));u!=null&&u.rewrite&&(n[l]=u.rewrite(s))}),{images:t||void 0,videos:n||void 0,nurls:o&&o.length>0?o:void 0,tags:a||void 0,text:e.trim()}}function _ne(e){if(!e)return;let t=[];for(let n of e){if(!Array.isArray(n)||n.length<2||n.length>3||n[0]!=="a")continue;let r=n[1].split(":");if(r.length!==3)continue;let o=r[0],i=r[1],a=r[2],s;n.length===3&&(s=n[2]),t.push({kind:o,pubkey:i,identifier:a,relay:s})}if(t.length!==0)return t}function One(e){const t=_ne(e.tags);if(t)return t}function Tne(e){const{kind:t,pubkey:n,identifier:r,relay:o}=e;return o?[`a:${t}:${n}:${r}, ${o}`]:[`a:${t}:${n}:${r}`]}function Rne(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({eventId:r[1]}):r.length===3?n.push({eventId:r[1],relayUrl:r[2]}):r.length===4&&n.push({eventId:r[1],relayUrl:r[2],marker:r[3]});return n&&n.length>0?n:void 0}function Ine(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(let r=0;r2&&(r===1?n.push({eventId:t[r][1],relayUrl:"",marker:"mention"}):r>1&&n.push({eventId:t[r][1],relayUrl:"",marker:"reply"}));return n&&n.length>0?n:void 0}function Ane(e){return!e.tags||e.tags.length===0?!1:e.tags.filter(n=>n[0]==="e"&&n.length>2).length===0}function Lne(e){const t=e.tags.filter(n=>n[0]==="expiration");if(t.length!==0)return parseInt(t[0][1])}function jne(e){const t=[],n=e.tags.filter(r=>r[0]==="d");if(n.length!==0){for(const r of n){let o=r[1]||"";t.includes(o)||t.push(o)}return t&&t.length>0?t:void 0}}function Mne(e){return["d",e]}function $ne(e){const t=e.tags.filter(r=>r[0]==="lnurl");if(t.length===0)return;const n=[];for(const r of t)r.length>0&&n.push(r[1]);return n&&n.length>0?n:void 0}function Dne(e){return["lnurl",e]}function zne(e){const t=e.tags.filter(n=>n[0]==="nonce");if(t.length!==0)return[parseInt(t[0][1]),parseInt(t[0][2])]}function Nne(e,t){if(e.hasNonceTag())throw new Error("Event already has a nonce.");if(t.length!==2)throw new Error("Nonce must be an array of 2 numbers: [miningResult, difficulty]");const n=t[0].toString(),r=t[1].toString();return e.addTag(["nonce",n,r]),e}function Bne(e,t){return e.tags=e.tags.filter(n=>n[0]!=="nonce"),e.addNonceTag(t),e}function Fne(e){const t=e.tags.filter(r=>r[0]==="p");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push([r[1]]):r.length===3&&n.push([r[1],r[2]]);return n}function Une(e){const t=e.tags.filter(r=>r[0]==="relays");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({url:r[1],read:!0,write:!0}):r.length===3&&n.push({url:r[1],read:r[2]==="read",write:r[2]==="write"});return n.length>0?n:void 0}function Vne(e){if(e.kind!==1984)throw new Error(`Event is not a report: ${e.kind}. Expected 1984.`);const t=e.tags.filter(s=>s[0]==="p");if(!t||t.length===0)return;let n;const r=e.tags.filter(s=>s[0]==="e");r.length>0&&r[0].length>0&&(n=r[0][1]);let o;t[0].length===3?o=t[0][2]:r.length>0&&r[0].length===3&&(o=r[0][2]);let i;return t[0].length>0&&(i=t[0][1]),!o||!i?void 0:{eventId:n,kind:o,publicKey:i,content:e.content&&e.content!==""?e.content:void 0}}function Hne(e){const{eventId:t,kind:n,publicKey:r}=e;if(!n)throw new Error("Report must have a kind.");if(!r)throw new Error("Report must mention a public key.");if(n==="impersonation"&&t)throw new Error("Impersonation reports should refer to a person, not an event.");const o=[];return t?(o.push(["e",t,n]),r&&o.push(["p",r])):r&&o.push(["p",r,n]),o}function Wne(e){const t=e.tags.filter(n=>n[0]==="subject");if(t.length!==0)return t[0][1]}function jj(e){return e?e.startsWith("Re:"):!1}function qne(e){return jj(e)?e:`Re: ${e}`}function Kne(e){const t=e.tags?e.tags.filter(n=>n[0]==="t"):[];return t.length>0?t.map(n=>n[1]):void 0}function Gne(){const e=wb.utils.randomPrivateKey(),t=wb.getPublicKey(e);return{privateKey:Po(e),publicKey:Po(t)}}function Yne(e){return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}var Mj=new TextEncoder,CP=new TextDecoder("utf-8");function $j(e){const t=qp(Mj.encode(e));return Po(t)}function Dj({callback:e,amount:t,event:n,lnurl:r}){return`${e}?amount=${t}&nostr=${n}&lnurl=${r}`}function Xne(e){if(e.allowsNostr&&e.nostrPubkey)return!0}function Zne(e,t){const n=e.amount?e.amount:void 0,r=e.lnurl?e.lnurl:void 0;if(!n||!r)return!0;const o=pne(t.pr);let i;const a=o.sections.find(s=>s.name==="amount");if(a)i=a.value;else return!1;return!(n&&n.toString()!==i)}function Qne(e){const t=new In(e),n=t.hasPublicKeyTags();if(!n)throw new Error("No pubkey tags found");if(e.kind!==9734)throw new Error("Event is not a zap request");const r=n[0],o=t.hasRelaysTag(),i={pubkey:r,content:"",id:t.id,sig:t.sig,kind:t.kind,tags:t.tags,relays:o};return JSON.stringify(i)}function Jne(e){let t=/,*?((lnurl)([0-9]{1,}[a-z0-9]+){1})/.exec(e.toLowerCase());return t?t[1]:null}function ere(e){if(e=e.trim(),e.toLowerCase().slice(0,6)==="lnurl1"){const{words:t}=Yr.decode(e,2e4),n=new Uint8Array(Yr.fromWords(t));return CP.decode(n)}else if(e.slice(0,9)==="lnurlc://"||e.slice(0,9)==="lnurlw://"||e.slice(0,9)==="lnurlp://"||e.slice(0,10)==="keyauth://"){let[t,n]=e.split("://");return(n.match(/\.onion($|\W)/)?"http":"https")+"://"+n}else if(e.slice(0,8)==="https://"){let t=Jne(e);if(t){const{words:n}=Yr.decode(t,2e4),r=new Uint8Array(Yr.fromWords(n));return CP.decode(r)}return e}throw new Error(`invalid url ${e}`)}function zj(e){const t=Mj.encode(e),n=Yr.toWords(new Uint8Array(t));return Yr.encode("lnurl",n,2e4)}function Nj(e){return e.endsWith(".onion")}function tre(e){const[t,n]=e.split("@");return`${Nj(n)?"http":"https"}://${n}/.well-known/lnurlp/${t}`}function nre(e){const[t,n]=e.split("@");return`${Nj(n)?"http":"https"}://${n}/.well-known/nostr.json?name=${t}`}function rre(e){let t=0;for(let n=0;nl[0]==="nonce");i!==-1?e.tags[i][1]=r.toString():e.tags.push(["nonce",r.toString(),o]);const a=JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]);if(e.id=$j(a),rre(e.id)>=t)return console.log("Proof of work complete"),e.tags=e.tags.filter(l=>l[0]!=="nonce"),e.tags.push(["nonce",r.toString(),o]),e;if(n&&r>=n)return;r++}}function CS(e){return/^[a-z0-9\.\-_\/@]*$/.test(e)}function ire(e){return e.toLowerCase()}function are(e,t){if(e.length!==64)throw new Error("Invalid event hash");const n=wb.sign(e,t);return Po(n)}function sre(e){return e?JSON.stringify(e):""}function lre(e){try{const t=JSON.parse(e);return{name:t.name??null,display_name:t.display_name??null,picture:t.picture??null,banner:t.banner??null,nip05:t.nip05??null,website:t.website??null,about:t.about??null,image:t.image??null,npub:t.npub??null,lud16:t.lud16??null,lud06:t.lud06??null}}catch(t){return console.error("Unable to parse user metadata string",t),null}}var ure=class{constructor(e){if(e){if(!CS(e.identity))throw new Error("Invalid identity. Valid: a-z, 0-9, -, _, @");this.type=e.type,this.identity=ire(e.identity),this.proof=e.proof}}toTag(){switch(this.type){case"github":return["i",`github:${this.identity}`,this.proof];case"twitter":return["i",`twitter:${this.identity}`,this.proof];case"mastodon":return["i",`mastodon:${this.identity}`,this.proof];case"telegram":return["i",`telegram:${this.identity}`,this.proof];default:throw new Error(`Unknown claim type ${this.type}. Valid: github, twitter, mastodon, telegram`)}}fromTag(e){if(Bj(e))return this.type=e[1].split(":")[0],this.identity=e[1].split(":")[1],this.proof=e[2],this}};function Bj(e){return!(e.length!==3||!Object.values(kj).includes(e[1].split(":")[0])||!CS(e[1].split(":")[1]))}function Fj(e){const t=e.tags.filter(r=>r[0]==="i"&&Bj(r));if(t.length===0)return;const n=[];for(const r of t){const o=new ure;o.fromTag(r),n.push(o)}return n}var In=class{constructor(e){this.id=e.id?e.id:"",this.pubkey=e.pubkey?e.pubkey:"",this.created_at=e.created_at?e.created_at:Math.floor(Date.now()/1e3),this.kind=e.kind!=null?e.kind:1,this.tags=e.tags&&e.tags.length>0?e.tags:[],this.content=e.content,this.sig=e.sig?e.sig:""}generateId(){if(this.pubkey==="")throw new Error("Cannot generate event ID without a public key. Set a public key first.");const e=Yne(this.ToObj());this.id=$j(e)}sign(e){if(this.id==="")throw new Error("Cannot sign event without an ID. Generate ID first.");this.pubkey=e.publicKey,this.sig=are(this.id,e.privateKey)}signAndGenerateId(e){this.pubkey=e.publicKey,this.generateId(),this.sign(e)}ToObj(){const e={};for(const[t,n]of Object.entries(this))n!==void 0&&(e[t]=n);return e}toURI(){return encodeURI(JSON.stringify(this.ToObj()))}proofOfWork(e,t){const n=ore(this,e,t);if(n)this.id=n.id,this.tags=n.tags;else throw new Error("Failed to generate proof of work.")}hasMentions(){const e=this.extractContent();if(!e)return;const t=e==null?void 0:e.nurls.filter(n=>n.type==="npub");return t.length>0?t:void 0}setContentWithoutChecks(e){return this.content=e,this}extractContent(){return Lj(this.content)}addTag(e){this.tags||(this.tags=[]),this.tags.push(e)}removeTag(e){this.tags&&(this.tags=this.tags.filter(t=>t[0]!==e[0]&&t[1]!==e[1]))}addEventTag(e){const t=e.relayUrl?e.relayUrl:"";let n=["e",e.eventId];e.marker?n=[...n,t,e.marker]:e.relayUrl&&(n=[...n,e.relayUrl]),this.addTag(n)}hasEventTags(){return Ane(this)?Ine(this):Rne(this)}hasTags(){return Kne(this)}addPublicKeyTag(e,t){const n=["p",e];t&&n.push(t),this.addTag(n)}hasPublicKeyTags(){return Fne(this)}addRelaysTag(e){const t=this.tags.filter(n=>n[0]==="relays");if(t.length===0)this.tags.push(["relays",...e]);else for(const n of t)n.splice(1,0,...e)}hasRelaysTag(){return Une(this)}addEventCoordinatesTag(e){this.addTag(Tne(e))}hasEventCoordinatesTags(){return One(this)}addIdentifierTag(e){this.addTag(Mne(e))}hasIdentifierTags(){return jne(this)}addLnurlTag(e){this.addTag(Dne(e))}hasLnurlTags(){return $ne(this)}addAmountTag(e){this.addTag(mne(e))}hasAmountTags(){return hne(this)}addKindTag(e){this.addTag(["k",e.toString()])}addExpirationTag(e){if(this.hasExpirationTag())throw new Error("Event already has an expiration.");this.addTag(["expiration",e.toString()])}hasExpirationTag(){return Lne(this)}addSubjectTag(e){if(this.kind!==1)throw new Error(`Event kind ${this.kind} should not have a subject.`);if(this.hasSubjectTag())throw new Error("Event already has a subject.");this.addTag(["subject",e])}hasSubjectTag(){return Wne(this)}addNonceTag(e){const t=Nne(this,e);this.tags=t.tags}hasNonceTag(){return zne(this)}replaceNonceTag(e){const t=Bne(this,e);this.tags=t.tags}addContentWarningTag(e){if(this.hasContentWarningTag())throw new Error("Event already has a content warning.");this.addTag(["content-warning",e||""])}hasContentWarningTag(){return Tj(this)}addExternalIdentityClaimTag(e){this.addTag(e.toTag())}hasExternalIdentityClaimTag(){return Fj(this)}addReportTags(e){if(this.kind!==1984)throw new Error(`Event kind ${this.kind} should not have a report. Expected 1984.`);if(this.hasReportTags())throw new Error("Event already has report tags.");Hne(e).forEach(n=>this.addTag(n))}hasReportTags(){return Vne(this)}newZapReceipt(e){if(this.kind!==9734)throw new Error(`Event kind ${this.kind} should not have a zap receipt. Expected 9734.`);return yre({bolt11:e.bolt11,description:e.description,preimage:e.preimage,zapRequest:this})}determineRequiredNIP(){const e=[];return this.hasExternalIdentityClaimTag()&&e.push(39),this.hasExpirationTag()&&e.push(40),e}isReadyToPublish(){if(this.id==="")return{isReady:!1,reason:"Event has no ID."};if(this.pubkey==="")return{isReady:!1,reason:"Event has no pubkey."};if(this.sig==="")return{isReady:!1,reason:"Event has no signature."};const e=yne(this.content,this.kind);return e.isValid?{isReady:!0}:{isReady:!1,reason:e.error}}isReadyToPublishOrThrow(){const e=this.isReadyToPublish();if(!e.isReady)throw new Error(e.reason)}};function cre(e){const t=new In({content:e.text,kind:1});return e.subject&&t.addSubjectTag(e.subject),t}function fre(e){const t=new In({content:e.text,kind:e.isDraft?30024:30023});return e.identifier&&t.addEventTag({eventId:e.identifier}),t}function dre(e){const t=new In({content:e.text,kind:1}),n=new In(e.inResponseTo);if(n.kind!==1)throw new Error("Event you are responding to be SHORT_TEXT_NOTE");const r=n.hasSubjectTag();r?jj(r)?t.addSubjectTag(r):t.addSubjectTag(qne(r)):console.log("Event you are responding to does not have a subject.");const o=n.hasEventTags(),i=o?o.find(l=>l.marker==="root"):void 0;i?(t.addEventTag({eventId:i.eventId,relayUrl:e.relayUrl,marker:"root"}),t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"reply"})):t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"root"});const a=n.hasPublicKeyTags(),s=[];a&&s.push(a),s.push([n.pubkey,e.relayUrl]);for(const l of s)t.addPublicKeyTag(l[0],l[1]);return t}function pre(e){if(e.text!=="+"&&e.text!=="-")throw new Error("Reaction must be either '+' or '-'");const t=new In({content:e.text,kind:7,tags:[]});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function Uj(e){const t=new In({content:JSON.stringify({...e.inResponseTo,relay:e.relayUrl}),kind:6});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function hre(e){const t=new In({content:sre(e.userMetadata),kind:0,tags:[]});if(e.claims)for(const n of e.claims)CS(n.identity)?t.addExternalIdentityClaimTag(n):console.log("Invalid provider name",n.identity);return e.mastodonUrl&&t.addTag(["mostr",e.mastodonUrl]),t}function mre(e){if(!Ij(e.relayUrl))throw new Error("Invalid server URL");const t=new In({content:e.relayUrl,kind:2});return e.nonce&&t.addNonceTag(e.nonce),t}function Vj(e){const t=new In({content:"",kind:9734});return e.relayUrls&&e.relayUrls.length>0&&t.addRelaysTag(e.relayUrls),t.addAmountTag(e.amount.toString()),t.addLnurlTag(e.lnurl),t.addPublicKeyTag(e.recipientPubkey),e.eventId&&t.addEventTag({eventId:e.eventId}),t}function vre(e,t,n){const r=Vj(e);r.signAndGenerateId(n);const o=r.toURI();return{event:r,eventUri:o,invoiceUrl:Dj({callback:t,amount:e.amount,event:o,lnurl:e.lnurl})}}function yre(e){const t=e.zapRequest.tags.find(i=>i[0]==="p"),n=e.zapRequest.tags.find(i=>i[0]==="e"),r=Qne(e.zapRequest),o=new In({content:"",kind:9735,tags:[t,["bolt11",e.bolt11],["description",r]],created_at:e.zapRequest.created_at});return n&&o.addEventTag({eventId:n[1]}),e.preimage&&o.addTag(["preimage",e.preimage]),o}function gre(e){return new In({content:"",kind:22242,tags:[["relay",e.relayUrl],["challenge",e.challenge]]})}function bre(e){const t=new In({content:"",kind:3});for(const n of e.contacts)t.tags.push(["p",n.key,n.relayUrl?n.relayUrl:"",n.petname?n.petname:""]);return t}var Gi=class{constructor(e){this.ids=e==null?void 0:e.ids,this.authors=e==null?void 0:e.authors,this.kinds=e==null?void 0:e.kinds,this["#e"]=e==null?void 0:e["#e"],this["#p"]=e==null?void 0:e["#p"],this["#t"]=e==null?void 0:e["#t"],this.since=e==null?void 0:e.since,this.until=e==null?void 0:e.until,this.limit=e==null?void 0:e.limit}addId(e){this.ids||(this.ids=[]),this.ids.push(e)}addAuthor(e){this.authors||(this.authors=[]),this.authors.push(e)}addKind(e){this.kinds||(this.kinds=[]),this.kinds.push(e)}updateLimit(e){this.limit=e}toObj(){return JSON.parse(JSON.stringify(this))}},wre=class{constructor(e){this.pubkey=(e==null?void 0:e.pubkey)||void 0,this.claims=(e==null?void 0:e.claims)||[],this.data=(e==null?void 0:e.data)||{},this.lastUpdated=(e==null?void 0:e.lastUpdated)||0}loaded(){return this.data!==void 0}hasZapInfo(){return this.lightningZapInfo!==void 0}fromPublicKey(e){return this.pubkey=e,this}fromEvent(e,t=!0){const n=new In(e);if(n.kind!==0){if(t)throw new Error("wrong event kind");return}if(this.pubkey&&this.pubkey!==""&&n.pubkey!==this.pubkey){if(t)throw new Error("wrong event pubkey");return}if(this.pubkey=n.pubkey,this.lastUpdated=n.created_at,n.content&&n.content!==""){const o=lre(n.content);o&&(this.data=o)}const r=Fj(e);return r&&(this.claims=r),this}getNip05Url(){var t;const e=((t=this.data)==null?void 0:t.nip05)||void 0;if(e)return nre(e)}validateWellKnown(e){return e?Object.keys(e.names).find(n=>e.names[n]===this.pubkey)?(this.nip05isValid=!0,!0):(this.nip05isValid=!1,!1):!1}getLud16(){var e;return((e=this.data)==null?void 0:e.lud16)||void 0}getLud16Url(){const e=this.getLud16();if(e)return tre(e)}getLud06(){var e;return((e=this.data)==null?void 0:e.lud06)||void 0}getLud06Url(){const e=this.getLud06();if(e)return ere(e)}getLud16Or06(){const e=this.getLud06();if(e)return{type:"lud06",url:e};const t=this.getLud16();if(t)return{type:"lud16",url:t}}getLud16Or06Url(){const e=this.getLud06Url();if(e)return{type:"lud06",url:e};const t=this.getLud16Url();if(t)return{type:"lud16",url:t}}getMetadataFilter(){const e=new Gi;return e.addAuthor(this.pubkey),e.addKind(0),e}toJson(){return{pubkey:this.pubkey,claims:this.claims,data:this.data,lightningZapInfo:this.lightningZapInfo,lastUpdated:this.lastUpdated,nip05isValid:this.nip05isValid}}fromJson(e){return this.pubkey=e.pubkey,this.claims=e.claims,this.data=e.data,this.lightningZapInfo=e.lightningZapInfo,this.lastUpdated=e.lastUpdated,this.nip05isValid=e.nip05isValid,this}};/** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const Hj=Symbol("Comlink.proxy"),Sre=Symbol("Comlink.endpoint"),xre=Symbol("Comlink.releaseProxy"),Ny=Symbol("Comlink.finalizer"),Ud=Symbol("Comlink.thrown"),Wj=e=>typeof e=="object"&&e!==null||typeof e=="function",Ere={canHandle:e=>Wj(e)&&e[Hj],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Kj(e,t),[n,[n]]},deserialize(e){return e.start(),Yj(e)}},Cre={canHandle:e=>Wj(e)&&Ud in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},qj=new Map([["proxy",Ere],["throw",Cre]]);function kre(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function Kj(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(o){if(!o||!o.data)return;if(!kre(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:i,type:a,path:s}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(pa);let u;try{const c=s.slice(0,-1).reduce((d,g)=>d[g],e),f=s.reduce((d,g)=>d[g],e);switch(a){case"GET":u=f;break;case"SET":c[s.slice(-1)[0]]=pa(o.data.value),u=!0;break;case"APPLY":u=f.apply(c,l);break;case"CONSTRUCT":{const d=new f(...l);u=Ire(d)}break;case"ENDPOINT":{const{port1:d,port2:g}=new MessageChannel;Kj(e,g),u=Rre(d,[d])}break;case"RELEASE":u=void 0;break;default:return}}catch(c){u={value:c,[Ud]:0}}Promise.resolve(u).catch(c=>({value:c,[Ud]:0})).then(c=>{const[f,d]=Qp(c);t.postMessage(Object.assign(Object.assign({},f),{id:i}),d),a==="RELEASE"&&(t.removeEventListener("message",r),Gj(t),Ny in e&&typeof e[Ny]=="function"&&e[Ny]())}).catch(c=>{const[f,d]=Qp({value:new TypeError("Unserializable return value"),[Ud]:0});t.postMessage(Object.assign(Object.assign({},f),{id:i}),d)})}),t.start&&t.start()}function Pre(e){return e.constructor.name==="MessagePort"}function Gj(e){Pre(e)&&e.close()}function Yj(e,t){return Sb(e,[],t)}function sd(e){if(e)throw new Error("Proxy has been released and is not useable")}function Xj(e){return vs(e,{type:"RELEASE"}).then(()=>{Gj(e)})}const Xp=new WeakMap,Zp="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Xp.get(e)||0)-1;Xp.set(e,t),t===0&&Xj(e)});function _re(e,t){const n=(Xp.get(t)||0)+1;Xp.set(t,n),Zp&&Zp.register(e,t,e)}function Ore(e){Zp&&Zp.unregister(e)}function Sb(e,t=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(i,a){if(sd(r),a===xre)return()=>{Ore(o),Xj(e),r=!0};if(a==="then"){if(t.length===0)return{then:()=>o};const s=vs(e,{type:"GET",path:t.map(l=>l.toString())}).then(pa);return s.then.bind(s)}return Sb(e,[...t,a])},set(i,a,s){sd(r);const[l,u]=Qp(s);return vs(e,{type:"SET",path:[...t,a].map(c=>c.toString()),value:l},u).then(pa)},apply(i,a,s){sd(r);const l=t[t.length-1];if(l===Sre)return vs(e,{type:"ENDPOINT"}).then(pa);if(l==="bind")return Sb(e,t.slice(0,-1));const[u,c]=kP(s);return vs(e,{type:"APPLY",path:t.map(f=>f.toString()),argumentList:u},c).then(pa)},construct(i,a){sd(r);const[s,l]=kP(a);return vs(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:s},l).then(pa)}});return _re(o,e),o}function Tre(e){return Array.prototype.concat.apply([],e)}function kP(e){const t=e.map(Qp);return[t.map(n=>n[0]),Tre(t.map(n=>n[1]))]}const Zj=new WeakMap;function Rre(e,t){return Zj.set(e,t),e}function Ire(e){return Object.assign(e,{[Hj]:!0})}function Qp(e){for(const[t,n]of qj)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},Zj.get(e)||[]]}function pa(e){switch(e.type){case"HANDLER":return qj.get(e.name).deserialize(e.value);case"RAW":return e.value}}function vs(e,t,n){return new Promise(r=>{const o=Are();e.addEventListener("message",function i(a){!a.data||!a.data.id||a.data.id!==o||(e.removeEventListener("message",i),r(a.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)})}function Are(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const PP=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const f=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(d=>d(t,f))}},o=()=>t,s={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,s),s},Lre=e=>e?PP(e):PP;var Qj={exports:{}},Jj={},eM={exports:{}},tM={};/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var xl=P;function jre(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mre=typeof Object.is=="function"?Object.is:jre,$re=xl.useState,Dre=xl.useEffect,zre=xl.useLayoutEffect,Nre=xl.useDebugValue;function Bre(e,t){var n=t(),r=$re({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return zre(function(){o.value=n,o.getSnapshot=t,By(o)&&i({inst:o})},[e,n,t]),Dre(function(){return By(o)&&i({inst:o}),e(function(){By(o)&&i({inst:o})})},[e]),Nre(n),n}function By(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Mre(e,n)}catch{return!0}}function Fre(e,t){return t()}var Ure=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Fre:Bre;tM.useSyncExternalStore=xl.useSyncExternalStore!==void 0?xl.useSyncExternalStore:Ure;eM.exports=tM;var Vre=eM.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var qm=P,Hre=Vre;function Wre(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qre=typeof Object.is=="function"?Object.is:Wre,Kre=Hre.useSyncExternalStore,Gre=qm.useRef,Yre=qm.useEffect,Xre=qm.useMemo,Zre=qm.useDebugValue;Jj.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Gre(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Xre(function(){function l(g){if(!u){if(u=!0,c=g,g=r(g),o!==void 0&&a.hasValue){var w=a.value;if(o(w,g))return f=w}return f=g}if(w=f,qre(c,g))return w;var y=r(g);return o!==void 0&&o(w,y)?w:(c=g,f=y)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,o]);var s=Kre(e,i[0],i[1]);return Yre(function(){a.hasValue=!0,a.value=s},[s]),Zre(s),s};Qj.exports=Jj;var Qre=Qj.exports;const Jre=Ve(Qre),{useSyncExternalStoreWithSelector:eoe}=Jre;function toe(e,t=e.getState,n){const r=eoe(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return P.useDebugValue(r),r}const _P=e=>{const t=typeof e=="function"?Lre(e):e,n=(r,o)=>toe(t,r,o);return Object.assign(n,t),n},noe=e=>e?_P(e):_P,nM=100,xb={"wss://relay.shitforce.one":{read:!0,write:!0},"wss://relay.nostr.band":{read:!0,write:!0},"wss://offchain.pub":{read:!0,write:!1},"wss://nos.lol":{read:!0,write:!1},"wss://relay.snort.social":{read:!0,write:!1},"wss://relay.damus.io":{read:!0,write:!0},"wss://soloco.nl":{read:!0,write:!1},"wss://eden.nostr.land":{read:!0,write:!0},"wss://nostr.gruntwerk.org":{read:!0,write:!1},"wss://relay.cryptocculture.com":{read:!0,write:!1},"wss://relay.nostr.bg":{read:!0,write:!1},"wss://relay.nostrich.de":{read:!0,write:!1},"wss://relay.nostr.ro":{read:!0,write:!1}};function roe(){const e=localStorage.getItem("nostr-client:keystore:keystore");if(e)if(e==="localstore"){const t=localStorage.getItem("nostr-client:keystore:public-key"),n=localStorage.getItem("nostr-client:keystore:private-key");if(t&&n)return{keystore:"localstore",publicKey:t,privateKey:n}}else{if(e==="nos2x")return{keystore:"nos2x",publicKey:void 0,privateKey:void 0};if(e==="download")return{keystore:"download",publicKey:void 0,privateKey:void 0}}return{keystore:"none",publicKey:void 0,privateKey:void 0}}function Fy(e){localStorage.setItem("nostr-client:keystore:keystore",e.keystore),e.keystore==="localstore"&&e.publicKey&&e.privateKey?(localStorage.setItem("nostr-client:keystore:public-key",e.publicKey),localStorage.setItem("nostr-client:keystore:private-key",e.privateKey)):e.keystore==="nos2x"||e.keystore}const ooe=500,OP=new Worker(new URL("/nostr-ts/assets/worker-ef9cca43.js",self.location),{type:"module"});function ioe(e,t){let n=null,r=[];return function(o){if(o.data.type==="event:update"){const i=o.data.data.event.id,a=r.findIndex(s=>s.data.type==="event:update"?s.data.data.event.id===i:!1);a!==-1?r[a]=o:r.push(o)}else r.push(o);n||(n=setTimeout(()=>{e(r),r=[],n=null},t))}}const G=noe((e,t)=>({status:"loading",store:Yj(OP),_processEvents:n=>{n.forEach(r=>{const o=r.data;if(o.type!=="RAW")switch(o.type){case"event:notify":break;case"event:new":t().addEvent(o.data,o.view);break;case"event:update":t().updateEvent(o.data);break;case"relay:message":e({relayEvents:[...t().relayEvents,o.data]});break;case"status:change":e({status:o.data}),console.log(`Status changed to ${o.data}`);break;default:console.log(`Unsupported payload type: ${o.type}`)}})},init:async()=>{try{await t().loadKeyStore();const n=ioe(t()._processEvents,ooe);OP.addEventListener("message",n),await t().store.init()}catch(n){console.error("Initialization failed:",n)}},connected:!1,connect:async n=>{t().connected||(await t().store.connect(n),e({connected:!0}))},disconnect:async()=>{await t().store.disconnect(),e({connected:!1})},getRelays:async()=>t().store.getRelays(),updateRelay:async(n,r)=>t().store.updateRelay(n,r),relayAuth:async(n,r)=>{const o=t().keypair;if(!o)throw new Error("Keypair not initialized");const i=t().keystore,a=gre({relayUrl:n,challenge:r});if(a.pubkey=o.publicKey,a.generateId(),i==="localstore"){if(!o.privateKey||o.privateKey==="")throw new Error("No private key available");a.sign({privateKey:o.privateKey,publicKey:o.publicKey})}else if(i==="nos2x")if(window.nostr&&window.nostr.signEvent){const s=await window.nostr.signEvent(a.ToObj());if(!s.sig)throw new Error("No signature");a.sig=s.sig}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore");await t().subscribe({type:pf.AUTH,signedEvent:a.ToObj(),relayUrls:[n],options:{timeoutIn:3e5}})},relayEvents:[],getSubscriptions:async n=>t().store.getSubscriptions(n),subscribe:async n=>t().store.subscribe(n),unsubscribe:async n=>t().store.unsubscribe(n),unsubscribeAll:async()=>t().store.unsubscribeAll(),unsubscribeByToken:async n=>(console.log("=> CLIENT: Unsubscribe by token",n),e(r=>({events:{...r.events,[n]:[]},eventsNewest:{...r.eventsNewest,[n]:0},eventsNewer:{...r.eventsNewer,[n]:[]}})),t().store.unsubscribeByToken(n)),keystore:"none",loadKeyStore:()=>{const n=roe();e({keystore:n.keystore}),n.keystore==="localstore"&&n.publicKey&&n.privateKey&&(e({keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0}),t().store.setUserPubkey(n.publicKey))},saveKeyStore:()=>{const n=t().keystore;if(n==="localstore"){const r=t().keypair;Fy(r?{keystore:n,publicKey:r.publicKey,privateKey:r.privateKey}:{keystore:n})}},resetKeyStore:()=>{Fy({keystore:"none"}),e({keystore:"none",keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1}),t().store.setUserPubkey("")},setKeyStore:n=>{n.keystore==="localstore"?n.publicKey&&n.privateKey&&(e({keystore:n.keystore,keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0}),t().saveKeyStore(),t().store.setUserPubkey(n.publicKey)):n.keystore==="nos2x"?(e({keystore:n.keystore,keypair:{publicKey:n.publicKey||""},keypairIsLoaded:!0}),t().store.setUserPubkey(n.publicKey||"")):console.error(`Unknown keystore ${n.keystore}`)},keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1,getPopularEvents:async()=>t().store.getPopularEvents(),getPopularUsers:async()=>t().store.getPopularUsers(),calculatePopular:async()=>t().store.calculatePopular(),count:async n=>(console.log("=> CLIENT: TODO Count",n),new Promise(r=>r([]))),countEvents:async()=>new Promise(n=>n(0)),getEvent:async(n,r)=>{const o=await t().store.getEvent(n,r);return o&&e(i=>{const a=i.events;return i.events[r.view]=[o],{events:a}}),o},nextQuery:void 0,getEvents:async(n,r)=>{var u,c;if(!n){const f=t().nextQuery;if(!f)throw new Error("No query params provided and no next query set");n={token:f.token,query:f.next}}const{token:o,query:i}=n,a=r||"append",s=i.reqCount?i.reqCount===0:!0;s&&e({nextQuery:void 0});const l=await t().store.getEvents(n);if(t().nextQuery&&o!==((u=t().nextQuery)==null?void 0:u.token)||!l.events||l.events.length===0)return l.next;if(!n.query.reqCount||n.query.reqCount===0){const f=(c=l.events)==null?void 0:c.reduce((d,g)=>d.event.created_at>g.event.created_at?d:g);e({eventsNewest:{...t().eventsNewest,token:(f==null?void 0:f.event.created_at)||0}})}return e(f=>{const d={...f.events};return l.events&&l.events.length>0&&(s||a==="replace"?d[o]=l.events:a==="prepend"?d[o]=[...l.events,...d[o]||[]]:d[o]=[...d[o]||[],...l.events]),{events:d,nextQuery:{token:o,next:l.next}}}),l.next},getEventReplies:async(n,r,o)=>{const i=await t().store.getEventReplies(n,r,o);if(i)return e(a=>{const s=a.events;return a.events[r]=i,{events:s}}),i.length},events:{},eventsNewest:{},mergeNewerEvents:n=>{e(r=>{const o=r.events[n]||[],i=r.eventsNewer[n]||[];i.sort((s,l)=>s.event.created_at>l.event.created_at?-1:1),t().requestInformation({source:"events:related",idsOrKeys:[...i.map(s=>s.event.id)]},{view:n,timeoutIn:1e4,isLive:!0}),t().requestInformation({source:"users",idsOrKeys:[...new Set([...i.map(s=>s.event.pubkey)])]},{view:n,timeoutIn:1e4,isLive:!0});const a=[...i,...o];return{events:{...r.events,[n]:a},eventsNewer:{...r.eventsNewer,[n]:[]}}})},eventsNewer:{},addEvent:(n,r)=>{e(o=>{const i=o.eventsNewest[r]||0,s=(i===0?!0:n.event.created_at>i)?"eventsNewer":"events",l=o[s][r]||[];return l.find(c=>c.event.id===n.event.id)?o:{[s]:{...o[s],[r]:[...l,n]}}})},updateEvent:(n,r)=>{if(r){const i=(t().events[r]||[]).findIndex(a=>a.event.id===n.event.id);if(i!==-1){e(a=>{const s=a.events[r]||[];return s[i]=n,{events:{...a.events,[r]:s}}});return}}else{let o=!1;["events","eventsNewer"].forEach(i=>{if(o)return;const a=i==="events"?t().events:t().eventsNewer;for(const s in a)if(Object.prototype.hasOwnProperty.call(a,s)){const u=a[s].findIndex(c=>c.event.id===n.event.id);if(u!==-1){o=!0,e(c=>{const f=c[i][s]||[];return f[u]=n,{[i]:{...c[i],[s]:f}}});return}}})}},maxEvents:nM,setMaxEvents:async n=>{e({maxEvents:n})},determineApplicableRelays:async n=>{const r=await t().getRelays();if(!r){console.log("=> CLIENT: No relays found");return}const i=(n.relayUrls&&n.relayUrls.length>0?r.filter(a=>{var s;return(s=n.relayUrls)==null?void 0:s.includes(a.url)}):r).filter(a=>a.isReady&&a.write);if(i.length===0){console.log("=> CLIENT: No ready relays found");return}return console.log(`=> CLIENT: Found ${i.length} ready relays`),{relays:i,pow:0}},generateQueueItems:async n=>{const r=await t().determineApplicableRelays(n);if(!r)return;const o=[];for(const i of r.relays){const{relayUrls:a,...s}=n;o.push({...s,id:ote(),relayUrl:i.url,send:!1})}return console.log(o),o},getQueueItems:async()=>t().store.getQueueItems(),getUser:async n=>t().store.getUser(n),addUser:async n=>t().store.addUser(n),updateUser:async(n,r)=>t().store.updateUser(n,r),countUsers:async()=>t().store.countUsers(),eventProofOfWork:async(n,r)=>new Promise(o=>{const i=new Worker(new URL("/nostr-ts/assets/pow-worker-3948d45b.js",self.location),{type:"module"});i.onmessage=function(a){o(a.data.result),i.terminate()},i.postMessage({event:n,bits:r})}),sendEvent:async n=>t().store.sendEvent(n),signEvent:async n=>{const r=t().keystore;if(n.pubkey||(n.pubkey=t().keypair.publicKey),n.id||n.generateId(),r==="localstore"){const o=t().keypair;if(!o)throw new Error("Keypair not initialized");return n.sign({privateKey:o.privateKey||"",publicKey:o.publicKey}),n}else if(r==="nos2x")if(window.nostr&&window.nostr.signEvent){const o=await window.nostr.signEvent(n.ToObj());if(!o.sig)throw new Error("No signature");return n.sig=o.sig,n}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore")},signAndSendEvent:async n=>{const r=t().keypair;if(!r)throw new Error("Keypair not initialized");let o=n.event;o.pubkey=r.publicKey,o.generateId();let i=n.relayUrls;const a=await t().determineApplicableRelays(n);if(!a)throw new Error("No relays available");i=a.relays.map(c=>c.url);let s=n.pow;const l=a.pow;if(s&&s!==0){if(s0){const c=await t().generateQueueItems({...n,relayUrls:i,pow:s});c&&(u=c),await t().store.addQueueItems(u);const f=await t().eventProofOfWork(n.event,s);o=new In(f);for(const d of u)d.event=o,d.powDone=Date.now()}if(o=await t().signEvent(o),o.isReadyToPublishOrThrow(),u.length===0){const c=await t().generateQueueItems({...n,relayUrls:i,pow:s,event:o});c&&(u=c),await t().store.addQueueItems(u)}else for(const c of u)c.event=o,await t().store.updateQueueItem(c);return await t().store.sendQueueItems(u),o.id},followUser:async n=>{await t().store.followUser(n.pubkey)},unfollowUser:async n=>{await t().store.unfollowUser(n)},followingUser:async n=>{const r=await t().store.getUser(n);return(r==null?void 0:r.following)||!1},getAllUsersFollowing:async()=>t().store.getAllUsersFollowing(),blockUser:async n=>{await t().store.blockUser(n.pubkey);const r=t().events;e(o=>{const i={};for(const[a,s]of Object.entries(r))i[a]=s.filter(l=>l.event.pubkey!==n.pubkey);return{events:i}})},unblockUser:async n=>t().store.unblockUser(n),getAllUsersBlocked:async()=>t().store.getAllUsersBlocked(),lastContactsUpdate:async n=>t().store.lastContactsUpdate(n),createList:async n=>t().store.createList(n),updateList:async(n,r)=>t().store.updateList(n,r),deleteList:async n=>t().store.deleteList(n),getAllLists:async()=>t().store.getAllLists(),getList:async n=>t().store.getList(n),getListsWithUser:async n=>t().store.getListsWithUser(n),addUserToList:async(n,r)=>t().store.addUserToList(n,r),removeUserFromList:async(n,r)=>t().store.removeUserFromList(n,r),requestInformation:(n,r)=>t().store.requestInformation(n,r)}));function aoe(){const[e,t,n,r,o]=G(_=>{var O,E;return[_.keystore,_.keypairIsLoaded,_.keypair,((O=_==null?void 0:_.keypair)==null?void 0:O.publicKey)||"",((E=_==null?void 0:_.keypair)==null?void 0:E.privateKey)||""]}),[i,a]=P.useState(!1),[s,l]=P.useState(!1),[u,c]=P.useState(""),[f,d]=P.useState("");P.useEffect(()=>{c(r)},[r]),P.useEffect(()=>{d(o)},[o]),P.useEffect(()=>{e==="nos2x"&&l(!1)},[e]);const g=(s||e==="localstore")&&e!=="nos2x",w=ni(),[y,k]=P.useState(!1),S=()=>{const _=Gne();G.getState().setKeyStore({keystore:"localstore",publicKey:_.publicKey,privateKey:_.privateKey})},b=async _=>{if(k(!0),window.nostr)try{const O=await window.nostr.getPublicKey();G.getState().setKeyStore({keystore:"nos2x",publicKey:O,privateKey:""}),k(!1)}catch(O){console.error("Error loading public key:",O),k(!1)}else{console.log(`Nostr extention not ready, retry ${_}`);const O=_?_+1:1;if(O>2){w({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),k(!1);return}setTimeout(()=>b(O),1e3)}},C=()=>{if(u.length!==64){w({title:"Invalid public key",description:"Public key must be 64 characters long.",status:"error",duration:5e3,isClosable:!0});return}if(f!==""&&f.length!==64){w({title:"Invalid private key",description:"Private key must be 64 characters long.",status:"error",duration:5e3,isClosable:!0});return}u&&f&&(G.getState().setKeyStore({keystore:"localstore",publicKey:u,privateKey:f}),l(!1))},R=()=>{G.getState().resetKeyStore(),d(""),c(""),l(!1)};return m.jsxs(he,{children:[m.jsx(Qr,{size:"lg",children:"Account"}),t?m.jsxs(fe,{fontWeight:"bold",children:["Keypair loaded from ",e,"."]}):m.jsxs(m.Fragment,{children:[m.jsx(fe,{fontWeight:"bold",marginBottom:2,children:"Keypair is not loaded."}),m.jsx(fe,{marginBottom:2,children:"If you generate a new keypair, it will be stored in the browser local store (insecure). Alternatively get nos2x for Chrome, or nos2x-fox for Firefox, and store your keys in the extention (less insecure)."})]}),m.jsx(tt,{marginTop:4,children:!e||(e==="none"?m.jsxs(m.Fragment,{children:[m.jsx(ve,{onClick:S,children:"New keypair"}),m.jsx(ve,{onClick:()=>l(!0),children:"Enter keypair"}),m.jsx(ve,{isLoading:y,onClick:()=>b(),children:"Load from nos2x"})]}):m.jsx(ve,{onClick:R,children:"Reset"}))}),n&&m.jsxs(he,{mt:4,children:[m.jsxs(En,{marginBottom:4,children:[m.jsx(on,{children:"Public key:"}),m.jsx(Ot,{type:"text",value:u,onChange:_=>c(_.target.value),isReadOnly:!0})]}),g&&m.jsxs(En,{marginBottom:4,children:[m.jsx(on,{children:"Private key:"}),m.jsxs(tt,{spacing:2,children:[m.jsx(Ot,{type:i?"text":"password",value:f,onChange:_=>d(_.target.value),isReadOnly:!s}),m.jsx(ve,{size:"sm",onClick:()=>a(!i),children:i?"Hide":"Show"})]})]}),s&&m.jsx(ve,{onClick:C,children:"Save"})]})]})}function soe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Jp=soe(P),loe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},TP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=uoe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return Jp.createElement("svg",loe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Jp.createElement("path",{d:"M2,21L23,12L2,3V10L17,12L2,14V21Z"}))},coe=Jp.memo?Jp.memo(TP):TP,foe=coe;const doe=Ve(foe);function poe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var eh=poe(P),hoe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},RP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=moe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return eh.createElement("svg",hoe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),eh.createElement("path",{d:"M4,9H20V11H4V9M4,13H14V15H4V13Z"}))},voe=eh.memo?eh.memo(RP):RP,yoe=voe;const goe=Ve(yoe);function boe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var th=boe(P),woe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},IP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Soe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return th.createElement("svg",woe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),th.createElement("path",{d:"M4,5H20V7H4V5M4,9H20V11H4V9M4,13H20V15H4V13M4,17H14V19H4V17Z"}))},xoe=th.memo?th.memo(IP):IP,Eoe=xoe;const Coe=Ve(Eoe);function koe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var nh=koe(P),Poe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},AP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=_oe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return nh.createElement("svg",Poe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),nh.createElement("path",{d:"M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z"}))},Ooe=nh.memo?nh.memo(AP):AP,Toe=Ooe;const rM=Ve(Toe);function Roe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var rh=Roe(P),Ioe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},LP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Aoe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return rh.createElement("svg",Ioe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),rh.createElement("path",{d:"M12,6C8.6,6 5.5,7.1 3,9L1.2,6.6C4.2,4.3 8,3 12,3C16,3 19.8,4.3 22.8,6.6L21,9C18.5,7.1 15.4,6 12,6M13,19C13,17.7 13.4,16.4 14.2,15.4C13.5,15.2 12.8,15 12,15C10.7,15 9.4,15.5 8.4,16.2L12,21L13,19.6C13,19.4 13,19.2 13,19M16.8,13.4C17.1,13.3 17.5,13.2 17.9,13.1L19.2,11.4C17.2,9.9 14.7,9 12,9C9.3,9 6.8,9.9 4.8,11.4L6.6,13.8C8.1,12.7 10,12 12,12C13.8,12 15.4,12.5 16.8,13.4M16.5,22.6L17.2,19.8L15,17.9L17.9,17.7L19,15L20.1,17.6L23,17.8L20.8,19.7L21.5,22.5L19,21.1L16.5,22.6Z"}))},Loe=rh.memo?rh.memo(LP):LP,joe=Loe;const Moe=Ve(joe);function $oe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var oh=$oe(P),Doe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},jP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=zoe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return oh.createElement("svg",Doe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),oh.createElement("path",{d:"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z"}))},Noe=oh.memo?oh.memo(jP):jP,Boe=Noe;const oM=Ve(Boe);function Dl(e,t){return e.length<=t?e:e?e.substring(0,t)+"...":"..."}function Foe(e,t,n,r){switch(e){case"NewShortTextNote":return{event:cre({text:t})};case"NewLongFormContent":return{event:fre({text:t})};case"NewShortTextNoteResponse":return r.inResponseTo?{event:dre({text:t,inResponseTo:r.inResponseTo})}:{error:"Response requires inResponseTo"};case"NewRecommendRelay":return{event:mre({relayUrl:n})};case"NewQuoteRepost":return r.inResponseTo?{event:Uj({inResponseTo:r.inResponseTo,relayUrl:n})}:{error:"Quote repost requires inResponseTo"};default:return{error:"Invalid event type"}}}function Uoe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var ih=Uoe(P),Voe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},MP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Hoe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return ih.createElement("svg",Voe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),ih.createElement("path",{d:"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}))},Woe=ih.memo?ih.memo(MP):MP,qoe=Woe;const Uu=Ve(qoe);function Koe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var ah=Koe(P),Goe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},$P=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Yoe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return ah.createElement("svg",Goe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),ah.createElement("path",{d:"M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4Z"}))},Xoe=ah.memo?ah.memo($P):$P,Zoe=Xoe;const iM=Ve(Zoe);function Qoe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var sh=Qoe(P),Joe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},DP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=eie(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return sh.createElement("svg",Joe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),sh.createElement("path",{d:"M23,18V17.5A2.5,2.5 0 0,0 20.5,15A2.5,2.5 0 0,0 18,17.5V18A1,1 0 0,0 17,19V23A1,1 0 0,0 18,24H23A1,1 0 0,0 24,23V19A1,1 0 0,0 23,18M22,18H19V17.5A1.5,1.5 0 0,1 20.5,16A1.5,1.5 0 0,1 22,17.5V18M23,12L2,21V14L17,12L2,10V3L23,12Z"}))},tie=sh.memo?sh.memo(DP):DP,nie=tie;const rie=Ve(nie);function oie(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var lh=oie(P),iie=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},zP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=aie(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return lh.createElement("svg",iie({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),lh.createElement("path",{d:"M2 3V10L17 12L2 14V21L23 12M22 15.5L18.5 19L16.5 17L15 18.5L18.5 22L23.5 17Z"}))},sie=lh.memo?lh.memo(zP):zP,lie=sie;const uie=Ve(lie);function aM({relays:e,onChange:t}){const n=(r,o)=>{t(r,o?"remove":"add")};return m.jsx(he,{p:2,children:e.length===0?m.jsx(fe,{children:"No relays found."}):e.map(r=>m.jsxs(tt,{mb:1,children:[m.jsx(Ne,{as:r.data.isReady?iM:Uu,color:r.data.isReady?"green.500":"red.500"}),m.jsx(fe,{children:r.data.url}),m.jsx(Xa,{}),m.jsx(Ne,{as:r.data.write?uie:rie,color:r.data.write?"green.500":"red.500"}),m.jsx(gA,{isChecked:r.isAssigned,onChange:()=>n(r.data.url,r.isAssigned),isDisabled:r.data.write===!1})]},r.data.url))})}const sM=e=>{const[t,n]=G(T=>[T.connected&&T.keystore!=="none",T.keypairIsLoaded]),[r,o]=P.useState(!1),[i,a]=P.useState([]),[s,l]=G(T=>[T.keystore,T.keypair]),u=t||n?void 0:"Login and connect to send events.",[c,f]=P.useState(e.kind||"NewShortTextNote"),[d,g]=P.useState(""),w=[{label:"NewShortTextNote",icon:m.jsx(Ne,{as:goe}),disabled:e.isResponse||!1},{label:"NewLongFormContent",icon:m.jsx(Ne,{as:Coe}),disabled:e.isResponse||!1},{label:"NewShortTextNoteResponse",icon:m.jsx(Ne,{as:rM}),disabled:c!=="NewShortTextNoteResponse"},{label:"NewRecommendRelay",icon:m.jsx(Ne,{as:Moe}),disabled:e.isResponse||!1},{label:"NewQuoteRepost",icon:m.jsx(Ne,{as:oM}),disabled:c!=="NewQuoteRepost"}],y=ni(),{isOpen:k,onOpen:S,onClose:b}=yn(),[C,R]=P.useState([]),_=C.filter(T=>T.isAssigned).length,O=(T,I)=>{R(C.map(A=>A.data.url===T?{...A,isAssigned:I==="add"}:A))};P.useEffect(()=>{const T=e.relayUrls?e.relayUrls:void 0,I=T&&T.length>0?T[0]:"";G.getState().getRelays().then(A=>{A&&R(A.map(L=>I===L.url&&L.write||L.isReady&&L.write?{data:L,isAssigned:!0}:{data:L,isAssigned:!1}))})},[]);const E=T=>{if(T.content==="")return{error:"Event content is required"};if(s&&s==="none")return{error:"Keystore is required"};if(!l)return{error:"Keypair is required"}},p=()=>{g(""),f("NewShortTextNote"),a([])},v=T=>{a([T]),y({title:"Error",description:T,status:"error",duration:5e3,isClosable:!0})},h=T=>{y({title:"Success",description:T,status:"success",duration:5e3,isClosable:!0})},x=async()=>{o(!0),a([]);const T=C.map($=>$.data.url);if(T.length===0){v("Select at least one relay"),o(!1);return}const I=Foe(c,d,T[0],e);if(I.error){v(I.error),o(!1);return}const A=I.event,L=E(A);if(L!=null&&L.error){v(L.error),o(!1);return}try{const $=await G.getState().signAndSendEvent({event:A,relayUrls:T});$&&(h(`Event sent: ${Dl(A.content,20)}`),p(),o(!1),e.sendCallback&&e.sendCallback($))}catch($){let j="";$ instanceof Error?j=$.message:j=$?$.toString():"Unknown error",v(j),o(!1);return}};return m.jsxs(he,{width:"100%",children:[m.jsxs(En,{marginBottom:4,children:[m.jsx(on,{children:"Content"}),m.jsx(Ot,{type:"text",as:c==="NewLongFormContent"?lS:Ot,value:d,onChange:T=>g(T.target.value),placeholder:"Enter event content"})]}),m.jsx(tt,{marginBottom:4,children:w.map(T=>m.jsx(Lm,{variant:"outline","aria-label":T.label,icon:T.icon,onClick:()=>f(T.label),isActive:c===T.label,isDisabled:T.disabled},T.label))}),i.map((T,I)=>m.jsx(he,{color:"red.500",children:T},I)),u&&m.jsx(he,{color:"red.500",paddingBottom:2,children:u}),k&&m.jsx(aM,{relays:C,onChange:O}),m.jsxs(Qc,{children:[m.jsx(ve,{type:"submit",variant:"solid",onClick:x,leftIcon:m.jsx(Ne,{as:doe}),isDisabled:!t||_===0,isLoading:r,children:"Send"}),m.jsxs(ve,{variant:"outline",onClick:k?b:S,children:["Select relays (",_,")"]})]})]})};function NP(e){const{isOpen:t,onOpen:n,onClose:r}=yn(),o=()=>{r()};return m.jsxs(m.Fragment,{children:[m.jsx(ve,{size:(e==null?void 0:e.buttonSize)||"md",onClick:n,children:"Post message"}),m.jsxs(ir,{isOpen:t,onClose:r,children:[m.jsx(lr,{}),m.jsxs(ar,{children:[m.jsx(sr,{children:"Broadcast to the Network"}),m.jsx(cr,{}),m.jsx(ur,{children:m.jsx(sM,{sendCallback:o})}),m.jsx(af,{children:m.jsx(ve,{colorScheme:"blue",mr:3,onClick:r,children:"Close"})})]})]})]})}const cie=Object.keys(Rn).map(e=>({name:e,value:Rn[e]})),fie=e=>{const t=cie.find(n=>n.value===e);return t?t.name:"Unknown"},die=e=>e.map(fie).join(", ");function pie(){const[e,t]=P.useState([]),[n,r]=P.useState(null),{isOpen:o,onOpen:i,onClose:a}=yn(),s=async()=>{const c=await G.getState().getSubscriptions();c&&t(c)};P.useEffect(()=>{(async()=>{await s()})();const f=setInterval(s,3e3);return()=>clearInterval(f)},[]);const l=m.jsxs(ir,{isOpen:o,onClose:a,size:"xl",children:[" ",m.jsx(lr,{}),m.jsxs(ar,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",m.jsx(sr,{children:"Filters"}),m.jsx(cr,{}),m.jsxs(ur,{overflowY:"auto",children:[" ",m.jsx("pre",{children:n})]})]})]}),u=c=>{var d;const f=c.options&&c.options.view?c.options.view:"";return m.jsxs(Fi,{children:[m.jsx(wt,{children:c.type}),m.jsx(wt,{children:m.jsx(zp,{label:c.relayUrl,children:c.relayUrl.substring(6)})}),m.jsx(wt,{children:m.jsx(fe,{fontSize:"sm",children:c.filters&&c.filters.kinds&&die(c.filters.kinds)})}),m.jsx(wt,{children:m.jsx(ve,{size:"sm",onClick:()=>{r(JSON.stringify(c.filters,null,2)),i()},children:"Show"})}),m.jsx(wt,{children:m.jsx(zp,{label:f,children:Dl(f,5)})}),m.jsx(wt,{children:(d=c.options)==null?void 0:d.timeoutIn}),m.jsx(wt,{children:m.jsx(ve,{size:"sm",onClick:()=>G.getState().unsubscribe([c.id]),children:"Unsubscribe"})})]},c.id)};return m.jsxs(he,{children:[m.jsxs(uf,{variant:"simple",marginBottom:4,children:[m.jsx(zm,{children:m.jsxs(Fi,{children:[m.jsx(St,{children:"Type"}),m.jsx(St,{children:"Relay"}),m.jsx(St,{children:"Kind"}),m.jsx(St,{children:"Filter"}),m.jsx(St,{children:"View"}),m.jsx(St,{children:"Timeout"}),m.jsx(St,{children:"Action"})]})}),m.jsx(Nm,{children:e.map(c=>u(c))})]}),l]})}function hie(){const[e,t]=P.useState([]),[n,r]=P.useState(null),[o,i]=P.useState(!1),{isOpen:a,onOpen:s,onClose:l}=yn(),u=async()=>{await G.getState().getRelays().then(w=>{w&&t(w)})};P.useEffect(()=>{u();const w=setInterval(u,2e3);return()=>clearInterval(w)},[]);const c=async w=>{i(!0);const y=!w.read;await G.getState().updateRelay(w.url,{read:y}),await u(),i(!1)},f=async w=>{i(!0);const y=!w.write;await G.getState().updateRelay(w.url,{write:y}),await u(),i(!1)},d=m.jsxs(ir,{isOpen:a,onClose:l,size:"xl",children:[m.jsx(lr,{}),m.jsxs(ar,{maxHeight:"80vh",maxWidth:"80vw",children:[m.jsx(sr,{children:"Relay"}),m.jsx(cr,{}),m.jsx(ur,{overflowY:"auto",children:n&&n.info&&m.jsx("pre",{children:m.jsx("code",{children:JSON.stringify(n.info,null,2)})})})]})]}),g=w=>m.jsxs(Fi,{children:[m.jsx(wt,{children:m.jsx(Ne,{as:w.isReady?iM:Uu,color:w.isReady?"green.500":"red.500"})}),m.jsx(wt,{children:w.url}),m.jsx(wt,{children:m.jsx(ve,{size:"sm",onClick:()=>{r(w),s()},children:"Show"})}),m.jsx(wt,{children:m.jsx(lb,{isChecked:w.read,onChange:()=>c(w),isDisabled:o})}),m.jsx(wt,{children:m.jsx(lb,{isChecked:w.write,onChange:()=>f(w),isDisabled:o})}),m.jsx(wt,{children:w.error})]},w.url);return m.jsxs(he,{children:[m.jsxs(uf,{variant:"simple",marginBottom:4,children:[m.jsx(zm,{children:m.jsxs(Fi,{children:[m.jsx(St,{children:"Ready"}),m.jsx(St,{children:"Url"}),m.jsx(St,{children:"Info"}),m.jsx(St,{children:"Read"}),m.jsx(St,{children:"Write"}),m.jsx(St,{children:"Error"})]})}),m.jsx(Nm,{children:e.map(w=>g(w))})]}),d]})}function mie(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var uh=mie(P),vie=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},BP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=yie(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return uh.createElement("svg",vie({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),uh.createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z"}))},gie=uh.memo?uh.memo(BP):BP,bie=gie;const Uy=Ve(bie);function wie(){const[e,t]=P.useState([]),[n,r]=P.useState(null),{isOpen:o,onOpen:i,onClose:a}=yn(),s=async()=>{await G.getState().getQueueItems().then(d=>{d&&t(d)})};P.useEffect(()=>{s();const d=setInterval(s,3e3);return()=>clearInterval(d)},[]);const l=d=>!!d.error,u=d=>d.error?d.error:"",c=m.jsxs(ir,{isOpen:o,onClose:a,size:"xl",children:[m.jsx(lr,{}),m.jsxs(ar,{maxHeight:"80vh",maxWidth:"80vw",children:[m.jsx(sr,{children:"Queue Item Detail"}),m.jsx(cr,{}),m.jsx(ur,{overflowY:"auto",children:n&&m.jsx("pre",{children:m.jsx("code",{children:JSON.stringify(n,null,2)})})})]})]}),f=d=>m.jsxs(Fi,{children:[m.jsx(wt,{children:d.relayUrl}),m.jsx(wt,{children:m.jsx(zp,{label:d.event.id,children:Dl(d.event.id,5)})}),m.jsx(wt,{children:m.jsxs(tt,{children:[d.pow?m.jsx(fe,{children:d.pow}):m.jsx(fe,{children:"0"}),m.jsx(fe,{children:"/"}),m.jsx(Ne,{as:d.powDone?Uy:Uu})]})}),m.jsx(wt,{children:m.jsx(ve,{size:"sm",onClick:()=>{r(d),i()},children:"Show"})}),m.jsx(wt,{children:m.jsx(Ne,{as:d.send?Uy:Uu,marginRight:1})}),m.jsxs(wt,{children:[m.jsx(Ne,{as:d.accepted?Uy:Uu}),l(d)&&m.jsx(fe,{color:"red.500",children:u(d)})]})]},`${d.event.id}_${d.relayUrl}`);return m.jsxs(he,{children:[m.jsxs(uf,{variant:"simple",marginBottom:4,children:[m.jsx(zm,{children:m.jsxs(Fi,{children:[m.jsx(St,{children:"Relay"}),m.jsx(St,{children:"Event ID"}),m.jsx(St,{children:"POW / Done"}),m.jsx(St,{children:"Info"}),m.jsx(St,{children:"Send"}),m.jsx(St,{children:"Accepted"})]})}),m.jsx(Nm,{children:e.map(d=>({item:d}&&f(d)))})]}),c]})}function Sie(){const{colorMode:e,toggleColorMode:t}=gm(),[n,r]=P.useState(0),[o]=G(L=>[L.relayEvents]),[i,a]=P.useState(0),[s,l]=P.useState(0),[u,c]=P.useState(0),[f,d]=P.useState(0),[g,w]=P.useState(0),y=ni(),k=async()=>{if(G.getState().status==="loading")return;const L=await G.getState().countUsers();L&&r(L);const $=await G.getState().getSubscriptions({isActive:!0});$&&c($.length);const j=await G.getState().getRelays();j&&d(j.length);const M=await G.getState().getQueueItems();M&&w(M.length);const z=await G.getState().getAllUsersBlocked();z&&a(z.length)};P.useEffect(()=>{const L=setInterval(async()=>await k(),2e3);return()=>clearInterval(L)},[]);const S=async(L,$)=>{!L||!$||await G.getState().relayAuth(L,$)};P.useEffect(()=>{const L=o.length;if(L>0){const $=L-s;if($>0){l(L);const j=o.slice(-$);for(const M of j){let z="",N="",D=!0;if(M.data[0]===ms.NOTICE)z=M.data[1],N=`${M.meta.url}`;else if(M.data[0]===ms.OK)D=M.data[2],z=D?"Event accepted":"Event rejected",N=`${M.meta.url}`;else{if(M.data[0]===ms.EOSE)return;if(M.data[0]===ms.COUNT)z="Received count",N=`${M.meta.url} #${M.data[1]}: ${JSON.stringify(M.data[2])} events`;else if(M.data[0]===ms.AUTH){z="Authentication requested",N=`${M.meta.url}`;const F=G.getState().keystore;!F||F==="none"?N+=" but no account is available to sign the challenge.":S(M.meta.url,M.data[1])}}N!==""&&y({title:z,position:"top-right",description:N,status:D?"info":"error",duration:5e3,isClosable:!0})}}}},[o]);const{isOpen:b,onOpen:C,onClose:R}=yn(),_=m.jsxs(ir,{isOpen:b,onClose:R,size:"xl",children:[" ",m.jsx(lr,{}),m.jsxs(ar,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",m.jsx(sr,{children:m.jsx(Qr,{size:"lg",children:"Subscriptions"})}),m.jsx(cr,{}),m.jsx(ur,{overflowY:"auto",children:m.jsx(pie,{})})]})]}),{isOpen:O,onOpen:E,onClose:p}=yn(),v=m.jsxs(ir,{isOpen:O,onClose:p,size:"xl",children:[m.jsx(lr,{}),m.jsxs(ar,{maxHeight:"80vh",maxWidth:"80vw",children:[m.jsx(sr,{children:m.jsx(Qr,{size:"lg",children:"Relays"})}),m.jsx(cr,{}),m.jsx(ur,{overflowY:"auto",children:m.jsx(hie,{})})]})]}),{isOpen:h,onOpen:x,onClose:T}=yn(),I=m.jsxs(ir,{isOpen:h,onClose:T,size:"xl",children:[m.jsx(lr,{}),m.jsxs(ar,{maxHeight:"80vh",maxWidth:"80vw",children:[m.jsx(sr,{children:m.jsx(Qr,{size:"lg",children:"Queue"})}),m.jsx(cr,{}),m.jsx(ur,{overflowY:"auto",children:m.jsx(wie,{})})]})]}),[A]=DX("(max-width: 600px)");return m.jsxs(he,{position:"fixed",bottom:0,left:0,right:0,p:3,backgroundColor:"background",children:[A?m.jsxs(tt,{spacing:4,children:[m.jsxs(ve,{variant:"outline",size:"sm",onClick:t,children:["Toggle ",e==="light"?"Dark":"Light"]}),m.jsx(NP,{buttonSize:"sm"}),m.jsxs(Jw,{children:[m.jsx(tS,{as:ve,size:"sm",children:"Actions"}),m.jsxs(eS,{children:[m.jsx(fo,{children:m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Users:"}),m.jsx(fe,{fontSize:"sm",children:n})]})}),m.jsx(fo,{children:m.jsx(Kt,{as:Vp,to:"/blocked",children:m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Blocked Users:"}),m.jsx(fe,{fontSize:"sm",children:i})]})})}),m.jsx(fo,{children:m.jsx(Kt,{onClick:O?p:E,children:m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Relays:"}),m.jsx(fe,{fontSize:"sm",children:f})]})})}),m.jsx(fo,{children:m.jsx(Kt,{onClick:h?T:x,children:m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Queue:"}),m.jsx(fe,{fontSize:"sm",children:g})]})})}),m.jsx(fo,{children:m.jsx(Kt,{onClick:b?R:C,children:m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Subscriptions:"}),m.jsx(fe,{fontSize:"sm",children:u})]})})}),m.jsx(fo,{children:m.jsx(Kt,{href:"https://github.com/franzos/nostr-ts",children:m.jsxs(fe,{children:["NostrOP source (v","0.0.4",")"]})})})]})]})]}):m.jsx(tt,{spacing:4,children:m.jsxs(m.Fragment,{children:[m.jsxs(ve,{variant:"outline",size:"sm",onClick:t,children:["Toggle ",e==="light"?"Dark":"Light"]}),m.jsx(NP,{buttonSize:"sm"}),m.jsx(Xa,{}),m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Users:"}),m.jsx(fe,{fontSize:"sm",children:n})]}),m.jsx(Kt,{as:Vp,to:"/blocked",children:m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Blocked Users:"}),m.jsx(fe,{fontSize:"sm",children:i})]})}),m.jsx(Kt,{onClick:O?p:E,children:m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Relays:"}),m.jsx(fe,{fontSize:"sm",children:f})]})}),m.jsx(Kt,{onClick:h?T:x,children:m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Queue:"}),m.jsx(fe,{fontSize:"sm",children:g})]})}),m.jsx(Kt,{onClick:b?R:C,children:m.jsxs(tt,{spacing:2,children:[m.jsx(fe,{fontSize:"xs",children:"Subscriptions:"}),m.jsx(fe,{fontSize:"sm",children:u})]})}),m.jsx(Kt,{href:"https://github.com/franzos/nostr-ts",children:m.jsxs(fe,{fontSize:"xs",children:["NostrOP v","0.0.4"]})})]})}),_,v,I]})}function ou({label:e,value:t,to:n,leftIcon:r}){return m.jsx(Kt,{as:Vp,to:n,w:"100%",padding:2,borderRadius:5,bg:"blackAlpha.50",border:"1px solid",borderColor:"whiteAlpha.100",_hover:{backgroundColor:"blackAlpha.400"},_activeLink:{backgroundColor:"blackAlpha.300"},children:m.jsxs(tt,{children:[r,m.jsx(fe,{fontSize:"md",fontWeight:"bold",children:e}),t&&m.jsx(fe,{fontSize:"md",children:t})]})})}function xie(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var ch=xie(P),Eie=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},FP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Cie(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return ch.createElement("svg",Eie({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),ch.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M3,13V18L3,20H10V18H5V13H3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M14,15H20V19H14V15Z"}))},kie=ch.memo?ch.memo(FP):FP,Pie=kie;const _ie=Ve(Pie);function Oie(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var fh=Oie(P),Tie=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},UP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Rie(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return fh.createElement("svg",Tie({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),fh.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3.88,13.46L2.46,14.88L4.59,17L2.46,19.12L3.88,20.54L6,18.41L8.12,20.54L9.54,19.12L7.41,17L9.54,14.88L8.12,13.46L6,15.59L3.88,13.46M14,15H20V19H14V15Z"}))},Iie=fh.memo?fh.memo(UP):UP,Aie=Iie;const Lie=Ve(Aie);function jie(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var dh=jie(P),Mie=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},VP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=$ie(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return dh.createElement("svg",Mie({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),dh.createElement("path",{d:"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"}))},Die=dh.memo?dh.memo(VP):VP,zie=Die;const Nie=Ve(zie);function Bie(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var ph=Bie(P),Fie=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},HP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Uie(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return ph.createElement("svg",Fie({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),ph.createElement("path",{d:"M11 10V12H9V14H7V12H5.8C5.4 13.2 4.3 14 3 14C1.3 14 0 12.7 0 11S1.3 8 3 8C4.3 8 5.4 8.8 5.8 10H11M3 10C2.4 10 2 10.4 2 11S2.4 12 3 12 4 11.6 4 11 3.6 10 3 10M16 14C18.7 14 24 15.3 24 18V20H8V18C8 15.3 13.3 14 16 14M16 12C13.8 12 12 10.2 12 8S13.8 4 16 4 20 5.8 20 8 18.2 12 16 12Z"}))},Vie=ph.memo?ph.memo(HP):HP,Hie=Vie;const Wie=Ve(Hie);function qie(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var hh=qie(P),Kie=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},WP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Gie(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return hh.createElement("svg",Kie({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),hh.createElement("path",{d:"M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"}))},Yie=hh.memo?hh.memo(WP):WP,Xie=Yie;const lM=Ve(Xie);function Zie(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var mh=Zie(P),Qie=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},qP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Jie(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return mh.createElement("svg",Qie({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),mh.createElement("path",{d:"M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z"}))},eae=mh.memo?mh.memo(qP):qP,tae=eae;const uM=Ve(tae);function nae(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var vh=nae(P),rae=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},KP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=oae(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return vh.createElement("svg",rae({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),vh.createElement("path",{d:"M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.09 20.21,11.09 20.42,11.3L21.7,12.58C21.91,12.79 21.91,13.14 21.7,13.35M12,18.94L18.06,12.88L20.11,14.93L14.06,21H12V18.94M12,14C7.58,14 4,15.79 4,18V20H10V18.11L14,14.11C13.34,14.03 12.67,14 12,14M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4Z"}))},iae=vh.memo?vh.memo(KP):KP,aae=iae;const sae=Ve(aae);function Vd(e){return Object.entries(e).map(([t,{read:n,write:r}])=>({url:t,read:n,write:r}))}function lae({isOpen:e,onClose:t}){const[n,r]=P.useState(Vd(xb)),[o,i]=P.useState(""),[a,s]=P.useState(!1),[l,u]=P.useState(!1),c=ni(),f=async w=>{if(s(!0),window.nostr&&window.nostr.getRelays)try{const y=await window.nostr.getRelays();r(Vd(y)),s(!1)}catch(y){console.error("Error loading relays:",y);let k="Unknown error";y instanceof Error&&(k=y.message),c({title:"Error loading relays",description:k,status:"error",duration:5e3,isClosable:!0}),s(!1)}else{console.log(`Nostr extention not ready, retry ${w}`);const y=w?w+1:1;if(y>2){c({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),s(!1);return}setTimeout(()=>f(y),1e3)}},d=()=>{r(Vd(xb))};P.useEffect(()=>{const w=localStorage.getItem("nostr-client:relays");w&&r(JSON.parse(w))},[]);const g=async()=>{u(!0),localStorage.setItem("nostr-client:relays",JSON.stringify(n)),await G.getState().connect(n),u(!1),t()};return m.jsxs(ir,{isOpen:e,onClose:t,children:[m.jsx(lr,{}),m.jsxs(ar,{children:[m.jsx(sr,{children:"Connect to Relay(s)"}),m.jsx(cr,{}),m.jsxs(ur,{children:[m.jsxs(fe,{children:["You can find a list of relays in the nostr-ts repository",m.jsx(Kt,{marginLeft:1,href:"https://github.com/franzos/nostr-ts/blob/master/discovered-relays.json",isExternal:!0,color:"blue.500",children:"github.com/franzos/nostr-ts"}),",",m.jsx(Kt,{marginLeft:1,marginRight:1,href:"https://nostr.info/relays/",isExternal:!0,color:"blue.500",children:"nostr.info"}),"and elsewhere."]}),m.jsx(Ra,{spacing:3,width:"100%",children:n&&n.map(w=>m.jsxs(eb,{width:"100%",alignItems:"center",py:2,children:[m.jsx(fe,{flex:"1",marginLeft:"2",children:w.url}),m.jsx(ve,{ml:"auto",onClick:()=>{const y=n.filter(k=>k.url!==w.url);r(y)},children:"Remove"})]},w.url))}),m.jsxs(eb,{direction:"row",alignItems:"center",pt:4,children:[m.jsx(Ot,{flex:"1",value:o,onChange:w=>i(w.target.value),placeholder:"Enter new relay URL"}),m.jsx(ve,{ml:2,onClick:()=>{o.trim()!==""&&(r([...n,{url:o,read:!0,write:!0}]),i(""))},children:"Add"})]}),m.jsxs(Qc,{children:[m.jsx(ve,{isLoading:a,onClick:()=>f(),size:"xs",marginTop:2,children:"Load from nos2x"}),m.jsx(ve,{isLoading:a,onClick:d,size:"xs",marginTop:2,children:"Reset"})]})]}),m.jsx(af,{children:m.jsx(ve,{variant:"outline",isDisabled:n.length===0,isLoading:l,onClick:g,children:"Connect"})})]})]})}const cM="/nostr-ts/assets/logo-2c2a6c00.svg";function uae(){const[e,t,n]=G(f=>{var d;return[f.connected,f.keystore,((d=f.keypair)==null?void 0:d.publicKey)||""]}),[r,o]=P.useState(0),{isOpen:i,onOpen:a,onClose:s}=yn(),l=async()=>{if(!G.getState().connected)return;const f=await G.getState().getAllUsersFollowing();f&&o(f.length)},u=async()=>{await G.getState().connect(Vd(xb))};P.useEffect(()=>{const f=setInterval(l,1e3);return u(),()=>clearInterval(f)},[]);const c=m.jsxs(Ra,{align:"start",spacing:5,children:[m.jsx(ou,{label:"Home",to:"/",leftIcon:m.jsx(Ne,{as:Nie,marginRight:1})}),e&&m.jsxs(m.Fragment,{children:[m.jsx(ou,{label:"Following",value:r,to:"/following",leftIcon:m.jsx(Ne,{as:lM,marginRight:1})}),m.jsx(ou,{label:"Lists",to:"/lists",leftIcon:m.jsx(Ne,{as:uM,marginRight:1})}),n&&n!==""&&m.jsx(ou,{label:"Profile",to:"/profile",leftIcon:m.jsx(Ne,{as:sae,marginRight:1})})]}),m.jsx(ou,{label:"Account",value:t,to:"/account",leftIcon:m.jsx(Ne,{as:Wie,marginRight:1})}),e?m.jsxs(ve,{w:"100%",variant:"outline",onClick:G.getState().disconnect,children:[m.jsx(Ne,{as:Lie,marginRight:1}),"Disconnect"]}):m.jsx(ve,{w:"100%",variant:"solid",onClick:a,leftIcon:m.jsx(Ne,{as:_ie}),children:"Connect to relay(s)"})]});return m.jsxs(m.Fragment,{children:[m.jsxs(dL,{maxW:"8xl",p:5,marginBottom:14,children:[m.jsxs(Ra,{spacing:5,align:"stretch",children:[m.jsx(Ra,{spacing:1,align:"start",children:m.jsx(Ll,{height:"30px",src:cM})}),m.jsxs(jl,{templateColumns:["1fr","1fr 4fr"],gap:20,children:[c,m.jsx(he,{children:m.jsx(qee,{})})]})]}),lae({isOpen:i,onOpen:a,onClose:s})]}),m.jsx(Sie,{})]})}function cae({data:e,isOpen:t,onClose:n}){const r=`/e/${Oj(ES.NoteIDs,[{type:0,value:e.event.id}])}`,o=e.eventRelayUrls?e.eventRelayUrls[0]:"Unknown (from local DB)";return m.jsxs(ir,{isOpen:t,onClose:n,size:"xl",children:[m.jsx(lr,{}),m.jsxs(ar,{maxHeight:"80vh",maxWidth:"80vw",children:[m.jsx(sr,{children:"Event"}),m.jsx(cr,{}),m.jsxs(ur,{overflowY:"auto",children:[m.jsxs(fe,{children:["Link:"," ",m.jsx(Kt,{as:Oc,to:r,children:r})]}),m.jsxs(fe,{children:["Relay: ",o]}),m.jsx(he,{m:4,children:m.jsx("pre",{children:m.jsx("code",{children:JSON.stringify(e.event,null,2)})})})]})]})]})}function fae({note:e,index:t}){const o=P.useRef(""),i=P.useRef([]),[a]=G(f=>[f.connected]),[s]=G(f=>[f.events[e]?f.events[e][0]:null]),[l,u]=P.useState(!1),c=async(f=0)=>{if(f>20){u(!0);return}await G.getState().getEvent(o.current,{view:e,retryCount:f,relayUrls:i.current})||setTimeout(()=>c(f+1),1e3)};return P.useEffect(()=>{try{const f=Wm(e);for(const d of f.tlvItems)d.type===0?o.current=d.value:d.type===1&&i.current.push(d.value)}catch(f){console.error(f);return}e&&a&&(!t||t<=2)&&c()},[e,t,a]),m.jsx(he,{p:1,m:1,children:s?m.jsx(tv,{data:s,level:0}):l?m.jsxs(fe,{fontSize:"sm",color:"gray.500",children:["Couldn't find ",e,"."]}):m.jsxs(fe,{fontSize:"sm",color:"gray.500",children:["Loading ... ",e]})})}function dae({npub:e}){const[t]=G(f=>[f.status]),n=P.useRef(null),[r,o]=P.useState(""),[i,a]=P.useState(""),[s,l]=P.useState(!1),u=f=>{const d=f.user.data;return d&&d.display_name?`@${d.display_name}`:""},c=async(f,d=0)=>{if(d>20){l(!1);return}const g=await G.getState().getUser(f);g?(o(u(g)),l(!1)):(d===2&&await G.getState().requestInformation({idsOrKeys:[f],source:"users"},{timeoutIn:1e4}),setTimeout(()=>c(f,d+1),1e3))};return P.useEffect(()=>{if(!(!e||!["online","offline"].includes(t)))try{const d=Wm(e).tlvItems.find(g=>g.type===0);d&&(n.current=d.value,a(`/p/${e}`),l(!0),c(n.current))}catch(f){console.error("Error decoding bech32:",f)}},[t,e]),m.jsx(m.Fragment,{children:e?m.jsx(Kt,{as:Vp,to:i,color:"gray.500",children:r===""||s?Dl(e,10):r}):m.jsx(m.Fragment,{children:"..."})})}function pae({text:e}){if(!e)return null;const t=/(https?:\/\/[^\s]+)/g,n=/(?:nostr:)?(note[0-9a-zA-Z]+|nevent[0-9a-zA-Z]+)/g,r=/(?:nostr:)?(npub[0-9a-zA-Z]+|nprofile[0-9a-zA-Z]+)/g,o=/#[a-zA-Z0-9]+/g,i=e.split(/(https?:\/\/[^\s]+|(?:nostr:)?note[0-9a-zA-Z]+|(?:nostr:)?npub[0-9a-zA-Z]+|(?:nostr:)?nprofile[0-9a-zA-Z]+|(?:nostr:)?nevent[0-9a-zA-Z]+|#[a-zA-Z0-9]+)/g);return m.jsx(m.Fragment,{children:i.map((a,s)=>{if(t.test(a))return m.jsx(Kt,{color:"gray.500",href:a,target:"_blank",rel:"noopener noreferrer",children:Dl(a,40)},s);if(n.test(a)){const l=a.split(":").pop();return l&&m.jsx(fae,{note:l,index:s},s)}if(r.test(a)){const l=a.split(":").pop();return m.jsx(dae,{npub:l},s)}return o.test(a)?m.jsx(Kt,{as:Oc,to:`/t/${encodeURIComponent(a.slice(1))}`,color:"gray.500",children:a},s):a})})}function hae({content:e}){return m.jsx(m.Fragment,{children:e&&e!==""&&m.jsx(he,{overflowWrap:"break-word",wordBreak:"break-word",pl:2,pr:2,pt:1,pb:1,background:"blackAlpha.100",borderRadius:4,style:{overflowWrap:"anywhere"},children:m.jsx(pae,{text:e})})})}const kS=({text:e})=>{const t=e||"Just a sec ... Searching the Matrix.";return m.jsxs(he,{textAlign:"center",children:[m.jsx(fe,{children:t}),m.jsx(Im,{p:4,mt:2})]})};function mae({data:e,isOpen:t,sendCallback:n,level:r}){const o=`event-${e.event.id}_replies`,[i,a]=P.useState(!1),[s]=G(u=>[u.events[`event-${e.event.id}_replies`]]),l=async()=>{a(!0);try{await G.getState().getEventReplies(e.event.id,o,!0)}catch(u){console.error(u)}if(s&&s.length>0){await G.getState().requestInformation({source:"events:related",idsOrKeys:[...s.map(c=>c.event.id)]},{timeoutIn:2e4,view:o,isLive:!0});let u=s.map(c=>c.event.pubkey);u=[...new Set(u)],await G.getState().requestInformation({source:"users",idsOrKeys:[...u]},{timeoutIn:1e4,view:o,isLive:!0})}a(!1)};return P.useEffect(()=>{t&&l()},[t]),m.jsxs(m.Fragment,{children:[t&&m.jsx(he,{padding:4,marginBottom:2,marginTop:2,background:"background",borderRadius:4,children:m.jsx(sM,{isResponse:!0,inResponseTo:e.event,relayUrls:e.eventRelayUrls,kind:"NewShortTextNoteResponse",sendCallback:n})}),s&&t&&s.map(u=>{const c=u.user?u.user:{pubkey:u.event.pubkey};return m.jsx(he,{marginLeft:10,mb:1,children:m.jsx(tv,{data:u,level:r+1})},`${u.event.id}_${c.pubkey}_replies`)}),i&&t&&m.jsx(kS,{text:"Just a sec ... Loading replies."})]})}const vae=({contentWarning:e,setShowNSFWContent:t})=>m.jsxs(ve,{size:"sm",width:"100%",overflowWrap:"break-word",wordBreak:"break-all",onClick:()=>t(!0),children:["Show content"," ",e&&e!==""?`(${e})`:"(NSFW)"]});function yae(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var yh=yae(P),gae=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},GP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=bae(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return yh.createElement("svg",gae({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),yh.createElement("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"}))},wae=yh.memo?yh.memo(GP):GP,Sae=wae;const xae=Ve(Sae);function Eae(e){return e?Object.keys(e).filter(t=>t!=="+"&&t!=="-").reduce((t,n)=>(t[n]=e[n],t),{}):{}}const Cae=e=>{const t=new Date,n=new Date(e*1e3),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3),i=Math.floor(o/60),a=Math.floor(i/60);return o<60?`${o} seconds ago`:i<60?`${i} minutes ago`:a<24?`${a} hours ago`:`${n.toLocaleDateString()} ${n.toLocaleTimeString()}`};function kae(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var gh=kae(P),Pae=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},YP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=_ae(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return gh.createElement("svg",Pae({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),gh.createElement("path",{d:"M17.06 11.57C17.65 10.88 18 10 18 9C18 7.14 16.73 5.57 15 5.13V3H13V5H11V3H9V5H6V7H8V17H6V19H9V21H11V19H13V21H15V19C17.21 19 19 17.21 19 15C19 13.55 18.22 12.27 17.06 11.57M10 7H14C15.1 7 16 7.9 16 9S15.1 11 14 11H10V7M15 17H10V13H15C16.1 13 17 13.9 17 15S16.1 17 15 17Z"}))},Oae=gh.memo?gh.memo(YP):YP,Tae=Oae;const Rae=Ve(Tae);function Iae(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var bh=Iae(P),Aae=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},XP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Lae(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return bh.createElement("svg",Aae({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),bh.createElement("path",{d:"M19,15H23V3H19M15,3H6C5.17,3 4.46,3.5 4.16,4.22L1.14,11.27C1.05,11.5 1,11.74 1,12V14A2,2 0 0,0 3,16H9.31L8.36,20.57C8.34,20.67 8.33,20.77 8.33,20.88C8.33,21.3 8.5,21.67 8.77,21.94L9.83,23L16.41,16.41C16.78,16.05 17,15.55 17,15V5C17,3.89 16.1,3 15,3Z"}))},jae=bh.memo?bh.memo(XP):XP,Mae=jae;const $ae=Ve(Mae);function Dae(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var wh=Dae(P),zae=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},ZP=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Nae(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return wh.createElement("svg",zae({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),wh.createElement("path",{d:"M23,10C23,8.89 22.1,8 21,8H14.68L15.64,3.43C15.66,3.33 15.67,3.22 15.67,3.11C15.67,2.7 15.5,2.32 15.23,2.05L14.17,1L7.59,7.58C7.22,7.95 7,8.45 7,9V19A2,2 0 0,0 9,21H18C18.83,21 19.54,20.5 19.84,19.78L22.86,12.73C22.95,12.5 23,12.26 23,12V10M1,21H5V9H1V21Z"}))},Bae=wh.memo?wh.memo(ZP):ZP,Fae=Bae;const Uae=Ve(Fae);function Vae({isReady:e,level:t,repliesCount:n,reactionsCount:r,repostCount:o,zapReceiptCount:i,zapReceiptAmount:a,isReplyOpen:s,onReplyOpen:l,onReplyClose:u,onAction:c}){return m.jsxs(tt,{children:[m.jsx(ve,{size:"xs",variant:"outline",color:"gray.500",colorScheme:"blue",leftIcon:m.jsx(Ne,{as:rM}),onClick:()=>s?u():l(),isDisabled:!e||t>=2,children:n}),m.jsx(ve,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Upvote",leftIcon:m.jsx(Ne,{as:Uae}),onClick:()=>c("reaction","+"),isDisabled:!e,children:(r==null?void 0:r["+"])||0}),m.jsx(ve,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Downvote",leftIcon:m.jsx(Ne,{as:$ae}),onClick:()=>c("reaction","-"),isDisabled:!e,children:(r==null?void 0:r["-"])||0}),m.jsx(ve,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Repost",leftIcon:m.jsx(Ne,{as:oM}),onClick:()=>c("quote"),isDisabled:!e,children:o}),m.jsxs(ve,{size:"xs",variant:"outline",color:"gray.500","aria-label":"ZAP",leftIcon:m.jsx(Ne,{as:Rae}),onClick:()=>c("zap"),isDisabled:!e,children:[i," (",a,")"]})]})}const Hae=({isReady:e,createdAt:t,level:n,repliesCount:r,reactionsCount:o,repostCount:i,zapReceiptCount:a,zapReceiptAmount:s,isReplyOpen:l,onReplyOpen:u,onReplyClose:c,isInfoModalOpen:f,onInfoModalOpen:d,onInfoModalClose:g,onAction:w})=>{const y=Eae(o);return m.jsx(CG,{p:1,pl:2,pr:2,children:m.jsxs(Ra,{align:"stretch",children:[m.jsx(he,{overflowWrap:"break-word",wordBreak:"break-word",children:y&&Object.keys(y).map(k=>m.jsxs(ve,{size:"xs",variant:"outline","aria-label":"Repost",isDisabled:!0,m:.5,children:[k," ",y[k]]},k))}),m.jsx(he,{children:m.jsxs(tt,{children:[m.jsx(Vae,{isReady:e,level:n,repliesCount:r,reactionsCount:o,repostCount:i,zapReceiptCount:a,zapReceiptAmount:s,isReplyOpen:l,onReplyOpen:u,onReplyClose:c,onAction:w}),m.jsx(Xa,{}),m.jsx(fe,{fontSize:12,color:"gray.500",children:Cae(t)}),m.jsx(Lm,{"aria-label":"Event info",size:"xs",variant:"outline",color:"gray.500",icon:m.jsx(Ne,{as:xae}),onClick:()=>f?g():d()})]})})]})})};var fM={},dM={},Je={},Wae=function(t,n,r){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},i.type=n.type||"text/javascript",i.charset=n.charset||"utf8",i.async="async"in n?!!n.async:!0,i.src=t,n.attrs&&qae(i,n.attrs),n.text&&(i.text=""+n.text);var a="onload"in i?QP:Kae;a(i,r),i.onload||QP(i,r),o.appendChild(i)};function qae(e,t){for(var n in t)e.setAttribute(n,t[n])}function QP(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function Kae(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var Gae=function(t){return Yae(t)&&!Xae(t)};function Yae(e){return!!e&&typeof e=="object"}function Xae(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Jae(e)}var Zae=typeof Symbol=="function"&&Symbol.for,Qae=Zae?Symbol.for("react.element"):60103;function Jae(e){return e.$$typeof===Qae}function ese(e){return Array.isArray(e)?[]:{}}function Ic(e,t){return t.clone!==!1&&t.isMergeableObject(e)?El(ese(e),e,t):e}function tse(e,t,n){return e.concat(t).map(function(r){return Ic(r,n)})}function nse(e,t){if(!t.customMerge)return El;var n=t.customMerge(e);return typeof n=="function"?n:El}function rse(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function JP(e){return Object.keys(e).concat(rse(e))}function pM(e,t){try{return t in e}catch{return!1}}function ose(e,t){return pM(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function ise(e,t,n){var r={};return n.isMergeableObject(e)&&JP(e).forEach(function(o){r[o]=Ic(e[o],n)}),JP(t).forEach(function(o){ose(e,o)||(pM(e,o)&&n.isMergeableObject(t[o])?r[o]=nse(o,n)(e[o],t[o],n):r[o]=Ic(t[o],n))}),r}function El(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||tse,n.isMergeableObject=n.isMergeableObject||Gae,n.cloneUnlessOtherwiseSpecified=Ic;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):ise(e,t,n):Ic(t,n)}El.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return El(r,o,n)},{})};var ase=El,hM=ase;Object.defineProperty(Je,"__esModule",{value:!0});Je.parseStartTime=gse;Je.parseEndTime=bse;Je.randomString=wse;Je.queryString=Sse;Je.getSDK=xse;Je.getConfig=Ese;Je.omit=Cse;Je.callPlayer=kse;Je.isMediaStream=Pse;Je.isBlobUrl=_se;Je.supportsWebKitPresentationMode=Ose;var sse=mM(Wae),lse=mM(hM);function mM(e){return e&&e.__esModule?e:{default:e}}function use(e,t){return pse(e)||dse(e,t)||fse(e,t)||cse()}function cse(){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 fse(e,t){if(e){if(typeof e=="string")return e_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e_(e,t)}}function e_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(o)throw i}}return n}}function pse(e){if(Array.isArray(e))return e}var hse=/[?&#](?:start|t)=([0-9hms]+)/,mse=/[?&#]end=([0-9hms]+)/,Eb=/(\d+)(h|m|s)/g,vse=/^\d+$/;function vM(e,t){if(!(e instanceof Array)){var n=e.match(t);if(n){var r=n[1];if(r.match(Eb))return yse(r);if(vse.test(r))return parseInt(r)}}}function yse(e){for(var t=0,n=Eb.exec(e);n!==null;){var r=n,o=use(r,3),i=o[1],a=o[2];a==="h"&&(t+=parseInt(i,10)*60*60),a==="m"&&(t+=parseInt(i,10)*60),a==="s"&&(t+=parseInt(i,10)),n=Eb.exec(e)}return t}function gse(e){return vM(e,hse)}function bse(e){return vM(e,mse)}function wse(){return Math.random().toString(36).substr(2,5)}function Sse(e){return Object.keys(e).map(function(t){return"".concat(t,"=").concat(e[t])}).join("&")}function Vy(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}var ds={};function xse(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:sse.default,i=Vy(t);return i&&r(i)?Promise.resolve(i):new Promise(function(a,s){if(ds[e]){ds[e].push({resolve:a,reject:s});return}ds[e]=[{resolve:a,reject:s}];var l=function(f){ds[e].forEach(function(d){return d.resolve(f)})};if(n){var u=window[n];window[n]=function(){u&&u(),l(Vy(t))}}o(e,function(c){c?(ds[e].forEach(function(f){return f.reject(c)}),ds[e]=null):n||l(Vy(t))})})}function Ese(e,t){return(0,lse.default)(t.config,e.config)}function Cse(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?r-1:0),i=1;i0&&arguments[0]!==void 0?arguments[0]:document.createElement("video"),t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var we={};Object.defineProperty(we,"__esModule",{value:!0});we.canPlay=we.FLV_EXTENSIONS=we.DASH_EXTENSIONS=we.HLS_EXTENSIONS=we.VIDEO_EXTENSIONS=we.AUDIO_EXTENSIONS=we.MATCH_URL_KALTURA=we.MATCH_URL_VIDYARD=we.MATCH_URL_MIXCLOUD=we.MATCH_URL_DAILYMOTION=we.MATCH_URL_TWITCH_CHANNEL=we.MATCH_URL_TWITCH_VIDEO=we.MATCH_URL_WISTIA=we.MATCH_URL_STREAMABLE=we.MATCH_URL_FACEBOOK_WATCH=we.MATCH_URL_FACEBOOK=we.MATCH_URL_VIMEO=we.MATCH_URL_SOUNDCLOUD=we.MATCH_URL_YOUTUBE=void 0;var t_=Je;function Tse(e,t){var n;if(typeof Symbol>"u"||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=Rse(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){n=e[Symbol.iterator]()},n:function(){var u=n.next();return i=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function Rse(e,t){if(e){if(typeof e=="string")return n_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return n_(e,t)}}function n_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nM.length)&&(z=M.length);for(var N=0,D=new Array(z);N"u"||!(Symbol.iterator in Object(M)))){var N=[],D=!0,F=!1,W=void 0;try{for(var H=M[Symbol.iterator](),Y;!(D=(Y=H.next()).done)&&(N.push(Y.value),!(z&&N.length===z));D=!0);}catch(q){F=!0,W=q}finally{try{!D&&H.return!=null&&H.return()}finally{if(F)throw W}}return N}}function w(M){if(Array.isArray(M))return M}function y(M,z){if(!(M instanceof z))throw new TypeError("Cannot call a class as a function")}function k(M,z){for(var N=0;N"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function p(M){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(N){return N.__proto__||Object.getPrototypeOf(N)},p(M)}function v(M,z,N){return z in M?Object.defineProperty(M,z,{value:N,enumerable:!0,configurable:!0,writable:!0}):M[z]=N,M}var h="https://www.youtube.com/iframe_api",x="YT",T="onYouTubeIframeAPIReady",I=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,A=/user\/([a-zA-Z0-9_-]+)\/?/,L=/youtube-nocookie\.com/,$="https://www.youtube-nocookie.com",j=function(M){b(N,M);var z=R(N);function N(){var D;y(this,N);for(var F=arguments.length,W=new Array(F),H=0;H1&&arguments[1]!==void 0?arguments[1]:!1;this.callPlayer("seekTo",F),!W&&!this.props.playing&&this.pause()}},{key:"setVolume",value:function(F){this.callPlayer("setVolume",F*100)}},{key:"setPlaybackRate",value:function(F){this.callPlayer("setPlaybackRate",F)}},{key:"setLoop",value:function(F){this.callPlayer("setLoop",F)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var F=this.props.display,W={width:"100%",height:"100%",display:F};return n.default.createElement("div",{style:W},n.default.createElement("div",{ref:this.ref}))}}]),N}(n.Component);e.default=j,v(j,"displayName","YouTube"),v(j,"canPlay",o.canPlay.youtube)}(Hy)),Hy}var Wy={},o_;function jse(){return o_||(o_=1,function(e){function t(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(E)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return i=function(){return E},E}function a(E){if(E&&E.__esModule)return E;if(E===null||t(E)!=="object"&&typeof E!="function")return{default:E};var p=i();if(p&&p.has(E))return p.get(E);var v={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in E)if(Object.prototype.hasOwnProperty.call(E,x)){var T=h?Object.getOwnPropertyDescriptor(E,x):null;T&&(T.get||T.set)?Object.defineProperty(v,x,T):v[x]=E[x]}return v.default=E,p&&p.set(E,v),v}function s(E,p){var v=Object.keys(E);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(E);p&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(E,x).enumerable})),v.push.apply(v,h)}return v}function l(E){for(var p=1;p"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(E){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},b(E)}function C(E,p,v){return p in E?Object.defineProperty(E,p,{value:v,enumerable:!0,configurable:!0,writable:!0}):E[p]=v,E}var R="https://w.soundcloud.com/player/api.js",_="SC",O=function(E){d(v,E);var p=w(v);function v(){var h;u(this,v);for(var x=arguments.length,T=new Array(x),I=0;I1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seekTo",x*1e3),T||this.pause()}},{key:"setVolume",value:function(x){this.callPlayer("setVolume",x*100)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var x=this.props.display,T={width:"100%",height:"100%",display:x};return n.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:T,frameBorder:0,allow:"autoplay"})}}]),v}(n.Component);e.default=O,C(O,"displayName","SoundCloud"),C(O,"canPlay",o.canPlay.soundcloud),C(O,"loopOnEnded",!0)}(Wy)),Wy}var qy={},i_;function Mse(){return i_||(i_=1,function(e){function t(p){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(h){return typeof h}:t=function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},t(p)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var p=new WeakMap;return i=function(){return p},p}function a(p){if(p&&p.__esModule)return p;if(p===null||t(p)!=="object"&&typeof p!="function")return{default:p};var v=i();if(v&&v.has(p))return v.get(p);var h={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in p)if(Object.prototype.hasOwnProperty.call(p,T)){var I=x?Object.getOwnPropertyDescriptor(p,T):null;I&&(I.get||I.set)?Object.defineProperty(h,T,I):h[T]=p[T]}return h.default=p,v&&v.set(p,h),h}function s(p,v){var h=Object.keys(p);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(p);v&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(p,T).enumerable})),h.push.apply(h,x)}return h}function l(p){for(var v=1;v"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(p){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},b(p)}function C(p,v,h){return v in p?Object.defineProperty(p,v,{value:h,enumerable:!0,configurable:!0,writable:!0}):p[v]=h,p}var R="https://player.vimeo.com/api/player.js",_="Vimeo",O=function(v){return v.replace("/manage/videos","")},E=function(p){d(h,p);var v=w(h);function h(){var x;u(this,h);for(var T=arguments.length,I=new Array(T),A=0;A1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",T),I||this.pause()}},{key:"setVolume",value:function(T){this.callPlayer("setVolume",T)}},{key:"setMuted",value:function(T){this.callPlayer("setMuted",T)}},{key:"setLoop",value:function(T){this.callPlayer("setLoop",T)}},{key:"setPlaybackRate",value:function(T){this.callPlayer("setPlaybackRate",T)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var T=this.props.display,I={width:"100%",height:"100%",overflow:"hidden",display:T};return n.default.createElement("div",{key:this.props.url,ref:this.ref,style:I})}}]),h}(n.Component);e.default=E,C(E,"displayName","Vimeo"),C(E,"canPlay",o.canPlay.vimeo),C(E,"forceLoad",!0)}(qy)),qy}var Ky={},a_;function $se(){return a_||(a_=1,function(e){function t(p){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(h){return typeof h}:t=function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},t(p)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var p=new WeakMap;return i=function(){return p},p}function a(p){if(p&&p.__esModule)return p;if(p===null||t(p)!=="object"&&typeof p!="function")return{default:p};var v=i();if(v&&v.has(p))return v.get(p);var h={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in p)if(Object.prototype.hasOwnProperty.call(p,T)){var I=x?Object.getOwnPropertyDescriptor(p,T):null;I&&(I.get||I.set)?Object.defineProperty(h,T,I):h[T]=p[T]}return h.default=p,v&&v.set(p,h),h}function s(){return s=Object.assign||function(p){for(var v=1;v"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(p){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},S(p)}function b(p,v,h){return v in p?Object.defineProperty(p,v,{value:h,enumerable:!0,configurable:!0,writable:!0}):p[v]=h,p}var C="https://connect.facebook.net/en_US/sdk.js",R="FB",_="fbAsyncInit",O="facebook-player-",E=function(p){f(h,p);var v=g(h);function h(){var x;l(this,h);for(var T=arguments.length,I=new Array(T),A=0;A1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",T),I||this.pause()}},{key:"setVolume",value:function(T){this.callPlayer("setVolume",T)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var T=this.props.config.attributes,I={width:"100%",height:"100%"};return n.default.createElement("div",s({style:I,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"},T))}}]),h}(n.Component);e.default=E,b(E,"displayName","Facebook"),b(E,"canPlay",o.canPlay.facebook),b(E,"loopOnEnded",!0)}(Ky)),Ky}var Gy={},s_;function Dse(){return s_||(s_=1,function(e){function t(_){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(E){return typeof E}:t=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},t(_)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var _=new WeakMap;return i=function(){return _},_}function a(_){if(_&&_.__esModule)return _;if(_===null||t(_)!=="object"&&typeof _!="function")return{default:_};var O=i();if(O&&O.has(_))return O.get(_);var E={},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in _)if(Object.prototype.hasOwnProperty.call(_,v)){var h=p?Object.getOwnPropertyDescriptor(_,v):null;h&&(h.get||h.set)?Object.defineProperty(E,v,h):E[v]=_[v]}return E.default=_,O&&O.set(_,E),E}function s(_,O){if(!(_ instanceof O))throw new TypeError("Cannot call a class as a function")}function l(_,O){for(var E=0;E"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function k(_){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},k(_)}function S(_,O,E){return O in _?Object.defineProperty(_,O,{value:E,enumerable:!0,configurable:!0,writable:!0}):_[O]=E,_}var b="https://cdn.embed.ly/player-0.1.0.min.js",C="playerjs",R=function(_){c(E,_);var O=d(E);function E(){var p;s(this,E);for(var v=arguments.length,h=new Array(v),x=0;x1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",v),h||this.pause()}},{key:"setVolume",value:function(v){this.callPlayer("setVolume",v*100)}},{key:"setLoop",value:function(v){this.callPlayer("setLoop",v)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var v=this.props.url.match(o.MATCH_URL_STREAMABLE)[1],h={width:"100%",height:"100%"};return n.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat(v),frameBorder:"0",scrolling:"no",style:h,allow:"encrypted-media; autoplay; fullscreen;"})}}]),E}(n.Component);e.default=R,S(R,"displayName","Streamable"),S(R,"canPlay",o.canPlay.streamable)}(Gy)),Gy}var Yy={},l_;function zse(){return l_||(l_=1,function(e){function t(p){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(h){return typeof h}:t=function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},t(p)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var p=new WeakMap;return i=function(){return p},p}function a(p){if(p&&p.__esModule)return p;if(p===null||t(p)!=="object"&&typeof p!="function")return{default:p};var v=i();if(v&&v.has(p))return v.get(p);var h={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in p)if(Object.prototype.hasOwnProperty.call(p,T)){var I=x?Object.getOwnPropertyDescriptor(p,T):null;I&&(I.get||I.set)?Object.defineProperty(h,T,I):h[T]=p[T]}return h.default=p,v&&v.set(p,h),h}function s(p,v){var h=Object.keys(p);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(p);v&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(p,T).enumerable})),h.push.apply(h,x)}return h}function l(p){for(var v=1;v"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(p){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},b(p)}function C(p,v,h){return v in p?Object.defineProperty(p,v,{value:h,enumerable:!0,configurable:!0,writable:!0}):p[v]=h,p}var R="https://fast.wistia.com/assets/external/E-v1.js",_="Wistia",O="wistia-player-",E=function(p){d(h,p);var v=w(h);function h(){var x;u(this,h);for(var T=arguments.length,I=new Array(T),A=0;A1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("time",T),I||this.pause()}},{key:"setVolume",value:function(T){this.callPlayer("volume",T)}},{key:"setPlaybackRate",value:function(T){this.callPlayer("playbackRate",T)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var T=this.props.url,I=T&&T.match(o.MATCH_URL_WISTIA)[1],A="wistia_embed wistia_async_".concat(I),L={width:"100%",height:"100%"};return n.default.createElement("div",{id:this.playerID,key:I,className:A,style:L})}}]),h}(n.Component);e.default=E,C(E,"displayName","Wistia"),C(E,"canPlay",o.canPlay.wistia),C(E,"loopOnEnded",!0)}(Yy)),Yy}var Xy={},u_;function Nse(){return u_||(u_=1,function(e){function t(p){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(h){return typeof h}:t=function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},t(p)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var p=new WeakMap;return i=function(){return p},p}function a(p){if(p&&p.__esModule)return p;if(p===null||t(p)!=="object"&&typeof p!="function")return{default:p};var v=i();if(v&&v.has(p))return v.get(p);var h={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in p)if(Object.prototype.hasOwnProperty.call(p,T)){var I=x?Object.getOwnPropertyDescriptor(p,T):null;I&&(I.get||I.set)?Object.defineProperty(h,T,I):h[T]=p[T]}return h.default=p,v&&v.set(p,h),h}function s(p,v){var h=Object.keys(p);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(p);v&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(p,T).enumerable})),h.push.apply(h,x)}return h}function l(p){for(var v=1;v"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(p){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},b(p)}function C(p,v,h){return v in p?Object.defineProperty(p,v,{value:h,enumerable:!0,configurable:!0,writable:!0}):p[v]=h,p}var R="https://player.twitch.tv/js/embed/v1.js",_="Twitch",O="twitch-player-",E=function(p){d(h,p);var v=w(h);function h(){var x;u(this,h);for(var T=arguments.length,I=new Array(T),A=0;A1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",T),I||this.pause()}},{key:"setVolume",value:function(T){this.callPlayer("setVolume",T)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var T={width:"100%",height:"100%"};return n.default.createElement("div",{style:T,id:this.playerID})}}]),h}(n.Component);e.default=E,C(E,"displayName","Twitch"),C(E,"canPlay",o.canPlay.twitch),C(E,"loopOnEnded",!0)}(Xy)),Xy}var Zy={},c_;function Bse(){return c_||(c_=1,function(e){function t(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function($){return typeof $}:t=function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},t(A)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var A=new WeakMap;return i=function(){return A},A}function a(A){if(A&&A.__esModule)return A;if(A===null||t(A)!=="object"&&typeof A!="function")return{default:A};var L=i();if(L&&L.has(A))return L.get(A);var $={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in A)if(Object.prototype.hasOwnProperty.call(A,M)){var z=j?Object.getOwnPropertyDescriptor(A,M):null;z&&(z.get||z.set)?Object.defineProperty($,M,z):$[M]=A[M]}return $.default=A,L&&L.set(A,$),$}function s(A,L){var $=Object.keys(A);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(A);L&&(j=j.filter(function(M){return Object.getOwnPropertyDescriptor(A,M).enumerable})),$.push.apply($,j)}return $}function l(A){for(var L=1;LA.length)&&(L=A.length);for(var $=0,j=new Array(L);$"u"||!(Symbol.iterator in Object(A)))){var $=[],j=!0,M=!1,z=void 0;try{for(var N=A[Symbol.iterator](),D;!(j=(D=N.next()).done)&&($.push(D.value),!(L&&$.length===L));j=!0);}catch(F){M=!0,z=F}finally{try{!j&&N.return!=null&&N.return()}finally{if(M)throw z}}return $}}function w(A){if(Array.isArray(A))return A}function y(A,L){if(!(A instanceof L))throw new TypeError("Cannot call a class as a function")}function k(A,L){for(var $=0;$"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function p(A){return p=Object.setPrototypeOf?Object.getPrototypeOf:function($){return $.__proto__||Object.getPrototypeOf($)},p(A)}function v(A,L,$){return L in A?Object.defineProperty(A,L,{value:$,enumerable:!0,configurable:!0,writable:!0}):A[L]=$,A}var h="https://api.dmcdn.net/all.js",x="DM",T="dmAsyncInit",I=function(A){b($,A);var L=R($);function $(){var j;y(this,$);for(var M=arguments.length,z=new Array(M),N=0;N1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",M),z||this.pause()}},{key:"setVolume",value:function(M){this.callPlayer("setVolume",M)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var M=this.props.display,z={width:"100%",height:"100%",display:M};return n.default.createElement("div",{style:z},n.default.createElement("div",{ref:this.ref}))}}]),$}(n.Component);e.default=I,v(I,"displayName","DailyMotion"),v(I,"canPlay",o.canPlay.dailymotion),v(I,"loopOnEnded",!0)}(Zy)),Zy}var Qy={},f_;function Fse(){return f_||(f_=1,function(e){function t(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(E)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return i=function(){return E},E}function a(E){if(E&&E.__esModule)return E;if(E===null||t(E)!=="object"&&typeof E!="function")return{default:E};var p=i();if(p&&p.has(E))return p.get(E);var v={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in E)if(Object.prototype.hasOwnProperty.call(E,x)){var T=h?Object.getOwnPropertyDescriptor(E,x):null;T&&(T.get||T.set)?Object.defineProperty(v,x,T):v[x]=E[x]}return v.default=E,p&&p.set(E,v),v}function s(E,p){var v=Object.keys(E);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(E);p&&(h=h.filter(function(x){return Object.getOwnPropertyDescriptor(E,x).enumerable})),v.push.apply(v,h)}return v}function l(E){for(var p=1;p"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(E){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},b(E)}function C(E,p,v){return p in E?Object.defineProperty(E,p,{value:v,enumerable:!0,configurable:!0,writable:!0}):E[p]=v,E}var R="https://widget.mixcloud.com/media/js/widgetApi.js",_="Mixcloud",O=function(E){d(v,E);var p=w(v);function v(){var h;u(this,v);for(var x=arguments.length,T=new Array(x),I=0;I1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",x),T||this.pause()}},{key:"setVolume",value:function(x){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var x=this.props,T=x.url,I=x.config,A=T.match(o.MATCH_URL_MIXCLOUD)[1],L={width:"100%",height:"100%"},$=(0,r.queryString)(l(l({},I.options),{},{feed:"/".concat(A,"/")}));return n.default.createElement("iframe",{key:A,ref:this.ref,style:L,src:"https://www.mixcloud.com/widget/iframe/?".concat($),frameBorder:"0",allow:"autoplay"})}}]),v}(n.Component);e.default=O,C(O,"displayName","Mixcloud"),C(O,"canPlay",o.canPlay.mixcloud),C(O,"loopOnEnded",!0)}(Qy)),Qy}var Jy={},d_;function Use(){return d_||(d_=1,function(e){function t(p){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(h){return typeof h}:t=function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},t(p)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var p=new WeakMap;return i=function(){return p},p}function a(p){if(p&&p.__esModule)return p;if(p===null||t(p)!=="object"&&typeof p!="function")return{default:p};var v=i();if(v&&v.has(p))return v.get(p);var h={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in p)if(Object.prototype.hasOwnProperty.call(p,T)){var I=x?Object.getOwnPropertyDescriptor(p,T):null;I&&(I.get||I.set)?Object.defineProperty(h,T,I):h[T]=p[T]}return h.default=p,v&&v.set(p,h),h}function s(p,v){var h=Object.keys(p);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(p);v&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(p,T).enumerable})),h.push.apply(h,x)}return h}function l(p){for(var v=1;v"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(p){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},b(p)}function C(p,v,h){return v in p?Object.defineProperty(p,v,{value:h,enumerable:!0,configurable:!0,writable:!0}):p[v]=h,p}var R="https://play.vidyard.com/embed/v4.js",_="VidyardV4",O="onVidyardAPI",E=function(p){d(h,p);var v=w(h);function h(){var x;u(this,h);for(var T=arguments.length,I=new Array(T),A=0;A1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",T),I||this.pause()}},{key:"setVolume",value:function(T){this.callPlayer("setVolume",T)}},{key:"setPlaybackRate",value:function(T){this.callPlayer("setPlaybackSpeed",T)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.callPlayer("currentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var T=this.props.display,I={width:"100%",height:"100%",display:T};return n.default.createElement("div",{style:I},n.default.createElement("div",{ref:this.ref}))}}]),h}(n.Component);e.default=E,C(E,"displayName","Vidyard"),C(E,"canPlay",o.canPlay.vidyard)}(Jy)),Jy}var eg={},p_;function Vse(){return p_||(p_=1,function(e){function t(_){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(E){return typeof E}:t=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},t(_)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var _=new WeakMap;return i=function(){return _},_}function a(_){if(_&&_.__esModule)return _;if(_===null||t(_)!=="object"&&typeof _!="function")return{default:_};var O=i();if(O&&O.has(_))return O.get(_);var E={},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in _)if(Object.prototype.hasOwnProperty.call(_,v)){var h=p?Object.getOwnPropertyDescriptor(_,v):null;h&&(h.get||h.set)?Object.defineProperty(E,v,h):E[v]=_[v]}return E.default=_,O&&O.set(_,E),E}function s(_,O){if(!(_ instanceof O))throw new TypeError("Cannot call a class as a function")}function l(_,O){for(var E=0;E"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function k(_){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},k(_)}function S(_,O,E){return O in _?Object.defineProperty(_,O,{value:E,enumerable:!0,configurable:!0,writable:!0}):_[O]=E,_}var b="https://cdn.embed.ly/player-0.1.0.min.js",C="playerjs",R=function(_){c(E,_);var O=d(E);function E(){var p;s(this,E);for(var v=arguments.length,h=new Array(v),x=0;x1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",v),h||this.pause()}},{key:"setVolume",value:function(v){this.callPlayer("setVolume",v)}},{key:"setLoop",value:function(v){this.callPlayer("setLoop",v)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var v={width:"100%",height:"100%"};return n.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:v,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}]),E}(n.Component);e.default=R,S(R,"displayName","Kaltura"),S(R,"canPlay",o.canPlay.kaltura)}(eg)),eg}var tg={},h_;function Hse(){return h_||(h_=1,function(e){function t(j){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(z){return typeof z}:t=function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},t(j)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=Je,o=we;function i(){if(typeof WeakMap!="function")return null;var j=new WeakMap;return i=function(){return j},j}function a(j){if(j&&j.__esModule)return j;if(j===null||t(j)!=="object"&&typeof j!="function")return{default:j};var M=i();if(M&&M.has(j))return M.get(j);var z={},N=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in j)if(Object.prototype.hasOwnProperty.call(j,D)){var F=N?Object.getOwnPropertyDescriptor(j,D):null;F&&(F.get||F.set)?Object.defineProperty(z,D,F):z[D]=j[D]}return z.default=j,M&&M.set(j,z),z}function s(){return s=Object.assign||function(j){for(var M=1;M"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(j){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(z){return z.__proto__||Object.getPrototypeOf(z)},S(j)}function b(j,M,z){return M in j?Object.defineProperty(j,M,{value:z,enumerable:!0,configurable:!0,writable:!0}):j[M]=z,j}var C=typeof navigator<"u",R=C&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,_=C&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||R)&&!window.MSStream,O=C&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,E="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",p="Hls",v="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",h="dashjs",x="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",T="flvjs",I=/www\.dropbox\.com\/.+/,A=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,L="https://videodelivery.net/{id}/manifest/video.m3u8",$=function(j){f(z,j);var M=g(z);function z(){var N;l(this,z);for(var D=arguments.length,F=new Array(D),W=0;W1&&arguments[1]!==void 0?arguments[1]:!0;this.player.currentTime=D,F||this.pause()}},{key:"setVolume",value:function(D){this.player.volume=D}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,r.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,r.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(D){try{this.player.playbackRate=D}catch(F){this.props.onError(F)}}},{key:"getDuration",value:function(){if(!this.player)return null;var D=this.player,F=D.duration,W=D.seekable;return F===1/0&&W.length>0?W.end(W.length-1):F}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var D=this.player.buffered;if(D.length===0)return 0;var F=D.end(D.length-1),W=this.getDuration();return F>W?W:F}},{key:"getSource",value:function(D){var F=this.shouldUseHLS(D),W=this.shouldUseDASH(D),H=this.shouldUseFLV(D);if(!(D instanceof Array||(0,r.isMediaStream)(D)||F||W||H))return I.test(D)?D.replace("www.dropbox.com","dl.dropboxusercontent.com"):D}},{key:"render",value:function(){var D=this.props,F=D.url,W=D.playing,H=D.loop,Y=D.controls,q=D.muted,X=D.config,Q=D.width,oe=D.height,pe=this.shouldUseAudio(this.props),re=pe?"audio":"video",ie={width:Q==="auto"?Q:"100%",height:oe==="auto"?oe:"100%"};return n.default.createElement(re,s({ref:this.ref,src:this.getSource(F),style:ie,preload:"auto",autoPlay:W||void 0,controls:Y,muted:q,loop:H},X.attributes),F instanceof Array&&F.map(this.renderSourceElement),X.tracks.map(this.renderTrack))}}]),z}(n.Component);e.default=$,b($,"displayName","FilePlayer"),b($,"canPlay",o.canPlay.file)}(tg)),tg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=P,n=Je,r=we;function o(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(c){return typeof c}:o=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(l)}function i(){if(typeof WeakMap!="function")return null;var l=new WeakMap;return i=function(){return l},l}function a(l){if(l&&l.__esModule)return l;if(l===null||o(l)!=="object"&&typeof l!="function")return{default:l};var u=i();if(u&&u.has(l))return u.get(l);var c={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in l)if(Object.prototype.hasOwnProperty.call(l,d)){var g=f?Object.getOwnPropertyDescriptor(l,d):null;g&&(g.get||g.set)?Object.defineProperty(c,d,g):c[d]=l[d]}return c.default=l,u&&u.set(l,c),c}var s=[{key:"youtube",name:"YouTube",canPlay:r.canPlay.youtube,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Lse())})})},{key:"soundcloud",name:"SoundCloud",canPlay:r.canPlay.soundcloud,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(jse())})})},{key:"vimeo",name:"Vimeo",canPlay:r.canPlay.vimeo,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Mse())})})},{key:"facebook",name:"Facebook",canPlay:r.canPlay.facebook,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a($se())})})},{key:"streamable",name:"Streamable",canPlay:r.canPlay.streamable,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Dse())})})},{key:"wistia",name:"Wistia",canPlay:r.canPlay.wistia,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(zse())})})},{key:"twitch",name:"Twitch",canPlay:r.canPlay.twitch,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Nse())})})},{key:"dailymotion",name:"DailyMotion",canPlay:r.canPlay.dailymotion,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Bse())})})},{key:"mixcloud",name:"Mixcloud",canPlay:r.canPlay.mixcloud,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Fse())})})},{key:"vidyard",name:"Vidyard",canPlay:r.canPlay.vidyard,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Use())})})},{key:"kaltura",name:"Kaltura",canPlay:r.canPlay.kaltura,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Vse())})})},{key:"file",name:"FilePlayer",canPlay:r.canPlay.file,canEnablePIP:function(u){return r.canPlay.file(u)&&(document.pictureInPictureEnabled||(0,n.supportsWebKitPresentationMode)())&&!r.AUDIO_EXTENSIONS.test(u)},lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Hse())})})}];e.default=s})(dM);var Km={},m_=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Wse(e,t){return!!(e===t||m_(e)&&m_(t))}function qse(e,t){if(e.length!==t.length)return!1;for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function C(E){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},C(E)}function R(E,p,v){return p in E?Object.defineProperty(E,p,{value:v,enumerable:!0,configurable:!0,writable:!0}):E[p]=v,E}var _=5e3,O=function(E){g(v,E);var p=y(v);function v(){var h;c(this,v);for(var x=arguments.length,T=new Array(x),I=0;I0&&x<1;if(L){var $=this.player.getDuration();if(!$){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo($*x,I);return}this.player.seekTo(x,I)}},{key:"render",value:function(){var x=this.props.activePlayer;return x?n.default.createElement(x,u({},this.props,{onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError})):null}}]),v}(n.Component);e.default=O,R(O,"displayName","Player"),R(O,"propTypes",o.propTypes),R(O,"defaultProps",o.defaultProps)})(IM);var rg={},y_;function Jse(){return y_||(y_=1,function(e){function t(_){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(E){return typeof E}:t=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},t(_)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(P);function r(){if(typeof WeakMap!="function")return null;var _=new WeakMap;return r=function(){return _},_}function o(_){if(_&&_.__esModule)return _;if(_===null||t(_)!=="object"&&typeof _!="function")return{default:_};var O=r();if(O&&O.has(_))return O.get(_);var E={},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in _)if(Object.prototype.hasOwnProperty.call(_,v)){var h=p?Object.getOwnPropertyDescriptor(_,v):null;h&&(h.get||h.set)?Object.defineProperty(E,v,h):E[v]=_[v]}return E.default=_,O&&O.set(_,E),E}function i(_,O){var E=Object.keys(_);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(_);O&&(p=p.filter(function(v){return Object.getOwnPropertyDescriptor(_,v).enumerable})),E.push.apply(E,p)}return E}function a(_){for(var O=1;O"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function k(_){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},k(_)}function S(_,O,E){return O in _?Object.defineProperty(_,O,{value:E,enumerable:!0,configurable:!0,writable:!0}):_[O]=E,_}var b="64px",C={},R=function(_){c(E,_);var O=d(E);function E(){var p;s(this,E);for(var v=arguments.length,h=new Array(v),x=0;xe.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function xh(e){return xh=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},xh(e)}function _t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AM(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return AM=function(){return e},e}function LM(e){if(e&&e.__esModule)return e;if(e===null||Vu(e)!=="object"&&typeof e!="function")return{default:e};var t=AM();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}var ple=(0,ha.lazy)(function(){return Promise.resolve().then(function(){return LM(Jse())})}),hle=typeof window<"u"&&window.document,mle=typeof Or<"u"&&Or.window&&Or.window.document,vle=Object.keys(bu.propTypes),yle=hle||mle?ha.Suspense:function(){return null},au=[],gle=function(t,n){var r,o;return o=r=function(i){ule(s,i);var a=cle(s);function s(){var l;sle(this,s);for(var u=arguments.length,c=new Array(u),f=0;f0&&arguments[0]!==void 0?arguments[0]:"player";return l.player?l.player.getInternalPlayer(d):null}),_t(hn(l),"seekTo",function(d,g,w){if(!l.player)return null;l.player.seekTo(d,g,w)}),_t(hn(l),"handleReady",function(){l.props.onReady(hn(l))}),_t(hn(l),"getActivePlayer",(0,og.default)(function(d){for(var g=0,w=[].concat(au,ig(t));g=t||E<0||f&&p>=i}function S(){var O=ag();if(k(O))return b(O);s=setTimeout(S,y(O))}function b(O){return s=void 0,d&&r?g(O):(r=o=void 0,a)}function C(){s!==void 0&&clearTimeout(s),u=0,r=l=o=s=void 0}function R(){return s===void 0?a:b(ag())}function _(){var O=ag(),E=k(O);if(r=arguments,o=this,l=O,E){if(s===void 0)return w(l);if(f)return s=setTimeout(S,t),g(l)}return s===void 0&&(s=setTimeout(S,t)),a}return _.cancel=C,_.flush=R,_}function _b(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function jle(e){return!!e&&typeof e=="object"}function Mle(e){return typeof e=="symbol"||jle(e)&&Rle.call(e)==wle}function C_(e){if(typeof e=="number")return e;if(Mle(e))return E_;if(_b(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=_b(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Sle,"");var n=Ele.test(e);return n||Cle.test(e)?kle(e.slice(2),n?2:8):xle.test(e)?E_:+e}var $le=Lle,DM={exports:{}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],o=0;o0?1:0):0};ae.lazySlidesOnLeft=NM;var BM=function(t){return t.centerMode?Math.floor((t.slidesToShow-1)/2)+1+(parseInt(t.centerPadding)>0?1:0):t.slidesToShow};ae.lazySlidesOnRight=BM;var Eh=function(t){return t&&t.offsetWidth||0};ae.getWidth=Eh;var AS=function(t){return t&&t.offsetHeight||0};ae.getHeight=AS;var LS=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r,o,i,a;return r=t.startX-t.curX,o=t.startY-t.curY,i=Math.atan2(o,r),a=Math.round(i*180/Math.PI),a<0&&(a=360-Math.abs(a)),a<=45&&a>=0||a<=360&&a>=315?"left":a>=135&&a<=225?"right":n===!0?a>=35&&a<=135?"up":"down":"vertical"};ae.getSwipeDirection=LS;var jS=function(t){var n=!0;return t.infinite||(t.centerMode&&t.currentSlide>=t.slideCount-1||t.slideCount<=t.slidesToShow||t.currentSlide>=t.slideCount-t.slidesToShow)&&(n=!1),n};ae.canGoNext=jS;var Fle=function(t,n){var r={};return n.forEach(function(o){return r[o]=t[o]}),r};ae.extractObject=Fle;var Ule=function(t){var n=Dle.default.Children.count(t.children),r=t.listRef,o=Math.ceil(Eh(r)),i=t.trackRef&&t.trackRef.node,a=Math.ceil(Eh(i)),s;if(t.vertical)s=o;else{var l=t.centerMode&&parseInt(t.centerPadding)*2;typeof t.centerPadding=="string"&&t.centerPadding.slice(-1)==="%"&&(l*=o/100),s=Math.ceil((o-l)/t.slidesToShow)}var u=r&&AS(r.querySelector('[data-index="0"]')),c=u*t.slidesToShow,f=t.currentSlide===void 0?t.initialSlide:t.currentSlide;t.rtl&&t.currentSlide===void 0&&(f=n-1-t.initialSlide);var d=t.lazyLoadedList||[],g=TS(ft(ft({},t),{},{currentSlide:f,lazyLoadedList:d}));d=d.concat(g);var w={slideCount:n,slideWidth:s,listWidth:o,trackWidth:a,currentSlide:f,slideHeight:u,listHeight:c,lazyLoadedList:d};return t.autoplaying===null&&t.autoplay&&(w.autoplaying="playing"),w};ae.initializedState=Ule;var Vle=function(t){var n=t.waitForAnimate,r=t.animating,o=t.fade,i=t.infinite,a=t.index,s=t.slideCount,l=t.lazyLoad,u=t.currentSlide,c=t.centerMode,f=t.slidesToScroll,d=t.slidesToShow,g=t.useCSS,w=t.lazyLoadedList;if(n&&r)return{};var y=a,k,S,b,C={},R={},_=i?a:zM(a,0,s-1);if(o){if(!i&&(a<0||a>=s))return{};a<0?y=a+s:a>=s&&(y=a-s),l&&w.indexOf(y)<0&&(w=w.concat(y)),C={animating:!0,currentSlide:y,lazyLoadedList:w,targetSlide:y},R={animating:!1,targetSlide:y}}else k=y,y<0?(k=y+s,i?s%f!==0&&(k=s-s%f):k=0):!jS(t)&&y>u?y=k=u:c&&y>=s?(y=i?s:s-1,k=i?0:s-1):y>=s&&(k=y-s,i?s%f!==0&&(k=0):k=s-d),!i&&y+d>=s&&(k=s-d),S=Lc(ft(ft({},t),{},{slideIndex:y})),b=Lc(ft(ft({},t),{},{slideIndex:k})),i||(S===b&&(y=k),S=b),l&&(w=w.concat(TS(ft(ft({},t),{},{currentSlide:y})))),g?(C={animating:!0,currentSlide:k,trackStyle:MS(ft(ft({},t),{},{left:S})),lazyLoadedList:w,targetSlide:_},R={animating:!1,currentSlide:k,trackStyle:Ac(ft(ft({},t),{},{left:b})),swipeLeft:null,targetSlide:_}):C={currentSlide:k,trackStyle:Ac(ft(ft({},t),{},{left:b})),lazyLoadedList:w,targetSlide:_};return{state:C,nextState:R}};ae.slideHandler=Vle;var Hle=function(t,n){var r,o,i,a,s,l=t.slidesToScroll,u=t.slidesToShow,c=t.slideCount,f=t.currentSlide,d=t.targetSlide,g=t.lazyLoad,w=t.infinite;if(a=c%l!==0,r=a?0:(c-f)%l,n.message==="previous")i=r===0?l:u-r,s=f-i,g&&!w&&(o=f-i,s=o===-1?c-1:o),w||(s=d-l);else if(n.message==="next")i=r===0?l:r,s=f+i,g&&!w&&(s=(f+l)%c+r),w||(s=d+l);else if(n.message==="dots")s=n.index*n.slidesToScroll;else if(n.message==="children"){if(s=n.index,w){var y=HM(ft(ft({},t),{},{targetSlide:s}));s>n.currentSlide&&y==="left"?s=s-c:s10)return{scrolling:!0};s&&(b.swipeLength=v);var h=(l?-1:1)*(b.curX>b.startX?1:-1);s&&(h=b.curY>b.startY?1:-1);var x=Math.ceil(y/k),T=LS(n.touchObject,s),I=b.swipeLength;return S||(u===0&&(T==="right"||T==="down")||u+1>=x&&(T==="left"||T==="up")||!jS(n)&&(T==="left"||T==="up"))&&(I=b.swipeLength*c,f===!1&&d&&(d(T),E.edgeDragged=!0)),!g&&C&&(C(T),E.swiped=!0),i?O=p+I*(R/_)*h:l?O=p-I*h:O=p+I*h,s&&(O=p+I*h),E=ft(ft({},E),{},{touchObject:b,swipeLeft:O,trackStyle:Ac(ft(ft({},n),{},{left:O}))}),Math.abs(b.curX-b.startX)10&&(E.swiping=!0,Aa(t)),E}};ae.swipeMove=Kle;var Gle=function(t,n){var r=n.dragging,o=n.swipe,i=n.touchObject,a=n.listWidth,s=n.touchThreshold,l=n.verticalSwiping,u=n.listHeight,c=n.swipeToSlide,f=n.scrolling,d=n.onSwipe,g=n.targetSlide,w=n.currentSlide,y=n.infinite;if(!r)return o&&Aa(t),{};var k=l?u/s:a/s,S=LS(i,l),b={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(f||!i.swipeLength)return b;if(i.swipeLength>k){Aa(t),d&&d(S);var C,R,_=y?w:g;switch(S){case"left":case"up":R=_+Tb(n),C=c?Ob(n,R):R,b.currentDirection=0;break;case"right":case"down":R=_-Tb(n),C=c?Ob(n,R):R,b.currentDirection=1;break;default:C=_}b.triggerSlideHandler=C}else{var O=Lc(n);b.trackStyle=MS(ft(ft({},n),{},{left:O}))}return b};ae.swipeEnd=Gle;var FM=function(t){for(var n=t.infinite?t.slideCount*2:t.slideCount,r=t.infinite?t.slidesToShow*-1:0,o=t.infinite?t.slidesToShow*-1:0,i=[];rr[r.length-1])n=r[r.length-1];else for(var i in r){if(nt.swipeLeft*-1)return r=l,!1}else if(l.offsetLeft-n+Eh(l)/2>t.swipeLeft*-1)return r=l,!1;return!0}),!r)return 0;var a=t.rtl===!0?t.slideCount-t.currentSlide:t.currentSlide,s=Math.abs(r.dataset.index-a)||1;return s}else return t.slidesToScroll};ae.getSlideCount=Tb;var Zm=function(t,n){return n.reduce(function(r,o){return r&&t.hasOwnProperty(o)},!0)?null:console.error("Keys Missing:",t)};ae.checkSpecKeys=Zm;var Ac=function(t){Zm(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var n,r,o=t.slideCount+2*t.slidesToShow;t.vertical?r=o*t.slideHeight:n=VM(t)*t.slideWidth;var i={opacity:1,transition:"",WebkitTransition:""};if(t.useTransform){var a=t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",s=t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",l=t.vertical?"translateY("+t.left+"px)":"translateX("+t.left+"px)";i=ft(ft({},i),{},{WebkitTransform:a,transform:s,msTransform:l})}else t.vertical?i.top=t.left:i.left=t.left;return t.fade&&(i={opacity:1}),n&&(i.width=n),r&&(i.height=r),window&&!window.addEventListener&&window.attachEvent&&(t.vertical?i.marginTop=t.left+"px":i.marginLeft=t.left+"px"),i};ae.getTrackCSS=Ac;var MS=function(t){Zm(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var n=Ac(t);return t.useTransform?(n.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,n.transition="transform "+t.speed+"ms "+t.cssEase):t.vertical?n.transition="top "+t.speed+"ms "+t.cssEase:n.transition="left "+t.speed+"ms "+t.cssEase,n};ae.getTrackAnimateCSS=MS;var Lc=function(t){if(t.unslick)return 0;Zm(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var n=t.slideIndex,r=t.trackRef,o=t.infinite,i=t.centerMode,a=t.slideCount,s=t.slidesToShow,l=t.slidesToScroll,u=t.slideWidth,c=t.listWidth,f=t.variableWidth,d=t.slideHeight,g=t.fade,w=t.vertical,y=0,k,S,b=0;if(g||t.slideCount===1)return 0;var C=0;if(o?(C=-Hu(t),a%l!==0&&n+l>a&&(C=-(n>a?s-(n-a):a%l)),i&&(C+=parseInt(s/2))):(a%l!==0&&n+l>a&&(C=s-a%l),i&&(C=parseInt(s/2))),y=C*u,b=C*d,w?k=n*d*-1+b:k=n*u*-1+y,f===!0){var R,_=r&&r.node;if(R=n+Hu(t),S=_&&_.childNodes[R],k=S?S.offsetLeft*-1:0,i===!0){R=o?n+Hu(t):n,S=_&&_.children[R],k=0;for(var O=0;Ot.currentSlide?t.targetSlide>t.currentSlide+WM(t)?"left":"right":t.targetSlide0&&(a+=1),o&&n%2===0&&(a+=1),a}return o?0:n-1};ae.slidesOnRight=WM;var qM=function(t){var n=t.slidesToShow,r=t.centerMode,o=t.rtl,i=t.centerPadding;if(r){var a=(n-1)/2+1;return parseInt(i)>0&&(a+=1),!o&&n%2===0&&(a+=1),a}return o?n-1:0};ae.slidesOnLeft=qM;var Yle=function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)};ae.canUseDOM=Yle;var Qm={};function Rb(e){"@babel/helpers - typeof";return Rb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rb(e)}Object.defineProperty(Qm,"__esModule",{value:!0});Qm.Track=void 0;var vi=KM(P),sg=KM(Xm),lg=ae;function KM(e){return e&&e.__esModule?e:{default:e}}function Ib(){return Ib=Object.assign||function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ch(e){return Ch=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Ch(e)}function __(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $n(e){for(var t=1;t=t.slideCount,t.centerMode?(i=Math.floor(t.slidesToShow/2),r=(a-t.currentSlide)%t.slideCount===0,a>t.currentSlide-i-1&&a<=t.currentSlide+i&&(n=!0)):n=t.currentSlide<=a&&a=t.slideCount?s=t.targetSlide-t.slideCount:s=t.targetSlide;var l=a===s;return{"slick-slide":!0,"slick-active":n,"slick-center":r,"slick-cloned":o,"slick-current":l}},nue=function(t){var n={};return(t.variableWidth===void 0||t.variableWidth===!1)&&(n.width=t.slideWidth),t.fade&&(n.position="relative",t.vertical?n.top=-t.index*parseInt(t.slideHeight):n.left=-t.index*parseInt(t.slideWidth),n.opacity=t.currentSlide===t.index?1:0,t.useCSS&&(n.transition="opacity "+t.speed+"ms "+t.cssEase+", visibility "+t.speed+"ms "+t.cssEase)),n},cg=function(t,n){return t.key||n},rue=function(t){var n,r=[],o=[],i=[],a=vi.default.Children.count(t.children),s=(0,lg.lazyStartIndex)(t),l=(0,lg.lazyEndIndex)(t);return vi.default.Children.forEach(t.children,function(u,c){var f,d={message:"children",index:c,slidesToScroll:t.slidesToScroll,currentSlide:t.currentSlide};!t.lazyLoad||t.lazyLoad&&t.lazyLoadedList.indexOf(c)>=0?f=u:f=vi.default.createElement("div",null);var g=nue($n($n({},t),{},{index:c})),w=f.props.className||"",y=ug($n($n({},t),{},{index:c}));if(r.push(vi.default.cloneElement(f,{key:"original"+cg(f,c),"data-index":c,className:(0,sg.default)(y,w),tabIndex:"-1","aria-hidden":!y["slick-active"],style:$n($n({outline:"none"},f.props.style||{}),g),onClick:function(b){f.props&&f.props.onClick&&f.props.onClick(b),t.focusOnSelect&&t.focusOnSelect(d)}})),t.infinite&&t.fade===!1){var k=a-c;k<=(0,lg.getPreClones)(t)&&a!==t.slidesToShow&&(n=-k,n>=s&&(f=u),y=ug($n($n({},t),{},{index:n})),o.push(vi.default.cloneElement(f,{key:"precloned"+cg(f,n),"data-index":n,tabIndex:"-1",className:(0,sg.default)(y,w),"aria-hidden":!y["slick-active"],style:$n($n({},f.props.style||{}),g),onClick:function(b){f.props&&f.props.onClick&&f.props.onClick(b),t.focusOnSelect&&t.focusOnSelect(d)}}))),a!==t.slidesToShow&&(n=a+c,n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function kh(e){return kh=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},kh(e)}var mue=function(t){var n;return t.infinite?n=Math.ceil(t.slideCount/t.slidesToScroll):n=Math.ceil((t.slideCount-t.slidesToShow)/t.slidesToScroll)+1,n},vue=function(e){cue(n,e);var t=fue(n);function n(){return lue(this,n),t.apply(this,arguments)}return uue(n,[{key:"clickHandler",value:function(o,i){i.preventDefault(),this.props.clickHandler(o)}},{key:"render",value:function(){for(var o=this.props,i=o.onMouseEnter,a=o.onMouseOver,s=o.onMouseLeave,l=o.infinite,u=o.slidesToScroll,c=o.slidesToShow,f=o.slideCount,d=o.currentSlide,g=mue({slideCount:f,slidesToScroll:u,slidesToShow:c,infinite:l}),w={onMouseEnter:i,onMouseOver:a,onMouseLeave:s},y=[],k=0;k=R&&d<=b:d===R}),O={message:"dots",index:k,slidesToScroll:u,currentSlide:d},E=this.clickHandler.bind(this,O);y=y.concat(ld.default.createElement("li",{key:k,className:_},ld.default.cloneElement(this.props.customPaging(k),{onClick:E})))}return ld.default.cloneElement(this.props.appendDots(y),aue({className:this.props.dotsClass},w))}}]),n}(ld.default.PureComponent);Jm.Dots=vue;var Cl={};function Db(e){"@babel/helpers - typeof";return Db=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Db(e)}Object.defineProperty(Cl,"__esModule",{value:!0});Cl.PrevArrow=Cl.NextArrow=void 0;var rl=XM(P),YM=XM(Xm),yue=ae;function XM(e){return e&&e.__esModule?e:{default:e}}function Ph(){return Ph=Object.assign||function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Oh(e){return Oh=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Oh(e)}var xue=function(e){JM(n,e);var t=e$(n);function n(){return ZM(this,n),t.apply(this,arguments)}return QM(n,[{key:"clickHandler",value:function(o,i){i&&i.preventDefault(),this.props.clickHandler(o,i)}},{key:"render",value:function(){var o={"slick-arrow":!0,"slick-prev":!0},i=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(this.props.currentSlide===0||this.props.slideCount<=this.props.slidesToShow)&&(o["slick-disabled"]=!0,i=null);var a={key:"0","data-role":"none",className:(0,YM.default)(o),style:{display:"block"},onClick:i},s={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},l;return this.props.prevArrow?l=rl.default.cloneElement(this.props.prevArrow,_h(_h({},a),s)):l=rl.default.createElement("button",Ph({key:"0",type:"button"},a)," ","Previous"),l}}]),n}(rl.default.PureComponent);Cl.PrevArrow=xue;var Eue=function(e){JM(n,e);var t=e$(n);function n(){return ZM(this,n),t.apply(this,arguments)}return QM(n,[{key:"clickHandler",value:function(o,i){i&&i.preventDefault(),this.props.clickHandler(o,i)}},{key:"render",value:function(){var o={"slick-arrow":!0,"slick-next":!0},i=this.clickHandler.bind(this,{message:"next"});(0,yue.canGoNext)(this.props)||(o["slick-disabled"]=!0,i=null);var a={key:"1","data-role":"none",className:(0,YM.default)(o),style:{display:"block"},onClick:i},s={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},l;return this.props.nextArrow?l=rl.default.cloneElement(this.props.nextArrow,_h(_h({},a),s)):l=rl.default.createElement("button",Ph({key:"1",type:"button"},a)," ","Next"),l}}]),n}(rl.default.PureComponent);Cl.NextArrow=Eue;var t$=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!Nb||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Tue?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Nb||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=Oue.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),n$=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof kl(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new zue(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof kl(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Nue(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),o$=typeof WeakMap<"u"?new WeakMap:new t$,i$=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Rue.getInstance(),r=new Bue(t,n,this);o$.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){i$.prototype[e]=function(){var t;return(t=o$.get(this))[e].apply(t,arguments)}});var Fue=function(){return typeof Th.ResizeObserver<"u"?Th.ResizeObserver:i$}();const Uue=Object.freeze(Object.defineProperty({__proto__:null,default:Fue},Symbol.toStringTag,{value:"Module"})),Vue=mO(Uue);Object.defineProperty(Ym,"__esModule",{value:!0});Ym.InnerSlider=void 0;var xn=hf(P),Hue=hf($M),Wue=hf($le),que=hf(Xm),yt=ae,Kue=Qm,Gue=Jm,j_=Cl,Yue=hf(Vue);function hf(e){return e&&e.__esModule?e:{default:e}}function Ih(e){"@babel/helpers - typeof";return Ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ih(e)}function Ah(){return Ah=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zue(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function M_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xe(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lh(e){return Lh=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Lh(e)}function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oce=function(e){ece(n,e);var t=tce(n);function n(r){var o;Que(this,n),o=t.call(this,r),Ae(Ie(o),"listRefHandler",function(a){return o.list=a}),Ae(Ie(o),"trackRefHandler",function(a){return o.track=a}),Ae(Ie(o),"adaptHeight",function(){if(o.props.adaptiveHeight&&o.list){var a=o.list.querySelector('[data-index="'.concat(o.state.currentSlide,'"]'));o.list.style.height=(0,yt.getHeight)(a)+"px"}}),Ae(Ie(o),"componentDidMount",function(){if(o.props.onInit&&o.props.onInit(),o.props.lazyLoad){var a=(0,yt.getOnDemandLazySlides)(xe(xe({},o.props),o.state));a.length>0&&(o.setState(function(l){return{lazyLoadedList:l.lazyLoadedList.concat(a)}}),o.props.onLazyLoad&&o.props.onLazyLoad(a))}var s=xe({listRef:o.list,trackRef:o.track},o.props);o.updateState(s,!0,function(){o.adaptHeight(),o.props.autoplay&&o.autoPlay("update")}),o.props.lazyLoad==="progressive"&&(o.lazyLoadTimer=setInterval(o.progressiveLazyLoad,1e3)),o.ro=new Yue.default(function(){o.state.animating?(o.onWindowResized(!1),o.callbackTimers.push(setTimeout(function(){return o.onWindowResized()},o.props.speed))):o.onWindowResized()}),o.ro.observe(o.list),document.querySelectorAll&&Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"),function(l){l.onfocus=o.props.pauseOnFocus?o.onSlideFocus:null,l.onblur=o.props.pauseOnFocus?o.onSlideBlur:null}),window.addEventListener?window.addEventListener("resize",o.onWindowResized):window.attachEvent("onresize",o.onWindowResized)}),Ae(Ie(o),"componentWillUnmount",function(){o.animationEndCallback&&clearTimeout(o.animationEndCallback),o.lazyLoadTimer&&clearInterval(o.lazyLoadTimer),o.callbackTimers.length&&(o.callbackTimers.forEach(function(a){return clearTimeout(a)}),o.callbackTimers=[]),window.addEventListener?window.removeEventListener("resize",o.onWindowResized):window.detachEvent("onresize",o.onWindowResized),o.autoplayTimer&&clearInterval(o.autoplayTimer),o.ro.disconnect()}),Ae(Ie(o),"componentDidUpdate",function(a){if(o.checkImagesLoad(),o.props.onReInit&&o.props.onReInit(),o.props.lazyLoad){var s=(0,yt.getOnDemandLazySlides)(xe(xe({},o.props),o.state));s.length>0&&(o.setState(function(c){return{lazyLoadedList:c.lazyLoadedList.concat(s)}}),o.props.onLazyLoad&&o.props.onLazyLoad(s))}o.adaptHeight();var l=xe(xe({listRef:o.list,trackRef:o.track},o.props),o.state),u=o.didPropsChange(a);u&&o.updateState(l,u,function(){o.state.currentSlide>=xn.default.Children.count(o.props.children)&&o.changeSlide({message:"index",index:xn.default.Children.count(o.props.children)-o.props.slidesToShow,currentSlide:o.state.currentSlide}),o.props.autoplay?o.autoPlay("update"):o.pause("paused")})}),Ae(Ie(o),"onWindowResized",function(a){o.debouncedResize&&o.debouncedResize.cancel(),o.debouncedResize=(0,Wue.default)(function(){return o.resizeWindow(a)},50),o.debouncedResize()}),Ae(Ie(o),"resizeWindow",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=!!(o.track&&o.track.node);if(s){var l=xe(xe({listRef:o.list,trackRef:o.track},o.props),o.state);o.updateState(l,a,function(){o.props.autoplay?o.autoPlay("update"):o.pause("paused")}),o.setState({animating:!1}),clearTimeout(o.animationEndCallback),delete o.animationEndCallback}}),Ae(Ie(o),"updateState",function(a,s,l){var u=(0,yt.initializedState)(a);a=xe(xe(xe({},a),u),{},{slideIndex:u.currentSlide});var c=(0,yt.getTrackLeft)(a);a=xe(xe({},a),{},{left:c});var f=(0,yt.getTrackCSS)(a);(s||xn.default.Children.count(o.props.children)!==xn.default.Children.count(a.children))&&(u.trackStyle=f),o.setState(u,l)}),Ae(Ie(o),"ssrInit",function(){if(o.props.variableWidth){var a=0,s=0,l=[],u=(0,yt.getPreClones)(xe(xe(xe({},o.props),o.state),{},{slideCount:o.props.children.length})),c=(0,yt.getPostClones)(xe(xe(xe({},o.props),o.state),{},{slideCount:o.props.children.length}));o.props.children.forEach(function(E){l.push(E.props.style.width),a+=E.props.style.width});for(var f=0;f=s&&o.onWindowResized()};if(!u.onclick)u.onclick=function(){return u.parentNode.focus()};else{var f=u.onclick;u.onclick=function(){f(),u.parentNode.focus()}}u.onload||(o.props.lazyLoad?u.onload=function(){o.adaptHeight(),o.callbackTimers.push(setTimeout(o.onWindowResized,o.props.speed))}:(u.onload=c,u.onerror=function(){c(),o.props.onLazyLoadError&&o.props.onLazyLoadError()}))})}),Ae(Ie(o),"progressiveLazyLoad",function(){for(var a=[],s=xe(xe({},o.props),o.state),l=o.state.currentSlide;l=-(0,yt.getPreClones)(s);u--)if(o.state.lazyLoadedList.indexOf(u)<0){a.push(u);break}a.length>0?(o.setState(function(c){return{lazyLoadedList:c.lazyLoadedList.concat(a)}}),o.props.onLazyLoad&&o.props.onLazyLoad(a)):o.lazyLoadTimer&&(clearInterval(o.lazyLoadTimer),delete o.lazyLoadTimer)}),Ae(Ie(o),"slideHandler",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=o.props,u=l.asNavFor,c=l.beforeChange,f=l.onLazyLoad,d=l.speed,g=l.afterChange,w=o.state.currentSlide,y=(0,yt.slideHandler)(xe(xe(xe({index:a},o.props),o.state),{},{trackRef:o.track,useCSS:o.props.useCSS&&!s})),k=y.state,S=y.nextState;if(k){c&&c(w,k.currentSlide);var b=k.lazyLoadedList.filter(function(C){return o.state.lazyLoadedList.indexOf(C)<0});f&&b.length>0&&f(b),!o.props.waitForAnimate&&o.animationEndCallback&&(clearTimeout(o.animationEndCallback),g&&g(w),delete o.animationEndCallback),o.setState(k,function(){u&&o.asNavForIndex!==a&&(o.asNavForIndex=a,u.innerSlider.slideHandler(a)),S&&(o.animationEndCallback=setTimeout(function(){var C=S.animating,R=Xue(S,["animating"]);o.setState(R,function(){o.callbackTimers.push(setTimeout(function(){return o.setState({animating:C})},10)),g&&g(k.currentSlide),delete o.animationEndCallback})},d))})}}),Ae(Ie(o),"changeSlide",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=xe(xe({},o.props),o.state),u=(0,yt.changeSlide)(l,a);if(!(u!==0&&!u)&&(s===!0?o.slideHandler(u,s):o.slideHandler(u),o.props.autoplay&&o.autoPlay("update"),o.props.focusOnSelect)){var c=o.list.querySelectorAll(".slick-current");c[0]&&c[0].focus()}}),Ae(Ie(o),"clickHandler",function(a){o.clickable===!1&&(a.stopPropagation(),a.preventDefault()),o.clickable=!0}),Ae(Ie(o),"keyHandler",function(a){var s=(0,yt.keyHandler)(a,o.props.accessibility,o.props.rtl);s!==""&&o.changeSlide({message:s})}),Ae(Ie(o),"selectHandler",function(a){o.changeSlide(a)}),Ae(Ie(o),"disableBodyScroll",function(){var a=function(l){l=l||window.event,l.preventDefault&&l.preventDefault(),l.returnValue=!1};window.ontouchmove=a}),Ae(Ie(o),"enableBodyScroll",function(){window.ontouchmove=null}),Ae(Ie(o),"swipeStart",function(a){o.props.verticalSwiping&&o.disableBodyScroll();var s=(0,yt.swipeStart)(a,o.props.swipe,o.props.draggable);s!==""&&o.setState(s)}),Ae(Ie(o),"swipeMove",function(a){var s=(0,yt.swipeMove)(a,xe(xe(xe({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));s&&(s.swiping&&(o.clickable=!1),o.setState(s))}),Ae(Ie(o),"swipeEnd",function(a){var s=(0,yt.swipeEnd)(a,xe(xe(xe({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));if(s){var l=s.triggerSlideHandler;delete s.triggerSlideHandler,o.setState(s),l!==void 0&&(o.slideHandler(l),o.props.verticalSwiping&&o.enableBodyScroll())}}),Ae(Ie(o),"touchEnd",function(a){o.swipeEnd(a),o.clickable=!0}),Ae(Ie(o),"slickPrev",function(){o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"previous"})},0))}),Ae(Ie(o),"slickNext",function(){o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"next"})},0))}),Ae(Ie(o),"slickGoTo",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(a=Number(a),isNaN(a))return"";o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"index",index:a,currentSlide:o.state.currentSlide},s)},0))}),Ae(Ie(o),"play",function(){var a;if(o.props.rtl)a=o.state.currentSlide-o.props.slidesToScroll;else if((0,yt.canGoNext)(xe(xe({},o.props),o.state)))a=o.state.currentSlide+o.props.slidesToScroll;else return!1;o.slideHandler(a)}),Ae(Ie(o),"autoPlay",function(a){o.autoplayTimer&&clearInterval(o.autoplayTimer);var s=o.state.autoplaying;if(a==="update"){if(s==="hovered"||s==="focused"||s==="paused")return}else if(a==="leave"){if(s==="paused"||s==="focused")return}else if(a==="blur"&&(s==="paused"||s==="hovered"))return;o.autoplayTimer=setInterval(o.play,o.props.autoplaySpeed+50),o.setState({autoplaying:"playing"})}),Ae(Ie(o),"pause",function(a){o.autoplayTimer&&(clearInterval(o.autoplayTimer),o.autoplayTimer=null);var s=o.state.autoplaying;a==="paused"?o.setState({autoplaying:"paused"}):a==="focused"?(s==="hovered"||s==="playing")&&o.setState({autoplaying:"focused"}):s==="playing"&&o.setState({autoplaying:"hovered"})}),Ae(Ie(o),"onDotsOver",function(){return o.props.autoplay&&o.pause("hovered")}),Ae(Ie(o),"onDotsLeave",function(){return o.props.autoplay&&o.state.autoplaying==="hovered"&&o.autoPlay("leave")}),Ae(Ie(o),"onTrackOver",function(){return o.props.autoplay&&o.pause("hovered")}),Ae(Ie(o),"onTrackLeave",function(){return o.props.autoplay&&o.state.autoplaying==="hovered"&&o.autoPlay("leave")}),Ae(Ie(o),"onSlideFocus",function(){return o.props.autoplay&&o.pause("focused")}),Ae(Ie(o),"onSlideBlur",function(){return o.props.autoplay&&o.state.autoplaying==="focused"&&o.autoPlay("blur")}),Ae(Ie(o),"render",function(){var a=(0,que.default)("slick-slider",o.props.className,{"slick-vertical":o.props.vertical,"slick-initialized":!0}),s=xe(xe({},o.props),o.state),l=(0,yt.extractObject)(s,["fade","cssEase","speed","infinite","centerMode","focusOnSelect","currentSlide","lazyLoad","lazyLoadedList","rtl","slideWidth","slideHeight","listHeight","vertical","slidesToShow","slidesToScroll","slideCount","trackStyle","variableWidth","unslick","centerPadding","targetSlide","useCSS"]),u=o.props.pauseOnHover;l=xe(xe({},l),{},{onMouseEnter:u?o.onTrackOver:null,onMouseLeave:u?o.onTrackLeave:null,onMouseOver:u?o.onTrackOver:null,focusOnSelect:o.props.focusOnSelect&&o.clickable?o.selectHandler:null});var c;if(o.props.dots===!0&&o.state.slideCount>=o.props.slidesToShow){var f=(0,yt.extractObject)(s,["dotsClass","slideCount","slidesToShow","currentSlide","slidesToScroll","clickHandler","children","customPaging","infinite","appendDots"]),d=o.props.pauseOnDotsHover;f=xe(xe({},f),{},{clickHandler:o.changeSlide,onMouseEnter:d?o.onDotsLeave:null,onMouseOver:d?o.onDotsOver:null,onMouseLeave:d?o.onDotsLeave:null}),c=xn.default.createElement(Gue.Dots,f)}var g,w,y=(0,yt.extractObject)(s,["infinite","centerMode","currentSlide","slideCount","slidesToShow","prevArrow","nextArrow"]);y.clickHandler=o.changeSlide,o.props.arrows&&(g=xn.default.createElement(j_.PrevArrow,y),w=xn.default.createElement(j_.NextArrow,y));var k=null;o.props.vertical&&(k={height:o.state.listHeight});var S=null;o.props.vertical===!1?o.props.centerMode===!0&&(S={padding:"0px "+o.props.centerPadding}):o.props.centerMode===!0&&(S={padding:o.props.centerPadding+" 0px"});var b=xe(xe({},k),S),C=o.props.touchMove,R={className:"slick-list",style:b,onClick:o.clickHandler,onMouseDown:C?o.swipeStart:null,onMouseMove:o.state.dragging&&C?o.swipeMove:null,onMouseUp:C?o.swipeEnd:null,onMouseLeave:o.state.dragging&&C?o.swipeEnd:null,onTouchStart:C?o.swipeStart:null,onTouchMove:o.state.dragging&&C?o.swipeMove:null,onTouchEnd:C?o.touchEnd:null,onTouchCancel:o.state.dragging&&C?o.swipeEnd:null,onKeyDown:o.props.accessibility?o.keyHandler:null},_={className:a,dir:"ltr",style:o.props.style};return o.props.unslick&&(R={className:"slick-list"},_={className:a}),xn.default.createElement("div",_,o.props.unslick?"":g,xn.default.createElement("div",Ah({ref:o.listRefHandler},R),xn.default.createElement(Kue.Track,Ah({ref:o.trackRefHandler},l),o.props.children)),o.props.unslick?"":w,o.props.unslick?"":c)}),o.list=null,o.track=null,o.state=xe(xe({},Hue.default),{},{currentSlide:o.props.initialSlide,slideCount:xn.default.Children.count(o.props.children)}),o.callbackTimers=[],o.clickable=!0,o.debouncedResize=null;var i=o.ssrInit();return o.state=xe(xe({},o.state),i),o}return Jue(n,[{key:"didPropsChange",value:function(o){for(var i=!1,a=0,s=Object.keys(this.props);a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function R(p){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},R(p)}function _(p,v,h){return v in p?Object.defineProperty(p,v,{value:h,enumerable:!0,configurable:!0,writable:!0}):p[v]=h,p}var O=(0,a.canUseDOM)()&&hce(),E=function(p){w(h,p);var v=k(h);function h(x){var T;return f(this,h),T=v.call(this,x),_(b(T),"innerSliderRefHandler",function(I){return T.innerSlider=I}),_(b(T),"slickPrev",function(){return T.innerSlider.slickPrev()}),_(b(T),"slickNext",function(){return T.innerSlider.slickNext()}),_(b(T),"slickGoTo",function(I){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return T.innerSlider.slickGoTo(I,A)}),_(b(T),"slickPause",function(){return T.innerSlider.pause("paused")}),_(b(T),"slickPlay",function(){return T.innerSlider.autoPlay("play")}),T.state={breakpoint:null},T._responsiveMediaHandlers=[],T}return g(h,[{key:"media",value:function(T,I){O.register(T,I),this._responsiveMediaHandlers.push({query:T,handler:I})}},{key:"componentDidMount",value:function(){var T=this;if(this.props.responsive){var I=this.props.responsive.map(function(L){return L.breakpoint});I.sort(function(L,$){return L-$}),I.forEach(function(L,$){var j;$===0?j=(0,o.default)({minWidth:0,maxWidth:L}):j=(0,o.default)({minWidth:I[$-1]+1,maxWidth:L}),(0,a.canUseDOM)()&&T.media(j,function(){T.setState({breakpoint:L})})});var A=(0,o.default)({minWidth:I.slice(-1)[0]});(0,a.canUseDOM)()&&this.media(A,function(){T.setState({breakpoint:null})})}}},{key:"componentWillUnmount",value:function(){this._responsiveMediaHandlers.forEach(function(T){O.unregister(T.query,T.handler)})}},{key:"render",value:function(){var T=this,I,A;this.state.breakpoint?(A=this.props.responsive.filter(function(H){return H.breakpoint===T.state.breakpoint}),I=A[0].settings==="unslick"?"unslick":c(c(c({},i.default),this.props),A[0].settings)):I=c(c({},i.default),this.props),I.centerMode&&(I.slidesToScroll>1,I.slidesToScroll=1),I.fade&&(I.slidesToShow>1,I.slidesToScroll>1,I.slidesToShow=1,I.slidesToScroll=1);var L=n.default.Children.toArray(this.props.children);L=L.filter(function(H){return typeof H=="string"?!!H.trim():!!H}),I.variableWidth&&(I.rows>1||I.slidesPerRow>1)&&(console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"),I.variableWidth=!1);for(var $=[],j=null,M=0;M=L.length));F+=1)D.push(n.default.cloneElement(L[F],{key:100*M+10*N+F,tabIndex:-1,style:{width:"".concat(100/I.slidesPerRow,"%"),display:"inline-block"}}));z.push(n.default.createElement("div",{key:10*M+N},D))}I.variableWidth?$.push(n.default.createElement("div",{key:M,style:{width:j}},z)):$.push(n.default.createElement("div",{key:M},z))}if(I==="unslick"){var W="regular slider "+(this.props.className||"");return n.default.createElement("div",{className:W},L)}else $.length<=I.slidesToShow&&(I.unslick=!0);return n.default.createElement(r.InnerSlider,l({style:this.props.style,ref:this.innerSliderRefHandler},I),$)}}]),h}(n.default.Component);e.default=E})(MM);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(MM);function n(o){return o&&o.__esModule?o:{default:o}}var r=t.default;e.default=r})(jM);const mce=Ve(jM);function vce({images:e}){const t={dots:!0,infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1,adaptiveHeight:!0};return m.jsx(mce,{...t,children:e.map((n,r)=>m.jsx(he,{children:m.jsx(Ll,{src:n})},r))})}const yce=({src:e,alt:t})=>m.jsx(Ll,{width:"100%",src:e,fallback:m.jsx(he,{width:"100%",textAlign:"center",children:m.jsx(fe,{children:"Image failed to load."})}),fallbackStrategy:"onError",alt:t}),gce=({images:e})=>m.jsx(m.Fragment,{children:(e==null?void 0:e.length)===1?m.jsx(yce,{src:e[0]}):m.jsx(vce,{images:e})}),bce=e=>{const[t,n]=P.useState(!1),r=new URL(e.url).hostname,o=x_.canPlay(e.url);return m.jsx(m.Fragment,{children:t?m.jsx(fL,{ratio:16/9,children:m.jsx(x_,{url:e.url,controls:!0,width:"100%",height:"100%",fallback:m.jsx(he,{width:"100%",textAlign:"center",children:m.jsx(fe,{children:"Video failed to load."})}),fallbackStrategy:"onError"})}):m.jsx(ve,{size:"sm",width:"100%",overflowWrap:"break-word",wordBreak:"break-all",onClick:()=>n(!0),isDisabled:!o,children:o?`Load video from ${r}`:"Cannot play this video."})})},wce=({videos:e})=>m.jsx(m.Fragment,{children:e.map((t,n)=>m.jsx(bce,{url:t},n))});function Sce({images:e,videos:t}){return m.jsxs(m.Fragment,{children:[e&&m.jsx(gce,{images:e}),t&&m.jsx(wce,{videos:t})]})}function xce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var jh=xce(P),Ece=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},V_=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Cce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return jh.createElement("svg",Ece({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),jh.createElement("path",{d:"M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z"}))},kce=jh.memo?jh.memo(V_):V_,Pce=kce;const _ce=Ve(Pce);function Oce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Mh=Oce(P),Tce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},H_=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Rce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return Mh.createElement("svg",Tce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Mh.createElement("path",{d:"M10.5,12A1.5,1.5 0 0,1 12,10.5A1.5,1.5 0 0,1 13.5,12A1.5,1.5 0 0,1 12,13.5A1.5,1.5 0 0,1 10.5,12M10.5,16.5A1.5,1.5 0 0,1 12,15A1.5,1.5 0 0,1 13.5,16.5A1.5,1.5 0 0,1 12,18A1.5,1.5 0 0,1 10.5,16.5M10.5,7.5A1.5,1.5 0 0,1 12,6A1.5,1.5 0 0,1 13.5,7.5A1.5,1.5 0 0,1 12,9A1.5,1.5 0 0,1 10.5,7.5M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z"}))},Ice=Mh.memo?Mh.memo(H_):H_,Ace=Ice;const Lce=Ve(Ace);function jce({pubkey:e,isOpen:t,onClose:n}){const[r,o]=P.useState([]),i=ni(),a=async()=>{const l=await G.getState().getAllLists(),u=(l==null?void 0:l.map(d=>({id:d.id,title:d.title,isAssigned:!1})))||[],c=await G.getState().getListsWithUser(e),f=u.map(d=>({...d,isAssigned:!!(c!=null&&c.find(g=>g.id===d.id))}));o(f)};P.useEffect(()=>{t&&a()},[t]);const s=async(l,u)=>{try{u?(await G.getState().removeUserFromList(l,e),i({title:"User removed from list",status:"success",duration:9e3,isClosable:!0})):(await G.getState().addUserToList(l,e),i({title:"User added to list",status:"success",duration:9e3,isClosable:!0})),o(c=>c.map(f=>f.id===l?{...f,isAssigned:!u}:f))}catch(c){i({title:"Operation failed",description:c.message||"Something went wrong",status:"error",duration:9e3,isClosable:!0})}};return m.jsxs(ir,{isOpen:t,onClose:n,children:[m.jsx(lr,{}),m.jsxs(ar,{children:[m.jsx(sr,{children:"Add or Remove from List"}),m.jsx(cr,{}),m.jsx(ur,{children:r.length===0?m.jsx(fe,{children:"No lists found. Create one first."}):r.map(l=>m.jsxs(tt,{children:[m.jsx(fe,{children:l.title}),m.jsx(ve,{onClick:()=>s(l.id,l.isAssigned),children:l.isAssigned?"Remove from List":"Add to List"})]},l.id))}),m.jsx(af,{children:m.jsx(ve,{colorScheme:"blue",mr:3,onClick:n,children:"Close"})})]})]})}var l$={exports:{}};(function(e,t){(function(n,r){e.exports=r(P)})(Or,function(n){return function(r){var o={};function i(a){if(o[a])return o[a].exports;var s=o[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=o,i.d=function(a,s,l){i.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:l})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,s){if(1&s&&(a=i(a)),8&s||4&s&&typeof a=="object"&&a&&a.__esModule)return a;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:a}),2&s&&typeof a!="string")for(var u in a)i.d(l,u,(function(c){return a[c]}).bind(null,u));return l},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="/",i(i.s=1)}([function(r,o){r.exports=n},function(r,o,i){r.exports=i(2)},function(r,o,i){function a(v,h,x){return h in v?Object.defineProperty(v,h,{value:x,enumerable:!0,configurable:!0,writable:!0}):v[h]=x,v}function s(v,h){var x=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);h&&(T=T.filter(function(I){return Object.getOwnPropertyDescriptor(v,I).enumerable})),x.push.apply(x,T)}return x}function l(v,h){if(v==null)return{};var x,T,I=function(L,$){if(L==null)return{};var j,M,z={},N=Object.keys(L);for(M=0;M=0||(z[j]=L[j]);return z}(v,h);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(v);for(T=0;T=0||Object.prototype.propertyIsEnumerable.call(v,x)&&(I[x]=v[x])}return I}i.r(o);var u=i(0),c=i.n(u),f=function(v){for(var h=0,x=0;x=128?"#000000":"#FFFFFF"),backgroundColor:y(L+13,I,$),wrapperTranslateX:z,wrapperTranslateY:D,wrapperRotate:w(L,360),wrapperScale:1+w(L,3)/10,isMouthOpen:g(L,2),isCircle:g(L,1),eyeSpread:w(L,5),mouthSpread:w(L,3),faceRotate:w(L,10,3),faceTranslateX:z>6?z/2:w(L,8,1),faceTranslateY:D>6?D/2:w(L,7,2)}}(v.name,v.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 36 36",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:v.size,height:v.size},v.title&&u.createElement("title",null,v.name),u.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},u.createElement("rect",{width:36,height:36,rx:v.square?void 0:72,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:36,height:36,fill:h.backgroundColor}),u.createElement("rect",{x:"0",y:"0",width:36,height:36,transform:"translate("+h.wrapperTranslateX+" "+h.wrapperTranslateY+") rotate("+h.wrapperRotate+" 18 18) scale("+h.wrapperScale+")",fill:h.wrapperColor,rx:h.isCircle?36:6}),u.createElement("g",{transform:"translate("+h.faceTranslateX+" "+h.faceTranslateY+") rotate("+h.faceRotate+" 18 18)"},h.isMouthOpen?u.createElement("path",{d:"M15 "+(19+h.mouthSpread)+"c2 1 4 1 6 0",stroke:h.faceColor,fill:"none",strokeLinecap:"round"}):u.createElement("path",{d:"M13,"+(19+h.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:h.faceColor}),u.createElement("rect",{x:14-h.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:h.faceColor}),u.createElement("rect",{x:20+h.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:h.faceColor}))))},R=function(v){var h=function(I,A){var L=f(I),$=A&&A.length;return Array.from({length:4},function(j,M){return y(L+M,A,$)})}(v.name,v.colors),x=v.name.replace(/\s/g,""),T=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:v.size,height:v.size},v.title&&u.createElement("title",null,v.name),u.createElement("mask",{id:T,maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:v.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(T,")")},u.createElement("path",{fill:"url(#gradient_paint0_linear_"+x+")",d:"M0 0h80v40H0z"}),u.createElement("path",{fill:"url(#gradient_paint1_linear_"+x+")",d:"M0 40h80v40H0z"})),u.createElement("defs",null,u.createElement("linearGradient",{id:"gradient_paint0_linear_"+x,x1:40,y1:0,x2:40,y2:40,gradientUnits:"userSpaceOnUse"},u.createElement("stop",{stopColor:h[0]}),u.createElement("stop",{offset:1,stopColor:h[1]})),u.createElement("linearGradient",{id:"gradient_paint1_linear_"+x,x1:40,y1:40,x2:40,y2:80,gradientUnits:"userSpaceOnUse"},u.createElement("stop",{stopColor:h[2]}),u.createElement("stop",{offset:1,stopColor:h[3]}))))},_=function(v){var h=function(T,I){var A=f(T),L=I&&I.length;return Array.from({length:3},function($,j){return{color:y(A+j,I,L),translateX:w(A*(j+1),8,1),translateY:w(A*(j+1),8,2),scale:1.2+w(A*(j+1),4)/10,rotate:w(A*(j+1),360,1)}})}(v.name,v.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:v.size,height:v.size},v.title&&u.createElement("title",null,v.name),u.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:v.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:80,height:80,fill:h[0].color}),u.createElement("path",{filter:"url(#prefix__filter0_f)",d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:h[1].color,transform:"translate("+h[1].translateX+" "+h[1].translateY+") rotate("+h[1].rotate+" 40 40) scale("+h[2].scale+")"}),u.createElement("path",{filter:"url(#prefix__filter0_f)",style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:h[2].color,transform:"translate("+h[2].translateX+" "+h[2].translateY+") rotate("+h[2].rotate+" 40 40) scale("+h[2].scale+")"})),u.createElement("defs",null,u.createElement("filter",{id:"prefix__filter0_f",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},u.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),u.createElement("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),u.createElement("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"}))))},O=["pixel","bauhaus","ring","beam","sunset","marble"],E={geometric:"beam",abstract:"bauhaus"},p=function(v){var h=v.variant,x=h===void 0?"marble":h,T=v.colors,I=T===void 0?["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]:T,A=v.name,L=A===void 0?"Clara Barton":A,$=v.square,j=$!==void 0&&$,M=v.title,z=M!==void 0&&M,N=v.size,D=function(F){for(var W=1;Wt.some(n=>e instanceof n);let W_,q_;function zce(){return W_||(W_=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Nce(){return q_||(q_=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const u$=new WeakMap,Fb=new WeakMap,c$=new WeakMap,vg=new WeakMap,$S=new WeakMap;function Bce(e){const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{n(Wu(e.result)),o()},a=()=>{r(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&u$.set(n,e)}).catch(()=>{}),$S.set(t,e),t}function Fce(e){if(Fb.has(e))return;const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",a),e.removeEventListener("abort",a)},i=()=>{n(),o()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",i),e.addEventListener("error",a),e.addEventListener("abort",a)});Fb.set(e,t)}let Ub={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Fb.get(e);if(t==="objectStoreNames")return e.objectStoreNames||c$.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Wu(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function Uce(e){Ub=e(Ub)}function Vce(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(yg(this),t,...n);return c$.set(r,t.sort?t.sort():[t]),Wu(r)}:Nce().includes(e)?function(...t){return e.apply(yg(this),t),Wu(u$.get(this))}:function(...t){return Wu(e.apply(yg(this),t))}}function Hce(e){return typeof e=="function"?Vce(e):(e instanceof IDBTransaction&&Fce(e),Dce(e,zce())?new Proxy(e,Ub):e)}function Wu(e){if(e instanceof IDBRequest)return Bce(e);if(vg.has(e))return vg.get(e);const t=Hce(e);return t!==e&&(vg.set(e,t),$S.set(t,e)),t}const yg=e=>$S.get(e),Wce=["get","getKey","getAll","getAllKeys","count"],qce=["put","add","delete","clear"],gg=new Map;function K_(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(gg.get(t))return gg.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=qce.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||Wce.includes(n)))return;const i=async function(a,...s){const l=this.transaction(a,o?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(s.shift())),(await Promise.all([u[n](...s),o&&l.done]))[0]};return gg.set(t,i),i}Uce(e=>({...e,get:(t,n,r)=>K_(t,n)||e.get(t,n,r),has:(t,n)=>!!K_(t,n)||e.has(t,n)}));async function bg(e,t){try{let n=await Promise.race([fetch(e,{headers:t}),new Promise((o,i)=>setTimeout(()=>i(new Error("Timeout")),5e3))]);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){throw new Error(`Error making request: ${n}`)}}var Kce=class extends wre{constructor(e){super(e)}async getZapCallbackInfo(e){const t=await bg(e);if(!Xne(t))throw new Error("Lnurl endpoint does not allow Nostr payments. Expected to find 'allowsNostr' in response.");return this.lightningZapInfo=t,console.log("LnurlEndpointResponse",this.lightningZapInfo),this.lightningZapInfo}async getLightningInvoice(e,t){const n=await bg(t);if(n&&n.status==="ERROR")throw new Error(`Error getting lightning invoice: ${n.reason}`);if(!Zne(e,n))throw new Error("Lnurl invoice response is invalid or does not match your request.");return console.log("LnurlInvoiceResponse",n),n}async makeZapRequest(e,t){const n=this.getLud16Or06Url();if(n)try{this.hasZapInfo()||await this.getZapCallbackInfo(n.url);const r={...e,recipientPubkey:this.pubkey,lnurl:n.type==="lud16"?zj(this.getLud16()):this.getLud06()},o=vre(r,this.lightningZapInfo.callback,t);return{...await this.getLightningInvoice(r,o.invoiceUrl),event:o.event}}catch(r){throw new Error(`Error making zap request: ${r}`)}else throw new Error("No lud16 or lud06 url found")}async makeNIP05Request(){const e=this.getNip05Url();if(e)try{return await bg(e)}catch(t){throw new Error(`Error making NIP05 request: ${t}`)}else throw new Error("No nip05 url found")}},Gce=Object.defineProperty,$h=Object.getOwnPropertySymbols,f$=Object.prototype.hasOwnProperty,d$=Object.prototype.propertyIsEnumerable,G_=(e,t,n)=>t in e?Gce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yce=(e,t)=>{for(var n in t||(t={}))f$.call(t,n)&&G_(e,n,t[n]);if($h)for(var n of $h(t))d$.call(t,n)&&G_(e,n,t[n]);return e},Xce=(e,t)=>{var n={};for(var r in e)f$.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$h)for(var r of $h(e))t.indexOf(r)<0&&d$.call(e,r)&&(n[r]=e[r]);return n};/** - * @license QR Code generator library (TypeScript) - * Copyright (c) Project Nayuki. - * SPDX-License-Identifier: MIT - */var Wa;(e=>{const t=class{constructor(l,u,c,f){if(this.version=l,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],lt.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let d=[];for(let w=0;w7)throw new RangeError("Invalid value");let w,y;for(w=c;;w++){const C=t.getNumDataCodewords(w,u)*8,R=s.getTotalBits(l,w);if(R<=C){y=R;break}if(w>=f)throw new RangeError("Data too long")}for(const C of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])g&&y<=t.getNumDataCodewords(w,C)*8&&(u=C);let k=[];for(const C of l){r(C.mode.modeBits,4,k),r(C.numChars,C.mode.numCharCountBits(w),k);for(const R of C.getData())k.push(R)}i(k.length==y);const S=t.getNumDataCodewords(w,u)*8;i(k.length<=S),r(0,Math.min(4,S-k.length),k),r(0,(8-k.length%8)%8,k),i(k.length%8==0);for(let C=236;k.lengthb[R>>>3]|=C<<7-(R&7)),new t(w,u,b,d)}getModule(l,u){return 0<=l&&l>>9)*1335;const f=(u<<10|c)^21522;i(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,o(f,d));this.setFunctionModule(8,7,o(f,6)),this.setFunctionModule(8,8,o(f,7)),this.setFunctionModule(7,8,o(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,o(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,o(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,o(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;const u=this.version<<12|l;i(u>>>18==0);for(let c=0;c<18;c++){const f=o(u,c),d=this.size-11+c%3,g=Math.floor(c/3);this.setFunctionModule(d,g,f),this.setFunctionModule(g,d,f)}}drawFinderPattern(l,u){for(let c=-4;c<=4;c++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(c)),g=l+f,w=u+c;0<=g&&g{(C!=y-d||_>=w)&&b.push(R[C])});return i(b.length==g),b}drawCodewords(l){if(l.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let f=0;f>>3],7-(u&7)),u++)}}i(u==l.length*8)}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let u=0;u5&&l++):(this.finderPenaltyAddHistory(w,y),g||(l+=this.finderPenaltyCountPatterns(y)*t.PENALTY_N3),g=this.modules[d][k],w=1);l+=this.finderPenaltyTerminateAndCount(g,w,y)*t.PENALTY_N3}for(let d=0;d5&&l++):(this.finderPenaltyAddHistory(w,y),g||(l+=this.finderPenaltyCountPatterns(y)*t.PENALTY_N3),g=this.modules[k][d],w=1);l+=this.finderPenaltyTerminateAndCount(g,w,y)*t.PENALTY_N3}for(let d=0;dg+(w?1:0),u);const c=this.size*this.size,f=Math.ceil(Math.abs(u*20-c*10)/c)-1;return i(0<=f&&f<=9),l+=f*t.PENALTY_N4,i(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return[];{const l=Math.floor(this.version/7)+2,u=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2;let c=[6];for(let f=this.size-7;c.lengtht.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*l+128)*l+64;if(l>=2){const c=Math.floor(l/7)+2;u-=(25*c-10)*c-55,l>=7&&(u-=36)}return i(208<=u&&u<=29648),u}static getNumDataCodewords(l,u){return Math.floor(t.getNumRawDataModules(l)/8)-t.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l]*t.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let u=[];for(let f=0;f0);for(const f of l){const d=f^c.shift();c.push(0),u.forEach((g,w)=>c[w]^=t.reedSolomonMultiply(g,d))}return c}static reedSolomonMultiply(l,u){if(l>>>8||u>>>8)throw new RangeError("Byte out of range");let c=0;for(let f=7;f>=0;f--)c=c<<1^(c>>>7)*285,c^=(u>>>f&1)*l;return i(c>>>8==0),c}finderPenaltyCountPatterns(l){const u=l[1];i(u<=this.size*3);const c=u>0&&l[2]==u&&l[3]==u*3&&l[4]==u&&l[5]==u;return(c&&l[0]>=u*4&&l[6]>=u?1:0)+(c&&l[6]>=u*4&&l[0]>=u?1:0)}finderPenaltyTerminateAndCount(l,u,c){return l&&(this.finderPenaltyAddHistory(u,c),u=0),u+=this.size,this.finderPenaltyAddHistory(u,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,u){u[0]==0&&(l+=this.size),u.pop(),u.unshift(l)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(l,u,c){if(u<0||u>31||l>>>u)throw new RangeError("Value out of range");for(let f=u-1;f>=0;f--)c.push(l>>>f&1)}function o(l,u){return(l>>>u&1)!=0}function i(l){if(!l)throw new Error("Assertion error")}const a=class{constructor(l,u,c){if(this.mode=l,this.numChars=u,this.bitData=c,u<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(l){let u=[];for(const c of l)r(c,8,u);return new a(a.Mode.BYTE,l.length,u)}static makeNumeric(l){if(!a.isNumeric(l))throw new RangeError("String contains non-numeric characters");let u=[];for(let c=0;c=1<{(t=>{const n=class{constructor(o,i){this.ordinal=o,this.formatBits=i}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Wa||(Wa={}));(e=>{(t=>{const n=class{constructor(o,i){this.modeBits=o,this.numBitsCharCount=i}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Wa||(Wa={}));var wu=Wa;/** - * @license qrcode.react - * Copyright (c) Paul O'Shannessy - * SPDX-License-Identifier: ISC - */var Zce={L:wu.QrCode.Ecc.LOW,M:wu.QrCode.Ecc.MEDIUM,Q:wu.QrCode.Ecc.QUARTILE,H:wu.QrCode.Ecc.HIGH},Qce=128,Jce="L",efe="#FFFFFF",tfe="#000000",nfe=!1,p$=4,rfe=.1;function ofe(e,t=0){const n=[];return e.forEach(function(r,o){let i=null;r.forEach(function(a,s){if(!a&&i!==null){n.push(`M${i+t} ${o+t}h${s-i}v1H${i+t}z`),i=null;return}if(s===r.length-1){if(!a)return;i===null?n.push(`M${s+t},${o+t} h1v1H${s+t}z`):n.push(`M${i+t},${o+t} h${s+1-i}v1H${i+t}z`);return}a&&i===null&&(i=s)})}),n.join("")}function ife(e,t){return e.slice().map((n,r)=>r=t.y+t.h?n:n.map((o,i)=>i=t.x+t.w?o:!1))}function afe(e,t,n,r){if(r==null)return null;const o=n?p$:0,i=e.length+o*2,a=Math.floor(t*rfe),s=i/t,l=(r.width||a)*s,u=(r.height||a)*s,c=r.x==null?e.length/2-l/2:r.x*s,f=r.y==null?e.length/2-u/2:r.y*s;let d=null;if(r.excavate){let g=Math.floor(c),w=Math.floor(f),y=Math.ceil(l+c-g),k=Math.ceil(u+f-w);d={x:g,y:w,w:y,h:k}}return{x:c,y:f,h:u,w:l,excavation:d}}(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();function sfe(e){const t=e,{value:n,size:r=Qce,level:o=Jce,bgColor:i=efe,fgColor:a=tfe,includeMargin:s=nfe,imageSettings:l}=t,u=Xce(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=wu.QrCode.encodeText(n,Zce[o]).getModules();const f=s?p$:0,d=c.length+f*2,g=afe(c,r,s,l);let w=null;l!=null&&g!=null&&(g.excavation!=null&&(c=ife(c,g.excavation)),w=Z.createElement("image",{xlinkHref:l.src,height:g.h,width:g.w,x:g.x+f,y:g.y+f,preserveAspectRatio:"none"}));const y=ofe(c,f);return Z.createElement("svg",Yce({height:r,width:r,viewBox:`0 0 ${d} ${d}`},u),Z.createElement("path",{fill:i,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),Z.createElement("path",{fill:a,d:y,shapeRendering:"crispEdges"}),w)}const lfe=({user:e,relatedEvent:t,onConfirmPayment:n,relayUrl:r})=>{const[o,i]=P.useState(void 0),[a,s]=P.useState(!1),[l,u]=P.useState(!1),[c,f]=P.useState(0),[d,g]=P.useState(""),[w,y]=P.useState(""),k=ni(),[S,b]=P.useState(void 0),C=async()=>{var $;if(!o)return;if(c<=0){k({title:"Error",description:"Please enter a valid amount",status:"error",duration:9e3,isClosable:!0});return}u(!0);const p=o;if(!p)return;const v=p==null?void 0:p.getLud16Or06Url();if(!v)return;if(!(p!=null&&p.hasZapInfo()))try{await(p==null?void 0:p.getZapCallbackInfo(v.url))}catch(j){console.error(j),k({title:"Error",description:`Could not get zap callback info: ${j.message}`,status:"error",duration:9e3,isClosable:!0}),u(!1);return}const h=v.type==="lud16"?zj(p.getLud16()):p.getLud06(),x={amount:c,relayUrls:r?[r]:[],recipientPubkey:p==null?void 0:p.pubkey,lnurl:h},T=Vj(x),I=await G.getState().signEvent(T),A=Dj({callback:($=p==null?void 0:p.lightningZapInfo)==null?void 0:$.callback,amount:x.amount,event:I.toURI(),lnurl:x.lnurl});let L;try{L=await p.getLightningInvoice(x,A)}catch(j){console.error(j),k({title:"Error",description:`Could not get lightning invoice: ${j.message}`,status:"error",duration:9e3,isClosable:!0}),u(!1);return}L&&L.pr&&b({pr:L.pr,event:I}),u(!1)},R=async()=>{if(!S)return;if(d===""||w===""){k({title:"Error",description:"Please fill in all fields",status:"error",duration:9e3,isClosable:!0});return}u(!0);const v=S.event.newZapReceipt({bolt11:d,description:w});t&&v.addEventTag({eventId:t.id}),await G.getState().signAndSendEvent({event:v}),u(!1),k({title:"Success",description:"Payment confirmed. Keep stracking!",status:"success",duration:9e3,isClosable:!0}),n()};P.useEffect(()=>{const p=new Kce(e),v=p.getLud16Or06Url()!==void 0;i(p),s(v)},[e]);const _=m.jsx(m.Fragment,{children:!a&&m.jsx(fe,{fontWeight:"bold",children:"The user does not have a supported ligning address."})}),O=m.jsx(m.Fragment,{children:a&&!S&&m.jsxs(Ra,{children:[m.jsx(fe,{mb:2,children:"Request a ligning invoice, pay it with your ligtning wallet, and enter the bolt11 invoice receipt from your wallet in the next step."}),m.jsxs(aL,{children:[m.jsx(Vw,{children:"Sats"}),m.jsx(Ot,{type:"number",value:c,onChange:p=>f(parseInt(p.target.value))})]}),m.jsx(ve,{onClick:C,isLoading:l,width:"100%",children:"Get ₿ LN invoice"})]})}),E=m.jsx(m.Fragment,{children:S&&m.jsxs(m.Fragment,{children:[m.jsx(fe,{mb:2,textAlign:"center",children:"Scan or copy the invoice to your lightning wallet."}),m.jsx(he,{mb:2,width:"100%",children:m.jsx(sfe,{value:S.pr,width:"100%"})}),m.jsx(Ot,{type:"text",value:S.pr,onChange:()=>g(S.pr),mb:2}),m.jsx(on,{htmlFor:"bolt11",mt:2,children:"Bolt11"}),m.jsx(fe,{mb:2,children:"Copy the bolt11 invoice receipt from your lightning wallet."}),m.jsx(Ot,{type:"text",value:d,onChange:p=>g(p.target.value),placeholder:"lnbc..."}),m.jsx(on,{htmlFor:"description",mt:2,children:"Description"}),m.jsx(Ot,{type:"text",value:w,onChange:p=>y(p.target.value),placeholder:"Keep stracking ...",mb:2}),m.jsx(ve,{onClick:R,isLoading:l,children:"Confirm payment"})]})});return m.jsxs(he,{children:[_,O,E]})},h$=({user:e,relatedEvent:t,isOpen:n,onClose:r})=>m.jsxs(ir,{isOpen:n,onClose:r,children:[m.jsx(lr,{}),m.jsxs(ar,{maxWidth:300,children:[m.jsx(sr,{children:"Send sats (WIP)"}),m.jsx(cr,{}),m.jsx(ur,{children:m.jsx(lfe,{user:e,relatedEvent:t,onConfirmPayment:r})}),m.jsx(af,{children:m.jsx(ve,{variant:"outline",onClick:r,children:"Close"})})]})]});function Yi({user:{pubkey:e,data:t},opts:{showAbout:n,showBanner:r,showFollowing:o,showBlock:i,showLud:a,relayUrls:s,isBlocked:l}}){const u=t&&t.name?t.name:"Anonymous",c=t&&t.display_name?t.display_name:u,f=t&&t.picture?t.picture:"",d=t&&t.banner?t.banner:void 0,g=t&&t.about?t.about:void 0,w=t&&t.lud06?t.lud06:void 0,y=t&&t.lud16?t.lud16:void 0,k=c===u,[S,b]=P.useState(""),[C,R]=P.useState(!1);P.useEffect(()=>{const T=Oj(ES.PublicKeys,[{type:0,value:e}]);b(`/p/${T}`)},[e]);const _=async()=>{const T=await G.getState().followingUser(e);R(T)},{isOpen:O,onOpen:E,onClose:p}=yn(),{isOpen:v,onClose:h}=yn(),x=({lud:T,name:I})=>m.jsxs(rS,{children:[m.jsx(nS,{children:m.jsx(ve,{size:"xs",variant:"outline",color:"gray.500",children:I})}),m.jsxs(sS,{children:[m.jsx(oS,{}),m.jsx(aS,{}),m.jsx(iS,{children:T&&m.jsx(fe,{fontSize:12,children:T})})]})]});return m.jsxs(m.Fragment,{children:[r&&d&&m.jsx(he,{marginBottom:2,children:m.jsx(Ll,{src:d,alt:"banner"})}),m.jsxs(tt,{children:[m.jsx(he,{children:m.jsx(Oc,{to:S,children:f===""?m.jsx($ce,{size:24,name:e,variant:"marble",colors:["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]}):m.jsx(Lp,{size:"xs",src:f})})}),m.jsx(he,{overflowWrap:"anywhere",maxWidth:80,children:m.jsx(Oc,{to:S,children:m.jsx(fe,{size:"sm",children:c})})}),m.jsx(he,{overflowWrap:"anywhere",maxWidth:80,children:m.jsx(fe,{fontSize:10,children:!k&&u})}),a&&m.jsxs(m.Fragment,{children:[w&&m.jsx(x,{lud:w,name:"LUD06"}),y&&m.jsx(x,{lud:y,name:"LUD16"})]}),m.jsx(Xa,{}),m.jsxs(Jw,{isLazy:!0,onOpen:_,children:[m.jsx(tS,{as:Lm,size:"xs",icon:m.jsx(Ne,{as:Lce}),children:"Actions"}),m.jsxs(eS,{children:[i&&m.jsx(fo,{icon:m.jsx(Ne,{as:_ce}),onClick:()=>l?G.getState().unblockUser(e):G.getState().blockUser({pubkey:e,relayUrls:s}),children:l?"Unblock":"Block"}),m.jsx(fo,{icon:m.jsx(Ne,{as:uM}),onClick:E,children:"Lists"}),o&&m.jsx(fo,{icon:m.jsx(Ne,{as:lM}),onClick:()=>C?G.getState().unfollowUser(e):G.getState().followUser({pubkey:e,relayUrls:s}),children:C?"Unfollow":"Follow"})]})]})]}),m.jsx(he,{overflowWrap:"anywhere",mt:2,children:n&&g&&m.jsx(fe,{fontSize:"sm",children:g})}),m.jsx(jce,{pubkey:e,isOpen:O,onClose:p}),m.jsx(h$,{user:{pubkey:e,data:t},isOpen:v,onClose:h})]})}function tv({data:e,level:t}){const[n]=G(x=>[(x.status==="offline"||x.status==="online")&&x.keystore!=="none"]),[r,o]=P.useState(e.user?e.user:{pubkey:e.event.pubkey}),i=Lj(e.event.content),a=Tj(e.event);let s;i!=null&&i.text&&!a?s=!0:a&&(s=!1);const l={isLoaded:!0,contentWarning:a,images:i.images,videos:i.videos,nurls:i.nurls,text:i.text},[u,c]=P.useState(s),f={showFollowing:!0,showBlock:!0,showLud:!0,relayUrls:e.eventRelayUrls},{isOpen:d,onOpen:g,onClose:w}=yn(),{isOpen:y,onOpen:k,onClose:S}=yn(),{isOpen:b,onOpen:C,onClose:R}=yn(),_=ni();P.useEffect(()=>{if(t===0){const x=e.user?e.user:{pubkey:e.event.pubkey};o(x)}},[e.user]),P.useEffect(()=>{const x=async()=>{const T=await G.getState().getUser(e.event.pubkey);T&&o(T.user)};t>0&&x()},[e.event.pubkey]);const O=async()=>{if(!e.eventRelayUrls)return;const T=(await G.getState().getRelays()||[]).find(I=>e.eventRelayUrls.includes(I.url));if(T&&T.write)return T},E=async x=>{console.log("replyCallback",x)},p=x=>{let T="";x instanceof Error?T=x.message:T="Unknown error",_({title:"Error",description:T,status:"error",duration:5e3,isClosable:!0})},v=x=>{_({title:"Success",description:`Event ${Dl(x,5)} submitted`,status:"success",duration:5e3,isClosable:!0})},h=async(x,T)=>{const I=await O();let A;switch(x){case"quote":A=Uj({inResponseTo:e.event,relayUrl:I?I.url:void 0});break;case"reaction":if(!T)throw new Error("Reaction is required");A=pre({text:T,inResponseTo:{id:e.event.id,pubkey:e.event.pubkey},relayUrl:I?I.url:void 0});break;case"zap":C();return;default:return}try{const L=await G.getState().signAndSendEvent({event:A,relayUrls:I?[I.url]:void 0});L&&(v(L),setTimeout(()=>{G.getState().requestInformation({source:"events",idsOrKeys:[L]},{timeoutIn:1e4})},1e3))}catch(L){p(L);return}};return m.jsxs(m.Fragment,{children:[m.jsxs(PG,{children:[m.jsxs(kG,{p:0,children:[u?m.jsx(Sce,{images:l.images,videos:l.videos}):m.jsx(vae,{contentWarning:l.contentWarning,setShowNSFWContent:c}),m.jsx(he,{p:1,pl:2,children:m.jsx(Yi,{user:r,opts:f})})]}),u&&m.jsx(EG,{p:0,children:m.jsx(VL,{isLoaded:l.isLoaded,children:m.jsx(hae,{content:l.text})})}),m.jsx(Hae,{isReady:n,level:t,createdAt:e.event.created_at,repliesCount:e.repliesCount,reactionsCount:e.reactionsCount,repostCount:e.repostsCount,zapReceiptCount:e.zapReceiptCount,zapReceiptAmount:e.zapReceiptAmount,isReplyOpen:y,onReplyOpen:k,onReplyClose:S,isInfoModalOpen:d,onInfoModalOpen:g,onInfoModalClose:w,onAction:h})]}),y&&m.jsx(mae,{data:e,isOpen:y,sendCallback:E,level:t}),m.jsx(cae,{data:e,isOpen:d,onClose:w}),m.jsx(h$,{user:r,relatedEvent:e.event,isOpen:b,onClose:R})]})}const nv=0,Xi=1,zl=2,m$=4;function v$(e,t){return n=>e(t(n))}function ufe(e,t){return t(e)}function y$(e,t){return n=>e(t,n)}function Y_(e,t){return()=>e(t)}function rv(e,t){return t(e),e}function vt(...e){return e}function cfe(e){e()}function X_(e){return()=>e}function ffe(...e){return()=>{e.map(cfe)}}function DS(e){return e!==void 0}function Nl(){}function Qe(e,t){return e(Xi,t)}function Re(e,t){e(nv,t)}function zS(e){e(zl)}function tr(e){return e(m$)}function me(e,t){return Qe(e,y$(t,nv))}function Jo(e,t){const n=e(Xi,r=>{n(),t(r)});return n}function Be(){const e=[];return(t,n)=>{switch(t){case zl:e.splice(0,e.length);return;case Xi:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case nv:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function se(e){let t=e;const n=Be();return(r,o)=>{switch(r){case Xi:o(t);break;case nv:t=o;break;case m$:return t}return n(r,o)}}function dfe(e){let t,n;const r=()=>t&&t();return function(o,i){switch(o){case Xi:return i?n===i?void 0:(r(),n=i,t=Qe(e,i),t):(r(),Nl);case zl:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function fr(e){return rv(Be(),t=>me(e,t))}function _n(e,t){return rv(se(t),n=>me(e,n))}function pfe(...e){return t=>e.reduceRight(ufe,t)}function ee(e,...t){const n=pfe(...t);return(r,o)=>{switch(r){case Xi:return Qe(e,n(o));case zl:zS(e);return}}}function g$(e,t){return e===t}function pt(e=g$){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Oe(e){return t=>n=>{e(n)&&t(n)}}function de(e){return t=>v$(t,e)}function jo(e){return t=>()=>t(e)}function yo(e,t){return n=>r=>n(t=e(t,r))}function Pl(e){return t=>n=>{e>0?e--:t(n)}}function Ei(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Z_(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Le(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);Qe(i,l=>{const u=n;n=n|s,t[a]=l,u!==o&&n===o&&r&&(r(),r=null)})}),i=>a=>{const s=()=>i([a].concat(t));n===o?s():r=s}}function Q_(...e){return function(t,n){switch(t){case Xi:return ffe(...e.map(r=>Qe(r,n)));case zl:return;default:throw new Error(`unrecognized action ${t}`)}}}function _e(e,t=g$){return ee(e,pt(t))}function Xt(...e){const t=Be(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);Qe(i,l=>{n[a]=l,r=r|s,r===o&&Re(t,n)})}),function(i,a){switch(i){case Xi:return r===o&&a(n),Qe(t,a);case zl:return zS(t);default:throw new Error(`unrecognized action ${i}`)}}}function Ze(e,t=[],{singleton:n}={singleton:!0}){return{id:hfe(),constructor:e,dependencies:t,singleton:n}}const hfe=()=>Symbol();function mfe(e){const t=new Map,n=({id:r,constructor:o,dependencies:i,singleton:a})=>{if(a&&t.has(r))return t.get(r);const s=o(i.map(l=>n(l)));return a&&t.set(r,s),s};return n(e)}function vfe(e,t){const n={},r={};let o=0;const i=e.length;for(;o(k[S]=b=>{const C=y[t.methods[S]];Re(C,b)},k),{})}function c(y){return a.reduce((k,S)=>(k[S]=dfe(y[t.events[S]]),k),{})}return{Component:Z.forwardRef((y,k)=>{const{children:S,...b}=y,[C]=Z.useState(()=>rv(mfe(e),_=>l(_,b))),[R]=Z.useState(Y_(c,C));return ud(()=>{for(const _ of a)_ in b&&Qe(R[_],b[_]);return()=>{Object.values(R).map(zS)}},[b,R,C]),ud(()=>{l(C,b)}),Z.useImperativeHandle(k,X_(u(C))),Z.createElement(s.Provider,{value:C},n?Z.createElement(n,vfe([...r,...o,...a],b),S):S)}),usePublisher:y=>Z.useCallback(y$(Re,Z.useContext(s)[y]),[y]),useEmitterValue:y=>{const S=Z.useContext(s)[y],[b,C]=Z.useState(Y_(tr,S));return ud(()=>Qe(S,R=>{R!==b&&C(X_(R))}),[S,b]),b},useEmitter:(y,k)=>{const b=Z.useContext(s)[y];ud(()=>Qe(b,k),[k,b])}}}const yfe=typeof document<"u"?Z.useLayoutEffect:Z.useEffect,gfe=yfe;var dr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(dr||{});const bfe={0:"debug",1:"log",2:"warn",3:"error"},wfe=()=>typeof globalThis>"u"?window:globalThis,Zi=Ze(()=>{const e=se(3);return{log:se((n,r,o=1)=>{var i;const a=(i=wfe().VIRTUOSO_LOG_LEVEL)!=null?i:tr(e);o>=a&&console[bfe[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function NS(e,t=!0){const n=Z.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=Z.useMemo(()=>new ResizeObserver(i=>{const a=i[0].target;a.offsetParent!==null&&e(a)}),[e]);r=i=>{i&&t?(o.observe(i),n.current=i):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function Ja(e,t=!0){return NS(e,t).callbackRef}function Sfe(e,t,n,r,o,i,a){const s=Z.useCallback(l=>{const u=xfe(l.children,t,"offsetHeight",o);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const f=c.lastElementChild.dataset.viewportType==="window",d=a?a.scrollTop:f?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,g=a?a.scrollHeight:f?document.documentElement.scrollHeight:c.scrollHeight,w=a?a.offsetHeight:f?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(d,0),scrollHeight:g,viewportHeight:w}),i==null||i(Efe("row-gap",getComputedStyle(l).rowGap,o)),u!==null&&e(u)},[e,t,o,i,a,r]);return NS(s,n)}function xfe(e,t,n,r){const o=e.length;if(o===0)return null;const i=[];for(let a=0;a{const d=f.target,g=d===window||d===document,w=g?window.pageYOffset||document.documentElement.scrollTop:d.scrollTop,y=g?document.documentElement.scrollHeight:d.scrollHeight,k=g?window.innerHeight:d.offsetHeight,S=()=>{e({scrollTop:Math.max(w,0),scrollHeight:y,viewportHeight:k})};f.suppressFlushSync?S():xz.flushSync(S),a.current!==null&&(w===a.current||w<=0||w===y-k)&&(a.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);Z.useEffect(()=>{const f=o||i.current;return r(o||i.current),l({target:f,suppressFlushSync:!0}),f.addEventListener("scroll",l,{passive:!0}),()=>{r(null),f.removeEventListener("scroll",l)}},[i,l,n,r,o]);function u(f){const d=i.current;if(!d||"offsetHeight"in d&&d.offsetHeight===0)return;const g=f.behavior==="smooth";let w,y,k;d===window?(y=Math.max(Ui(document.documentElement,"height"),document.documentElement.scrollHeight),w=window.innerHeight,k=document.documentElement.scrollTop):(y=d.scrollHeight,w=Ui(d,"height"),k=d.scrollTop);const S=y-w;if(f.top=Math.ceil(Math.max(Math.min(S,f.top),0)),w$(w,y)||f.top===k){e({scrollTop:k,scrollHeight:y,viewportHeight:w}),g&&t(!0);return}g?(a.current=f.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,a.current=null,t(!0)},1e3)):a.current=null,d.scrollTo(f)}function c(f){i.current.scrollBy(f)}return{scrollerRef:i,scrollByCallback:c,scrollToCallback:u}}const jn=Ze(()=>{const e=Be(),t=Be(),n=se(0),r=Be(),o=se(0),i=Be(),a=Be(),s=se(0),l=se(0),u=se(0),c=se(0),f=Be(),d=Be(),g=se(!1);return me(ee(e,de(({scrollTop:w})=>w)),t),me(ee(e,de(({scrollHeight:w})=>w)),a),me(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:i,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:a,smoothScrollTargetReached:r,scrollTo:f,scrollBy:d,statefulScrollTop:o,deviation:n,scrollingInProgress:g}},[],{singleton:!0}),jc={lvl:0};function x$(e,t,n,r=jc,o=jc){return{k:e,v:t,lvl:n,l:r,r:o}}function nt(e){return e===jc}function ol(){return jc}function Vb(e,t){if(nt(e))return jc;const{k:n,l:r,r:o}=e;if(t===n){if(nt(r))return o;if(nt(o))return r;{const[i,a]=E$(r);return Hd(Ht(e,{k:i,v:a,l:C$(r)}))}}else return tt&&(s=s.concat(Hb(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Hb(a,t,n))),s}function xa(e){return nt(e)?[]:[...xa(e.l),{k:e.k,v:e.v},...xa(e.r)]}function E$(e){return nt(e.r)?[e.k,e.v]:E$(e.r)}function C$(e){return nt(e.r)?e.l:Hd(Ht(e,{r:C$(e.r)}))}function Ht(e,t){return x$(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function wg(e){return nt(e)||e.lvl>e.r.lvl}function J_(e){return Wb(P$(e))}function Hd(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(wg(t))return P$(Ht(e,{lvl:r-1}));if(!nt(t)&&!nt(t.r))return Ht(t.r,{l:Ht(t,{r:t.r.l}),r:Ht(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(wg(e))return Wb(Ht(e,{lvl:r-1}));if(!nt(n)&&!nt(n.l)){const o=n.l,i=wg(o)?n.lvl-1:n.lvl;return Ht(o,{l:Ht(e,{r:o.l,lvl:r-1}),r:Wb(Ht(n,{l:o.r,lvl:i})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function ov(e,t,n){if(nt(e))return[];const r=to(e,t)[0];return Cfe(Hb(e,r,n))}function k$(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const i=[];for(let a=1;a({index:t,value:n}))}function Wb(e){const{r:t,lvl:n}=e;return!nt(t)&&!nt(t.r)&&t.lvl===n&&t.r.lvl===n?Ht(t,{l:Ht(e,{r:t.l}),lvl:n+1}):e}function P$(e){const{l:t}=e;return!nt(t)&&t.lvl===e.lvl?Ht(t,{r:Ht(e,{l:t.r})}):e}function Dh(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const i=Math.floor((r+o)/2),a=e[i],s=n(a,t);if(s===0)return i;if(s===-1){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function _$(e,t,n){return e[Dh(e,t,n)]}function kfe(e,t,n,r){const o=Dh(e,t,r),i=Dh(e,n,r,o);return e.slice(o,i+1)}const BS=Ze(()=>({recalcInProgress:se(!1)}),[],{singleton:!0});function Pfe(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function eO(e,t){let n=0,r=0;for(;n=c||o===d)&&(e=Vb(e,c)):(u=d!==o,l=!0),f>a&&a>=c&&d!==o&&(e=Jn(e,a+1,d));u&&(e=Jn(e,i,o))}return[e,n]}function Ofe(){return{offsetTree:[],sizeTree:ol(),groupOffsetTree:ol(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function FS({index:e},t){return t===e?0:t0&&(t=Math.max(t,_$(e,r,FS).offset)),k$(kfe(e,t,n,Tfe),Rfe)}function qb(e,t,n,r){let o=e,i=0,a=0,s=0,l=0;if(t!==0){l=Dh(o,t-1,FS),s=o[l].offset;const c=to(n,t-1);i=c[0],a=c[1],o.length&&o[l].size===to(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:u,value:c}of ov(n,t,1/0)){const f=u-i,d=f*a+s+f*r;o.push({offset:d,size:c,index:u}),i=u,s=d,a=c}return{offsetTree:o,lastIndex:i,lastOffset:s,lastSize:a}}function Afe(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,dr.DEBUG);const i=e.sizeTree;let a=i,s=0;if(n.length>0&&nt(i)&&t.length===2){const d=t[0].size,g=t[1].size;a=n.reduce((w,y)=>Jn(Jn(w,y,d),y+1,g),a)}else[a,s]=_fe(a,t);if(a===i)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:f}=qb(e.offsetTree,s,a,o);return{sizeTree:a,offsetTree:l,lastIndex:u,lastOffset:f,lastSize:c,groupOffsetTree:n.reduce((d,g)=>Jn(d,g,$c(g,l,o)),ol()),groupIndices:n}}function $c(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:i}=_$(t,e,FS),a=e-o,s=i*a+(a-1)*n+r;return s>0?s+n:s}function Lfe(e){return typeof e.groupIndex<"u"}function O$(e,t,n){if(Lfe(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=T$(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function T$(e,t){if(!iv(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function iv(e){return!nt(e.groupOffsetTree)}function jfe(e){return xa(e).map(({k:t,v:n},r,o)=>{const i=o[r+1],a=i?i.k-1:1/0;return{startIndex:t,endIndex:a,size:n}})}const Mfe={offsetHeight:"height",offsetWidth:"width"},To=Ze(([{log:e},{recalcInProgress:t}])=>{const n=Be(),r=Be(),o=_n(r,0),i=Be(),a=Be(),s=se(0),l=se([]),u=se(void 0),c=se(void 0),f=se((_,O)=>Ui(_,Mfe[O])),d=se(void 0),g=se(0),w=Ofe(),y=_n(ee(n,Le(l,e,g),yo(Afe,w),pt()),w),k=_n(ee(l,pt(),yo((_,O)=>({prev:_.current,current:O}),{prev:[],current:[]}),de(({prev:_})=>_)),[]);me(ee(l,Oe(_=>_.length>0),Le(y,g),de(([_,O,E])=>{const p=_.reduce((v,h,x)=>Jn(v,h,$c(h,O.offsetTree,E)||x),ol());return{...O,groupIndices:_,groupOffsetTree:p}})),y),me(ee(r,Le(y),Oe(([_,{lastIndex:O}])=>_[{startIndex:_,endIndex:O,size:E}])),n),me(u,c);const S=_n(ee(u,de(_=>_===void 0)),!0);me(ee(c,Oe(_=>_!==void 0&&nt(tr(y).sizeTree)),de(_=>[{startIndex:0,endIndex:0,size:_}])),n);const b=fr(ee(n,Le(y),yo(({sizes:_},[O,E])=>({changed:E!==_,sizes:E}),{changed:!1,sizes:w}),de(_=>_.changed)));Qe(ee(s,yo((_,O)=>({diff:_.prev-O,prev:O}),{diff:0,prev:0}),de(_=>_.diff)),_=>{const{groupIndices:O}=tr(y);if(_>0)Re(t,!0),Re(i,_+eO(_,O));else if(_<0){const E=tr(k);E.length>0&&(_-=eO(-_,E)),Re(a,_)}}),Qe(ee(s,Le(e)),([_,O])=>{_<0&&O("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},dr.ERROR)});const C=fr(i);me(ee(i,Le(y),de(([_,O])=>{const E=O.groupIndices.length>0,p=[],v=O.lastSize;if(E){const h=Mc(O.sizeTree,0);let x=0,T=0;for(;x<_;){const L=O.groupIndices[T],$=O.groupIndices.length===T+1?1/0:O.groupIndices[T+1]-L-1;p.push({startIndex:L,endIndex:L,size:h}),p.push({startIndex:L+1,endIndex:L+1+$-1,size:v}),T++,x+=$+1}const I=xa(O.sizeTree);return x!==_&&I.shift(),I.reduce((L,{k:$,v:j})=>{let M=L.ranges;return L.prevSize!==0&&(M=[...L.ranges,{startIndex:L.prevIndex,endIndex:$+_-1,size:L.prevSize}]),{ranges:M,prevIndex:$+_,prevSize:j}},{ranges:p,prevIndex:_,prevSize:0}).ranges}return xa(O.sizeTree).reduce((h,{k:x,v:T})=>({ranges:[...h.ranges,{startIndex:h.prevIndex,endIndex:x+_-1,size:h.prevSize}],prevIndex:x+_,prevSize:T}),{ranges:[],prevIndex:0,prevSize:v}).ranges})),n);const R=fr(ee(a,Le(y,g),de(([_,{offsetTree:O},E])=>{const p=-_;return $c(p,O,E)})));return me(ee(a,Le(y,g),de(([_,O,E])=>{if(O.groupIndices.length>0){if(nt(O.sizeTree))return O;let v=ol();const h=tr(k);let x=0,T=0,I=0;for(;x<-_;){I=h[T];const L=h[T+1]-I-1;T++,x+=L+1}if(v=xa(O.sizeTree).reduce((L,{k:$,v:j})=>Jn(L,Math.max(0,$+_),j),v),x!==-_){const L=Mc(O.sizeTree,I);v=Jn(v,0,L);const $=to(O.sizeTree,-_+1)[1];v=Jn(v,1,$)}return{...O,sizeTree:v,...qb(O.offsetTree,0,v,E)}}else{const v=xa(O.sizeTree).reduce((h,{k:x,v:T})=>Jn(h,Math.max(0,x+_),T),ol());return{...O,sizeTree:v,...qb(O.offsetTree,0,v,E)}}})),y),{data:d,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:i,shiftWith:a,shiftWithOffset:R,beforeUnshiftWith:C,firstItemIndex:s,gap:g,sizes:y,listRefresh:b,statefulTotalCount:o,trackItemSizes:S,itemSize:f}},vt(Zi,BS),{singleton:!0}),$fe=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function R$(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!$fe)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const mf=Ze(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:i,scrollTo:a,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:f},{log:d}])=>{const g=Be(),w=se(0);let y=null,k=null,S=null;function b(){y&&(y(),y=null),S&&(S(),S=null),k&&(clearTimeout(k),k=null),Re(o,!1)}return me(ee(g,Le(e,i,t,w,l,u,d),Le(r,c,f),de(([[C,R,_,O,E,p,v,h],x,T,I])=>{const A=R$(C),{align:L,behavior:$,offset:j}=A,M=O-1,z=O$(A,R,M);let N=$c(z,R.offsetTree,x)+p;L==="end"?(N+=T+to(R.sizeTree,z)[1]-_+I,z===M&&(N+=v)):L==="center"?N+=(T+to(R.sizeTree,z)[1]-_+I)/2:N-=E,j&&(N+=j);const D=F=>{b(),F?(h("retrying to scroll to",{location:C},dr.DEBUG),Re(g,C)):h("list did not change, scroll successful",{},dr.DEBUG)};if(b(),$==="smooth"){let F=!1;S=Qe(n,W=>{F=F||W}),y=Jo(s,()=>{D(F)})}else y=Jo(ee(n,Dfe(150)),D);return k=setTimeout(()=>{b()},1200),Re(o,!0),h("scrolling from index to",{index:z,top:N,behavior:$},dr.DEBUG),{top:N,behavior:$}})),a),{scrollToIndex:g,topListHeight:w}},vt(To,jn,Zi),{singleton:!0});function Dfe(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const Dc="up",qu="down",zfe="none",Nfe={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Bfe=0,vf=Ze(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:i}])=>{const a=se(!1),s=se(!0),l=Be(),u=Be(),c=se(4),f=se(Bfe),d=_n(ee(Q_(ee(_e(t),Pl(1),jo(!0)),ee(_e(t),Pl(1),jo(!1),Z_(100))),pt()),!1),g=_n(ee(Q_(ee(i,jo(!0)),ee(i,jo(!1),Z_(200))),pt()),!1);me(ee(Xt(_e(t),_e(f)),de(([b,C])=>b<=C),pt()),s),me(ee(s,Ei(50)),u);const w=fr(ee(Xt(e,_e(n),_e(r),_e(o),_e(c)),yo((b,[{scrollTop:C,scrollHeight:R},_,O,E,p])=>{const v=C+_-R>-p,h={viewportHeight:_,scrollTop:C,scrollHeight:R};if(v){let T,I;return C>b.state.scrollTop?(T="SCROLLED_DOWN",I=b.state.scrollTop-C):(T="SIZE_DECREASED",I=b.state.scrollTop-C||b.scrollTopDelta),{atBottom:!0,state:h,atBottomBecause:T,scrollTopDelta:I}}let x;return h.scrollHeight>b.state.scrollHeight?x="SIZE_INCREASED":_b&&b.atBottom===C.atBottom))),y=_n(ee(e,yo((b,{scrollTop:C,scrollHeight:R,viewportHeight:_})=>{if(w$(b.scrollHeight,R))return{scrollTop:C,scrollHeight:R,jump:0,changed:!1};{const O=R-(C+_)<1;return b.scrollTop!==C&&O?{scrollHeight:R,scrollTop:C,jump:b.scrollTop-C,changed:!0}:{scrollHeight:R,scrollTop:C,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Oe(b=>b.changed),de(b=>b.jump)),0);me(ee(w,de(b=>b.atBottom)),a),me(ee(a,Ei(50)),l);const k=se(qu);me(ee(e,de(({scrollTop:b})=>b),pt(),yo((b,C)=>tr(g)?{direction:b.direction,prevScrollTop:C}:{direction:Cb.direction)),k),me(ee(e,Ei(50),jo(zfe)),k);const S=se(0);return me(ee(d,Oe(b=>!b),jo(0)),S),me(ee(t,Ei(100),Le(d),Oe(([b,C])=>!!C),yo(([b,C],[R])=>[C,R],[0,0]),de(([b,C])=>C-b)),S),{isScrolling:d,isAtTop:s,isAtBottom:a,atBottomState:w,atTopStateChange:u,atBottomStateChange:l,scrollDirection:k,atBottomThreshold:c,atTopThreshold:f,scrollVelocity:S,lastJumpDueToItemResize:y}},vt(jn)),Qi=Ze(([{log:e}])=>{const t=se(!1),n=fr(ee(t,Oe(r=>r),pt()));return Qe(t,r=>{r&&tr(e)("props updated",{},dr.DEBUG)}),{propsReady:t,didMount:n}},vt(Zi),{singleton:!0});function US(e,t){e==0?t():requestAnimationFrame(()=>US(e-1,t))}function VS(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const yf=Ze(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o},{didMount:i}])=>{const a=se(!0),s=se(0),l=se(!1);return me(ee(i,Le(s),Oe(([u,c])=>!!c),jo(!1)),a),Qe(ee(Xt(t,i),Le(a,e,n,l),Oe(([[,u],c,{sizeTree:f},d,g])=>u&&(!nt(f)||DS(d))&&!c&&!g),Le(s)),([,u])=>{Re(l,!0),US(3,()=>{Jo(r,()=>Re(a,!0)),Re(o,u)})}),{scrolledToInitialItem:a,initialTopMostItemIndex:s}},vt(To,jn,mf,Qi),{singleton:!0});function tO(e){return e?e==="smooth"?"smooth":"auto":!1}const Ffe=(e,t)=>typeof e=="function"?tO(e(t)):t&&tO(e),Ufe=Ze(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:i},{propsReady:a,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=se(!1),f=Be();let d=null;function g(y){Re(o,{index:"LAST",align:"end",behavior:y})}Qe(ee(Xt(ee(_e(e),Pl(1)),s),Le(_e(c),n,i,u),de(([[y,k],S,b,C,R])=>{let _=k&&C,O="auto";return _&&(O=Ffe(S,b||R),_=_&&!!O),{totalCount:y,shouldFollow:_,followOutputBehavior:O}}),Oe(({shouldFollow:y})=>y)),({totalCount:y,followOutputBehavior:k})=>{d&&(d(),d=null),d=Jo(t,()=>{tr(l)("following output to ",{totalCount:y},dr.DEBUG),g(k),d=null})});function w(y){const k=Jo(r,S=>{y&&!S.atBottom&&S.notAtBottomBecause==="SIZE_INCREASED"&&!d&&(tr(l)("scrolling to bottom due to increased size",{},dr.DEBUG),g("auto"))});setTimeout(k,100)}return Qe(ee(Xt(_e(c),e,a),Oe(([y,,k])=>y&&k),yo(({value:y},[,k])=>({refreshed:y===k,value:k}),{refreshed:!1,value:0}),Oe(({refreshed:y})=>y),Le(c,e)),([,y])=>{w(y!==!1)}),Qe(f,()=>{w(tr(c)!==!1)}),Qe(Xt(_e(c),r),([y,k])=>{y&&!k.atBottom&&k.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&g("auto")}),{followOutput:c,autoscrollToBottom:f}},vt(To,vf,mf,yf,Qi,Zi,jn));function Vfe(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const I$=Ze(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const i=Be(),a=Be(),s=fr(ee(i,de(Vfe)));return me(ee(s,de(l=>l.totalCount)),e),me(ee(s,de(l=>l.groupIndices)),t),me(ee(Xt(r,n,o),Oe(([l,u])=>iv(u)),de(([l,u,c])=>to(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),pt(),de(l=>[l])),a),{groupCounts:i,topItemsIndexes:a}},vt(To,jn));function zc(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function A$(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const zh="top",Nh="bottom",nO="none";function rO(e,t,n){return typeof e=="number"?n===Dc&&t===zh||n===qu&&t===Nh?e:0:n===Dc?t===zh?e.main:e.reverse:t===Nh?e.main:e.reverse}function oO(e,t){return typeof e=="number"?e:e[t]||0}const HS=Ze(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const i=Be(),a=se(0),s=se(0),l=se(0),u=_n(ee(Xt(_e(e),_e(t),_e(r),_e(i,zc),_e(l),_e(a),_e(o),_e(n),_e(s)),de(([c,f,d,[g,w],y,k,S,b,C])=>{const R=c-b,_=k+S,O=Math.max(d-R,0);let E=nO;const p=oO(C,zh),v=oO(C,Nh);return g-=b,g+=d+S,w+=d+S,w-=b,g>c+_-p&&(E=Dc),wc!=null),pt(zc)),[0,0]);return{listBoundary:i,overscan:l,topListHeight:a,increaseViewportBy:s,visibleRange:u}},vt(jn),{singleton:!0});function Hfe(e,t,n){if(iv(t)){const r=T$(e,t);return[{index:to(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const Sg={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function iO(e,t,n){if(e.length===0)return[];if(!iv(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,o=e[e.length-1].index,i=[],a=ov(t.groupOffsetTree,r,o);let s,l=0;for(const u of e){(!s||s.end0){u=e[0].offset;const y=e[e.length-1];c=y.offset+y.size}const f=n-l,d=s+f*a+(f-1)*r,g=u,w=d-c;return{items:iO(e,o,i),topItems:iO(t,o,i),topListHeight:t.reduce((y,k)=>k.size+y,0),offsetTop:u,offsetBottom:w,top:g,bottom:c,totalCount:n,firstItemIndex:i}}function L$(e,t,n,r,o,i){let a=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-a>=e)break;a++}const s=e+a,l=VS(t,s),u=Array.from({length:s}).map((c,f)=>({index:f+l,size:0,offset:0,data:i[f+l]}));return Wd(u,[],s,o,n,r)}const es=Ze(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},i,{visibleRange:a,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:f},d,{didMount:g},{recalcInProgress:w}])=>{const y=se([]),k=se(0),S=Be();me(i.topItemsIndexes,y);const b=_n(ee(Xt(g,w,_e(a,zc),_e(t),_e(e),_e(c),u,_e(y),_e(r),_e(o),n),Oe(([O,E,,p,,,,,,,v])=>{const h=v&&v.length!==p;return O&&!E&&!h}),de(([,,[O,E],p,v,h,x,T,I,A,L])=>{const $=v,{sizeTree:j,offsetTree:M}=$,z=tr(k);if(p===0)return{...Sg,totalCount:p};if(O===0&&E===0)return z===0?{...Sg,totalCount:p}:L$(z,h,v,I,A,L||[]);if(nt(j))return z>0?null:Wd(Hfe(VS(h,p),$,L),[],p,A,$,I);const N=[];if(T.length>0){const Y=T[0],q=T[T.length-1];let X=0;for(const Q of ov(j,Y,q)){const oe=Q.value,pe=Math.max(Q.start,Y),re=Math.min(Q.end,q);for(let ie=pe;ie<=re;ie++)N.push({index:ie,size:oe,offset:X,data:L&&L[ie]}),X+=oe}}if(!x)return Wd([],N,p,A,$,I);const D=T.length>0?T[T.length-1]+1:0,F=Ife(M,O,E,D);if(F.length===0)return null;const W=p-1,H=rv([],Y=>{for(const q of F){const X=q.value;let Q=X.offset,oe=q.start;const pe=X.size;if(X.offset=E);ie++)Y.push({index:ie,size:pe,offset:Q,data:L&&L[ie]}),Q+=pe+A}});return Wd(H,N,p,A,$,I)}),Oe(O=>O!==null),pt()),Sg);me(ee(n,Oe(DS),de(O=>O==null?void 0:O.length)),t),me(ee(b,de(O=>O.topListHeight)),f),me(f,l),me(ee(b,de(O=>[O.top,O.bottom])),s),me(ee(b,de(O=>O.items)),S);const C=fr(ee(b,Oe(({items:O})=>O.length>0),Le(t,n),Oe(([{items:O},E])=>O[O.length-1].originalIndex===E-1),de(([,O,E])=>[O-1,E]),pt(zc),de(([O])=>O))),R=fr(ee(b,Ei(200),Oe(({items:O,topItems:E})=>O.length>0&&O[0].originalIndex===E.length),de(({items:O})=>O[0].index),pt())),_=fr(ee(b,Oe(({items:O})=>O.length>0),de(({items:O})=>{let E=0,p=O.length-1;for(;O[E].type==="group"&&EE;)p--;return{startIndex:O[E].index,endIndex:O[p].index}}),pt(A$)));return{listState:b,topItemsIndexes:y,endReached:C,startReached:R,rangeChanged:_,itemsRendered:S,initialItemCount:k,...d}},vt(To,I$,HS,yf,mf,vf,Qi,BS),{singleton:!0}),Wfe=Ze(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{initialItemCount:i,listState:a},{didMount:s}])=>(me(ee(s,Le(i),Oe(([,l])=>l!==0),Le(o,e,t,r,n),de(([[,l],u,c,f,d,g=[]])=>L$(l,u,c,f,d,g))),a),{}),vt(To,yf,es,Qi),{singleton:!0}),j$=Ze(([{scrollVelocity:e}])=>{const t=se(!1),n=Be(),r=se(!1);return me(ee(e,Le(r,t,n),Oe(([o,i])=>!!i),de(([o,i,a,s])=>{const{exit:l,enter:u}=i;if(a){if(l(o,s))return!1}else if(u(o,s))return!0;return a}),pt()),t),Qe(ee(Xt(t,e,n),Le(r)),([[o,i,a],s])=>o&&s&&s.change&&s.change(i,a)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},vt(vf),{singleton:!0}),qfe=Ze(([{topItemsIndexes:e}])=>{const t=se(0);return me(ee(t,Oe(n=>n>0),de(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},vt(es)),M$=Ze(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const i=Be(),a=_n(ee(Xt(e,r,t,n,o),de(([s,l,u,c,f])=>s+l+u+c+f.offsetBottom+f.bottom)),0);return me(_e(a),i),{totalListHeight:a,totalListHeightChanged:i}},vt(jn,es),{singleton:!0});function $$(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Kfe=$$(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Gfe=Ze(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:i,scrollDirection:a,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:f,gap:d},{log:g},{recalcInProgress:w}])=>{const y=fr(ee(l,Le(s),yo(([,S,b,C],[{items:R,totalCount:_,bottom:O,offsetBottom:E},p])=>{const v=O+E;let h=0;return b===_&&S.length>0&&R.length>0&&(R[0].originalIndex===0&&S[0].originalIndex===0||(h=v-C,h!==0&&(h+=p))),[h,R,_,v]},[0,[],0,0]),Oe(([S])=>S!==0),Le(t,a,r,i,g,w),Oe(([,S,b,C,,,R])=>!R&&!C&&S!==0&&b===Dc),de(([[S],,,,,b])=>(b("Upward scrolling compensation",{amount:S},dr.DEBUG),S))));function k(S){S>0?(Re(e,{top:-S,behavior:"auto"}),Re(n,0)):(Re(n,0),Re(e,{top:-S,behavior:"auto"}))}return Qe(ee(y,Le(n,o)),([S,b,C])=>{C&&Kfe()?Re(n,b-S):k(-S)}),Qe(ee(Xt(_n(o,!1),n,w),Oe(([S,b,C])=>!S&&!C&&b!==0),de(([S,b])=>b),Ei(1)),k),me(ee(c,de(S=>({top:-S}))),e),Qe(ee(u,Le(f,d),de(([S,{lastSize:b,groupIndices:C,sizeTree:R},_])=>{function O(E){return E*(b+_)}if(C.length===0)return O(S);{let E=0;const p=Mc(R,0);let v=0,h=0;for(;vS&&(E-=p,x=S-v+1),v+=x,E+=O(x),h++}return E}})),S=>{Re(n,S),requestAnimationFrame(()=>{Re(e,{top:S}),requestAnimationFrame(()=>{Re(n,0),Re(w,!1)})})}),{deviation:n}},vt(jn,vf,es,To,Zi,BS)),Yfe=Ze(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=se(0);return Qe(ee(e,Le(r),Oe(([,o])=>o!==0),de(([,o])=>({top:o}))),o=>{Jo(ee(n,Pl(1),Oe(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{Re(t,o)})})}),{initialScrollTop:r}},vt(Qi,jn,es),{singleton:!0}),Xfe=Ze(([{viewportHeight:e},{totalListHeight:t}])=>{const n=se(!1),r=_n(ee(Xt(n,e,t),Oe(([o])=>o),de(([,o,i])=>Math.max(0,o-i)),Ei(0),pt()),0);return{alignToBottom:n,paddingTopAddition:r}},vt(jn,M$),{singleton:!0}),WS=Ze(([{scrollTo:e,scrollContainerState:t}])=>{const n=Be(),r=Be(),o=Be(),i=se(!1),a=se(void 0);return me(ee(Xt(n,r),de(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),me(ee(e,Le(r),de(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),o),{useWindowScroll:i,customScrollParent:a,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},vt(jn)),Zfe=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:i,...a}})=>er?{...a,behavior:o,align:i??"end"}:null,Qfe=Ze(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:i,fixedHeaderHeight:a,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=Be();return me(ee(c,Le(e,o,t,i,a,s,r),Le(n),de(([[f,d,g,w,y,k,S,b],C])=>{const{done:R,behavior:_,align:O,calculateViewLocation:E=Zfe,...p}=f,v=O$(f,d,w-1),h=$c(v,d.offsetTree,C)+y+k,x=h+to(d.sizeTree,v)[1],T=b+k,I=b+g-S,A=E({itemTop:h,itemBottom:x,viewportTop:T,viewportBottom:I,locationParams:{behavior:_,align:O,...p}});return A?R&&Jo(ee(l,Oe(L=>L===!1),Pl(tr(l)?1:2)),R):R&&R(),A}),Oe(f=>f!==null)),u),{scrollIntoView:c}},vt(To,jn,mf,es,Zi),{singleton:!0}),Jfe=Ze(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:s}])=>{const l=Be(),u=se(void 0),c=se(null),f=se(null);return me(a,c),me(s,f),Qe(ee(l,Le(e,n,i,c,f)),([d,g,w,y,k,S])=>{const b=jfe(g.sizeTree);y&&k!==null&&S!==null&&(w=k.scrollTop-S.offsetTop),d({ranges:b,scrollTop:w})}),me(ee(u,Oe(DS),de(ede)),r),me(ee(o,Le(u),Oe(([,d])=>d!==void 0),pt(),de(([,d])=>d.ranges)),t),{getState:l,restoreStateFrom:u}},vt(To,jn,yf,Qi,WS));function ede(e){return{offset:e.scrollTop,index:0,align:"start"}}const tde=Ze(([e,t,n,r,o,i,a,s,l,u])=>({...e,...t,...n,...r,...o,...i,...a,...s,...l,...u}),vt(HS,Wfe,Qi,j$,M$,Yfe,Xfe,WS,Qfe,Zi)),nde=Ze(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:i,data:a,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:f},{initialTopMostItemIndex:d,scrolledToInitialItem:g},w,y,k,{listState:S,topItemsIndexes:b,...C},{scrollToIndex:R},_,{topItemCount:O},{groupCounts:E},p])=>(me(C.rangeChanged,p.scrollSeekRangeChanged),me(ee(p.windowViewportRect,de(v=>v.visibleHeight)),w.viewportHeight),{totalCount:e,data:a,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:d,scrolledToInitialItem:g,topItemsIndexes:b,topItemCount:O,groupCounts:E,fixedItemHeight:n,defaultItemHeight:r,gap:c,...k,statefulTotalCount:u,listState:S,scrollToIndex:R,trackItemSizes:o,itemSize:i,groupIndices:l,...C,...p,...w,sizes:f,...y}),vt(To,yf,jn,Jfe,Ufe,es,mf,Gfe,qfe,I$,tde)),xg="-webkit-sticky",aO="sticky",D$=$$(()=>{if(typeof document>"u")return aO;const e=document.createElement("div");return e.style.position=xg,e.style.position===xg?xg:aO});function z$(e,t){const n=Z.useRef(null),r=Z.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,f;if(t){const d=t.getBoundingClientRect(),g=l.top-d.top;c=d.height-Math.max(0,g),f=g+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),f=l.top+window.pageYOffset;n.current={offsetTop:f,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:o,ref:i}=NS(r),a=Z.useCallback(()=>{r(i.current)},[r,i]);return Z.useEffect(()=>{if(t){t.addEventListener("scroll",a);const s=new ResizeObserver(a);return s.observe(t),()=>{t.removeEventListener("scroll",a),s.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),o}const N$=Z.createContext(void 0),B$=Z.createContext(void 0);function F$(e){return e}const rde=Ze(()=>{const e=se(l=>`Item ${l}`),t=se(null),n=se(l=>`Group ${l}`),r=se({}),o=se(F$),i=se("div"),a=se(Nl),s=(l,u=null)=>_n(ee(r,de(c=>c[l]),pt()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:i,scrollerRef:a,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),ode=Ze(([e,t])=>({...e,...t}),vt(nde,rde)),ide=({height:e})=>Z.createElement("div",{style:{height:e}}),ade={position:D$(),zIndex:1,overflowAnchor:"none"},sde={overflowAnchor:"none"},sO=Z.memo(function({showTopList:t=!1}){const n=ze("listState"),r=Ar("sizeRanges"),o=ze("useWindowScroll"),i=ze("customScrollParent"),a=Ar("windowScrollContainerState"),s=Ar("scrollContainerState"),l=i||o?a:s,u=ze("itemContent"),c=ze("context"),f=ze("groupContent"),d=ze("trackItemSizes"),g=ze("itemSize"),w=ze("log"),y=Ar("gap"),{callbackRef:k}=Sfe(r,g,d,t?Nl:l,w,y,i),[S,b]=Z.useState(0);qS("deviation",A=>{S!==A&&b(A)});const C=ze("EmptyPlaceholder"),R=ze("ScrollSeekPlaceholder")||ide,_=ze("ListComponent"),O=ze("ItemComponent"),E=ze("GroupComponent"),p=ze("computeItemKey"),v=ze("isSeeking"),h=ze("groupIndices").length>0,x=ze("paddingTopAddition"),T=ze("scrolledToInitialItem"),I=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+x,paddingBottom:n.offsetBottom,marginTop:S,...T?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&C?Z.createElement(C,Nn(C,c)):Z.createElement(_,{...Nn(_,c),ref:k,style:I,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(A=>{const L=A.originalIndex,$=p(L+n.firstItemIndex,A.data,c);return v?Z.createElement(R,{...Nn(R,c),key:$,index:A.index,height:A.size,type:A.type||"item",...A.type==="group"?{}:{groupIndex:A.groupIndex}}):A.type==="group"?Z.createElement(E,{...Nn(E,c),key:$,"data-index":L,"data-known-size":A.size,"data-item-index":A.index,style:ade},f(A.index,c)):Z.createElement(O,{...Nn(O,c),key:$,"data-index":L,"data-known-size":A.size,"data-item-index":A.index,"data-item-group-index":A.groupIndex,item:A.data,style:sde},h?u(A.index,A.groupIndex,A.data,c):u(A.index,A.data,c))}))}),lde={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},av={width:"100%",height:"100%",position:"absolute",top:0},ude={width:"100%",position:D$(),top:0,zIndex:1};function Nn(e,t){if(typeof e!="string")return{context:t}}const cde=Z.memo(function(){const t=ze("HeaderComponent"),n=Ar("headerHeight"),r=ze("headerFooterTag"),o=Ja(a=>n(Ui(a,"height"))),i=ze("context");return t?Z.createElement(r,{ref:o},Z.createElement(t,Nn(t,i))):null}),fde=Z.memo(function(){const t=ze("FooterComponent"),n=Ar("footerHeight"),r=ze("headerFooterTag"),o=Ja(a=>n(Ui(a,"height"))),i=ze("context");return t?Z.createElement(r,{ref:o},Z.createElement(t,Nn(t,i))):null});function U$({usePublisher:e,useEmitter:t,useEmitterValue:n}){return Z.memo(function({style:i,children:a,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),f=n("scrollerRef"),d=n("context"),{scrollerRef:g,scrollByCallback:w,scrollToCallback:y}=S$(l,c,u,f);return t("scrollTo",y),t("scrollBy",w),Z.createElement(u,{ref:g,style:{...lde,...i},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...Nn(u,d)},a)})}function V$({usePublisher:e,useEmitter:t,useEmitterValue:n}){return Z.memo(function({style:i,children:a,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),f=n("totalListHeight"),d=n("deviation"),g=n("customScrollParent"),w=n("context"),{scrollerRef:y,scrollByCallback:k,scrollToCallback:S}=S$(l,c,u,Nl,g);return gfe(()=>(y.current=g||window,()=>{y.current=null}),[y,g]),t("windowScrollTo",S),t("scrollBy",k),Z.createElement(u,{style:{position:"relative",...i,...f!==0?{height:f+d}:{}},"data-virtuoso-scroller":!0,...s,...Nn(u,w)},a)})}const dde=({children:e})=>{const t=Z.useContext(N$),n=Ar("viewportHeight"),r=Ar("fixedItemHeight"),o=Ja(v$(n,i=>Ui(i,"height")));return Z.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),Z.createElement("div",{style:av,ref:o,"data-viewport-type":"element"},e)},pde=({children:e})=>{const t=Z.useContext(N$),n=Ar("windowViewportRect"),r=Ar("fixedItemHeight"),o=ze("customScrollParent"),i=z$(n,o);return Z.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),Z.createElement("div",{ref:i,style:av,"data-viewport-type":"window"},e)},hde=({children:e})=>{const t=ze("TopItemListComponent"),n=ze("headerHeight"),r={...ude,marginTop:`${n}px`},o=ze("context");return Z.createElement(t||"div",{style:r,context:o},e)},mde=Z.memo(function(t){const n=ze("useWindowScroll"),r=ze("topItemsIndexes").length>0,o=ze("customScrollParent"),i=o||n?gde:yde,a=o||n?pde:dde;return Z.createElement(i,{...t},r&&Z.createElement(hde,null,Z.createElement(sO,{showTopList:!0})),Z.createElement(a,null,Z.createElement(cde,null),Z.createElement(sO,null),Z.createElement(fde,null)))}),{Component:vde,usePublisher:Ar,useEmitterValue:ze,useEmitter:qS}=b$(ode,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},mde),yde=U$({usePublisher:Ar,useEmitterValue:ze,useEmitter:qS}),gde=V$({usePublisher:Ar,useEmitterValue:ze,useEmitter:qS}),bde=vde,lO={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},wde={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:uO,ceil:cO,floor:Bh,min:Eg,max:Ku}=Math;function Sde(e){return{...wde,items:e}}function fO(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const i=n===null?null:n[o+e];return{index:o+e,data:i}})}function xde(e,t){return e&&e.column===t.column&&e.row===t.row}function cd(e,t){return e&&e.width===t.width&&e.height===t.height}const Ede=Ze(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:i,scrollTo:a,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},f,d,{propsReady:g,didMount:w},{windowViewportRect:y,useWindowScroll:k,customScrollParent:S,windowScrollContainerState:b,windowScrollTo:C},R])=>{const _=se(0),O=se(0),E=se(lO),p=se({height:0,width:0}),v=se({height:0,width:0}),h=Be(),x=Be(),T=se(0),I=se(null),A=se({row:0,column:0}),L=Be(),$=Be(),j=se(!1),M=se(0),z=se(!0),N=se(!1);Qe(ee(w,Le(M),Oe(([q,X])=>!!X)),()=>{Re(z,!1),Re(O,0)}),Qe(ee(Xt(w,z,v,p,M,N),Oe(([q,X,Q,oe,,pe])=>q&&!X&&Q.height!==0&&oe.height!==0&&!pe)),([,,,,q])=>{Re(N,!0),US(1,()=>{Re(h,q)}),Jo(ee(r),()=>{Re(n,[0,0]),Re(z,!0)})}),me(ee($,Oe(q=>q!=null&&q.scrollTop>0),jo(0)),O),Qe(ee(w,Le($),Oe(([,q])=>q!=null)),([,q])=>{q&&(Re(p,q.viewport),Re(v,q==null?void 0:q.item),Re(A,q.gap),q.scrollTop>0&&(Re(j,!0),Jo(ee(r,Pl(1)),X=>{Re(j,!1)}),Re(a,{top:q.scrollTop})))}),me(ee(p,de(({height:q})=>q)),o),me(ee(Xt(_e(p,cd),_e(v,cd),_e(A,(q,X)=>q&&q.column===X.column&&q.row===X.row),_e(r)),de(([q,X,Q,oe])=>({viewport:q,item:X,gap:Q,scrollTop:oe}))),L),me(ee(Xt(_e(_),t,_e(A,xde),_e(v,cd),_e(p,cd),_e(I),_e(O),_e(j),_e(z),_e(M)),Oe(([,,,,,,,q])=>!q),de(([q,[X,Q],oe,pe,re,ie,Ce,,rt,ne])=>{const{row:be,column:Te}=oe,{height:je,width:Mn}=pe,{width:It}=re;if(Ce===0&&(q===0||It===0))return lO;if(Mn===0){const ts=VS(ne,q),bf=ts===0?Math.max(Ce-1,0):ts;return Sde(fO(ts,bf,ie))}const Jt=H$(It,Mn,Te);let en,kt;rt?X===0&&Q===0&&Ce>0?(en=0,kt=Ce-1):(en=Jt*Bh((X+be)/(je+be)),kt=Jt*cO((Q+be)/(je+be))-1,kt=Eg(q-1,Ku(kt,Jt-1)),en=Eg(kt,Ku(0,en))):(en=0,kt=-1);const Br=fO(en,kt,ie),{top:no,bottom:Ji}=dO(re,oe,pe,Br),ea=cO(q/Jt),gf=ea*je+(ea-1)*be-Ji;return{items:Br,offsetTop:no,offsetBottom:gf,top:no,bottom:Ji,itemHeight:je,itemWidth:Mn}})),E),me(ee(I,Oe(q=>q!==null),de(q=>q.length)),_),me(ee(Xt(p,v,E,A),Oe(([q,X,{items:Q}])=>Q.length>0&&X.height!==0&&q.height!==0),de(([q,X,{items:Q},oe])=>{const{top:pe,bottom:re}=dO(q,oe,X,Q);return[pe,re]}),pt(zc)),n);const D=se(!1);me(ee(r,Le(D),de(([q,X])=>X||q!==0)),D);const F=fr(ee(_e(E),Oe(({items:q})=>q.length>0),Le(_,D),Oe(([{items:q},X,Q])=>Q&&q[q.length-1].index===X-1),de(([,q])=>q-1),pt())),W=fr(ee(_e(E),Oe(({items:q})=>q.length>0&&q[0].index===0),jo(0),pt())),H=fr(ee(_e(E),Le(j),Oe(([{items:q},X])=>q.length>0&&!X),de(([{items:q}])=>({startIndex:q[0].index,endIndex:q[q.length-1].index})),pt(A$),Ei(0)));me(H,d.scrollSeekRangeChanged),me(ee(h,Le(p,v,_,A),de(([q,X,Q,oe,pe])=>{const re=R$(q),{align:ie,behavior:Ce,offset:rt}=re;let ne=re.index;ne==="LAST"&&(ne=oe-1),ne=Ku(0,ne,Eg(oe-1,ne));let be=Kb(X,pe,Q,ne);return ie==="end"?be=uO(be-X.height+Q.height):ie==="center"&&(be=uO(be-X.height/2+Q.height/2)),rt&&(be+=rt),{top:be,behavior:Ce}})),a);const Y=_n(ee(E,de(q=>q.offsetBottom+q.bottom)),0);return me(ee(y,de(q=>({width:q.visibleWidth,height:q.visibleHeight}))),p),{data:I,totalCount:_,viewportDimensions:p,itemDimensions:v,scrollTop:r,scrollHeight:x,overscan:e,scrollBy:i,scrollTo:a,scrollToIndex:h,smoothScrollTargetReached:s,windowViewportRect:y,windowScrollTo:C,useWindowScroll:k,customScrollParent:S,windowScrollContainerState:b,deviation:T,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:O,gap:A,restoreStateFrom:$,...d,initialTopMostItemIndex:M,gridState:E,totalListHeight:Y,...f,startReached:W,endReached:F,rangeChanged:H,stateChanged:L,propsReady:g,stateRestoreInProgress:j,...R}},vt(HS,jn,vf,j$,Qi,WS,Zi));function dO(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const i=Kb(e,t,n,r[0].index),a=Kb(e,t,n,r[r.length-1].index)+o;return{top:i,bottom:a}}function Kb(e,t,n,r){const o=H$(e.width,n.width,t.column),i=Bh(r/o),a=i*n.height+Ku(0,i-1)*t.row;return a>0?a+t.row:a}function H$(e,t,n){return Ku(1,Bh((e+n)/(Bh(t)+n)))}const Cde=Ze(()=>{const e=se(u=>`Item ${u}`),t=se({}),n=se(null),r=se("virtuoso-grid-item"),o=se("virtuoso-grid-list"),i=se(F$),a=se("div"),s=se(Nl),l=(u,c=null)=>_n(ee(t,de(f=>f[u]),pt()),c);return{context:n,itemContent:e,components:t,computeItemKey:i,itemClassName:r,listClassName:o,headerFooterTag:a,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),kde=Ze(([e,t])=>({...e,...t}),vt(Ede,Cde)),Pde=Z.memo(function(){const t=gt("gridState"),n=gt("listClassName"),r=gt("itemClassName"),o=gt("itemContent"),i=gt("computeItemKey"),a=gt("isSeeking"),s=Jr("scrollHeight"),l=gt("ItemComponent"),u=gt("ListComponent"),c=gt("ScrollSeekPlaceholder"),f=gt("context"),d=Jr("itemDimensions"),g=Jr("gap"),w=gt("log"),y=gt("stateRestoreInProgress"),k=Ja(S=>{const b=S.parentElement.parentElement.scrollHeight;s(b);const C=S.firstChild;if(C){const{width:R,height:_}=C.getBoundingClientRect();d({width:R,height:_})}g({row:pO("row-gap",getComputedStyle(S).rowGap,w),column:pO("column-gap",getComputedStyle(S).columnGap,w)})});return y?null:Z.createElement(u,{ref:k,className:n,...Nn(u,f),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(S=>{const b=i(S.index,S.data,f);return a?Z.createElement(c,{key:b,...Nn(c,f),index:S.index,height:t.itemHeight,width:t.itemWidth}):Z.createElement(l,{...Nn(l,f),className:r,"data-index":S.index,key:b},o(S.index,S.data,f))}))}),_de=Z.memo(function(){const t=gt("HeaderComponent"),n=Jr("headerHeight"),r=gt("headerFooterTag"),o=Ja(a=>n(Ui(a,"height"))),i=gt("context");return t?Z.createElement(r,{ref:o},Z.createElement(t,Nn(t,i))):null}),Ode=Z.memo(function(){const t=gt("FooterComponent"),n=Jr("footerHeight"),r=gt("headerFooterTag"),o=Ja(a=>n(Ui(a,"height"))),i=gt("context");return t?Z.createElement(r,{ref:o},Z.createElement(t,Nn(t,i))):null}),Tde=({children:e})=>{const t=Z.useContext(B$),n=Jr("itemDimensions"),r=Jr("viewportDimensions"),o=Ja(i=>{r(i.getBoundingClientRect())});return Z.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),Z.createElement("div",{style:av,ref:o},e)},Rde=({children:e})=>{const t=Z.useContext(B$),n=Jr("windowViewportRect"),r=Jr("itemDimensions"),o=gt("customScrollParent"),i=z$(n,o);return Z.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),Z.createElement("div",{ref:i,style:av},e)},Ide=Z.memo(function({...t}){const n=gt("useWindowScroll"),r=gt("customScrollParent"),o=r||n?Lde:Ade,i=r||n?Rde:Tde;return Z.createElement(o,{...t},Z.createElement(i,null,Z.createElement(_de,null),Z.createElement(Pde,null),Z.createElement(Ode,null)))}),{Component:epe,usePublisher:Jr,useEmitterValue:gt,useEmitter:W$}=b$(kde,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},Ide),Ade=U$({usePublisher:Jr,useEmitterValue:gt,useEmitter:W$}),Lde=V$({usePublisher:Jr,useEmitterValue:gt,useEmitter:W$});function pO(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,dr.WARN),t==="normal"?0:parseInt(t??"0",10)}function KS({view:e,changingView:t}){const[n,r]=G(s=>{var l;return[s.events[e]||[],((l=s.eventsNewer[e])==null?void 0:l.length)||0]}),o=P.useRef(Date.now()),i=async()=>{if(o.current>Date.now()-2e3||t===!0)return;o.current=Date.now();const s=G.getState().nextQuery;s&&s.next&&s.next.reqCount&&s.next.reqCount>2&&G.getState().events[e]&&G.getState().events[e].length<10?await G.getState().getEvents({token:s.token,query:{...s.next,filters:{...s.next.filters,until:Math.round(Date.now()/1e3),since:Math.round(Date.now()/1e3)-30*24*60*60}}},"replace"):await G.getState().getEvents()};P.useEffect(()=>{G.getState().nextQuery&&i()},[]);const a=()=>{G.getState().mergeNewerEvents(e)};return m.jsxs(m.Fragment,{children:[r>0&&m.jsxs(ve,{onClick:a,variant:"outline",colorScheme:"blue",size:"sm",mb:2,width:"100%",children:[r," new events"]}),m.jsx(bde,{useWindowScroll:!0,data:n,itemContent:(s,l)=>m.jsx(he,{mb:2,children:m.jsx(tv,{data:l,level:0},s)}),endReached:()=>{i()}})]})}function jde({showFollowing:e,showMentions:t,changeFeed:n}){const[r,o]=P.useState([]),[i,a]=P.useState("global"),s=async()=>{const c=await G.getState().getAllLists();c&&o(c.map(f=>({id:f.id,title:f.title})))},l=()=>{o([])},u=c=>{a(c),n(c)};return P.useEffect(()=>(setTimeout(()=>{s()},100),l),[]),m.jsx(UL,{onChange:u,value:i,children:m.jsxs(Mm,{direction:"row",children:[m.jsx(gu,{value:"global",children:"Global"}),e&&m.jsx(gu,{value:"following",children:"Following"}),t&&m.jsx(gu,{value:"mentions",children:"Mentions"}),r&&r.length>0&&r.map(c=>m.jsx(gu,{value:c.id,children:c.title},c.id))]})})}function Cg(e){return new Gi({kinds:[Rn.SHORT_TEXT_NOTE,Rn.LONG_FORM_CONTENT],until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-1728e5)/1e3),limit:e||15})}function Gb(e,t){const n=new Gi({kinds:[Rn.SHORT_TEXT_NOTE,Rn.LONG_FORM_CONTENT],authors:e,until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-6048e5)/1e3),limit:t||15});return t&&(n.limit=t),n}function Mde(e,t){const n=new Gi({kinds:[Rn.SHORT_TEXT_NOTE,Rn.LONG_FORM_CONTENT],"#t":e,until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-6048e5)/1e3),limit:t||15});return t&&(n.limit=t),n}function $de(e,t){const n=new Gi({kinds:[Rn.SHORT_TEXT_NOTE,Rn.LONG_FORM_CONTENT,Rn.REPOST],"#p":e});return t&&(n.limit=t),n}function Dde(){const[e,t,n]=G(c=>[c.status,c.keypairIsLoaded,c.keypair]),r=P.useRef(!1),o=P.useRef(Cg()),[i,a]=P.useState("global"),s=P.useRef(!1),l=async()=>{r.current||(r.current=!0,o.current=Cg(),a("global"),await G.getState().getEvents({token:i,query:{direction:"OLDER",filters:o.current,stickyInterval:!0,isLive:!0}}),r.current=!0)};P.useEffect(()=>(["online","offline"].includes(G.getState().status)&&l(),()=>{G.getState().unsubscribeByToken(i)}),[]),P.useEffect(()=>{["online","offline"].includes(G.getState().status)&&l()},[e]);const u=async c=>{if(s.current=!0,await G.getState().unsubscribeByToken(i),a(c),c==="global")o.current=Cg();else if(c==="following"){const f=await G.getState().getAllUsersFollowing();f&&(o.current=Gb(f==null?void 0:f.map(d=>d.user.pubkey)))}else if(c==="mentions")o.current=$de([n.publicKey]);else{const f=await G.getState().getList(c);if(f&&f.userPubkeys)o.current=Gb(f.userPubkeys);else{console.error("List not found."),s.current=!1;return}}await G.getState().getEvents({token:c,query:{filters:o.current,stickyInterval:!0,isLive:!0}}),s.current=!1};return m.jsxs(he,{children:[m.jsx(he,{p:2,children:m.jsx(jde,{showFollowing:!0,showMentions:t,changeFeed:u})}),m.jsx(KS,{changingView:s.current,view:i})]})}function zde(){const[e,t]=P.useState([]),[n,r]=P.useState(0),[o,i]=P.useState(!1),[a,s]=P.useState(!1),l=P.useRef(0),u=async()=>{await G.getState().getPopularUsers().then(g=>{g&&g.length>0?(r(100),clearInterval(l.current),t(g)):n>90?(s(!0),clearInterval(l.current),i(!1)):r(w=>w+5)})},c=async()=>{t([]),r(0),l.current=setInterval(async()=>{await u()},2e3)};P.useEffect(()=>(c(),()=>{l.current&&clearInterval(l.current)}),[]);const f=async()=>{i(!0),await G.getState().calculatePopular(),await c(),i(!1)},d=m.jsx(m.Fragment,{children:a?m.jsx(fe,{fontSize:"sm",mb:2,children:"Looks like there are no events to work with yet. Try again after browsing a little longer."}):m.jsx(m.Fragment,{children:m.jsx(BL,{size:"xs",mb:2,hasStripe:!0,value:n})})});return m.jsxs(he,{children:[m.jsxs(tt,{spacing:2,mb:4,children:[m.jsx(Qr,{as:"h2",size:"md",marginBottom:4,children:"Hot right now"}),m.jsx(Xa,{}),!o&&n===100?m.jsx(ve,{onClick:f,size:"xs",marginBottom:2,children:"Refresh"}):m.jsx(ve,{onClick:c,size:"xs",disabled:!0,marginBottom:2,children:"Calculating ..."})]}),e.length>0?e.map((g,w)=>m.jsx(Yi,{user:g.user,opts:{showAbout:!1,showBanner:!1,showFollowing:!0,showBlock:!1,relayUrls:[],isBlocked:!1}},w)):d]})}function Nde(){const[e]=G(t=>[t.connected]);return m.jsxs(jl,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[m.jsxs(he,{children:[m.jsx(Dde,{}),!e&&m.jsx(Ll,{src:cM})]}),m.jsx(he,{display:"flex",flexDirection:"column",children:m.jsx(he,{mt:4,children:m.jsx(zde,{})})})]})}function Bde(){const[e,t]=G(f=>[f.keypair.publicKey,f.status]),[n,r]=P.useState([]),[o,i]=P.useState(0),[a,s]=P.useState(!1);P.useEffect(()=>{l();const f=setInterval(l,3e3);return()=>clearInterval(f)},[]),P.useEffect(()=>{a&&setTimeout(()=>{s(!1)},3e3)},[a]);const l=async()=>{await G.getState().getAllUsersFollowing().then(f=>{f&&f.length>0&&r(f)}),e&&await G.getState().lastContactsUpdate(e).then(f=>{f&&i(f)})},u=async()=>{s(!0),await G.getState().subscribe({type:pf.REQ,filters:new Gi({kinds:[Rn.CONTACTS],authors:[e]}),options:{timeoutIn:1e4}})},c=async()=>{s(!0);const f=bre({contacts:n.map(d=>({key:d.user.pubkey,relayUrls:d.relayUrls}))});await G.getState().signAndSendEvent({event:f})};return m.jsxs(he,{children:[m.jsx(Qr,{size:"lg",children:"Following"}),n.length>0?m.jsxs(m.Fragment,{children:[m.jsx(fe,{maxWidth:"800px",children:"You may decide not to publish the people you follow, but you won't be able to access this list from other devices, and it will be lost if you clear your browser data. Note: Load overwrites local data."}),m.jsxs(tt,{mt:2,mb:2,children:[m.jsxs(Qc,{children:[m.jsx(ve,{onClick:u,isDisabled:!e||t!=="online",isLoading:a,children:"Load"}),m.jsx(ve,{onClick:c,isDisabled:!e||t!=="online",isLoading:a,children:"Publish"})]}),m.jsxs(fe,{children:["Last published:"," ",o?new Date(o*1e3).toLocaleString():"never"]})]}),n.map(f=>m.jsx(he,{mb:"3",children:m.jsx(Yi,{user:f.user,opts:{showFollowing:!0,relayUrls:f.relayUrls}},f.user.pubkey)},f.user.pubkey))]}):m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Follow users to easily access their content. By default, this list is not public."}),m.jsx(he,{pb:2,pt:2,children:m.jsx(ve,{onClick:u,isDisabled:!e||t!=="online",isLoading:a,children:"Load followers"})}),m.jsx(fe,{fontWeight:"bold",children:"You are not following anyone."})]})]})}function Fde(){const[e]=G(y=>[y.status]),t=P.useRef(void 0),n=P.useRef(null),r=P.useRef(null),[o,i]=P.useState(null),[a,s]=P.useState(!1),{npub:l}=dS(),u=`profile-${l}`,c=()=>t.current===l,f=async(y,k=0)=>{s(!0),await G.getState().getUser(y).then(S=>{S?(i(S),s(!1),r.current&&clearTimeout(r.current)):r.current=setTimeout(async()=>{if(console.log(`Retrying to load user ${y} ...`),k===2)await G.getState().requestInformation({idsOrKeys:[y],source:"users"},{timeoutIn:1e4});else if(k>20){s(!1),r.current&&clearTimeout(r.current);return}await f(y,k+1)},1e3)})},d=async y=>{await G.getState().count(y)},g=async()=>{if(l)try{const y=Wm(l);let k;for(const S of y.tlvItems)if(S.type===0){k=S.value;break}if(!k)return;n.current=k,i(null),await f(k),await d(k)}catch(y){console.log(y);return}},w=async y=>{t.current=l,await G.getState().getEvents({token:u,query:{direction:"OLDER",filters:Gb([y]),stickyInterval:!0,isLive:!0}})};return P.useEffect(()=>()=>{r.current&&clearTimeout(r.current),G.getState().unsubscribeByToken(u)},[]),P.useEffect(()=>{["online","offline"].includes(G.getState().status)&&g()},[e,l]),P.useEffect(()=>{["online","offline"].includes(G.getState().status)&&n.current&&!c()&&w(n.current)},[e,n.current]),m.jsxs(jl,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[m.jsxs(he,{children:[m.jsxs(he,{mb:4,children:[a&&m.jsx(kS,{text:"Just a sec ... Searching the Matrix for the user."}),o&&m.jsx(Yi,{user:o.user,opts:{showAbout:!0,showBanner:!0,showFollowing:!0,relayUrls:o.relayUrls,showBlock:!0}})]}),m.jsx(KS,{view:u})]}),m.jsx(he,{display:"flex",flexDirection:"column"})]})}function Ude({props:e}){const[t,n]=P.useState({name:"",display_name:"",picture:"",banner:"",nip05:"",website:"",about:"",image:"",lud16:"",lud06:""}),[r,o]=P.useState(""),[i,a]=P.useState(!1),s=P.useRef(!1),l=ni(),{isOpen:u,onOpen:c,onClose:f}=yn(),[d,g]=P.useState([]),w=d.filter(C=>C.isAssigned).length,y=(C,R)=>{g(d.map(_=>_.data.url===C?{..._,isAssigned:R==="add"}:_))};P.useEffect(()=>{e.metadata&&!s.current&&n(Object.assign(t,e.metadata))},[e.metadata]),P.useEffect(()=>{G.getState().getRelays().then(C=>{C&&g(C.map(R=>R.isReady&&R.write?{data:R,isAssigned:!0}:{data:R,isAssigned:!1}))})},[]);const k=C=>{l({title:"Error",description:C,status:"error",duration:5e3,isClosable:!0})},S=async()=>{a(!0);const C=d.map(O=>O.data.url);if(C.length===0){k("Select at least one relay"),a(!1);return}const R={};for(const[O,E]of Object.entries(t))E&&E!==""&&(R[O]=E);const _=hre({userMetadata:R,mastodonUrl:r});if(Object.keys(R).length===0){l({title:"No changes",description:"No changes to update.",status:"info",duration:5e3,isClosable:!0}),a(!1);return}try{await G.getState().signAndSendEvent({event:_,relayUrls:C}),a(!1),await G.getState().subscribe({type:pf.REQ,filters:new Gi({authors:[e.pubkey],kinds:[Rn.METADATA]}),options:{timeoutIn:1e4,view:"user-profile"}})}catch(O){console.error(O),a(!1)}},b=C=>{const{name:R,value:_}=C.target;n(O=>({...O,[R]:_})),s.current=!0};return m.jsxs(he,{marginBottom:10,children:[m.jsxs(En,{id:"name",mb:4,children:[m.jsx(on,{children:"Name"}),m.jsx(Ot,{name:"name",value:t.name,onChange:b})]}),m.jsxs(En,{id:"display_name",mb:4,children:[m.jsx(on,{children:"Display Name"}),m.jsx(Ot,{name:"display_name",value:t.display_name||"",onChange:b})]}),m.jsxs(En,{id:"website",mb:4,children:[m.jsx(on,{children:"Website"}),m.jsx(Ot,{name:"website",value:t.website||"",onChange:b})]}),m.jsxs(En,{id:"about",mb:4,children:[m.jsx(on,{children:"About"}),m.jsx(lS,{name:"about",value:t.about||"",onChange:b})]}),m.jsxs(En,{id:"picture",mb:4,children:[m.jsx(on,{children:"Picture URL"}),m.jsx(Ot,{name:"picture",value:t.picture||"",onChange:b}),m.jsx(ua,{children:"URL for your profile picture."})]}),m.jsxs(En,{id:"banner",mb:4,children:[m.jsx(on,{children:"Banner URL"}),m.jsx(Ot,{name:"banner",value:t.banner||"",onChange:b}),m.jsx(ua,{children:"URL for your profile banner."})]}),m.jsxs(En,{id:"image",mb:4,children:[m.jsx(on,{children:"Image URL"}),m.jsx(Ot,{name:"image",value:t.image||"",onChange:b}),m.jsx(ua,{children:"URL for an additional image."})]}),m.jsxs(En,{id:"nip05",mb:4,children:[m.jsx(on,{children:"NIP05"}),m.jsx(Ot,{name:"nip05",value:t.nip05||"",onChange:b}),m.jsx(ua,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),m.jsxs(En,{id:"lud16",mb:4,children:[m.jsx(on,{children:"LUD16"}),m.jsx(Ot,{name:"lud16",value:t.lud16||"",onChange:b}),m.jsx(ua,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),m.jsxs(En,{id:"lud06",mb:4,children:[m.jsx(on,{children:"LUD06"}),m.jsx(Ot,{name:"lud06",value:t.lud06||"",onChange:b}),m.jsx(ua,{children:"bech32 encoded lnurl"})]}),m.jsxs(En,{id:"mastodonUrl",mb:4,children:[m.jsx(on,{children:"Mastodon URL"}),m.jsx(Ot,{name:"mastodonUrl",value:r,onChange:C=>o(C.target.value)})]}),u&&m.jsx(aM,{relays:d,onChange:y}),m.jsxs(Qc,{children:[m.jsx(ve,{colorScheme:"blue",type:"submit",isLoading:i,onClick:S,children:"Send update"}),m.jsxs(ve,{variant:"outline",onClick:u?f:c,children:["Select relays (",w,")"]}),m.jsx(ve,{isDisabled:!s.current||w===0,onClick:()=>s.current=!1,children:"Reset"})]})]})}function Vde(){const[e,t]=G(u=>{var c;return[((c=u.keypair)==null?void 0:c.publicKey)||"",u.connected]}),[n,r]=P.useState(null),[o,i]=P.useState([]),a=ni(),s=async()=>{if(!e||e==="")return;const u=await G.getState().getUser(e);u&&(r(u.user),i(u.relayUrls))},l=async()=>{if(!e||e===""){a({title:"Not found",description:"No user data found yet. Did you publish your profile to one of the connected relays?",status:"error",duration:5e3,isClosable:!0});return}await G.getState().subscribe({type:pf.REQ,filters:new Gi({authors:[e],kinds:[Rn.METADATA]}),options:{timeoutIn:1e4,view:"user-profile"}}),a({title:"Refreshing ...",description:"Requesting information from the network.",status:"info",duration:5e3,isClosable:!0})};return P.useEffect(()=>{const u=setInterval(()=>{s()},1e3);return()=>{clearInterval(u)}},[]),m.jsxs(he,{children:[n?m.jsx(Yi,{user:n,opts:{relayUrls:o}}):m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:'"No user data found yet. Did you publish your profile to one of the connected relays?".'}),t&&m.jsx(ve,{onClick:l,children:"Try again"})]}),m.jsx(Qr,{as:"h2",size:"lg",mb:4,mt:4,children:"Update your profile"}),m.jsx(Ude,{props:{pubkey:e,metadata:n==null?void 0:n.data}})]})}function Hde(){const[e,t]=P.useState([]),n=async()=>{await G.getState().getAllUsersBlocked().then(r=>{r&&t(r)})};return P.useEffect(()=>{n();const r=setInterval(n,2e3);return()=>clearInterval(r)},[]),m.jsxs(he,{children:[m.jsx(Qr,{size:"lg",children:"Blocked"}),e.length>0?m.jsx(m.Fragment,{children:e.map(r=>m.jsx(he,{mb:"3",children:m.jsx(Yi,{user:r.user,opts:{showFollowing:!1,showBlock:!0,relayUrls:r.relayUrls,isBlocked:!0}},r.user.pubkey)},r.user.pubkey))}):m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Block users to ignore their events. The information is stored in your browser and not shared with relays."}),m.jsx(fe,{fontWeight:"bold",children:"You have not blocked anyone."})]})]})}function Wde({user:e,opts:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:a,avatarSize:s}}){const l=e.data&&e.data.picture?e.data.picture:"";return m.jsx(m.Fragment,{children:m.jsxs(rS,{children:[m.jsx(nS,{children:a?m.jsxs(he,{position:"relative",children:[m.jsx(Lp,{size:s,src:l}),m.jsx(he,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(255, 255, 255, 0.5)",borderRadius:10}),m.jsx(fe,{position:"absolute",right:"0",bottom:"0",backgroundColor:"white",height:15,width:15,textAlign:"center",borderRadius:10,fontSize:12,children:a})]}):m.jsx(Lp,{size:s,src:l})}),m.jsxs(sS,{children:[m.jsx(oS,{}),m.jsx(aS,{}),m.jsx(zL,{children:i}),m.jsx(iS,{children:m.jsx(Yi,{user:e,opts:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:a,avatarSize:s}})})]})]})})}function qde(){const[e,t]=P.useState([]),[n,r]=P.useState(null),[o,i]=P.useState(""),[a,s]=P.useState(!1),{isOpen:l,onOpen:u,onClose:c}=yn(),f=async()=>{await G.getState().getAllLists().then(b=>{b&&t(b)})};P.useEffect(()=>{f();const b=setInterval(f,2e3);return()=>clearInterval(b)},[]);const d=async()=>{s(!0),await G.getState().createList({title:o}),i(""),s(!1)},g=async b=>{s(!0),await G.getState().deleteList(b),s(!1),await f()},w=async b=>{n&&(s(!0),await G.getState().removeUserFromList(n.id,b),await f(),n.users&&r({...n,users:n.users.filter(C=>C.user.pubkey!==b)}),s(!1))},y=b=>m.jsx(he,{children:(b==null?void 0:b.users)&&b.users.map(C=>m.jsx(Wde,{user:C.user,opts:{avatarSize:"sm",relayUrls:C.relayUrls}},C.user.pubkey))}),k=m.jsxs(ir,{isOpen:l,onClose:c,size:"xl",children:[m.jsx(lr,{}),m.jsxs(ar,{maxHeight:"80vh",maxWidth:"80vw",children:[m.jsx(sr,{children:"List"}),m.jsx(cr,{}),m.jsx(ur,{overflowY:"auto",children:(n==null?void 0:n.users)&&n.users.map(b=>m.jsx(he,{p:1,children:m.jsxs(tt,{children:[m.jsx(Yi,{user:b.user,opts:{avatarSize:"sm",relayUrls:b.relayUrls}},b.user.pubkey),m.jsx(Xa,{}),m.jsx(ve,{size:"sm",onClick:()=>w(b.user.pubkey),isLoading:a,children:"Remove"})]})},b.user.pubkey))})]})]}),S=b=>m.jsxs(Fi,{children:[m.jsx(wt,{children:b.title}),m.jsx(wt,{children:y(b)}),m.jsx(wt,{children:m.jsx(ve,{size:"sm",onClick:()=>{r(b),u()},children:"Edit"})}),m.jsx(wt,{children:m.jsx(ve,{size:"sm",onClick:()=>g(b.id),isLoading:a,children:"Delete"})})]},b.id);return m.jsxs(he,{children:[m.jsx(Qr,{size:"lg",children:"Lists"}),m.jsx(fe,{children:"Lists make it easy to organize users."}),m.jsx(he,{mt:2,mb:2,children:m.jsxs(tt,{children:[m.jsx(Ot,{value:o,onChange:b=>i(b.target.value),placeholder:"Friends"}),m.jsx(ve,{size:"sm",onClick:d,isLoading:a,children:"Create list"})]})}),m.jsxs(uf,{variant:"simple",marginBottom:4,children:[m.jsx(zm,{children:m.jsxs(Fi,{children:[m.jsx(St,{children:"Title"}),m.jsx(St,{children:"Users"}),m.jsx(St,{}),m.jsx(St,{})]})}),m.jsx(Nm,{children:e.map(b=>S(b))})]}),k]})}function Kde(){const[e]=G(d=>[d.connected]),t=P.useRef(!1),n=P.useRef(""),r=P.useRef([]),o=P.useRef(null),[i,a]=P.useState(!1),{note:s}=dS(),l=`event-${s}`,[u]=G(d=>[d.events[l]?d.events[l][0]:null]),c=async(d=0)=>{await G.getState().getEvent(n.current,{view:l,retryCount:d,relayUrls:r.current}).then(g=>{g||(console.log("Could not get event. Retrying..."),o.current=setTimeout(async()=>{if(d>20){a(!0),o.current&&clearTimeout(o.current);return}await c(d+1)},1e3))})},f=async d=>{if(!(!G.getState().connected||t.current)){t.current=!0;try{const g=Wm(d);for(const w of g.tlvItems)if(w.type===0){n.current=w.value;break}else w.type===1&&r.current.push(w.value)}catch(g){console.log(g);return}await c()}};return P.useEffect(()=>(s&&f(s),()=>{o.current&&clearTimeout(o.current),G.getState().unsubscribeByToken(l)}),[]),P.useEffect(()=>{e&&s&&f(s)},[e]),m.jsxs(jl,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[m.jsx(he,{children:u?m.jsx(he,{mb:4,children:m.jsx(tv,{data:u,level:0})}):m.jsx(m.Fragment,{children:i?m.jsx(Qr,{as:"h2",size:"md",marginBottom:4,children:"It looks like the event is not available on any of the connected relays."}):m.jsx(kS,{text:"Just a sec ... Searching the Matrix for the event."})})}),m.jsx(he,{display:"flex",flexDirection:"column"})]})}function Gde(){const[e]=G(s=>[s.status]),t=P.useRef(void 0),n=P.useRef(null),{tag:r}=dS(),o=`view-${r}`,i=()=>t.current===r,a=async s=>{t.current=r,await G.getState().getEvents({token:o,query:{direction:"OLDER",filters:Mde([s]),stickyInterval:!0,isLive:!0}})};return P.useEffect(()=>()=>{n.current&&clearTimeout(n.current),G.getState().unsubscribeByToken(o)},[]),P.useEffect(()=>{["online","offline"].includes(G.getState().status)&&r&&!i()&&a(r)},[e,r]),m.jsxs(jl,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[m.jsx(he,{children:m.jsx(KS,{view:o})}),m.jsx(he,{display:"flex",flexDirection:"column"})]})}const Yde={initialColorMode:"dark",useSystemColorMode:!0},hO=TH({config:Yde,breakpoints:{sm:"500px"}}),Xde=async()=>{await G.getState().init({maxEvents:nM})};Xde();cb.createRoot(document.getElementById("root")).render(m.jsxs(Z.StrictMode,{children:[m.jsx(Mz,{initialColorMode:hO.config.initialColorMode}),m.jsx(GK,{theme:hO,children:m.jsx(ete,{basename:"/nostr-ts/",children:m.jsx(Gee,{children:m.jsxs(Vr,{element:m.jsx(uae,{}),children:[m.jsx(Vr,{path:"/",element:m.jsx(Nde,{})}),m.jsx(Vr,{path:"/account",element:m.jsx(aoe,{})}),m.jsx(Vr,{path:"/profile",element:m.jsx(Vde,{})}),m.jsx(Vr,{path:"/following",element:m.jsx(Bde,{})}),m.jsx(Vr,{path:"/blocked",element:m.jsx(Hde,{})}),m.jsx(Vr,{path:"/lists",element:m.jsx(qde,{})}),m.jsx(Vr,{path:"/p/:npub",element:m.jsx(Fde,{})}),m.jsx(Vr,{path:"/e/:note",element:m.jsx(Kde,{})}),m.jsx(Vr,{path:"/t/:tag",element:m.jsx(Gde,{})})]})})})})]})); diff --git a/index.html b/index.html index 352c137..cabebc3 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ NostrOP - + diff --git a/sw.js b/sw.js index 1a54e34..b3add33 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,i={};const s=(s,r)=>(s=new URL(s+".js",r).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(r,n)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let t={};const l=e=>s(e,o),d={module:{uri:o},exports:t,require:l};i[o]=Promise.all(r.map((e=>d[e]||l(e)))).then((e=>(n(...e),t)))}}define(["./workbox-99f5c7c2"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-534e67da.css",revision:null},{url:"assets/index-d9df9ff8.js",revision:null},{url:"assets/pow-worker-3948d45b.js",revision:null},{url:"assets/worker-ef9cca43.js",revision:null},{url:"index.html",revision:"57949bb06c96930b6c959e5b576d427a"},{url:"registerSW.js",revision:"72da3f9bb62b1890b879554c0bd77e27"},{url:"favicon.ico",revision:"83750d8612b9a4df99236629f37b04d7"},{url:"apple-touch-icon.png",revision:"95774594b729b50f85a69e6235e4a54f"},{url:"pwa-192x192.png",revision:"eb10b1f1cbc056c8edf67f26b9dd6f0a"},{url:"pwa-512x512.png",revision:"eb3d6288f970795a6f8b60198c62d36c"},{url:"manifest.webmanifest",revision:"80b57a076a6ed2222191d317528ba3ed"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,i={};const s=(s,r)=>(s=new URL(s+".js",r).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(r,n)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let t={};const l=e=>s(e,o),c={module:{uri:o},exports:t,require:l};i[o]=Promise.all(r.map((e=>c[e]||l(e)))).then((e=>(n(...e),t)))}}define(["./workbox-99f5c7c2"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-534e67da.css",revision:null},{url:"assets/index-6f685e16.js",revision:null},{url:"assets/pow-worker-3948d45b.js",revision:null},{url:"assets/worker-ef9cca43.js",revision:null},{url:"index.html",revision:"9ab1dc20289c9c3c12028cd40f89ffe9"},{url:"registerSW.js",revision:"72da3f9bb62b1890b879554c0bd77e27"},{url:"favicon.ico",revision:"83750d8612b9a4df99236629f37b04d7"},{url:"apple-touch-icon.png",revision:"95774594b729b50f85a69e6235e4a54f"},{url:"pwa-192x192.png",revision:"eb10b1f1cbc056c8edf67f26b9dd6f0a"},{url:"pwa-512x512.png",revision:"eb3d6288f970795a6f8b60198c62d36c"},{url:"manifest.webmanifest",revision:"80b57a076a6ed2222191d317528ba3ed"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));